diff --git a/audio/README.md b/audio/README.md index 1938ad4d11..3f40d72331 100644 --- a/audio/README.md +++ b/audio/README.md @@ -2,10 +2,29 @@ Directory structure of the audio HAL related code. -Run `common/all-versions/copyHAL.sh` to create a new version of the audio HAL -based on an existing one. +## Directory Structure for AIDL audio HAL -## Directory Structure +The AIDL version is located inside `aidl` directory. The tree below explains +the role of each subdirectory: + +* `aidl_api` — snapshots of the API created each Android release. Every + release, the current version of the API becomes "frozen" and gets assigned + the next version number. If the API needs further modifications, they are + made on the "current" version. After making modifications, run + `m -update-api` to update the snapshot of the "current" + version. +* `android/hardware/audio/common` — data structures and interfaces shared + between various HALs: BT HAL, core and effects audio HALs. +* `android/hardware/audio/core` — data structures and interfaces of the + core audio HAL. +* `default` — the default, reference implementation of the audio HAL service. +* `vts` — VTS tests for the AIDL HAL. + +## Directory Structure for HIDL audio HAL + +Run `common/all-versions/copyHAL.sh` to create a new version of the HIDL audio +HAL based on an existing one. Note that this isn't possible since Android T +release. Android U and above uses AIDL audio HAL. * `2.0` — version 2.0 of the core HIDL API. Note that `.hal` files can not be moved into the `core` directory because that would change diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 4038ab5139..5a009fe674 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -292,7 +292,6 @@ aidl_interface { sdk_version: "module_current", }, }, - frozen: true, versions_with_info: [ { version: "1", @@ -304,6 +303,7 @@ aidl_interface { ], }, ], + frozen: true, } diff --git a/audio/aidl/default/config/audioPolicy/api/current.txt b/audio/aidl/default/config/audioPolicy/api/current.txt index ba867a070e..e2bc833d43 100644 --- a/audio/aidl/default/config/audioPolicy/api/current.txt +++ b/audio/aidl/default/config/audioPolicy/api/current.txt @@ -279,8 +279,10 @@ package android.audio.policy.configuration { method @NonNull public String getRawName(); enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_DIRECT; enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_FAST; + enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_HOTWORD_TAP; enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_HW_AV_SYNC; enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_HW_HOTWORD; + enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_HW_LOOKBACK; enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_MMAP_NOIRQ; enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_RAW; enum_constant public static final android.audio.policy.configuration.AudioInOutFlag AUDIO_INPUT_FLAG_SYNC; diff --git a/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd b/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd index 92d67779ef..9a3a447b5f 100644 --- a/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd +++ b/audio/aidl/default/config/audioPolicy/audio_policy_configuration.xsd @@ -191,6 +191,8 @@ + + diff --git a/audio/aidl/sounddose/Android.bp b/audio/aidl/sounddose/Android.bp index 85d6e217a8..6f2f79083b 100644 --- a/audio/aidl/sounddose/Android.bp +++ b/audio/aidl/sounddose/Android.bp @@ -44,9 +44,15 @@ aidl_interface { }, }, versions_with_info: [ + { + version: "1", + imports: ["android.hardware.audio.core.sounddose-V1"], + }, + // IMPORTANT: Update latest_android_hardware_audio_sounddose every time you // add the latest frozen version to versions_with_info ], + frozen: true, } // Note: This should always be one version ahead of the last frozen version diff --git a/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/1/.hash b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/1/.hash new file mode 100644 index 0000000000..625ababf12 --- /dev/null +++ b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/1/.hash @@ -0,0 +1 @@ +7acf835db643d39414afbbbbcda816e2d7e8c77a diff --git a/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/1/android/hardware/audio/sounddose/ISoundDoseFactory.aidl b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/1/android/hardware/audio/sounddose/ISoundDoseFactory.aidl new file mode 100644 index 0000000000..148720ce4f --- /dev/null +++ b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/1/android/hardware/audio/sounddose/ISoundDoseFactory.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.audio.sounddose; +@VintfStability +interface ISoundDoseFactory { + @nullable android.hardware.audio.core.sounddose.ISoundDose getSoundDose(in @utf8InCpp String module); +} diff --git a/audio/aidl/sounddose/default/Android.bp b/audio/aidl/sounddose/default/Android.bp deleted file mode 100644 index bd770fa5b5..0000000000 --- a/audio/aidl/sounddose/default/Android.bp +++ /dev/null @@ -1,46 +0,0 @@ -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -cc_defaults { - name: "aidlsounddoseservice_defaults", - vendor: true, - header_libs: [ - "libsounddoseaidl_headers", - ], -} - -cc_library { - name: "libsounddoseserviceexampleimpl", - defaults: [ - "aidlsounddoseservice_defaults", - "latest_android_media_audio_common_types_ndk_shared", - "latest_android_hardware_audio_core_sounddose_ndk_shared", - "latest_android_hardware_audio_sounddose_ndk_shared", - ], - export_include_dirs: ["include"], - srcs: [ - "SoundDoseFactory.cpp", - ], - shared_libs: [ - "libaudioservicesounddoseimpl", - "libbase", - "libbinder_ndk", - ], - - visibility: [ - "//hardware/interfaces/audio/common/all-versions/default/service", - ], -} - -cc_library_headers { - name: "libsounddoseaidl_headers", - export_include_dirs: ["include"], - vendor_available: true, - host_supported: true, -} diff --git a/audio/aidl/sounddose/default/SoundDoseFactory.cpp b/audio/aidl/sounddose/default/SoundDoseFactory.cpp deleted file mode 100644 index 83a592b54e..0000000000 --- a/audio/aidl/sounddose/default/SoundDoseFactory.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "AHAL_SoundDoseFactory" - -#include "SoundDoseFactory.h" - -#include -#include - -namespace aidl::android::hardware::audio::sounddose { - -using ::aidl::android::hardware::audio::core::sounddose::SoundDose; - -ndk::ScopedAStatus SoundDoseFactory::getSoundDose(const std::string& in_module, - std::shared_ptr* _aidl_return) { - auto soundDoseIt = mSoundDoseBinderMap.find(in_module); - if (soundDoseIt != mSoundDoseBinderMap.end()) { - *_aidl_return = ISoundDose::fromBinder(soundDoseIt->second); - - LOG(DEBUG) << __func__ - << ": returning cached instance of ISoundDose: " << _aidl_return->get() - << " for module " << in_module; - return ndk::ScopedAStatus::ok(); - } - - auto soundDose = ndk::SharedRefBase::make(); - mSoundDoseBinderMap[in_module] = soundDose->asBinder(); - *_aidl_return = soundDose; - - LOG(DEBUG) << __func__ << ": returning new instance of ISoundDose: " << _aidl_return->get() - << " for module " << in_module; - return ndk::ScopedAStatus::ok(); -} - -} // namespace aidl::android::hardware::audio::sounddose diff --git a/audio/aidl/sounddose/default/include/SoundDoseFactory.h b/audio/aidl/sounddose/default/include/SoundDoseFactory.h deleted file mode 100644 index ced4291411..0000000000 --- a/audio/aidl/sounddose/default/include/SoundDoseFactory.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -#include - -namespace aidl::android::hardware::audio::sounddose { - -using ::aidl::android::hardware::audio::core::sounddose::ISoundDose; - -class SoundDoseFactory : public BnSoundDoseFactory { - public: - ndk::ScopedAStatus getSoundDose(const std::string& module, - std::shared_ptr* _aidl_return) override; - - private: - std::unordered_map mSoundDoseBinderMap; -}; - -} // namespace aidl::android::hardware::audio::sounddose diff --git a/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp b/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp index df35bae086..7722ccfb35 100644 --- a/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp +++ b/audio/aidl/sounddose/vts/VtsHalSoundDoseFactoryTargetTest.cpp @@ -71,6 +71,7 @@ class SoundDoseFactory : public testing::TestWithParam { std::shared_ptr soundDoseFactory; }; +// @VsrTest = VSR-5.5-002.001 TEST_P(SoundDoseFactory, GetSoundDoseForSameModule) { const std::string module = "primary"; diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp index 94b33d3830..8a8998e10c 100644 --- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp @@ -3593,6 +3593,7 @@ ndk::ScopedAStatus AudioCoreSoundDose::NoOpHalSoundDoseCallback::onNewMelValues( return ndk::ScopedAStatus::ok(); } +// @VsrTest = VSR-5.5-002.001 TEST_P(AudioCoreSoundDose, SameInstance) { if (soundDose == nullptr) { GTEST_SKIP() << "SoundDose is not supported"; @@ -3604,6 +3605,7 @@ TEST_P(AudioCoreSoundDose, SameInstance) { << "getSoundDose must return the same interface instance across invocations"; } +// @VsrTest = VSR-5.5-002.001 TEST_P(AudioCoreSoundDose, GetSetOutputRs2UpperBound) { if (soundDose == nullptr) { GTEST_SKIP() << "SoundDose is not supported"; @@ -3618,6 +3620,7 @@ TEST_P(AudioCoreSoundDose, GetSetOutputRs2UpperBound) { EXPECT_TRUE(isSupported) << "Getting/Setting RS2 upper bound must be supported"; } +// @VsrTest = VSR-5.5-002.001 TEST_P(AudioCoreSoundDose, CheckDefaultRs2UpperBound) { if (soundDose == nullptr) { GTEST_SKIP() << "SoundDose is not supported"; @@ -3628,6 +3631,7 @@ TEST_P(AudioCoreSoundDose, CheckDefaultRs2UpperBound) { EXPECT_EQ(rs2Value, ISoundDose::DEFAULT_MAX_RS2); } +// @VsrTest = VSR-5.5-002.001 TEST_P(AudioCoreSoundDose, RegisterSoundDoseCallbackTwiceThrowsException) { if (soundDose == nullptr) { GTEST_SKIP() << "SoundDose is not supported"; @@ -3638,6 +3642,7 @@ TEST_P(AudioCoreSoundDose, RegisterSoundDoseCallbackTwiceThrowsException) { << "Registering sound dose callback twice should throw EX_ILLEGAL_STATE"; } +// @VsrTest = VSR-5.5-002.001 TEST_P(AudioCoreSoundDose, RegisterSoundDoseNullCallbackThrowsException) { if (soundDose == nullptr) { GTEST_SKIP() << "SoundDose is not supported"; diff --git a/audio/common/all-versions/default/service/Android.bp b/audio/common/all-versions/default/service/Android.bp index 2fcfb235e7..d513062c25 100644 --- a/audio/common/all-versions/default/service/Android.bp +++ b/audio/common/all-versions/default/service/Android.bp @@ -38,13 +38,11 @@ cc_binary { name: "android.hardware.audio.service", init_rc: ["android.hardware.audio.service.rc"], - vintf_fragments: ["android.hardware.audio.sounddose-aidl.xml"], relative_install_path: "hw", vendor: true, defaults: [ "android_hardware_audio_config_defaults", - "latest_android_hardware_audio_sounddose_ndk_shared", ], srcs: ["service.cpp"], @@ -56,7 +54,6 @@ cc_binary { ], shared_libs: [ - "//hardware/interfaces/audio/aidl/sounddose/default:libsounddoseserviceexampleimpl", "libcutils", "libbinder", "libbinder_ndk", diff --git a/audio/common/all-versions/default/service/android.hardware.audio.sounddose-aidl.xml b/audio/common/all-versions/default/service/android.hardware.audio.sounddose-aidl.xml deleted file mode 100644 index a297bfbbe5..0000000000 --- a/audio/common/all-versions/default/service/android.hardware.audio.sounddose-aidl.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - android.hardware.audio.sounddose - 1 - ISoundDoseFactory/default - - diff --git a/audio/common/all-versions/default/service/service.cpp b/audio/common/all-versions/default/service/service.cpp index 7b5a932ff6..1557a9505d 100644 --- a/audio/common/all-versions/default/service/service.cpp +++ b/audio/common/all-versions/default/service/service.cpp @@ -20,10 +20,6 @@ #include #include -#include -#include -#include -#include #include #include #include @@ -37,8 +33,6 @@ using android::OK; using InterfacesList = std::vector; -using aidl::android::hardware::audio::sounddose::SoundDoseFactory; - /** Try to register the provided factories in the provided order. * If any registers successfully, do not register any other and return true. * If all fail, return false. @@ -144,6 +138,10 @@ int main(int /* argc */, char* /* argv */ []) { "android.hardware.bluetooth.audio-impl", "createIBluetoothAudioProviderFactory", }, + { + "android.hardware.audio.sounddose-vendor-impl", + "createISoundDoseFactory", + }, }; // clang-format on @@ -171,13 +169,5 @@ int main(int /* argc */, char* /* argv */ []) { } } - // Register ISoundDoseFactory interface as a workaround for using the audio AIDL HAL - auto soundDoseDefault = ndk::SharedRefBase::make(); - const std::string soundDoseDefaultName = - std::string() + SoundDoseFactory::descriptor + "/default"; - binder_status_t status = AServiceManager_addService(soundDoseDefault->asBinder().get(), - soundDoseDefaultName.c_str()); - CHECK_EQ(STATUS_OK, status); - joinRpcThreadpool(); } diff --git a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp index f6440f28f6..c4c18a48cb 100644 --- a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp @@ -715,11 +715,9 @@ class PcmOnlyConfigInputStreamTest : public InputStreamTest { } void releasePatchIfNeeded() { - if (getDevice()) { - if (areAudioPatchesSupported() && mHasPatch) { - EXPECT_OK(getDevice()->releaseAudioPatch(mPatchHandle)); - mHasPatch = false; - } + if (getDevice() && areAudioPatchesSupported() && mHasPatch) { + EXPECT_OK(getDevice()->releaseAudioPatch(mPatchHandle)); + mHasPatch = false; } } diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp index 03dab08f1f..9ae77cdea9 100644 --- a/automotive/audiocontrol/aidl/Android.bp +++ b/automotive/audiocontrol/aidl/Android.bp @@ -43,7 +43,15 @@ aidl_interface { "android.media.audio.common.types-V2", ], }, + { + version: "3", + imports: [ + "android.hardware.audio.common-V1", + "android.media.audio.common.types-V2", + ], + }, ], + frozen: true, } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/.hash b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/.hash new file mode 100644 index 0000000000..c8dbf1cc9d --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/.hash @@ -0,0 +1 @@ +bc0ead0d35057635fdb88f5353686cbbc6c65dcd diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl new file mode 100644 index 0000000000..8eab521ce4 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@Backing(type="int") @VintfStability +enum AudioFocusChange { + NONE = 0, + GAIN = 1, + GAIN_TRANSIENT = 2, + GAIN_TRANSIENT_MAY_DUCK = 3, + GAIN_TRANSIENT_EXCLUSIVE = 4, + LOSS = ((-1) * GAIN) /* -1 */, + LOSS_TRANSIENT = ((-1) * GAIN_TRANSIENT) /* -2 */, + LOSS_TRANSIENT_CAN_DUCK = ((-1) * GAIN_TRANSIENT_MAY_DUCK) /* -3 */, +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl new file mode 100644 index 0000000000..91ce035229 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +parcelable AudioGainConfigInfo { + int zoneId; + String devicePortAddress; + int volumeIndex; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/DuckingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/DuckingInfo.aidl new file mode 100644 index 0000000000..23abb46bd7 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/DuckingInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +parcelable DuckingInfo { + int zoneId; + String[] deviceAddressesToDuck; + String[] deviceAddressesToUnduck; + String[] usagesHoldingFocus; + @nullable android.hardware.audio.common.PlaybackTrackMetadata[] playbackMetaDataHoldingFocus; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IAudioControl.aidl new file mode 100644 index 0000000000..ffd575dfa4 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IAudioControl.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IAudioControl { + /** + * @deprecated use {@link android.hardware.audio.common.PlaybackTrackMetadata} instead. + */ + oneway void onAudioFocusChange(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); + oneway void onDevicesToDuckChange(in android.hardware.automotive.audiocontrol.DuckingInfo[] duckingInfos); + oneway void onDevicesToMuteChange(in android.hardware.automotive.audiocontrol.MutingInfo[] mutingInfos); + oneway void registerFocusListener(in android.hardware.automotive.audiocontrol.IFocusListener listener); + oneway void setBalanceTowardRight(in float value); + oneway void setFadeTowardFront(in float value); + oneway void onAudioFocusChangeWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); + oneway void setAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); + oneway void registerGainCallback(in android.hardware.automotive.audiocontrol.IAudioGainCallback callback); + void setModuleChangeCallback(in android.hardware.automotive.audiocontrol.IModuleChangeCallback callback); + void clearModuleChangeCallback(); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl new file mode 100644 index 0000000000..17a087f20c --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IAudioGainCallback { + oneway void onAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IFocusListener.aidl new file mode 100644 index 0000000000..3e175529fa --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IFocusListener.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IFocusListener { + oneway void abandonAudioFocus(in String usage, in int zoneId); + oneway void requestAudioFocus(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain); + oneway void abandonAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId); + oneway void requestAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl new file mode 100644 index 0000000000..2bbb9362b9 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IModuleChangeCallback { + oneway void onAudioPortsChanged(in android.media.audio.common.AudioPort[] audioPorts); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/MutingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/MutingInfo.aidl new file mode 100644 index 0000000000..b25ed0f1e9 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/MutingInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +parcelable MutingInfo { + int zoneId; + String[] deviceAddressesToMute; + String[] deviceAddressesToUnmute; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/Reasons.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/Reasons.aidl new file mode 100644 index 0000000000..8d669850a5 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/3/android/hardware/automotive/audiocontrol/Reasons.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@Backing(type="int") @VintfStability +enum Reasons { + FORCED_MASTER_MUTE = 0x1, + REMOTE_MUTE = 0x2, + TCU_MUTE = 0x4, + ADAS_DUCKING = 0x8, + NAV_DUCKING = 0x10, + PROJECTION_DUCKING = 0x20, + THERMAL_LIMITATION = 0x40, + SUSPEND_EXIT_VOL_LIMITATION = 0x80, + EXTERNAL_AMP_VOL_FEEDBACK = 0x100, + OTHER = 0x80000000, +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl index 8dc5ffe2eb..ffd575dfa4 100644 --- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl @@ -46,4 +46,6 @@ interface IAudioControl { oneway void onAudioFocusChangeWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); oneway void setAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); oneway void registerGainCallback(in android.hardware.automotive.audiocontrol.IAudioGainCallback callback); + void setModuleChangeCallback(in android.hardware.automotive.audiocontrol.IModuleChangeCallback callback); + void clearModuleChangeCallback(); } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl new file mode 100644 index 0000000000..2bbb9362b9 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IModuleChangeCallback { + oneway void onAudioPortsChanged(in android.media.audio.common.AudioPort[] audioPorts); +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl index 0ffcd5e19f..9564efc859 100644 --- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl @@ -51,6 +51,7 @@ import android.hardware.automotive.audiocontrol.AudioGainConfigInfo; import android.hardware.automotive.audiocontrol.DuckingInfo; import android.hardware.automotive.audiocontrol.IAudioGainCallback; import android.hardware.automotive.audiocontrol.IFocusListener; +import android.hardware.automotive.audiocontrol.IModuleChangeCallback; import android.hardware.automotive.audiocontrol.MutingInfo; import android.hardware.automotive.audiocontrol.Reasons; @@ -183,4 +184,26 @@ interface IAudioControl { * interface. */ oneway void registerGainCallback(in IAudioGainCallback callback); + + /** + * Sets callback with HAL for notifying changes to hardware module (that is: + * {@link android.hardware.audio.core.IModule}) configurations. + * + * @param callback The {@link android.hardware.automotive.audiocontrol.IModuleChangeCallback} + * interface to use use when new updates are available for + * {@link android.hardware.audio.core.IModule} configs + * @throws EX_UNSUPPORTED_OPERATION if dynamic audio configs are not supported. + * @throws EX_ILLEGAL_STATE if a callback already exists + * @throws EX_ILLEGAL_ARGUMENT if the passed callback is (@code null} + */ + void setModuleChangeCallback(in IModuleChangeCallback callback); + + /** + * Clears module change callback + * + * If no callback is registered previously, then this call should be a no-op. + * + * @throws EX_UNSUPPORTED_OPERATION if dynamic audio configs are not supported. + */ + void clearModuleChangeCallback(); } diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl new file mode 100644 index 0000000000..4282483100 --- /dev/null +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IModuleChangeCallback.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.audiocontrol; + +import android.media.audio.common.AudioPort; + +/** + * Interface definition for asynchronous changes to audio configs defined + * for a hardware {@link android.hardware.audio.core.IModule}. + */ +@VintfStability +oneway interface IModuleChangeCallback { + /** + * Used to indicate that one or more {@link android.media.audio.common.AudioPort} + * configs have changed. Implementations MUST return at least one AudioPort. + * + * Notes for AudioPort: + * 1. For V3, the support will be limited to configurable AudioGain stages - per + * car audio framework support. + * 2. For automotive 'bus' devices, the expected settings are + * AudioDevice { + * AudioDeviceDescription {type: IN/OUT_DEVICE, connection: CONNECTION_BUS} + * AudioDeviceAddress {id: string}} + * + * Notes for AudioGain: + * 1. Car audio framework only supports AudioGainMode::JOINT. Any other mode + * selection will be ignored. + * See {@link android.media.audio.common.AudioGainMode} + * 2. Implementations MUST ensure that the gain stages are identical for buses + * that map to the same volume group. Any inconsistencies will result in + * inferior volume-change experience to the users. + * 3. Implementations MUST ensure that the new gain stages are subset (do not + * exceed) of the gain stage definitions provided to audio policy. If they + * exceed, it can result in failure when setting value over the range + * allowed by the audio policy. + * + * Other notes: + * 1. In case of AudioControl service restart or resume, the implementations MUST + * issue an immediate callback following registration. + * 2. In case of client restart, the AudioControl service MUST clear all stale + * callbacks. + * + * @param audioPorts list of {@link android.media.audio.common.AudioPort} that + * are updated + */ + void onAudioPortsChanged(in AudioPort[] audioPorts); +} diff --git a/automotive/audiocontrol/aidl/default/Android.bp b/automotive/audiocontrol/aidl/default/Android.bp index 6bf4b9d860..435c2d63de 100644 --- a/automotive/audiocontrol/aidl/default/Android.bp +++ b/automotive/audiocontrol/aidl/default/Android.bp @@ -30,8 +30,8 @@ cc_binary { shared_libs: [ "android.hardware.audio.common@7.0-enums", "android.hardware.audio.common-V1-ndk", - "android.frameworks.automotive.powerpolicy-V1-ndk", - "android.hardware.automotive.audiocontrol-V2-ndk", + "android.frameworks.automotive.powerpolicy-V2-ndk", + "android.hardware.automotive.audiocontrol-V3-ndk", "libbase", "libbinder_ndk", "libcutils", diff --git a/automotive/audiocontrol/aidl/default/AudioControl.cpp b/automotive/audiocontrol/aidl/default/AudioControl.cpp index a121f8be21..cf7307d347 100644 --- a/automotive/audiocontrol/aidl/default/AudioControl.cpp +++ b/automotive/audiocontrol/aidl/default/AudioControl.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -37,6 +38,8 @@ namespace aidl::android::hardware::automotive::audiocontrol { using ::android::base::EqualsIgnoreCase; +using ::android::base::ParseBool; +using ::android::base::ParseBoolResult; using ::android::base::ParseInt; using ::std::shared_ptr; using ::std::string; @@ -70,6 +73,95 @@ bool safelyParseInt(string s, int* out) { } } // namespace +namespace { +using ::aidl::android::media::audio::common::AudioChannelLayout; +using ::aidl::android::media::audio::common::AudioDeviceDescription; +using ::aidl::android::media::audio::common::AudioDeviceType; +using ::aidl::android::media::audio::common::AudioFormatDescription; +using ::aidl::android::media::audio::common::AudioFormatType; +using ::aidl::android::media::audio::common::AudioGain; +using ::aidl::android::media::audio::common::AudioGainMode; +using ::aidl::android::media::audio::common::AudioIoFlags; +using ::aidl::android::media::audio::common::AudioOutputFlags; +using ::aidl::android::media::audio::common::AudioPort; +using ::aidl::android::media::audio::common::AudioPortDeviceExt; +using ::aidl::android::media::audio::common::AudioPortExt; +using ::aidl::android::media::audio::common::AudioPortMixExt; +using ::aidl::android::media::audio::common::AudioProfile; +using ::aidl::android::media::audio::common::PcmType; + +// reuse common code artifacts +void fillProfile(const std::vector& channelLayouts, + const std::vector& sampleRates, AudioProfile* profile) { + for (auto layout : channelLayouts) { + profile->channelMasks.push_back( + AudioChannelLayout::make(layout)); + } + profile->sampleRates.insert(profile->sampleRates.end(), sampleRates.begin(), sampleRates.end()); +} + +AudioProfile createProfile(PcmType pcmType, const std::vector& channelLayouts, + const std::vector& sampleRates) { + AudioProfile profile; + profile.format.type = AudioFormatType::PCM; + profile.format.pcm = pcmType; + fillProfile(channelLayouts, sampleRates, &profile); + return profile; +} + +AudioProfile createProfile(const std::string& encodingType, + const std::vector& channelLayouts, + const std::vector& sampleRates) { + AudioProfile profile; + profile.format.encoding = encodingType; + fillProfile(channelLayouts, sampleRates, &profile); + return profile; +} + +AudioPortExt createDeviceExt(AudioDeviceType devType, int32_t flags, + const std::string& connection = "", const std::string& address = "") { + AudioPortDeviceExt deviceExt; + deviceExt.device.type.type = devType; + if (devType == AudioDeviceType::IN_MICROPHONE && connection.empty()) { + deviceExt.device.address = "bottom"; + } else if (devType == AudioDeviceType::IN_MICROPHONE_BACK && connection.empty()) { + deviceExt.device.address = "back"; + } else { + deviceExt.device.address = std::move(address); + } + deviceExt.device.type.connection = std::move(connection); + deviceExt.flags = flags; + return AudioPortExt::make(deviceExt); +} + +AudioPort createPort(int32_t id, const std::string& name, int32_t flags, bool isInput, + const AudioPortExt& ext) { + AudioPort port; + port.id = id; + port.name = name; + port.flags = isInput ? AudioIoFlags::make(flags) + : AudioIoFlags::make(flags); + port.ext = ext; + return port; +} + +AudioGain createGain(int32_t mode, AudioChannelLayout channelMask, int32_t minValue, + int32_t maxValue, int32_t defaultValue, int32_t stepValue, + int32_t minRampMs = 100, int32_t maxRampMs = 100, bool useForVolume = true) { + AudioGain gain; + gain.mode = mode; + gain.channelMask = channelMask; + gain.minValue = minValue; + gain.maxValue = maxValue; + gain.defaultValue = defaultValue; + gain.stepValue = stepValue; + gain.minRampMs = minRampMs; + gain.maxRampMs = maxRampMs; + gain.useForVolume = useForVolume; + return gain; +} +} // namespace + ndk::ScopedAStatus AudioControl::registerFocusListener( const shared_ptr& in_listener) { LOG(DEBUG) << "registering focus listener"; @@ -190,6 +282,33 @@ ndk::ScopedAStatus AudioControl::registerGainCallback( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus AudioControl::setModuleChangeCallback( + const std::shared_ptr& in_callback) { + LOG(DEBUG) << ": " << __func__; + + if (in_callback.get() == nullptr) { + LOG(ERROR) << __func__ << ": Callback is nullptr"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + if (mModuleChangeCallback != nullptr) { + LOG(ERROR) << __func__ << ": Module change callback was already registered"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); + } + std::atomic_store(&mModuleChangeCallback, in_callback); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AudioControl::clearModuleChangeCallback() { + if (mModuleChangeCallback != nullptr) { + shared_ptr nullCallback = nullptr; + std::atomic_store(&mModuleChangeCallback, nullCallback); + LOG(DEBUG) << ":" << __func__ << ": Unregistered successfully"; + } else { + LOG(DEBUG) << ":" << __func__ << ": No callback registered, no-op"; + } + return ndk::ScopedAStatus::ok(); +} + binder_status_t AudioControl::dump(int fd, const char** args, uint32_t numArgs) { if (numArgs == 0) { return dumpsys(fd); @@ -208,6 +327,8 @@ binder_status_t AudioControl::dump(int fd, const char** args, uint32_t numArgs) return cmdAbandonFocusWithMetaData(fd, args, numArgs); } else if (EqualsIgnoreCase(option, "--audioGainCallback")) { return cmdOnAudioDeviceGainsChanged(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--audioPortsChangedCallback")) { + return cmdOnAudioPortsChanged(fd, args, numArgs); } else { dprintf(fd, "Invalid option: %s\n", option.c_str()); return STATUS_BAD_VALUE; @@ -262,7 +383,21 @@ binder_status_t AudioControl::cmdHelp(int fd) const { dprintf(fd, "Tags are optional. If provided, it must follow the = pattern, where the " "value is namespaced (for example com.google.strategy=VR).\n"); - + dprintf(fd, + "--audioPortsChangedCallback " + " [ " + "]: fires audio ports changed callback. Carries list of modified " + "AudioPorts. " + "For simplicity, this command accepts limited information for each AudioPort: " + "id(int), name(string), port address(string), connection type (string), " + "audio gain (csv int)\n"); + dprintf(fd, "Notes: \n"); + dprintf(fd, + "1. AudioGain csv should match definition at " + "android/media/audio/common/AudioPort.aidl\n"); + dprintf(fd, + "2. See android/media/audio/common/AudioDeviceDescription.aidl for valid " + " values.\n"); return STATUS_OK; } @@ -514,4 +649,166 @@ binder_status_t AudioControl::cmdOnAudioDeviceGainsChanged(int fd, const char** toEnumString(reasons).c_str(), toString(agcis).c_str()); return STATUS_OK; } + +binder_status_t AudioControl::parseAudioGains(int fd, const std::string& stringGain, + std::vector& gains) { + const int kAudioGainSize = 9; + std::stringstream csvGain(stringGain); + std::vector vecGain; + std::string value; + while (getline(csvGain, value, ',')) { + vecGain.push_back(value); + } + + if ((vecGain.size() == 0) || ((vecGain.size() % kAudioGainSize) != 0)) { + dprintf(fd, "Erroneous input to generate AudioGain: %s\n", stringGain.c_str()); + return STATUS_BAD_VALUE; + } + + // iterate over injected AudioGains + for (int index = 0; index < vecGain.size(); index += kAudioGainSize) { + int32_t mode; + if (!safelyParseInt(vecGain[index], &mode)) { + dprintf(fd, "Non-integer index provided with request: %s\n", vecGain[index].c_str()); + return STATUS_BAD_VALUE; + } + + // car audio framework only supports JOINT mode. + // skip injected AudioGains that are not compliant with this. + if (mode != static_cast(AudioGainMode::JOINT)) { + LOG(WARNING) << ":" << __func__ << ": skipping gain since it is not JOINT mode!"; + continue; + } + + int32_t layout; + if (!safelyParseInt(vecGain[index + 1], &layout)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 1].c_str()); + return STATUS_BAD_VALUE; + } + AudioChannelLayout channelMask = + AudioChannelLayout::make(layout); + + int32_t minValue; + if (!safelyParseInt(vecGain[index + 2], &minValue)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 2].c_str()); + return STATUS_BAD_VALUE; + } + + int32_t maxValue; + if (!safelyParseInt(vecGain[index + 3], &maxValue)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 3].c_str()); + return STATUS_BAD_VALUE; + } + + int32_t defaultValue; + if (!safelyParseInt(vecGain[index + 4], &defaultValue)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 4].c_str()); + return STATUS_BAD_VALUE; + } + + int32_t stepValue; + if (!safelyParseInt(vecGain[index + 5], &stepValue)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 5].c_str()); + return STATUS_BAD_VALUE; + } + + int32_t minRampMs; + if (!safelyParseInt(vecGain[index + 6], &minRampMs)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 6].c_str()); + return STATUS_BAD_VALUE; + } + + int32_t maxRampMs; + if (!safelyParseInt(vecGain[index + 7], &maxRampMs)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + vecGain[index + 7].c_str()); + return STATUS_BAD_VALUE; + } + + ParseBoolResult useForVolume = ParseBool(vecGain[index + 8]); + if (useForVolume == ParseBoolResult::kError) { + dprintf(fd, "Non-boolean index provided with request: %s\n", + vecGain[index + 8].c_str()); + return STATUS_BAD_VALUE; + } else if (useForVolume == ParseBoolResult::kFalse) { + // at this level we only care about gain stages that are relevant + // for volume control. skip the gain stage if its flagged as false. + LOG(WARNING) << ":" << __func__ + << ": skipping gain since it is not for volume control!"; + continue; + } + + AudioGain gain = createGain(mode, channelMask, minValue, maxValue, defaultValue, stepValue, + minRampMs, maxRampMs, true /*useForVolume*/); + gains.push_back(gain); + } + return STATUS_OK; +} + +binder_status_t AudioControl::cmdOnAudioPortsChanged(int fd, const char** args, uint32_t numArgs) { + if (!checkCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + + if ((numArgs < 6) || ((numArgs - 1) % 5 != 0)) { + dprintf(fd, + "Invalid number of arguments: please provide\n" + "--audioPortsChangedCallback " + " [ " + "]: triggers audio ports changed callback. Carries list of " + "modified AudioPorts. " + "For simplicity, this command accepts limited information for each AudioPort: " + "id(int), name(string), port address(string), connection type (string), " + "audio gain (csv int)\n"); + return STATUS_BAD_VALUE; + } + + std::vector ports; + for (uint32_t i = 1; i < numArgs; i += 5) { + binder_status_t status; + int32_t id; + if (!safelyParseInt(std::string(args[i]), &id)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + std::string(args[i]).c_str()); + return STATUS_BAD_VALUE; + } + + std::string name = std::string(args[i + 1]); + std::string address = std::string(args[i + 2]); + std::string connection = std::string(args[i + 3]); + + std::string stringGains = std::string(args[i + 4]); + std::vector gains; + status = parseAudioGains(fd, stringGains, gains); + if (status != STATUS_OK) { + return status; + } + + AudioPort port = createPort( + id, name, 0 /*flags*/, false /*isInput*/, + createDeviceExt(AudioDeviceType::OUT_DEVICE, 0 /*flags*/, connection, address)); + port.gains.insert(port.gains.begin(), gains.begin(), gains.end()); + + ports.push_back(port); + } + + if (mModuleChangeCallback == nullptr) { + dprintf(fd, + "Unable to trigger audio port callback for ports: %s \n" + " - no module change callback registered\n", + toString(ports).c_str()); + return STATUS_BAD_VALUE; + } + + // TODO (b/269139706) fix atomic read issue + mModuleChangeCallback->onAudioPortsChanged(ports); + dprintf(fd, "SUCCESS audio port callback for ports: %s \n", toString(ports).c_str()); + return STATUS_OK; +} } // namespace aidl::android::hardware::automotive::audiocontrol diff --git a/automotive/audiocontrol/aidl/default/AudioControl.h b/automotive/audiocontrol/aidl/default/AudioControl.h index 16b80e890c..7eca446f12 100644 --- a/automotive/audiocontrol/aidl/default/AudioControl.h +++ b/automotive/audiocontrol/aidl/default/AudioControl.h @@ -21,11 +21,20 @@ #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include + namespace aidl::android::hardware::automotive::audiocontrol { namespace audiohalcommon = ::aidl::android::hardware::audio::common; @@ -51,6 +60,9 @@ class AudioControl : public BnAudioControl { const std::vector& in_gains) override; ndk::ScopedAStatus registerGainCallback( const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus setModuleChangeCallback( + const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus clearModuleChangeCallback() override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; @@ -67,15 +79,23 @@ class AudioControl : public BnAudioControl { */ std::shared_ptr mAudioGainCallback = nullptr; + std::shared_ptr mModuleChangeCallback = nullptr; + binder_status_t cmdHelp(int fd) const; binder_status_t cmdRequestFocus(int fd, const char** args, uint32_t numArgs); binder_status_t cmdAbandonFocus(int fd, const char** args, uint32_t numArgs); binder_status_t cmdRequestFocusWithMetaData(int fd, const char** args, uint32_t numArgs); binder_status_t cmdAbandonFocusWithMetaData(int fd, const char** args, uint32_t numArgs); binder_status_t cmdOnAudioDeviceGainsChanged(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdOnAudioPortsChanged(int fd, const char** args, uint32_t numArgs); binder_status_t parseMetaData(int fd, const std::string& metadataLiteral, audiohalcommon::PlaybackTrackMetadata& trackMetadata); + binder_status_t parseAudioGains( + int fd, const std::string& stringGain, + std::vector<::aidl::android::media::audio::common::AudioGain>& gains); + binder_status_t parseSampleRates(int fd, const std::string& sampleRates, + std::vector& vecSampleRates); binder_status_t dumpsys(int fd); }; diff --git a/automotive/audiocontrol/aidl/default/audiocontrol-default.xml b/automotive/audiocontrol/aidl/default/audiocontrol-default.xml index 3452ae93d9..95cd7f024f 100644 --- a/automotive/audiocontrol/aidl/default/audiocontrol-default.xml +++ b/automotive/audiocontrol/aidl/default/audiocontrol-default.xml @@ -1,7 +1,7 @@ - 2 android.hardware.automotive.audiocontrol + 3 IAudioControl/default diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp index da92d38d2d..cfc2a3e4ec 100644 --- a/automotive/audiocontrol/aidl/vts/Android.bp +++ b/automotive/audiocontrol/aidl/vts/Android.bp @@ -38,8 +38,8 @@ cc_test { "libxml2", ], static_libs: [ + "android.hardware.automotive.audiocontrol-V3-cpp", "android.hardware.audio.common-V1-cpp", - "android.hardware.automotive.audiocontrol-V2-cpp", "libgmock", ], test_suites: [ diff --git a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp index f4f5eef757..4e7e963981 100644 --- a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp +++ b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -34,10 +35,14 @@ using android::hardware::automotive::audiocontrol::AudioFocusChange; using android::hardware::automotive::audiocontrol::AudioGainConfigInfo; using android::hardware::automotive::audiocontrol::BnAudioGainCallback; using android::hardware::automotive::audiocontrol::BnFocusListener; +using android::hardware::automotive::audiocontrol::BnModuleChangeCallback; using android::hardware::automotive::audiocontrol::DuckingInfo; using android::hardware::automotive::audiocontrol::IAudioControl; +using android::hardware::automotive::audiocontrol::IModuleChangeCallback; using android::hardware::automotive::audiocontrol::MutingInfo; using android::hardware::automotive::audiocontrol::Reasons; +using ::testing::AnyOf; +using ::testing::Eq; #include "android_audio_policy_configuration_V7_0.h" @@ -48,15 +53,25 @@ using namespace android::audio::policy::configuration::V7_0; namespace audiohalcommon = android::hardware::audio::common; namespace audiomediacommon = android::media::audio::common; +namespace { +constexpr int32_t kAidlVersionThree = 3; +} + class AudioControlAidl : public testing::TestWithParam { public: virtual void SetUp() override { audioControl = android::waitForDeclaredService(String16(GetParam().c_str())); ASSERT_NE(audioControl, nullptr); + aidlVersion = audioControl->getInterfaceVersion(); } + void TearDown() override { audioControl = nullptr; } + + bool isAidlVersionAtleast(int version) const { return aidlVersion >= version; } + sp audioControl; int32_t capabilities; + int32_t aidlVersion; }; TEST_P(AudioControlAidl, OnSetFadeTowardsFront) { @@ -226,6 +241,57 @@ TEST_P(AudioControlAidl, AudioGainCallbackRegistration) { ASSERT_TRUE(audioControl->registerGainCallback(gainCallback2).isOk()); } +/* + * Test Module change Callback registration. + * + * Verifies that: + * - setModuleChangeCallback succeeds + * - setting a double callback fails with exception + * - clearModuleChangeCallback succeeds + * - setting with nullptr callback fails with exception + * - closing handle does not crash + */ +struct ModuleChangeCallbackMock : BnModuleChangeCallback { + MOCK_METHOD(Status, onAudioPortsChanged, + (const std::vector& audioPorts)); +}; + +TEST_P(AudioControlAidl, RegisterModuleChangeCallbackTwiceThrowsException) { + ALOGI("Register Module change callback test"); + if (!isAidlVersionAtleast(kAidlVersionThree)) { + GTEST_SKIP() << "Device does not support the new APIs for module change callback"; + return; + } + + // make sure no stale callbacks. + audioControl->clearModuleChangeCallback(); + + sp moduleChangeCallback = new ModuleChangeCallbackMock(); + auto status = audioControl->setModuleChangeCallback(moduleChangeCallback); + EXPECT_THAT(status.exceptionCode(), + AnyOf(Eq(Status::EX_NONE), Eq(Status::EX_UNSUPPORTED_OPERATION))); + if (!status.isOk()) return; + + sp moduleChangeCallback2 = new ModuleChangeCallbackMock(); + // no need to check for unsupported feature + EXPECT_EQ(Status::EX_ILLEGAL_STATE, + audioControl->setModuleChangeCallback(moduleChangeCallback2).exceptionCode()); + ASSERT_TRUE(audioControl->clearModuleChangeCallback().isOk()); + ASSERT_TRUE(audioControl->setModuleChangeCallback(moduleChangeCallback2).isOk()); +} + +TEST_P(AudioControlAidl, RegisterModuleChangeNullCallbackThrowsException) { + ALOGI("Register Module change callback with nullptr test"); + if (!isAidlVersionAtleast(kAidlVersionThree)) { + GTEST_SKIP() << "Device does not support the new APIs for module change callback"; + return; + } + + auto status = audioControl->setModuleChangeCallback(nullptr); + EXPECT_THAT(status.exceptionCode(), + AnyOf(Eq(Status::EX_ILLEGAL_ARGUMENT), Eq(Status::EX_UNSUPPORTED_OPERATION))); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioControlAidl); INSTANTIATE_TEST_SUITE_P( Audiocontrol, AudioControlAidl, diff --git a/automotive/can/1.0/default/libnetdevice/can.cpp b/automotive/can/1.0/default/libnetdevice/can.cpp index 083f4f0028..2a0545ac8f 100644 --- a/automotive/can/1.0/default/libnetdevice/can.cpp +++ b/automotive/can/1.0/default/libnetdevice/can.cpp @@ -80,7 +80,7 @@ bool setBitrate(std::string ifname, uint32_t bitrate) { { auto linkinfo = req.addNested(IFLA_LINKINFO); - req.add(IFLA_INFO_KIND, "can"); + req.addBuffer(IFLA_INFO_KIND, "can"); { auto infodata = req.addNested(IFLA_INFO_DATA); /* For CAN FD, it would require to add IFLA_CAN_DATA_BITTIMING diff --git a/automotive/can/1.0/default/libnetdevice/ifreqs.cpp b/automotive/can/1.0/default/libnetdevice/ifreqs.cpp index 8df6434796..8471173d24 100644 --- a/automotive/can/1.0/default/libnetdevice/ifreqs.cpp +++ b/automotive/can/1.0/default/libnetdevice/ifreqs.cpp @@ -47,7 +47,7 @@ static SocketParams getSocketParams(int domain) { return params; } -bool send(unsigned long request, struct ifreq& ifr) { +int trySend(unsigned long request, struct ifreq& ifr) { const auto sp = getSocketParams(socketDomain); base::unique_fd sock(socket(sp.domain, sp.type, sp.protocol)); if (!sock.ok()) { @@ -55,7 +55,12 @@ bool send(unsigned long request, struct ifreq& ifr) { return false; } - if (ioctl(sock.get(), request, &ifr) < 0) { + if (ioctl(sock.get(), request, &ifr) < 0) return errno; + return 0; +} + +bool send(unsigned long request, struct ifreq& ifr) { + if (trySend(request, ifr) != 0) { PLOG(ERROR) << "ioctl(" << std::hex << request << std::dec << ") failed"; return false; } diff --git a/automotive/can/1.0/default/libnetdevice/ifreqs.h b/automotive/can/1.0/default/libnetdevice/ifreqs.h index 74e58775b6..d8d6fe0cd4 100644 --- a/automotive/can/1.0/default/libnetdevice/ifreqs.h +++ b/automotive/can/1.0/default/libnetdevice/ifreqs.h @@ -27,6 +27,15 @@ namespace android::netdevice::ifreqs { */ extern std::atomic_int socketDomain; +/** + * Tries to send ioctl interface request. + * + * \param request Request type (such as SIOCGIFFLAGS) + * \param ifr Request data (both input and output) + * \return error code of the call (0 for success) + */ +int trySend(unsigned long request, struct ifreq& ifr); + /** * Sends ioctl interface request. * diff --git a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h index 70cb688933..657f9b2cc6 100644 --- a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h +++ b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h @@ -67,21 +67,33 @@ enum class WaitCondition { */ PRESENT_AND_UP, + /** + * Interface is up and with IPv4 address configured. + */ + PRESENT_AND_IPV4, + /** * Interface is down or not present (disconnected) at all. */ DOWN_OR_GONE, }; +enum class Quantifier { + ALL_OF, + ANY_OF, +}; + /** * Listens for interface changes until anticipated condition takes place. * * \param ifnames List of interfaces to watch for. * \param cnd Awaited condition. - * \param allOf true if all interfaces need to satisfy the condition, false if only one satistying + * \param quant Whether all interfaces need to satisfy the condition or just one satistying * interface should stop the wait. + * \return name of one interface that satisfied the condition */ -void waitFor(std::set ifnames, WaitCondition cnd, bool allOf = true); +std::optional waitFor(std::set ifnames, WaitCondition cnd, + Quantifier quant = Quantifier::ALL_OF); /** * Brings network interface up. diff --git a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp index 4c5b30928f..aad07de6d7 100644 --- a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp +++ b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp @@ -60,7 +60,7 @@ bool add(std::string dev, std::string type) { { auto linkinfo = req.addNested(IFLA_LINKINFO); - req.add(IFLA_INFO_KIND, type); + req.addBuffer(IFLA_INFO_KIND, type); } nl::Socket sock(NETLINK_ROUTE); @@ -100,23 +100,36 @@ std::optional isUp(std::string ifname) { return ifr.ifr_flags & IFF_UP; } +static bool hasIpv4(std::string ifname) { + auto ifr = ifreqs::fromName(ifname); + switch (const auto status = ifreqs::trySend(SIOCGIFADDR, ifr)) { + case 0: + return true; + case EADDRNOTAVAIL: + case ENODEV: + return false; + default: + PLOG(WARNING) << "Failed checking IPv4 address"; + return false; + } +} + struct WaitState { bool present; bool up; + bool hasIpv4Addr; bool satisfied(WaitCondition cnd) const { switch (cnd) { case WaitCondition::PRESENT: - if (present) return true; - break; + return present; case WaitCondition::PRESENT_AND_UP: - if (present && up) return true; - break; + return present && up; + case WaitCondition::PRESENT_AND_IPV4: + return present && up && hasIpv4Addr; case WaitCondition::DOWN_OR_GONE: - if (!present || !up) return true; - break; + return !present || !up; } - return false; } }; @@ -126,11 +139,22 @@ static std::string toString(WaitCondition cnd) { return "become present"; case WaitCondition::PRESENT_AND_UP: return "come up"; + case WaitCondition::PRESENT_AND_IPV4: + return "get IPv4 address"; case WaitCondition::DOWN_OR_GONE: return "go down"; } } +static std::string toString(Quantifier quant) { + switch (quant) { + case Quantifier::ALL_OF: + return "all of"; + case Quantifier::ANY_OF: + return "any of"; + } +} + static std::string toString(const std::set& ifnames) { std::stringstream ss; std::copy(ifnames.begin(), ifnames.end(), std::ostream_iterator(ss, ",")); @@ -139,50 +163,73 @@ static std::string toString(const std::set& ifnames) { return str; } -void waitFor(std::set ifnames, WaitCondition cnd, bool allOf) { - nl::Socket sock(NETLINK_ROUTE, 0, RTMGRP_LINK); +std::optional waitFor(std::set ifnames, WaitCondition cnd, + Quantifier quant) { + nl::Socket sock(NETLINK_ROUTE, 0, RTMGRP_LINK | RTMGRP_IPV4_IFADDR); using StatesMap = std::map; StatesMap states = {}; for (const auto ifname : ifnames) { const auto present = exists(ifname); const auto up = present && isUp(ifname).value_or(false); - states[ifname] = {present, up}; + const auto hasIpv4Addr = present && hasIpv4(ifname); + states[ifname] = {present, up, hasIpv4Addr}; } const auto mapConditionChecker = [cnd](const StatesMap::iterator::value_type& it) { return it.second.satisfied(cnd); }; - const auto isFullySatisfied = [&states, allOf, mapConditionChecker]() { - if (allOf) { - return std::all_of(states.begin(), states.end(), mapConditionChecker); - } else { - return std::any_of(states.begin(), states.end(), mapConditionChecker); + const auto isFullySatisfied = [&states, quant, + mapConditionChecker]() -> std::optional { + if (quant == Quantifier::ALL_OF) { + if (!std::all_of(states.begin(), states.end(), mapConditionChecker)) return {}; + return states.begin()->first; + } else { // Quantifier::ANY_OF + const auto it = std::find_if(states.begin(), states.end(), mapConditionChecker); + if (it == states.end()) return {}; + return it->first; } }; - if (isFullySatisfied()) return; + if (const auto iface = isFullySatisfied()) return iface; - LOG(DEBUG) << "Waiting for " << (allOf ? "" : "any of ") << toString(ifnames) << " to " + LOG(DEBUG) << "Waiting for " << toString(quant) << " " << toString(ifnames) << " to " << toString(cnd); for (const auto rawMsg : sock) { - const auto msg = nl::Message::parse(rawMsg, {RTM_NEWLINK, RTM_DELLINK}); - if (!msg.has_value()) continue; + if (const auto msg = nl::Message::parse(rawMsg, {RTM_NEWLINK, RTM_DELLINK}); + msg.has_value()) { + // Interface added / removed + const auto ifname = msg->attributes.get(IFLA_IFNAME); + if (ifnames.count(ifname) == 0) continue; - const auto ifname = msg->attributes.get(IFLA_IFNAME); - if (ifnames.count(ifname) == 0) continue; + auto& state = states[ifname]; + state.present = (msg->header.nlmsg_type != RTM_DELLINK); + state.up = state.present && (msg->data.ifi_flags & IFF_UP) != 0; + if (!state.present) state.hasIpv4Addr = false; - const bool present = (msg->header.nlmsg_type != RTM_DELLINK); - const bool up = present && (msg->data.ifi_flags & IFF_UP) != 0; - states[ifname] = {present, up}; + } else if (const auto msg = + nl::Message::parse(rawMsg, {RTM_NEWADDR, RTM_DELADDR}); + msg.has_value()) { + // Address added / removed + const auto ifname = msg->attributes.get(IFLA_IFNAME); + if (ifnames.count(ifname) == 0) continue; - if (isFullySatisfied()) { - LOG(DEBUG) << "Finished waiting for " << (allOf ? "" : "some of ") << toString(ifnames) + if (msg->header.nlmsg_type == RTM_NEWADDR) { + states[ifname].hasIpv4Addr = true; + } else { + // instead of tracking which one got deleted, let's just ask + states[ifname].hasIpv4Addr = hasIpv4(ifname); + } + } + + if (const auto iface = isFullySatisfied()) { + LOG(DEBUG) << "Finished waiting for " << toString(quant) << " " << toString(ifnames) << " to " << toString(cnd); - return; + return iface; } } LOG(FATAL) << "Can't read Netlink socket"; + return {}; } } // namespace android::netdevice diff --git a/automotive/can/1.0/default/libnetdevice/vlan.cpp b/automotive/can/1.0/default/libnetdevice/vlan.cpp index ee02f7b58a..35b21b8346 100644 --- a/automotive/can/1.0/default/libnetdevice/vlan.cpp +++ b/automotive/can/1.0/default/libnetdevice/vlan.cpp @@ -40,7 +40,7 @@ bool add(const std::string& eth, const std::string& vlan, uint16_t id) { { auto linkinfo = req.addNested(IFLA_LINKINFO); - req.add(IFLA_INFO_KIND, "vlan"); + req.addBuffer(IFLA_INFO_KIND, "vlan"); { auto linkinfo = req.addNested(IFLA_INFO_DATA); diff --git a/automotive/can/1.0/default/libnl++/Android.bp b/automotive/can/1.0/default/libnl++/Android.bp index 2ebd1b4732..01c1e55ca9 100644 --- a/automotive/can/1.0/default/libnl++/Android.bp +++ b/automotive/can/1.0/default/libnl++/Android.bp @@ -37,8 +37,10 @@ cc_library_static { "protocols/generic/Unknown.cpp", "protocols/generic/families/Mac80211hwsim.cpp", "protocols/generic/families/Nl80211.cpp", + "protocols/route/Addr.cpp", "protocols/route/Link.cpp", "protocols/route/Route.cpp", + "protocols/route/attributes.cpp", "protocols/route/structs.cpp", "protocols/MessageDefinition.cpp", "protocols/NetlinkProtocol.cpp", diff --git a/automotive/can/1.0/default/libnl++/MessageFactory.cpp b/automotive/can/1.0/default/libnl++/MessageFactory.cpp index 6f35897e32..eff068ebea 100644 --- a/automotive/can/1.0/default/libnl++/MessageFactory.cpp +++ b/automotive/can/1.0/default/libnl++/MessageFactory.cpp @@ -27,8 +27,8 @@ static nlattr* tail(nlmsghdr* msg) { nlattr* MessageFactoryBase::add(nlmsghdr* msg, size_t maxLen, nlattrtype_t type, const void* data, size_t dataLen) { - const auto totalAttrLen = impl::space(dataLen); - const auto newLen = impl::align(msg->nlmsg_len) + totalAttrLen; + const auto totalAttrLen = impl::length(dataLen); + const auto newLen = impl::align(msg->nlmsg_len) + impl::align(totalAttrLen); if (newLen > maxLen) { LOG(ERROR) << "Can't add attribute of size " << dataLen // << " - exceeded maxLen: " << newLen << " > " << maxLen; diff --git a/automotive/can/1.0/default/libnl++/Socket.cpp b/automotive/can/1.0/default/libnl++/Socket.cpp index cc1d839434..221063d344 100644 --- a/automotive/can/1.0/default/libnl++/Socket.cpp +++ b/automotive/can/1.0/default/libnl++/Socket.cpp @@ -47,6 +47,17 @@ Socket::Socket(int protocol, unsigned pid, uint32_t groups) : mProtocol(protocol } } +void Socket::clearPollErr() { + sockaddr_nl sa = {}; + socklen_t saLen = sizeof(sa); + const auto bytesReceived = recvfrom(mFd.get(), mReceiveBuffer.data(), mReceiveBuffer.size(), 0, + reinterpret_cast(&sa), &saLen); + if (errno != EINVAL) { + PLOG(WARNING) << "clearPollError() caught unexpected error: "; + } + CHECK_LE(bytesReceived, 0) << "clearPollError() didn't find an error!"; +} + bool Socket::send(const Buffer& msg, const sockaddr_nl& sa) { if constexpr (kSuperVerbose) { LOG(VERBOSE) << (mFailed ? "(not) " : "") << "sending to " << sa.nl_pid << ": " @@ -110,6 +121,13 @@ std::pair>, sockaddr_nl> Socket::receiveFrom(size if constexpr (kSuperVerbose) { LOG(VERBOSE) << "received from " << sa.nl_pid << ": " << toString(msg, mProtocol); } + long headerByteTotal = 0; + for (const auto hdr : msg) { + headerByteTotal += hdr->nlmsg_len; + } + if (bytesReceived != headerByteTotal) { + LOG(ERROR) << "received " << bytesReceived << " bytes, header claims " << headerByteTotal; + } return {msg, sa}; } @@ -159,6 +177,7 @@ std::optional Socket::getPid() { } pollfd Socket::preparePoll(short events) { + CHECK(mFd.get() > 0) << "Netlink socket fd is invalid!"; return {mFd.get(), events, 0}; } diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/MessageFactory.h b/automotive/can/1.0/default/libnl++/include/libnl++/MessageFactory.h index c3d72c54e2..a5a425e0b2 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/MessageFactory.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/MessageFactory.h @@ -106,18 +106,25 @@ class MessageFactory : private MessageFactoryBase { */ template void add(nlattrtype_t type, const A& attr) { - add(type, &attr, sizeof(attr)); + addInternal(type, &attr, sizeof(attr)); } + // It will always send the last null character, otherwise use addBuffer + // variant instead template <> void add(nlattrtype_t type, const std::string& s) { - add(type, s.c_str(), s.size() + 1); + addInternal(type, s.c_str(), s.size() + 1); + } + + void addBuffer(nlattrtype_t type, const std::string_view& s) { + addInternal(type, s.data(), s.size()); } /** Guard class to frame nested attributes. \see addNested(nlattrtype_t). */ class [[nodiscard]] NestedGuard { public: - NestedGuard(MessageFactory & req, nlattrtype_t type) : mReq(req), mAttr(req.add(type)) {} + NestedGuard(MessageFactory& req, nlattrtype_t type) + : mReq(req), mAttr(req.addInternal(type)) {} ~NestedGuard() { closeNested(&mReq.mMessage.header, mAttr); } private: @@ -138,7 +145,7 @@ class MessageFactory : private MessageFactoryBase { * MessageFactory req(RTM_NEWLINK, NLM_F_REQUEST); * { * auto linkinfo = req.addNested(IFLA_LINKINFO); - * req.add(IFLA_INFO_KIND, "can"); + * req.addBuffer(IFLA_INFO_KIND, "can"); * { * auto infodata = req.addNested(IFLA_INFO_DATA); * req.add(IFLA_CAN_BITTIMING, bitTimingStruct); @@ -154,7 +161,7 @@ class MessageFactory : private MessageFactoryBase { Message mMessage = {}; bool mIsGood = true; - nlattr* add(nlattrtype_t type, const void* data = nullptr, size_t len = 0) { + nlattr* addInternal(nlattrtype_t type, const void* data = nullptr, size_t len = 0) { if (!mIsGood) return nullptr; auto attr = MessageFactoryBase::add(&mMessage.header, sizeof(mMessage), type, data, len); if (attr == nullptr) mIsGood = false; diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h index 7ec0f7bdf9..996a3500af 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h @@ -54,6 +54,12 @@ class Socket { */ Socket(int protocol, unsigned pid = 0, uint32_t groups = 0); + /** + * Attempt to clear POLLERR by recv-ing. + * TODO(224850481): determine if this is necessary, or if the socket is locked up anyway. + */ + void clearPollErr(); + /** * Send Netlink message with incremented sequence number to the Kernel. * diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/bits.h b/automotive/can/1.0/default/libnl++/include/libnl++/bits.h index 4c8f1aa9a1..b6573b3284 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/bits.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/bits.h @@ -35,12 +35,20 @@ constexpr size_t align(size_t len) { return (len + alignto - 1) & ~(alignto - 1); } +/** + * Equivalent to NLMSG_LENGTH(len). + */ +template +constexpr size_t length(size_t len) { + return align(sizeof(H)) + len; +} + /** * Equivalent to NLMSG_SPACE(len). */ template constexpr size_t space(size_t len) { - return align(align(sizeof(H)) + len); + return align(length(len)); } /** diff --git a/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.cpp b/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.cpp index aaf24a53aa..158d2a1e95 100644 --- a/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.cpp @@ -34,7 +34,7 @@ const AttributeDefinition AttributeMap::operator[](nlattrtype_t nla_type) const MessageDescriptor::MessageDescriptor(const std::string& name, const MessageDetailsMap&& messageDetails, - const AttributeMap&& attrTypes, size_t contentsSize) + const AttributeMap& attrTypes, size_t contentsSize) : mName(name), mContentsSize(contentsSize), mMessageDetails(messageDetails), diff --git a/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.h b/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.h index 8bed5e7a7e..33ded9a44d 100644 --- a/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.h +++ b/automotive/can/1.0/default/libnl++/protocols/MessageDefinition.h @@ -163,7 +163,7 @@ class MessageDescriptor { protected: MessageDescriptor(const std::string& name, const MessageDetailsMap&& messageDetails, - const AttributeMap&& attrTypes, size_t contentsSize); + const AttributeMap& attrTypes, size_t contentsSize); private: const std::string mName; @@ -183,7 +183,7 @@ class MessageDefinition : public MessageDescriptor { MessageDefinition( // const std::string& name, const std::initializer_list msgDet, - const std::initializer_list attrTypes = {}) + const AttributeMap& attrTypes = {}) : MessageDescriptor(name, msgDet, attrTypes, sizeof(T)) {} void dataToStream(std::stringstream& ss, const Buffer hdr) const override { diff --git a/automotive/can/1.0/default/libnl++/protocols/all.cpp b/automotive/can/1.0/default/libnl++/protocols/all.cpp index a398dc8f1f..72c60f251f 100644 --- a/automotive/can/1.0/default/libnl++/protocols/all.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/all.cpp @@ -33,12 +33,12 @@ static std::map> toMap( return map; } -static auto all = toMap({ - std::make_unique(), - std::make_unique(), -}); - std::optional> get(int protocol) { + static auto all = toMap({ + std::make_unique(), + std::make_unique(), + }); + if (all.count(protocol) == 0) return std::nullopt; return *all.find(protocol)->second.get(); } diff --git a/automotive/can/1.0/default/libnl++/protocols/generic/FamilyTracker.cpp b/automotive/can/1.0/default/libnl++/protocols/generic/FamilyTracker.cpp index 900560e5b9..3ad101e19d 100644 --- a/automotive/can/1.0/default/libnl++/protocols/generic/FamilyTracker.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/generic/FamilyTracker.cpp @@ -30,6 +30,7 @@ bool FamilyTracker::track(const Buffer& buffer) { const auto familyName = msg.attributes.get(CTRL_ATTR_FAMILY_NAME); const auto familyId = msg.attributes.get(CTRL_ATTR_FAMILY_ID); + // TODO(224845900): NETLINK_GENERIC == 16, and (erroneously?) sets off this warning if (familyId < GENL_START_ALLOC) { LOG(WARNING) << "Invalid family ID: " << familyId; return true; diff --git a/automotive/can/1.0/default/libnl++/protocols/route/Addr.cpp b/automotive/can/1.0/default/libnl++/protocols/route/Addr.cpp new file mode 100644 index 0000000000..024d3891b6 --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/route/Addr.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Addr.h" + +#include "../structs.h" +#include "attributes.h" +#include "structs.h" + +namespace android::nl::protocols::route { + +using DataType = AttributeDefinition::DataType; + +// clang-format off +Addr::Addr() : MessageDefinition("addr", { + {RTM_NEWADDR, {"NEWADDR", MessageGenre::New}}, + {RTM_DELADDR, {"DELADDR", MessageGenre::Delete}}, + {RTM_GETADDR, {"GETADDR", MessageGenre::Get}}, +}, gAttributes) {} + +static const FlagsMap ifaFlagsMap { + {IFA_F_SECONDARY, "SECONDARY"}, + {IFA_F_NODAD, "NODAD"}, + {IFA_F_OPTIMISTIC, "OPTIMISTIC"}, + {IFA_F_DADFAILED, "DADFAILED"}, + {IFA_F_HOMEADDRESS, "HOMEADDRESS"}, + {IFA_F_DEPRECATED, "DEPRECATED"}, + {IFA_F_TENTATIVE, "TENTATIVE"}, + {IFA_F_PERMANENT, "PERMANENT"}, + {IFA_F_MANAGETEMPADDR, "MANAGETEMPADDR"}, + {IFA_F_NOPREFIXROUTE, "NOPREFIXROUTE"}, + {IFA_F_MCAUTOJOIN, "MCAUTOJOIN"}, + {IFA_F_STABLE_PRIVACY, "STABLE_PRIVACY"}, +}; +// clang-format on + +void Addr::toStream(std::stringstream& ss, const ifaddrmsg& data) const { + ss << "ifaddrmsg{" + << "family=" << familyToString(data.ifa_family) + << ", prefixlen=" << unsigned(data.ifa_prefixlen) << ", flags="; + flagsToStream(ss, ifaFlagsMap, data.ifa_flags); + ss << ", scope=" << unsigned(data.ifa_scope) << ", index=" << data.ifa_index << "}"; +} + +} // namespace android::nl::protocols::route diff --git a/automotive/can/1.0/default/libnl++/protocols/route/Addr.h b/automotive/can/1.0/default/libnl++/protocols/route/Addr.h new file mode 100644 index 0000000000..b6b8bdca3f --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/route/Addr.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "../MessageDefinition.h" + +#include + +namespace android::nl::protocols::route { + +class Addr : public MessageDefinition { + public: + Addr(); + void toStream(std::stringstream& ss, const ifaddrmsg& data) const override; +}; + +} // namespace android::nl::protocols::route diff --git a/automotive/can/1.0/default/libnl++/protocols/route/Link.cpp b/automotive/can/1.0/default/libnl++/protocols/route/Link.cpp index 9cc05da027..3dd0066732 100644 --- a/automotive/can/1.0/default/libnl++/protocols/route/Link.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/route/Link.cpp @@ -16,10 +16,7 @@ #include "Link.h" -#include "../structs.h" -#include "structs.h" - -#include +#include "attributes.h" namespace android::nl::protocols::route { @@ -30,83 +27,8 @@ Link::Link() : MessageDefinition("link", { {RTM_NEWLINK, {"NEWLINK", MessageGenre::New}}, {RTM_DELLINK, {"DELLINK", MessageGenre::Delete}}, {RTM_GETLINK, {"GETLINK", MessageGenre::Get}}, -}, { - {IFLA_ADDRESS, {"ADDRESS"}}, - {IFLA_BROADCAST, {"BROADCAST"}}, - {IFLA_IFNAME, {"IFNAME", DataType::String}}, - {IFLA_MTU, {"MTU", DataType::Uint}}, - {IFLA_LINK, {"LINK", DataType::Uint}}, - {IFLA_QDISC, {"QDISC", DataType::String}}, - {IFLA_STATS, {"STATS", DataType::Struct, statsToStream}}, - {IFLA_COST, {"COST"}}, - {IFLA_PRIORITY, {"PRIORITY"}}, - {IFLA_MASTER, {"MASTER", DataType::Uint}}, - {IFLA_WIRELESS, {"WIRELESS"}}, - {IFLA_PROTINFO, {"PROTINFO"}}, - {IFLA_TXQLEN, {"TXQLEN", DataType::Uint}}, - {IFLA_MAP, {"MAP", DataType::Struct, mapToStream}}, - {IFLA_WEIGHT, {"WEIGHT", DataType::Uint}}, - {IFLA_OPERSTATE, {"OPERSTATE", DataType::Uint}}, - {IFLA_LINKMODE, {"LINKMODE", DataType::Uint}}, - {IFLA_LINKINFO, {"LINKINFO", DataType::Nested, AttributeMap{ - {IFLA_INFO_KIND, {"INFO_KIND", DataType::String}}, - {IFLA_INFO_DATA, {"INFO_DATA", DataType::Nested}}, - {IFLA_INFO_XSTATS, {"INFO_XSTATS"}}, - {IFLA_INFO_SLAVE_KIND, {"INFO_SLAVE_KIND", DataType::String}}, - {IFLA_INFO_SLAVE_DATA, {"INFO_SLAVE_DATA"}}, - }}}, - {IFLA_NET_NS_PID, {"NET_NS_PID", DataType::Uint}}, - {IFLA_IFALIAS, {"IFALIAS", DataType::String}}, - {IFLA_NUM_VF, {"NUM_VF", DataType::Uint}}, - {IFLA_VFINFO_LIST, {"VFINFO_LIST"}}, - {IFLA_STATS64, {"STATS64", DataType::Struct, statsToStream}}, - {IFLA_VF_PORTS, {"VF_PORTS"}}, - {IFLA_PORT_SELF, {"PORT_SELF"}}, - {IFLA_AF_SPEC, {"AF_SPEC", DataType::Nested, AttributeMap{ - {AF_INET, {"AF_INET", DataType::Nested, AttributeMap{ - {IFLA_INET_CONF, {"INET_CONF", DataType::Struct, arrayToStream}}, - }}}, - {AF_INET6, {"AF_INET6", DataType::Nested, AttributeMap{ - {IFLA_INET6_FLAGS, {"INET6_FLAGS", DataType::Uint}}, - {IFLA_INET6_CONF, {"INET6_CONF", DataType::Struct, arrayToStream}}, - {IFLA_INET6_STATS, {"INET6_STATS", DataType::Struct, arrayToStream}}, - {IFLA_INET6_MCAST, {"INET6_MCAST"}}, - {IFLA_INET6_CACHEINFO, {"INET6_CACHEINFO", DataType::Struct, ifla_cacheinfoToStream}}, - {IFLA_INET6_ICMP6STATS, {"INET6_ICMP6STATS", DataType::Struct, arrayToStream}}, - {IFLA_INET6_TOKEN, {"INET6_TOKEN"}}, - {IFLA_INET6_ADDR_GEN_MODE, {"INET6_ADDR_GEN_MODE", DataType::Uint}}, - }}}, - }}}, - {IFLA_GROUP, {"GROUP", DataType::Uint}}, - {IFLA_NET_NS_FD, {"NET_NS_FD", DataType::Uint}}, - {IFLA_EXT_MASK, {"EXT_MASK", DataType::Uint}}, - {IFLA_PROMISCUITY, {"PROMISCUITY", DataType::Uint}}, - {IFLA_NUM_TX_QUEUES, {"NUM_TX_QUEUES", DataType::Uint}}, - {IFLA_NUM_RX_QUEUES, {"NUM_RX_QUEUES", DataType::Uint}}, - {IFLA_CARRIER, {"CARRIER", DataType::Uint}}, - {IFLA_PHYS_PORT_ID, {"PHYS_PORT_ID"}}, - {IFLA_CARRIER_CHANGES, {"CARRIER_CHANGES", DataType::Uint}}, - {IFLA_PHYS_SWITCH_ID, {"PHYS_SWITCH_ID"}}, - {IFLA_LINK_NETNSID, {"LINK_NETNSID"}}, // NLA_S32 - {IFLA_PHYS_PORT_NAME, {"PHYS_PORT_NAME", DataType::String}}, - {IFLA_PROTO_DOWN, {"PROTO_DOWN", DataType::Uint}}, - {IFLA_GSO_MAX_SEGS, {"GSO_MAX_SEGS", DataType::Uint}}, - {IFLA_GSO_MAX_SIZE, {"GSO_MAX_SIZE", DataType::Uint}}, - {IFLA_PAD, {"PAD"}}, - {IFLA_XDP, {"XDP"}}, - {IFLA_EVENT, {"EVENT", DataType::Uint}}, - {IFLA_NEW_NETNSID, {"NEW_NETNSID"}}, // NLA_S32 - {IFLA_TARGET_NETNSID, {"TARGET_NETNSID"}}, // NLA_S32 - {IFLA_CARRIER_UP_COUNT, {"CARRIER_UP_COUNT", DataType::Uint}}, - {IFLA_CARRIER_DOWN_COUNT, {"CARRIER_DOWN_COUNT", DataType::Uint}}, - {IFLA_NEW_IFINDEX, {"NEW_IFINDEX"}}, // NLA_S32 - {IFLA_MIN_MTU, {"MIN_MTU", DataType::Uint}}, - {IFLA_MAX_MTU, {"MAX_MTU", DataType::Uint}}, - {IFLA_PROP_LIST, {"PROP_LIST"}}, - {IFLA_ALT_IFNAME, {"ALT_IFNAME", DataType::String}}, - {IFLA_PERM_ADDRESS, {"PERM_ADDRESS"}}, -}) {} -// clang-format off +}, gAttributes) {} +// clang-format on void Link::toStream(std::stringstream& ss, const ifinfomsg& data) const { ss << "ifinfomsg{" diff --git a/automotive/can/1.0/default/libnl++/protocols/route/Route.cpp b/automotive/can/1.0/default/libnl++/protocols/route/Route.cpp index c134911525..51e5b11b74 100644 --- a/automotive/can/1.0/default/libnl++/protocols/route/Route.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/route/Route.cpp @@ -16,10 +16,16 @@ #include "Route.h" +#include "Addr.h" #include "Link.h" namespace android::nl::protocols::route { -Route::Route() : NetlinkProtocol(NETLINK_ROUTE, "ROUTE", {std::make_shared()}) {} +// clang-format off +Route::Route() : NetlinkProtocol(NETLINK_ROUTE, "ROUTE", { + std::make_shared(), + std::make_shared(), +}) {} +// clang-format on } // namespace android::nl::protocols::route diff --git a/automotive/can/1.0/default/libnl++/protocols/route/attributes.cpp b/automotive/can/1.0/default/libnl++/protocols/route/attributes.cpp new file mode 100644 index 0000000000..69d9b811a9 --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/route/attributes.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "attributes.h" + +#include "../structs.h" +#include "structs.h" + +#include +#include + +namespace android::nl::protocols::route { + +using DataType = AttributeDefinition::DataType; +using Flags = AttributeDefinition::Flags; + +// clang-format off +AttributeMap gAttributes = { + {IFLA_ADDRESS, {"ADDRESS"}}, + {IFLA_BROADCAST, {"BROADCAST"}}, + {IFLA_IFNAME, {"IFNAME", DataType::StringNul}}, + {IFLA_MTU, {"MTU", DataType::Uint}}, + {IFLA_LINK, {"LINK", DataType::Uint}}, + {IFLA_QDISC, {"QDISC", DataType::Raw, AttributeMap{}, Flags::Verbose}}, // should be DataType::String, but looks like binary blob + {IFLA_STATS, {"STATS", DataType::Struct, statsToStream}}, + {IFLA_COST, {"COST", DataType::Uint}}, + {IFLA_PRIORITY, {"PRIORITY"}}, + {IFLA_MASTER, {"MASTER", DataType::Uint}}, + {IFLA_WIRELESS, {"WIRELESS"}}, + {IFLA_PROTINFO, {"PROTINFO"}}, + {IFLA_TXQLEN, {"TXQLEN", DataType::Uint}}, + {IFLA_MAP, {"MAP", DataType::Struct, mapToStream}}, + {IFLA_WEIGHT, {"WEIGHT", DataType::Uint}}, + {IFLA_OPERSTATE, {"OPERSTATE", DataType::Uint}}, + {IFLA_LINKMODE, {"LINKMODE", DataType::Uint}}, + {IFLA_LINKINFO, {"LINKINFO", DataType::Nested, AttributeMap{ + {IFLA_INFO_KIND, {"INFO_KIND", DataType::String}}, + {IFLA_INFO_DATA, {"INFO_DATA", DataType::Nested}}, + {IFLA_INFO_XSTATS, {"INFO_XSTATS"}}, + {IFLA_INFO_SLAVE_KIND, {"INFO_SLAVE_KIND", DataType::String}}, + {IFLA_INFO_SLAVE_DATA, {"INFO_SLAVE_DATA"}}, + }}}, + {IFLA_NET_NS_PID, {"NET_NS_PID", DataType::Uint}}, + {IFLA_IFALIAS, {"IFALIAS", DataType::String}}, + {IFLA_NUM_VF, {"NUM_VF", DataType::Uint}}, + {IFLA_VFINFO_LIST, {"VFINFO_LIST"}}, + {IFLA_STATS64, {"STATS64", DataType::Struct, statsToStream}}, + {IFLA_VF_PORTS, {"VF_PORTS"}}, + {IFLA_PORT_SELF, {"PORT_SELF"}}, + {IFLA_AF_SPEC, {"AF_SPEC", DataType::Nested, AttributeMap{ + {AF_INET, {"AF_INET", DataType::Nested, AttributeMap{ + {IFLA_INET_CONF, {"INET_CONF", DataType::Struct, arrayToStream}}, + }}}, + {AF_INET6, {"AF_INET6", DataType::Nested, AttributeMap{ + {IFLA_INET6_FLAGS, {"INET6_FLAGS", DataType::Uint}}, + {IFLA_INET6_CONF, {"INET6_CONF", DataType::Struct, arrayToStream}}, + {IFLA_INET6_STATS, {"INET6_STATS", DataType::Struct, arrayToStream}}, + {IFLA_INET6_MCAST, {"INET6_MCAST"}}, + {IFLA_INET6_CACHEINFO, {"INET6_CACHEINFO", DataType::Struct, ifla_cacheinfoToStream}}, + {IFLA_INET6_ICMP6STATS, {"INET6_ICMP6STATS", DataType::Struct, arrayToStream}}, + {IFLA_INET6_TOKEN, {"INET6_TOKEN"}}, + {IFLA_INET6_ADDR_GEN_MODE, {"INET6_ADDR_GEN_MODE", DataType::Uint}}, + }}}, + }}}, + {IFLA_GROUP, {"GROUP", DataType::Uint}}, + {IFLA_NET_NS_FD, {"NET_NS_FD", DataType::Uint}}, + {IFLA_EXT_MASK, {"EXT_MASK", DataType::Uint}}, + {IFLA_PROMISCUITY, {"PROMISCUITY", DataType::Uint}}, + {IFLA_NUM_TX_QUEUES, {"NUM_TX_QUEUES", DataType::Uint}}, + {IFLA_NUM_RX_QUEUES, {"NUM_RX_QUEUES", DataType::Uint}}, + {IFLA_CARRIER, {"CARRIER", DataType::Uint}}, + {IFLA_PHYS_PORT_ID, {"PHYS_PORT_ID"}}, + {IFLA_CARRIER_CHANGES, {"CARRIER_CHANGES", DataType::Uint}}, + {IFLA_PHYS_SWITCH_ID, {"PHYS_SWITCH_ID"}}, + {IFLA_LINK_NETNSID, {"LINK_NETNSID"}}, // NLA_S32 + {IFLA_PHYS_PORT_NAME, {"PHYS_PORT_NAME", DataType::String}}, + {IFLA_PROTO_DOWN, {"PROTO_DOWN", DataType::Uint}}, + {IFLA_GSO_MAX_SEGS, {"GSO_MAX_SEGS", DataType::Uint}}, + {IFLA_GSO_MAX_SIZE, {"GSO_MAX_SIZE", DataType::Uint}}, + {IFLA_PAD, {"PAD"}}, + {IFLA_XDP, {"XDP"}}, + {IFLA_EVENT, {"EVENT", DataType::Uint}}, + {IFLA_NEW_NETNSID, {"NEW_NETNSID"}}, // NLA_S32 + {IFLA_TARGET_NETNSID, {"TARGET_NETNSID"}}, // NLA_S32 + {IFLA_CARRIER_UP_COUNT, {"CARRIER_UP_COUNT", DataType::Uint}}, + {IFLA_CARRIER_DOWN_COUNT, {"CARRIER_DOWN_COUNT", DataType::Uint}}, + {IFLA_NEW_IFINDEX, {"NEW_IFINDEX"}}, // NLA_S32 + {IFLA_MIN_MTU, {"MIN_MTU", DataType::Uint}}, + {IFLA_MAX_MTU, {"MAX_MTU", DataType::Uint}}, + {IFLA_PROP_LIST, {"PROP_LIST"}}, + {IFLA_ALT_IFNAME, {"ALT_IFNAME", DataType::String}}, + {IFLA_PERM_ADDRESS, {"PERM_ADDRESS"}}, +}; +// clang-format on + +} // namespace android::nl::protocols::route diff --git a/automotive/can/1.0/default/libnl++/protocols/route/attributes.h b/automotive/can/1.0/default/libnl++/protocols/route/attributes.h new file mode 100644 index 0000000000..ace9234f3b --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/route/attributes.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "../MessageDefinition.h" + +namespace android::nl::protocols::route { + +extern AttributeMap gAttributes; + +} // namespace android::nl::protocols::route diff --git a/automotive/can/1.0/default/libnl++/protocols/route/structs.cpp b/automotive/can/1.0/default/libnl++/protocols/route/structs.cpp index b62cec3c7e..269771c423 100644 --- a/automotive/can/1.0/default/libnl++/protocols/route/structs.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/route/structs.cpp @@ -46,4 +46,58 @@ void ifla_cacheinfoToStream(std::stringstream& ss, const Buffer attr) { << data.retrans_time << '}'; } +// clang-format off +std::string familyToString(sa_family_t family) { + switch (family) { + case AF_UNSPEC: return "UNSPEC"; + case AF_UNIX: return "UNIX"; + case AF_INET: return "INET"; + case AF_AX25: return "AX25"; + case AF_IPX: return "IPX"; + case AF_APPLETALK: return "APPLETALK"; + case AF_NETROM: return "NETROM"; + case AF_BRIDGE: return "BRIDGE"; + case AF_ATMPVC: return "ATMPVC"; + case AF_X25: return "X25"; + case AF_INET6: return "INET6"; + case AF_ROSE: return "ROSE"; + case AF_DECnet: return "DECnet"; + case AF_NETBEUI: return "NETBEUI"; + case AF_SECURITY: return "SECURITY"; + case AF_KEY: return "KEY"; + case AF_NETLINK: return "NETLINK"; + case AF_PACKET: return "PACKET"; + case AF_ASH: return "ASH"; + case AF_ECONET: return "ECONET"; + case AF_ATMSVC: return "ATMSVC"; + case AF_RDS: return "RDS"; + case AF_SNA: return "SNA"; + case AF_IRDA: return "IRDA"; + case AF_PPPOX: return "PPPOX"; + case AF_WANPIPE: return "WANPIPE"; + case AF_LLC: return "LLC"; + case 27 /*AF_IB*/: return "IB"; + case 28 /*AF_MPLS*/: return "MPLS"; + case AF_CAN: return "CAN"; + case AF_TIPC: return "TIPC"; + case AF_BLUETOOTH: return "BLUETOOTH"; + case AF_IUCV: return "IUCV"; + case AF_RXRPC: return "RXRPC"; + case AF_ISDN: return "ISDN"; + case AF_PHONET: return "PHONET"; + case AF_IEEE802154: return "IEEE802154"; + case AF_CAIF: return "CAIF"; + case AF_ALG: return "ALG"; + case AF_NFC: return "NFC"; + case AF_VSOCK: return "VSOCK"; + case AF_KCM: return "KCM"; + case AF_QIPCRTR: return "QIPCRTR"; + case 43 /*AF_SMC*/: return "SMC"; + case 44 /*AF_XDP*/: return "XDP"; + default: + return std::to_string(family); + } +} +// clang-format on + } // namespace android::nl::protocols::route diff --git a/automotive/can/1.0/default/libnl++/protocols/route/structs.h b/automotive/can/1.0/default/libnl++/protocols/route/structs.h index fea2ce130c..c969a6c8cb 100644 --- a/automotive/can/1.0/default/libnl++/protocols/route/structs.h +++ b/automotive/can/1.0/default/libnl++/protocols/route/structs.h @@ -19,6 +19,7 @@ #include #include +#include #include @@ -30,6 +31,8 @@ void mapToStream(std::stringstream& ss, const Buffer attr); // ifla_cacheinfo void ifla_cacheinfoToStream(std::stringstream& ss, const Buffer attr); +std::string familyToString(sa_family_t family); + // rtnl_link_stats or rtnl_link_stats64 template void statsToStream(std::stringstream& ss, const Buffer attr) { diff --git a/automotive/can/1.0/default/libnl++/protocols/structs.cpp b/automotive/can/1.0/default/libnl++/protocols/structs.cpp index 8ff71f006a..3f896bffe2 100644 --- a/automotive/can/1.0/default/libnl++/protocols/structs.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/structs.cpp @@ -22,24 +22,27 @@ namespace android::nl::protocols { AttributeDefinition::ToStream flagsToStream(FlagsMap flags) { return [flags](std::stringstream& ss, const Buffer attr) { - auto val = attr.data().copyFirst(); + auto value = attr.data().copyFirst(); + flagsToStream(ss, flags, value); + }; +} - bool first = true; - for (const auto& [flag, name] : flags) { - if ((val & flag) != flag) continue; - val &= ~flag; - - if (!first) ss << '|'; - first = false; - - ss << name; - } - - if (val == 0) return; +void flagsToStream(std::stringstream& ss, const FlagsMap& flags, uint64_t val) { + bool first = true; + for (const auto& [flag, name] : flags) { + if ((val & flag) != flag) continue; + val &= ~flag; if (!first) ss << '|'; - ss << std::hex << val << std::dec; - }; + first = false; + + ss << name; + } + + if (val == 0) return; + + if (!first) ss << '|'; + ss << std::hex << val << std::dec; } void hwaddrToStream(std::stringstream& ss, const Buffer attr) { diff --git a/automotive/can/1.0/default/libnl++/protocols/structs.h b/automotive/can/1.0/default/libnl++/protocols/structs.h index f3a8c44afe..9cf6f1ae57 100644 --- a/automotive/can/1.0/default/libnl++/protocols/structs.h +++ b/automotive/can/1.0/default/libnl++/protocols/structs.h @@ -34,6 +34,7 @@ void arrayToStream(std::stringstream& ss, const Buffer attr) { typedef std::map FlagsMap; AttributeDefinition::ToStream flagsToStream(FlagsMap flags); +void flagsToStream(std::stringstream& ss, const FlagsMap& flags, uint64_t value); void hwaddrToStream(std::stringstream& ss, const Buffer attr); diff --git a/automotive/can/1.0/tools/configurator/canhalconfigurator.cpp b/automotive/can/1.0/tools/configurator/canhalconfigurator.cpp index a100f06f1b..3fb4259bf7 100644 --- a/automotive/can/1.0/tools/configurator/canhalconfigurator.cpp +++ b/automotive/can/1.0/tools/configurator/canhalconfigurator.cpp @@ -70,6 +70,9 @@ static bool processPbCfg(const config::CanBusConfig& pb_cfg) { static bool configuratorStart(const std::string& filepath) { base::SetDefaultTag("CanConfigurator"); + LOG(WARNING) << "The HIDL version of CAN HAL has been deprecated, if this tool fails with " + << "SIGABRT, you may need canhalconfigurator-aidl instead."; + auto pb_cfg = config::parseConfigFile(filepath); if (!pb_cfg.has_value()) { return false; diff --git a/automotive/can/1.0/tools/libcanhaltools/libcanhaltools.cpp b/automotive/can/1.0/tools/libcanhaltools/libcanhaltools.cpp index 9192e2f52d..fabe75fe65 100644 --- a/automotive/can/1.0/tools/libcanhaltools/libcanhaltools.cpp +++ b/automotive/can/1.0/tools/libcanhaltools/libcanhaltools.cpp @@ -34,8 +34,8 @@ hidl_vec getControlServices() { auto manager = hidl::manager::V1_2::IServiceManager::getService(); hidl_vec services; manager->listManifestByInterface(ICanController::descriptor, hidl_utils::fill(&services)); - CHECK(services.size() > 0) << "No ICanController services registered (missing privileges?)" - << std::endl; + CHECK(services.size() > 0) << "No ICanController services registered (missing privileges?). " + << "are you using the AIDL CanController?" << std::endl; return services; } diff --git a/automotive/can/aidl/Android.bp b/automotive/can/aidl/Android.bp new file mode 100644 index 0000000000..3c4ee19af7 --- /dev/null +++ b/automotive/can/aidl/Android.bp @@ -0,0 +1,48 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +aidl_interface { + name: "android.hardware.automotive.can", + vendor_available: true, + srcs: ["android/hardware/automotive/can/*.aidl"], + stability: "vintf", + host_supported: true, + backend: { + java: { + enabled: false, + }, + rust: { + enabled: true, + }, + }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/.hash b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/.hash new file mode 100644 index 0000000000..441924dcc7 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/.hash @@ -0,0 +1 @@ +faa17409884ed5419fe73ebd24279109ca7549e1 diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/BusConfig.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/BusConfig.aidl new file mode 100644 index 0000000000..0212e00f4c --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/BusConfig.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable BusConfig { + String name; + android.hardware.automotive.can.BusConfig.InterfaceId interfaceId; + int bitrate; + union InterfaceId { + android.hardware.automotive.can.VirtualInterface virtualif; + android.hardware.automotive.can.NativeInterface nativeif; + android.hardware.automotive.can.SlcanInterface slcan; + android.hardware.automotive.can.IndexedInterface indexed; + } +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/ICanController.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/ICanController.aidl new file mode 100644 index 0000000000..5d032f27ab --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/ICanController.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +interface ICanController { + android.hardware.automotive.can.InterfaceType[] getSupportedInterfaceTypes(); + String getInterfaceName(in String busName); + String upBus(in android.hardware.automotive.can.BusConfig config); + void downBus(in String name); +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/IndexedInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/IndexedInterface.aidl new file mode 100644 index 0000000000..1b00adf1e1 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/IndexedInterface.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable IndexedInterface { + byte index; +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/InterfaceType.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/InterfaceType.aidl new file mode 100644 index 0000000000..a1bdb90d22 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/InterfaceType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@Backing(type="byte") @VintfStability +enum InterfaceType { + VIRTUAL, + NATIVE, + SLCAN, + INDEXED, +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/NativeInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/NativeInterface.aidl new file mode 100644 index 0000000000..5d6c119356 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/NativeInterface.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable NativeInterface { + android.hardware.automotive.can.NativeInterface.InterfaceId interfaceId; + union InterfaceId { + String ifname; + String[] serialno; + } +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/Result.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/Result.aidl new file mode 100644 index 0000000000..5669645528 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@Backing(type="int") @VintfStability +enum Result { + OK, + UNKNOWN_ERROR, + INVALID_STATE, + NOT_SUPPORTED, + BAD_INTERFACE_ID, + BAD_BITRATE, + BAD_BUS_NAME, + INTERFACE_DOWN, +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/SlcanInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/SlcanInterface.aidl new file mode 100644 index 0000000000..af0c07d22a --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/SlcanInterface.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable SlcanInterface { + android.hardware.automotive.can.SlcanInterface.InterfaceId interfaceId; + union InterfaceId { + String ttyname; + String[] serialno; + } +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/VirtualInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/VirtualInterface.aidl new file mode 100644 index 0000000000..c870612dd9 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/1/android/hardware/automotive/can/VirtualInterface.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable VirtualInterface { + String ifname; +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/BusConfig.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/BusConfig.aidl new file mode 100644 index 0000000000..0212e00f4c --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/BusConfig.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable BusConfig { + String name; + android.hardware.automotive.can.BusConfig.InterfaceId interfaceId; + int bitrate; + union InterfaceId { + android.hardware.automotive.can.VirtualInterface virtualif; + android.hardware.automotive.can.NativeInterface nativeif; + android.hardware.automotive.can.SlcanInterface slcan; + android.hardware.automotive.can.IndexedInterface indexed; + } +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/ICanController.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/ICanController.aidl new file mode 100644 index 0000000000..5d032f27ab --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/ICanController.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +interface ICanController { + android.hardware.automotive.can.InterfaceType[] getSupportedInterfaceTypes(); + String getInterfaceName(in String busName); + String upBus(in android.hardware.automotive.can.BusConfig config); + void downBus(in String name); +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/IndexedInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/IndexedInterface.aidl new file mode 100644 index 0000000000..1b00adf1e1 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/IndexedInterface.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable IndexedInterface { + byte index; +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/InterfaceType.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/InterfaceType.aidl new file mode 100644 index 0000000000..44865aafb7 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/InterfaceType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@Backing(type="byte") @VintfStability +enum InterfaceType { + VIRTUAL = 0, + NATIVE = 1, + SLCAN = 2, + INDEXED = 3, +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/NativeInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/NativeInterface.aidl new file mode 100644 index 0000000000..5d6c119356 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/NativeInterface.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable NativeInterface { + android.hardware.automotive.can.NativeInterface.InterfaceId interfaceId; + union InterfaceId { + String ifname; + String[] serialno; + } +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/Result.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/Result.aidl new file mode 100644 index 0000000000..010792a054 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@Backing(type="int") @VintfStability +enum Result { + OK = 0, + UNKNOWN_ERROR = 1, + INVALID_STATE = 2, + NOT_SUPPORTED = 3, + BAD_INTERFACE_ID = 4, + BAD_BITRATE = 5, + BAD_BUS_NAME = 6, + INTERFACE_DOWN = 7, +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/SlcanInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/SlcanInterface.aidl new file mode 100644 index 0000000000..af0c07d22a --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/SlcanInterface.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable SlcanInterface { + android.hardware.automotive.can.SlcanInterface.InterfaceId interfaceId; + union InterfaceId { + String ttyname; + String[] serialno; + } +} diff --git a/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/VirtualInterface.aidl b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/VirtualInterface.aidl new file mode 100644 index 0000000000..c870612dd9 --- /dev/null +++ b/automotive/can/aidl/aidl_api/android.hardware.automotive.can/current/android/hardware/automotive/can/VirtualInterface.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.can; +@VintfStability +parcelable VirtualInterface { + String ifname; +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/BusConfig.aidl b/automotive/can/aidl/android/hardware/automotive/can/BusConfig.aidl new file mode 100644 index 0000000000..4e1027ba2d --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/BusConfig.aidl @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +import android.hardware.automotive.can.IndexedInterface; +import android.hardware.automotive.can.NativeInterface; +import android.hardware.automotive.can.SlcanInterface; +import android.hardware.automotive.can.VirtualInterface; + +/** + * Configuration of the (physical or virtual) CAN bus. + * + * ISO TP and CAN FD support is dependent upon the hardware. + */ +@VintfStability +parcelable BusConfig { + /** + * Name by which a given bus may be referenced. + * + * It must consist of only alphanumeric characters and underscore + * (a-z, A-Z, 0-9, '_'), at least 1 and at most 32 characters long. + * + * This field is *not* meant to distinguish between hardware interfaces + * nor preselect parameters like bitrate. + * + * This field represents a more human-friendly name for a CAN bus: + * e.x. rather than /some/dev/can1234, "name" might be "BodyCAN" or "CCAN" + */ + String name; + + /** + * Hardware interface configuration. + * + * This union's discriminator has an equivalent enum {@see InterfaceType} to + * express compatibility via getSupportedInterfaceTypes(). + */ + union InterfaceId { + /** Virtual SocketCAN interface. */ + VirtualInterface virtualif; + + /** Native SocketCAN interface. */ + NativeInterface nativeif; + + /** Serial line CAN interface. */ + SlcanInterface slcan; + + /** + * Proprietary, device-specific interface. + * + * Non-SocketCAN interfaces should use this variant. + */ + IndexedInterface indexed; + } + + InterfaceId interfaceId; + + /** + * Bit rate for CAN communication. + * + * Typical bit rates are: 100000, 125000, 250000, 500000. + * + * For {@see interfaceId#virtual} interfaces, this value is ignored. + */ + int bitrate; +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/ICanController.aidl b/automotive/can/aidl/android/hardware/automotive/can/ICanController.aidl new file mode 100644 index 0000000000..97c2674e8c --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/ICanController.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +import android.hardware.automotive.can.BusConfig; +import android.hardware.automotive.can.InterfaceType; +import android.hardware.automotive.can.Result; + +/** + * Represents a CAN controller that's capable of configuring CAN bus interfaces. + * + * The goal of this service is to configure and manage CAN interfaces. + * + * Providing an ICanController interface to configure CAN buses is optional. + * A system can elect to configure CAN buses manually if the hardware is + * dedicated to a specific application. + */ +@VintfStability +interface ICanController { + /** + * Fetches the list of interface types supported by this HAL server. + * + * @return iftypes The list of supported interface types. + */ + InterfaceType[] getSupportedInterfaceTypes(); + + /** + * Gets the interface name given the name of the bus. This will + * + * @param busName Name of the CAN bus who's interface name we would like + * (e.x. BCAN, CCAN, HS3, BodyCAN, ...) + * @return name of the socketcan network interface corresponding to busName + * (e.x. can0, vcan5, ...) + */ + String getInterfaceName(in String busName); + + /** + * Bring up a CAN bus. + * + * @param config Configuration for the CAN bus. + * @return name of iface if successful + */ + String upBus(in BusConfig config); + + /** + * Bring down a CAN bus. + * + * @param name Name of the bus (@see BusConfig#name} to bring down. + */ + void downBus(in String name); +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/IndexedInterface.aidl b/automotive/can/aidl/android/hardware/automotive/can/IndexedInterface.aidl new file mode 100644 index 0000000000..13e223ff3d --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/IndexedInterface.aidl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +@VintfStability +parcelable IndexedInterface { + /** Interface number, 0-based. */ + byte index; +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/InterfaceType.aidl b/automotive/can/aidl/android/hardware/automotive/can/InterfaceType.aidl new file mode 100644 index 0000000000..b13648a8b6 --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/InterfaceType.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +/** + * Type of an interface, an equivalent to BusConfig::InterfaceId + * union discriminator. Defines a number of specific standard hardware + * families and a generic catch-all type of {@see INDEXED}. + */ +@VintfStability +@Backing(type="byte") +enum InterfaceType { + /** Virtual SocketCAN interface. */ + VIRTUAL, + + /** Native SocketCAN interface. */ + NATIVE, + + /** Serial line CAN interface. */ + SLCAN, + + /** Proprietary, device-specific interface. */ + INDEXED, +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/NativeInterface.aidl b/automotive/can/aidl/android/hardware/automotive/can/NativeInterface.aidl new file mode 100644 index 0000000000..30c24c3d55 --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/NativeInterface.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +@VintfStability +parcelable NativeInterface { + union InterfaceId { + /** Interface name, such as can0. */ + String ifname; + + /** + * Alternatively to providing {@see ifname}, one may provide a list of + * interface serial number suffixes. If there happens to be a device + * (like USB2CAN) with a matching serial number suffix, the HAL service + * will locate it. + * + * Client may utilize this in two ways: by matching against the + * entire serial number, or the last few characters (usually + * one). The former is better for small-scale test deployments + * (with just a handful of vehicles), the latter is good for + * larger scale (where a small suffix list may support large + * test fleet). + */ + String[] serialno; + } + + InterfaceId interfaceId; +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/Result.aidl b/automotive/can/aidl/android/hardware/automotive/can/Result.aidl new file mode 100644 index 0000000000..cdd0066328 --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/Result.aidl @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +/** + * Possible error codes (or OK) for ICanController. + */ +@VintfStability +@Backing(type="int") +enum Result { + OK, + + /** + * General error class, if others are not applicable. + */ + UNKNOWN_ERROR, + + /** + * Up request was called out of order (i.e. trying to up the interface + * twice). + */ + INVALID_STATE, + + /** Interface type is not supported. */ + NOT_SUPPORTED, + + /** + * Provided interface ID (index, name, device path) doesn't exist or there + * is no device with a given serial number. + */ + BAD_INTERFACE_ID, + + /** Provided bit rate is not supported by the hardware. */ + BAD_BITRATE, + + /** + * Provided bus name ({@see BusConfig#name}) has invalid format or doesn't exist. + */ + BAD_BUS_NAME, + + /** + * The interface for the bus you are trying to interact with is currently + * down. As opposed to INVALID_STATE, this serves to warn the caller + * _before_ they attempt an invalid operation. + */ + INTERFACE_DOWN, +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/SlcanInterface.aidl b/automotive/can/aidl/android/hardware/automotive/can/SlcanInterface.aidl new file mode 100644 index 0000000000..4ed85838df --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/SlcanInterface.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +@VintfStability +parcelable SlcanInterface { + union InterfaceId { + /** Path to a device, such as /dev/ttyUSB0. */ + String ttyname; + + /** + * List of interface serial number suffixes. + * {@see Socketcan::serialno} + */ + String[] serialno; + } + + InterfaceId interfaceId; +} diff --git a/automotive/can/aidl/android/hardware/automotive/can/VirtualInterface.aidl b/automotive/can/aidl/android/hardware/automotive/can/VirtualInterface.aidl new file mode 100644 index 0000000000..7e1e5e17ca --- /dev/null +++ b/automotive/can/aidl/android/hardware/automotive/can/VirtualInterface.aidl @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.automotive.can; + +@VintfStability +parcelable VirtualInterface { + /** + * Interface name, such as vcan0. If the interface doesn't + * exist, HAL server must create it. + */ + String ifname; +} diff --git a/automotive/can/aidl/default/Android.bp b/automotive/can/aidl/default/Android.bp new file mode 100644 index 0000000000..d44cb91cf9 --- /dev/null +++ b/automotive/can/aidl/default/Android.bp @@ -0,0 +1,51 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_binary { + name: "android.hardware.automotive.can-service", + init_rc: ["android.hardware.automotive.can.rc"], + defaults: ["android.hardware.automotive.can@defaults"], + vendor: true, + relative_install_path: "hw", + srcs: [ + "CanBus.cpp", + "CanBusSlcan.cpp", + "CanBusNative.cpp", + "CanBusVirtual.cpp", + "CanController.cpp", + "service.cpp", + ], + shared_libs: [ + "android.hardware.automotive.can-V1-ndk", + "libbase", + "libbinder_ndk", + ], + static_libs: [ + "android.hardware.automotive.can@libnetdevice", + "android.hardware.automotive@libc++fs", + "libnl++", + ], + vintf_fragments: ["android.hardware.automotive.can.xml"], +} diff --git a/automotive/can/aidl/default/CanBus.cpp b/automotive/can/aidl/default/CanBus.cpp new file mode 100644 index 0000000000..d1f9b78d95 --- /dev/null +++ b/automotive/can/aidl/default/CanBus.cpp @@ -0,0 +1,93 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CanBus.h" + +#include +#include + +namespace aidl::android::hardware::automotive::can { + +CanBus::CanBus(std::string_view ifname) : mIfname(ifname) {} + +CanBus::~CanBus() { + std::lock_guard lck(mIsUpGuard); + CHECK(!mIsUp) << "Interface is still up while being destroyed"; +} + +Result CanBus::preUp() { + return Result::OK; +} + +bool CanBus::postDown() { + return true; +} + +std::string CanBus::getIfaceName() { + return mIfname; +} + +Result CanBus::up() { + std::lock_guard lck(mIsUpGuard); + + if (mIsUp) { + LOG(WARNING) << "Interface is already up"; + return Result::INVALID_STATE; + } + + const auto preResult = preUp(); + if (preResult != Result::OK) return preResult; + + const auto isUp = ::android::netdevice::isUp(mIfname); + if (!isUp.has_value()) { + // preUp() should prepare the interface (either create or make sure it's there) + LOG(ERROR) << "Interface " << mIfname << " didn't get prepared"; + return Result::BAD_INTERFACE_ID; + } + + if (!*isUp && !::android::netdevice::up(mIfname)) { + LOG(ERROR) << "Can't bring " << mIfname << " up"; + return Result::UNKNOWN_ERROR; + } + mDownAfterUse = !*isUp; + + mIsUp = true; + return Result::OK; +} + +Result CanBus::down() { + std::lock_guard lck(mIsUpGuard); + + if (!mIsUp) { + LOG(WARNING) << "Interface is already down"; + return Result::INVALID_STATE; + } + mIsUp = false; + + Result success = Result::OK; + + if (mDownAfterUse && !::android::netdevice::down(mIfname)) { + LOG(ERROR) << "Can't bring " << mIfname << " down"; + // don't return yet, let's try to do best-effort cleanup + success = Result::UNKNOWN_ERROR; + } + + if (!postDown()) success = Result::UNKNOWN_ERROR; + + return success; +} + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBus.h b/automotive/can/aidl/default/CanBus.h new file mode 100644 index 0000000000..abdbe5148f --- /dev/null +++ b/automotive/can/aidl/default/CanBus.h @@ -0,0 +1,77 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +#include +#include + +#include +#include + +namespace aidl::android::hardware::automotive::can { + +class CanBus { + public: + /** + * Some interface types (such as SLCAN) don't get an interface name until after being + * initialized, hence ifname is optional. + * + * You MUST ensure mIfname is initialized prior to the completion of preUp(). + */ + CanBus(std::string_view ifname = std::string_view{""}); + + virtual ~CanBus(); + + Result up(); + Result down(); + std::string getIfaceName(); + + protected: + /** + * Prepare the SocketCAN interface. + * + * After calling this method, mIfname network interface is available and ready to be brought up. + * + * \return true upon success and false upon failure + */ + virtual Result preUp(); + + /** + * Cleanup after bringing the interface down. + * + * This is a counterpart to preUp(). + * + * \return true upon success and false upon failure + */ + virtual bool postDown(); + + /** Network interface name. */ + std::string mIfname; + + private: + /** + * Guard for up flag is required to be held for entire time when the interface is being used + * because we don't want the interface to be torn down while executing that operation. + */ + std::mutex mIsUpGuard; + bool mIsUp GUARDED_BY(mIsUpGuard) = false; + + bool mDownAfterUse; +}; + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBusNative.cpp b/automotive/can/aidl/default/CanBusNative.cpp new file mode 100644 index 0000000000..8a7de99203 --- /dev/null +++ b/automotive/can/aidl/default/CanBusNative.cpp @@ -0,0 +1,54 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CanBusNative.h" + +#include +#include +#include + +namespace aidl::android::hardware::automotive::can { + +using namespace ::android; + +CanBusNative::CanBusNative(const std::string& ifname, uint32_t bitrate) + : CanBus(ifname), mBitrate(bitrate) {} + +Result CanBusNative::preUp() { + if (!netdevice::exists(mIfname)) { + LOG(ERROR) << "Interface " << mIfname << " doesn't exist"; + return Result::BAD_INTERFACE_ID; + } + + if (mBitrate == 0) { + // interface is already up and we just want to register it + return Result::OK; + } + + if (!netdevice::down(mIfname)) { + LOG(ERROR) << "Can't bring " << mIfname << " down (to configure it)"; + return Result::UNKNOWN_ERROR; + } + + if (!netdevice::can::setBitrate(mIfname, mBitrate)) { + LOG(ERROR) << "Can't set bitrate " << mBitrate << " for " << mIfname; + return Result::BAD_BITRATE; + } + + return Result::OK; +} + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBusNative.h b/automotive/can/aidl/default/CanBusNative.h new file mode 100644 index 0000000000..32846c7109 --- /dev/null +++ b/automotive/can/aidl/default/CanBusNative.h @@ -0,0 +1,33 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "CanBus.h" + +namespace aidl::android::hardware::automotive::can { + +class CanBusNative : public CanBus { + public: + CanBusNative(const std::string& ifname, uint32_t bitrate); + + protected: + virtual Result preUp() override; + + private: + const uint32_t mBitrate; +}; + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBusSlcan.cpp b/automotive/can/aidl/default/CanBusSlcan.cpp new file mode 100644 index 0000000000..6060419dbd --- /dev/null +++ b/automotive/can/aidl/default/CanBusSlcan.cpp @@ -0,0 +1,174 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CanBusSlcan.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include + +namespace aidl::android::hardware::automotive::can { + +using namespace std::string_view_literals; +using namespace ::android::base; + +namespace slcanprotocol { +static constexpr std::string_view kOpenCommand = "O\r"sv; +static constexpr std::string_view kCloseCommand = "C\r"sv; +static constexpr int kSlcanDiscipline = N_SLCAN; +static constexpr int kDefaultDiscipline = N_TTY; + +static const std::map kBitrateCommands = { + {10000, "C\rS0\r"sv}, {20000, "C\rS1\r"sv}, {50000, "C\rS2\r"sv}, + {100000, "C\rS3\r"sv}, {125000, "C\rS4\r"sv}, {250000, "C\rS5\r"sv}, + {500000, "C\rS6\r"sv}, {800000, "C\rS7\r"sv}, {1000000, "C\rS8\r"sv}}; +} // namespace slcanprotocol + +/** + * Serial Line CAN constructor + * \param string uartName - name of slcan device (e.x. /dev/ttyUSB0) + * \param uint32_t bitrate - speed of the CAN bus (125k = MSCAN, 500k = HSCAN) + */ +CanBusSlcan::CanBusSlcan(const std::string& uartName, uint32_t bitrate) + : CanBus(), mTtyPath(uartName), kBitrate(bitrate) {} + +/** helper function to update CanBusSlcan object's iface name */ +Result CanBusSlcan::updateIfaceName(unique_fd& uartFd) { + struct ifreq ifrequest = {}; + /* + * Fetching the iface name with an ioctl won't interfere with an open socketCAN iface attached + * to this tty. This is important in the event we are trying to register a SLCAN based iface + * that has already been configured and brought up. + */ + if (ioctl(uartFd.get(), SIOCGIFNAME, ifrequest.ifr_name) < 0) { + PLOG(ERROR) << "Failed to get the name of the created device"; + return Result::UNKNOWN_ERROR; + } + + // Update the CanBus object with name that was assigned to it + mIfname = ifrequest.ifr_name; + return Result::OK; +} + +Result CanBusSlcan::preUp() { + // verify valid bitrate and translate to serial command format + std::optional canBitrateCommand = std::nullopt; + if (kBitrate != 0) { + const auto lookupIt = slcanprotocol::kBitrateCommands.find(kBitrate); + if (lookupIt == slcanprotocol::kBitrateCommands.end()) { + return Result::BAD_BITRATE; + } + canBitrateCommand = lookupIt->second; + } + + /* Attempt to open the uart in r/w without blocking or becoming the + * controlling terminal */ + mFd = unique_fd(open(mTtyPath.c_str(), O_RDWR | O_NONBLOCK | O_NOCTTY | O_CLOEXEC)); + if (!mFd.ok()) { + PLOG(ERROR) << "SLCAN Failed to open " << mTtyPath; + return Result::BAD_INTERFACE_ID; + } + + // If the device is already up, update the iface name in our CanBusSlcan object + if (kBitrate == 0) { + return updateIfaceName(mFd); + } + + // blank terminal settings and pull them from the device + struct termios terminalSettings = {}; + if (tcgetattr(mFd.get(), &terminalSettings) < 0) { + PLOG(ERROR) << "Failed to read attrs of" << mTtyPath; + return Result::UNKNOWN_ERROR; + } + + // change settings to raw mode + cfmakeraw(&terminalSettings); + + // disable software flow control + terminalSettings.c_iflag &= ~IXOFF; + // enable hardware flow control + terminalSettings.c_cflag |= CRTSCTS; + + struct serial_struct serialSettings; + // get serial settings + if (ioctl(mFd.get(), TIOCGSERIAL, &serialSettings) < 0) { + PLOG(ERROR) << "Failed to read serial settings from " << mTtyPath; + return Result::UNKNOWN_ERROR; + } + // set low latency mode + serialSettings.flags |= ASYNC_LOW_LATENCY; + // apply serial settings + if (ioctl(mFd.get(), TIOCSSERIAL, &serialSettings) < 0) { + PLOG(ERROR) << "Failed to set low latency mode on " << mTtyPath; + return Result::UNKNOWN_ERROR; + } + + /* TCSADRAIN applies settings after we finish writing the rest of our + * changes (as opposed to TCSANOW, which changes immediately) */ + if (tcsetattr(mFd.get(), TCSADRAIN, &terminalSettings) < 0) { + PLOG(ERROR) << "Failed to apply terminal settings to " << mTtyPath; + return Result::UNKNOWN_ERROR; + } + + // apply speed setting for CAN + if (!WriteStringToFd(*canBitrateCommand, mFd)) { + PLOG(ERROR) << "Failed to apply CAN bitrate"; + return Result::UNKNOWN_ERROR; + } + + // TODO(b/144775286): set open flag & support listen only + if (!WriteStringToFd(slcanprotocol::kOpenCommand, mFd)) { + PLOG(ERROR) << "Failed to set open flag"; + return Result::UNKNOWN_ERROR; + } + + // set line discipline to slcan + if (ioctl(mFd.get(), TIOCSETD, &slcanprotocol::kSlcanDiscipline) < 0) { + PLOG(ERROR) << "Failed to set line discipline to slcan"; + return Result::UNKNOWN_ERROR; + } + + // Update the CanBus object with name that was assigned to it + return updateIfaceName(mFd); +} + +bool CanBusSlcan::postDown() { + // reset the line discipline to TTY mode + if (ioctl(mFd.get(), TIOCSETD, &slcanprotocol::kDefaultDiscipline) < 0) { + LOG(ERROR) << "Failed to reset line discipline!"; + return false; + } + + // issue the close command + if (!WriteStringToFd(slcanprotocol::kCloseCommand, mFd)) { + LOG(ERROR) << "Failed to close tty!"; + return false; + } + + // close our unique_fd + mFd.reset(); + + return true; +} + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBusSlcan.h b/automotive/can/aidl/default/CanBusSlcan.h new file mode 100644 index 0000000000..a1c908cc4f --- /dev/null +++ b/automotive/can/aidl/default/CanBusSlcan.h @@ -0,0 +1,40 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "CanBus.h" + +#include + +namespace aidl::android::hardware::automotive::can { + +class CanBusSlcan : public CanBus { + public: + CanBusSlcan(const std::string& uartName, uint32_t bitrate); + + protected: + virtual Result preUp() override; + virtual bool postDown() override; + + private: + Result updateIfaceName(::android::base::unique_fd& uartFd); + + const std::string mTtyPath; + const uint32_t kBitrate; + ::android::base::unique_fd mFd; +}; + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBusVirtual.cpp b/automotive/can/aidl/default/CanBusVirtual.cpp new file mode 100644 index 0000000000..28a1258ad2 --- /dev/null +++ b/automotive/can/aidl/default/CanBusVirtual.cpp @@ -0,0 +1,52 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CanBusVirtual.h" + +#include +#include + +namespace aidl::android::hardware::automotive::can { + +using namespace ::android; + +CanBusVirtual::CanBusVirtual(const std::string& ifname) : CanBus(ifname) {} + +Result CanBusVirtual::preUp() { + if (netdevice::exists(mIfname)) return Result::OK; + + LOG(DEBUG) << "Virtual interface " << mIfname << " doesn't exist, creating..."; + mWasCreated = true; + if (!netdevice::add(mIfname, "vcan")) { + LOG(ERROR) << "Can't create vcan interface " << mIfname; + return Result::UNKNOWN_ERROR; + } + + return Result::OK; +} + +bool CanBusVirtual::postDown() { + if (mWasCreated) { + mWasCreated = false; + if (!netdevice::del(mIfname)) { + LOG(ERROR) << "Couldn't remove vcan interface " << mIfname; + return false; + } + } + return true; +} + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanBusVirtual.h b/automotive/can/aidl/default/CanBusVirtual.h new file mode 100644 index 0000000000..9c5d35d0bf --- /dev/null +++ b/automotive/can/aidl/default/CanBusVirtual.h @@ -0,0 +1,34 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "CanBus.h" + +namespace aidl::android::hardware::automotive::can { + +class CanBusVirtual : public CanBus { + public: + CanBusVirtual(const std::string& ifname); + + protected: + virtual Result preUp() override; + virtual bool postDown() override; + + private: + bool mWasCreated = false; +}; + +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanController.cpp b/automotive/can/aidl/default/CanController.cpp new file mode 100644 index 0000000000..e4b5306815 --- /dev/null +++ b/automotive/can/aidl/default/CanController.cpp @@ -0,0 +1,333 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CanController.h" + +#include "CanBusNative.h" +#include "CanBusSlcan.h" +#include "CanBusVirtual.h" + +#include +#include + +#include +#include +#include + +namespace aidl::android::hardware::automotive::can { + +namespace fs = ::android::hardware::automotive::filesystem; + +namespace fsErrors { +static const std::error_code ok; +static const std::error_code eperm(EPERM, std::generic_category()); +static const std::error_code enoent(ENOENT, std::generic_category()); +static const std::error_code eacces(EACCES, std::generic_category()); +} // namespace fsErrors + +/* In the /sys/devices tree, there are files called "serial", which contain the serial numbers + * for various devices. The exact location inside of this directory is dependent upon the + * hardware we are running on, so we have to start from /sys/devices and work our way down. */ +static const fs::path kDevPath("/sys/devices/"); +static const std::regex kTtyRe("^tty[A-Z]+[0-9]+$"); +static constexpr auto kOpts = ~(fs::directory_options::follow_directory_symlink | + fs::directory_options::skip_permission_denied); + +constexpr auto ok = &ndk::ScopedAStatus::ok; + +/** + * A helper object to associate the interface name and type of a USB to CAN adapter. + */ +struct UsbCanIface { + InterfaceType iftype; + std::string ifaceName; +}; + +static bool isValidName(const std::string& name) { + static const std::regex nameRE("^[a-zA-Z0-9_]{1,32}$"); + return std::regex_match(name, nameRE); +} + +/** + * Given a path, get the last element from it. + * + * \param itrPath - the path we want the last element of + * \return - the last element in the path (in string form). + */ +static std::string getLeaf(const fs::path& itrPath) { + /* end() returns an iterator one past the leaf of the path, so we've overshot + decrement (--) to go back one to the leaf + dereference and now we have our leaf. */ + return *(--(itrPath.end())); +} + +static ndk::ScopedAStatus resultToStatus(Result res, const std::string& msg = "") { + if (msg.empty()) { + return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(static_cast(res))); + } + return ndk::ScopedAStatus( + AStatus_fromServiceSpecificErrorWithMessage(static_cast(res), msg.c_str())); +} + +/** + * Given a UsbCanIface object, get the ifaceName given the serialPath. + * + * \param serialPath - Absolute path to a "serial" file for a given device in /sys. + * \return A populated UsbCanIface. On failure, nullopt is returned. + */ +static std::optional getIfaceName(const fs::path& serialPath) { + std::error_code fsStatus; + // Since the path is to a file called "serial", we need to search its parent directory. + fs::recursive_directory_iterator fsItr(serialPath.parent_path(), kOpts, fsStatus); + if (fsStatus != fsErrors::ok) { + LOG(ERROR) << "Failed to open " << serialPath.parent_path(); + return std::nullopt; + } + + for (; fsStatus == fsErrors::ok && fsItr != fs::recursive_directory_iterator(); + fsItr.increment(fsStatus)) { + /* We want either a directory called "net" or a directory that looks like tty, so + * skip files. */ + bool isDir = fsItr->is_directory(fsStatus); + if (fsStatus != fsErrors::ok || !isDir) continue; + + std::string currentDir = getLeaf(fsItr->path()); + if (currentDir == "net") { + /* This device is a SocketCAN device. The iface name is the only directory under + * net/. Multiple directories under net/ is an error.*/ + fs::directory_iterator netItr(fsItr->path(), kOpts, fsStatus); + if (fsStatus != fsErrors::ok) { + LOG(ERROR) << "Failed to open " << fsItr->path() << " to get net name!"; + return std::nullopt; + } + + // The leaf of our path should be the interface name. + std::string netName = getLeaf(netItr->path()); + + // Check if there is more than one item in net/ + netItr.increment(fsStatus); + if (fsStatus != fsErrors::ok) { + // It's possible we have a valid net name, but this is most likely an error. + LOG(ERROR) << "Failed to verify " << fsItr->path() << " has valid net name!"; + return std::nullopt; + } + if (netItr != fs::directory_iterator()) { + // There should never be more than one name under net/ + LOG(ERROR) << "Found more than one net name in " << fsItr->path() << "!"; + return std::nullopt; + } + return {{InterfaceType::NATIVE, netName}}; + } else if (std::regex_match(currentDir, kTtyRe)) { + // This device is a USB serial device, and currentDir is the tty name. + return {{InterfaceType::SLCAN, "/dev/" + currentDir}}; + } + } + + // check if the loop above exited due to a c++fs error. + if (fsStatus != fsErrors::ok) { + LOG(ERROR) << "Failed search filesystem: " << fsStatus; + } + return std::nullopt; +} + +/** + * A helper function to read the serial number from a "serial" file in /sys/devices/ + * + * \param serialnoPath - path to the file to read. + * \return the serial number, or nullopt on failure. + */ +static std::optional readSerialNo(const std::string& serialnoPath) { + std::ifstream serialnoStream(serialnoPath); + std::string serialno; + if (!serialnoStream.good()) { + LOG(ERROR) << "Failed to read serial number from " << serialnoPath; + return std::nullopt; + } + std::getline(serialnoStream, serialno); + return serialno; +} + +/** + * Searches for USB devices found in /sys/devices/, and attempts to find a device matching the + * provided list of serial numbers. + * + * \param configSerialnos - a list of serial number (suffixes) from the HAL config. + * \param iftype - the type of the interface to be located. + * \return a matching USB device. On failure, std::nullopt is returned. + */ +static std::optional findUsbDevice(const std::vector& configSerialnos) { + std::error_code fsStatus; + fs::recursive_directory_iterator fsItr(kDevPath, kOpts, fsStatus); + if (fsStatus != fsErrors::ok) { + LOG(ERROR) << "Failed to open " << kDevPath; + return std::nullopt; + } + + for (; fsStatus == fsErrors::ok && fsItr != fs::recursive_directory_iterator(); + fsItr.increment(fsStatus)) { + // We want to find a file called "serial", which is in a directory somewhere. Skip files. + bool isDir = fsItr->is_directory(fsStatus); + if (fsStatus != fsErrors::ok) { + LOG(ERROR) << "Failed check if " << fsStatus; + return std::nullopt; + } + if (!isDir) continue; + + auto serialnoPath = fsItr->path() / "serial"; + bool isReg = fs::is_regular_file(serialnoPath, fsStatus); + + /* Make sure we have permissions to this directory, ignore enoent, since the file + * "serial" may not exist, which is ok. */ + if (fsStatus == fsErrors::eperm || fsStatus == fsErrors::eacces) { + /* This means we don't have access to this directory. If we recurse into it, this + * will cause the iterator to loose its state and we'll crash. */ + fsItr.disable_recursion_pending(); + continue; + } + if (fsStatus == fsErrors::enoent) continue; + if (fsStatus != fsErrors::ok) { + LOG(WARNING) << "An unexpected error occurred while checking for serialno: " + << fsStatus; + continue; + } + if (!isReg) continue; + + // we found a serial number + auto serialno = readSerialNo(serialnoPath); + if (!serialno.has_value()) continue; + + // see if the serial number exists in the config + for (auto&& cfgSn : configSerialnos) { + if (serialno->ends_with(std::string(cfgSn))) { + auto ifaceInfo = getIfaceName(serialnoPath); + if (!ifaceInfo.has_value()) break; + return ifaceInfo; + } + } + } + if (fsStatus != fsErrors::ok) { + LOG(ERROR) << "Error searching filesystem: " << fsStatus; + return std::nullopt; + } + return std::nullopt; +} + +ndk::ScopedAStatus CanController::getSupportedInterfaceTypes( + std::vector* supportedTypes) { + *supportedTypes = {InterfaceType::VIRTUAL, InterfaceType::NATIVE, InterfaceType::SLCAN}; + return ok(); +} + +ndk::ScopedAStatus CanController::getInterfaceName(const std::string& busName, + std::string* ifaceName) { + *ifaceName = {}; + if (mBusesByName.find(busName) == mBusesByName.end()) { + return resultToStatus(Result::BAD_BUS_NAME, fmt::format("{} doesn't exist", busName)); + } + *ifaceName = std::string(mBusesByName[busName]->getIfaceName()); + return ok(); +} + +ndk::ScopedAStatus CanController::upBus(const BusConfig& config, std::string* ifaceName) { + if (!isValidName(config.name)) { + LOG(ERROR) << "Bus name " << config.name << " is invalid"; + return resultToStatus(Result::BAD_BUS_NAME, + fmt::format("{} is not a valid bus name", config.name)); + } else if (mBusesByName.find(config.name) != mBusesByName.end()) { + LOG(ERROR) << "A bus named " << config.name << " already exists!"; + return resultToStatus(Result::INVALID_STATE, + fmt::format("A bus named {} already exists", config.name)); + } + + if (config.interfaceId.getTag() == BusConfig::InterfaceId::Tag::virtualif) { + auto& virtualif = config.interfaceId.get(); + mBusesByName[config.name] = std::make_unique(virtualif.ifname); + } + + else if (config.interfaceId.getTag() == BusConfig::InterfaceId::Tag::nativeif) { + auto& nativeif = config.interfaceId.get(); + std::string ifaceName; + if (nativeif.interfaceId.getTag() == NativeInterface::InterfaceId::Tag::serialno) { + // Configure by serial number. + auto selectedDevice = findUsbDevice( + nativeif.interfaceId.get()); + // verify the returned device is the correct one + if (!selectedDevice.has_value() || selectedDevice->iftype != InterfaceType::NATIVE) { + return resultToStatus( + Result::BAD_INTERFACE_ID, + "Couldn't find a native socketcan device with the given serial number(s)"); + } + ifaceName = selectedDevice->ifaceName; + } else { + // configure by iface name. + ifaceName = nativeif.interfaceId.get(); + } + mBusesByName[config.name] = std::make_unique(ifaceName, config.bitrate); + } + + else if (config.interfaceId.getTag() == BusConfig::InterfaceId::Tag::slcan) { + auto& slcanif = config.interfaceId.get(); + std::string ttyName; + if (slcanif.interfaceId.getTag() == SlcanInterface::InterfaceId::Tag::serialno) { + // Configure by serial number. + auto selectedDevice = findUsbDevice( + slcanif.interfaceId.get()); + if (!selectedDevice.has_value() || selectedDevice->iftype != InterfaceType::SLCAN) { + return resultToStatus( + Result::BAD_INTERFACE_ID, + "Couldn't find a slcan device with the given serial number(s)"); + } + ttyName = selectedDevice->ifaceName; + } else { + // Configure by tty name. + ttyName = slcanif.interfaceId.get(); + } + mBusesByName[config.name] = std::make_unique(ttyName, config.bitrate); + } + + else if (config.interfaceId.getTag() == BusConfig::InterfaceId::Tag::indexed) { + return resultToStatus(Result::NOT_SUPPORTED, + "Indexed devices are not supported in this implementation"); + } else { + // this shouldn't happen. + return resultToStatus(Result::UNKNOWN_ERROR, "Unknown interface id type"); + } + + Result result = mBusesByName[config.name]->up(); + if (result != Result::OK) { + // the bus failed to come up, don't leave a broken entry in the map. + mBusesByName.erase(config.name); + return resultToStatus(result, fmt::format("CanBus::up failed for {}", config.name)); + } + + *ifaceName = mBusesByName[config.name]->getIfaceName(); + return ok(); +} + +ndk::ScopedAStatus CanController::downBus(const std::string& busName) { + if (mBusesByName.find(busName) == mBusesByName.end()) { + return resultToStatus( + Result::UNKNOWN_ERROR, + fmt::format("Couldn't bring down {}, because it doesn't exist", busName)); + } + Result result = mBusesByName[busName]->down(); + if (result != Result::OK) { + return resultToStatus(result, fmt::format("Couldn't bring down {}!", busName)); + } + mBusesByName.erase(busName); + return ok(); +} +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/CanController.h b/automotive/can/aidl/default/CanController.h new file mode 100644 index 0000000000..784906e589 --- /dev/null +++ b/automotive/can/aidl/default/CanController.h @@ -0,0 +1,45 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "CanBus.h" + +#include + +#include +#include + +namespace aidl::android::hardware::automotive::can { + +class CanController : public BnCanController { + public: + ndk::ScopedAStatus getSupportedInterfaceTypes( + std::vector* supportedTypes) override; + + ndk::ScopedAStatus getInterfaceName(const std::string& busName, + std::string* ifaceName) override; + + ndk::ScopedAStatus upBus(const BusConfig& config, std::string* ifaceName) override; + + ndk::ScopedAStatus downBus(const std::string& busName) override; + + private: + std::map> mBusesByName = {}; +}; +} // namespace aidl::android::hardware::automotive::can diff --git a/automotive/can/aidl/default/android.hardware.automotive.can.rc b/automotive/can/aidl/default/android.hardware.automotive.can.rc new file mode 100644 index 0000000000..f8437528b3 --- /dev/null +++ b/automotive/can/aidl/default/android.hardware.automotive.can.rc @@ -0,0 +1,5 @@ +service android.hardware.automotive.can /vendor/bin/hw/android.hardware.automotive.can-service + class hal + capabilities NET_ADMIN + user vehicle_network + group system inet diff --git a/automotive/can/aidl/default/android.hardware.automotive.can.xml b/automotive/can/aidl/default/android.hardware.automotive.can.xml new file mode 100644 index 0000000000..873f3335b9 --- /dev/null +++ b/automotive/can/aidl/default/android.hardware.automotive.can.xml @@ -0,0 +1,26 @@ + + + + + + android.hardware.automotive.can + 1 + + ICanController + default + + + diff --git a/automotive/can/aidl/default/service.cpp b/automotive/can/aidl/default/service.cpp new file mode 100644 index 0000000000..eb45167e44 --- /dev/null +++ b/automotive/can/aidl/default/service.cpp @@ -0,0 +1,43 @@ +/* + * Copyright 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CanController.h" + +#include +#include +#include + +namespace android::hardware::automotive::can { + +using namespace std::string_literals; +using ::aidl::android::hardware::automotive::can::CanController; + +extern "C" int main() { + base::SetDefaultTag("CanController"); + base::SetMinimumLogSeverity(base::VERBOSE); + + LOG(VERBOSE) << "Starting up..."; + auto service = ndk::SharedRefBase::make(); + const auto instance = CanController::descriptor + "/default"s; + const auto status = AServiceManager_addService(service->asBinder().get(), instance.c_str()); + CHECK_EQ(status, STATUS_OK) << "Failed to add service " << instance; + LOG(VERBOSE) << "Started successfully!"; + + ABinderProcess_joinThreadPool(); + LOG(FATAL) << "CanController exited unexpectedly!"; + return EXIT_FAILURE; +} +} // namespace android::hardware::automotive::can diff --git a/automotive/can/aidl/default/tools/configurator/Android.bp b/automotive/can/aidl/default/tools/configurator/Android.bp new file mode 100644 index 0000000000..4c569e6db3 --- /dev/null +++ b/automotive/can/aidl/default/tools/configurator/Android.bp @@ -0,0 +1,44 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_binary { + name: "canhalconfigurator-aidl", + init_rc: ["canhalconfigurator-aidl.rc"], + defaults: ["android.hardware.automotive.can@defaults"], + srcs: [ + "canhalconfigurator.cpp", + "canprototools.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "libprotobuf-cpp-full", + ], + static_libs: [ + "android.hardware.automotive.can-V1-ndk", + "android.hardware.automotive.can-aidl-config-format", + ], + system_ext_specific: true, +} diff --git a/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc b/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc new file mode 100644 index 0000000000..08b1e7b187 --- /dev/null +++ b/automotive/can/aidl/default/tools/configurator/canhalconfigurator-aidl.rc @@ -0,0 +1,3 @@ +service canhalconfigurator /system_ext/bin/canhalconfigurator-aidl + class core + oneshot diff --git a/automotive/can/aidl/default/tools/configurator/canhalconfigurator.cpp b/automotive/can/aidl/default/tools/configurator/canhalconfigurator.cpp new file mode 100644 index 0000000000..94e77b4a48 --- /dev/null +++ b/automotive/can/aidl/default/tools/configurator/canhalconfigurator.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "canbus_config.pb.h" +#include "canprototools.h" + +#include +#include +#include + +#include +#include + +namespace android::hardware::automotive::can { + +using namespace std::string_literals; +using ::aidl::android::hardware::automotive::can::ICanController; + +static constexpr std::string_view kDefaultConfigPath = "/etc/canbus_config.pb"; + +/** + * Takes output from parsed protobuf config and uses it to configure the CAN HAL. + * + * \param pb_cfg is an instance of the autogenerated protobuf object for our configuration. + * \return boolean status, true on success, false on failure. + */ +static bool processPbCfg(const config::CanBusConfig& pb_cfg) { + for (auto const& bus : pb_cfg.buses()) { + if (bus.name().empty()) { + LOG(ERROR) << "Invalid config: Bus config must have a valid name field"; + return false; + } + + auto busCfgMaybe = config::fromPbBus(bus); + if (!busCfgMaybe.has_value()) { + return false; + } + auto busCfg = *busCfgMaybe; + + const auto instance = ICanController::descriptor + "/default"s; + const auto service = ICanController::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(instance.c_str()))); + if (service == nullptr) { + LOG(FATAL) << "Can't find CAN HAL! (has it started yet?)"; + return false; + } + + LOG(VERBOSE) << "Bringing up a " << busCfg.name << " @ " << busCfg.bitrate; + + std::string ifaceName; + const auto status = service->upBus(busCfg, &ifaceName); + if (!status.isOk() && status.getExceptionCode() != EX_SERVICE_SPECIFIC) { + LOG(FATAL) << "Binder transaction failed!" << status.getStatus(); + return false; + } else if (!status.isOk()) { + LOG(ERROR) << "upBus failed: " << config::resultStringFromStatus(status) << ": " + << status.getMessage(); + continue; + } + + LOG(INFO) << bus.name() << " has been successfully configured on " << ifaceName; + } + return true; +} + +/** + * This kicks off the CAN HAL configuration process. This starts the following: + * 1. Reading the config file + * 2. Setting up CAN buses + * 3. Handling services + * \param filepath is a string specifying the absolute path of the config file + * \return boolean status, true on success, false on failure + */ +static bool configuratorStart(const std::string& filepath) { + base::SetDefaultTag("CanConfigurator"); + auto pbCfg = config::parseConfigFile(filepath); + if (!pbCfg.has_value()) { + return false; + } + // process the rest of the config file data and configure the CAN buses. + if (!processPbCfg(*pbCfg)) { + return false; + } + LOG(INFO) << "CAN HAL has been configured!"; + return true; +} + +extern "C" int main(int argc, char* argv[]) { + std::string configFilepath = static_cast(kDefaultConfigPath); + + // allow for CLI specification of a config file. + if (argc == 2) { + configFilepath = argv[1]; + } else if (argc > 2) { + std::cerr << "usage: " << argv[0] << " [optional config filepath]"; + return 1; + } + + if (!configuratorStart(configFilepath)) { + return 1; + } + return 0; +} + +} // namespace android::hardware::automotive::can diff --git a/automotive/can/aidl/default/tools/configurator/canprototools.cpp b/automotive/can/aidl/default/tools/configurator/canprototools.cpp new file mode 100644 index 0000000000..84edd94bc5 --- /dev/null +++ b/automotive/can/aidl/default/tools/configurator/canprototools.cpp @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "canprototools.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include + +namespace android::hardware::automotive::can::config { + +using ::aidl::android::hardware::automotive::can::BusConfig; +using ::aidl::android::hardware::automotive::can::IndexedInterface; +using ::aidl::android::hardware::automotive::can::InterfaceType; +using ::aidl::android::hardware::automotive::can::NativeInterface; +using ::aidl::android::hardware::automotive::can::Result; +using ::aidl::android::hardware::automotive::can::SlcanInterface; +using ::aidl::android::hardware::automotive::can::VirtualInterface; + +/** + * Helper function for parseConfigFile. readString is used to get the fist n characters (n) from an + * istream object (s) and return it as a string object. + * + * \param s istream of the file you intend to read. + * \param n streamsize object of the number of characters you'd like. + * \return optional string containing up to n characters from the stream(s) you provided. + */ +static std::optional readString(std::istream& s, std::streamsize n) { + char buff[n]; + auto got = s.read(buff, n).gcount(); + if (!s.good() && !s.eof()) return std::nullopt; + return std::string(buff, 0, std::min(n, got)); +} + +/* + parseConfigFile *used to* contain the body of parseConfigStream. However, it seems there's some + sort of odd behavior with IstreamInputStream and/or TextFormat::Parse, which causes HW Address + Sanitizer to flag a "tag-mismatch" in this function. Having the ifstream defined in a wrapper + function seems to solve this problem. The exact cause of this problem is yet unknown, but probably + lies somewhere in the protobuf implementation. +*/ +static __attribute__((noinline)) std::optional parseConfigStream( + std::ifstream& cfg_stream) { + static const std::array text_headers = {"buses", "#", "controller"}; + auto cfg_file_snippet = readString(cfg_stream, 10); + + if (!cfg_file_snippet.has_value()) { + LOG(ERROR) << "Can't read config from stream (maybe failed to open file?)"; + return std::nullopt; + } + cfg_stream.seekg(0); + + // check if any of the textHeaders are at the start of the config file. + bool text_format = false; + for (auto const& header : text_headers) { + if (cfg_file_snippet->compare(0, header.length(), header) == 0) { + text_format = true; + break; + } + } + + CanBusConfig config; + if (text_format) { + google::protobuf::io::IstreamInputStream pb_stream(&cfg_stream); + if (!google::protobuf::TextFormat::Parse(&pb_stream, &config)) { + LOG(ERROR) << "Parsing text format config failed"; + return std::nullopt; + } + } else if (!config.ParseFromIstream(&cfg_stream)) { + LOG(ERROR) << "Parsing binary format config failed"; + return std::nullopt; + } + return config; +} + +std::optional parseConfigFile(const std::string& filepath) { + std::ifstream cfg_stream(filepath); + auto cfg_maybe = parseConfigStream(cfg_stream); + if (!cfg_maybe.has_value()) { + LOG(ERROR) << "Failed to parse " << filepath; + } + return cfg_maybe; +} + +std::optional fromPbBus(const Bus& pb_bus) { + BusConfig bus_cfg = {}; + bus_cfg.name = pb_bus.name(); + + switch (pb_bus.iface_type_case()) { + case Bus::kNative: { + const std::string ifname = pb_bus.native().ifname(); + const std::vector serials = {pb_bus.native().serialno().begin(), + pb_bus.native().serialno().end()}; + if (ifname.empty() == serials.empty()) { + LOG(ERROR) << "Invalid config: native type bus must have an iface name xor a " + << "serial number"; + return std::nullopt; + } + bus_cfg.bitrate = pb_bus.bitrate(); + NativeInterface nativeif = {}; + if (!ifname.empty()) + nativeif.interfaceId.set(ifname); + if (!serials.empty()) + nativeif.interfaceId.set(serials); + bus_cfg.interfaceId.set(nativeif); + break; + } + case Bus::kSlcan: { + const std::string ttyname = pb_bus.slcan().ttyname(); + const std::vector serials = {pb_bus.slcan().serialno().begin(), + pb_bus.slcan().serialno().end()}; + if (ttyname.empty() == serials.empty()) { + LOG(ERROR) << "Invalid config: slcan type bus must have a tty name xor a serial " + << "number"; + return std::nullopt; + } + bus_cfg.bitrate = pb_bus.bitrate(); + SlcanInterface slcan = {}; + if (!ttyname.empty()) + slcan.interfaceId.set(ttyname); + if (!serials.empty()) + slcan.interfaceId.set(serials); + bus_cfg.interfaceId.set(slcan); + break; + } + case Bus::kVirtual: { + // Theoretically, we could just create the next available vcan iface. + const std::string ifname = pb_bus.virtual_().ifname(); + if (ifname.empty()) { + LOG(ERROR) << "Invalid config: native type bus must have an iface name"; + return std::nullopt; + } + VirtualInterface virtualif = {}; + virtualif.ifname = ifname; + bus_cfg.interfaceId.set(virtualif); + break; + } + case Bus::kIndexed: { + const uint8_t index = pb_bus.indexed().index(); + if (index > UINT8_MAX) { + LOG(ERROR) << "Interface index out of range: " << index; + return std::nullopt; + } + IndexedInterface indexedif = {}; + indexedif.index = index; + bus_cfg.interfaceId.set(indexedif); + break; + } + default: + LOG(ERROR) << "Invalid config: bad interface type for " << bus_cfg.name; + return std::nullopt; + } + return bus_cfg; +} + +std::optional getHalIftype(const Bus& pb_bus) { + switch (pb_bus.iface_type_case()) { + case Bus::kNative: + return InterfaceType::NATIVE; + case Bus::kSlcan: + return InterfaceType::SLCAN; + case Bus::kVirtual: + return InterfaceType::VIRTUAL; + case Bus::kIndexed: + return InterfaceType::INDEXED; + default: + return std::nullopt; + } +} + +std::string resultStringFromStatus(const ndk::ScopedAStatus& status) { + const auto res = static_cast(status.getServiceSpecificError()); + switch (res) { + case Result::OK: + return "OK"; + case Result::UNKNOWN_ERROR: + return "UNKNOWN_ERROR"; + case Result::INVALID_STATE: + return "INVALID_STATE"; + case Result::NOT_SUPPORTED: + return "NOT_SUPPORTED"; + case Result::BAD_INTERFACE_ID: + return "BAD_INTERFACE_ID"; + case Result::BAD_BITRATE: + return "BAD_BITRATE"; + case Result::BAD_BUS_NAME: + return "BAD_BUS_NAME"; + case Result::INTERFACE_DOWN: + return "INTERFACE_DOWN"; + default: + return "Invalid Result!"; + } +} + +} // namespace android::hardware::automotive::can::config diff --git a/automotive/can/aidl/default/tools/configurator/canprototools.h b/automotive/can/aidl/default/tools/configurator/canprototools.h new file mode 100644 index 0000000000..377ee7f92a --- /dev/null +++ b/automotive/can/aidl/default/tools/configurator/canprototools.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "canbus_config.pb.h" + +#include +#include +#include + +namespace android::hardware::automotive::can::config { + +/** + * This reads the protobuf config file into a protobuf object. Both text based protobuf files as + * well as binary format protobuf files are supported. + * + * \param filepath string containing the name of the config file to read. + * \return a CanBusConfig protobuf object constructed from the config file. + */ +std::optional parseConfigFile(const std::string& filepath); + +/** + * Converts protobuf format single-bus config object to a HAL bus config object. + * + * \param pb_bus is the protobuf object representing a the configuration of one CAN bus. + * \return a converted HAL bus config object. + */ +std::optional<::aidl::android::hardware::automotive::can::BusConfig> fromPbBus(const Bus& pb_bus); + +/** + * Get the CAN HAL interface type specified by a given protobuf config object. + * + * \param pb_bus is the protobuf object representing a the configuration of one CAN bus. + * \return the CAN HAL interface type. + */ +std::optional<::aidl::android::hardware::automotive::can::InterfaceType> getHalIftype( + const Bus& pb_bus); + +std::string resultStringFromStatus(const ndk::ScopedAStatus& status); + +} // namespace android::hardware::automotive::can::config diff --git a/wifi/offload/1.0/vts/functional/Android.bp b/automotive/can/aidl/default/tools/configurator/proto/Android.bp similarity index 71% rename from wifi/offload/1.0/vts/functional/Android.bp rename to automotive/can/aidl/default/tools/configurator/proto/Android.bp index a0eb048c66..da1b37c664 100644 --- a/wifi/offload/1.0/vts/functional/Android.bp +++ b/automotive/can/aidl/default/tools/configurator/proto/Android.bp @@ -1,5 +1,5 @@ // -// Copyright (C) 2017 The Android Open Source Project +// Copyright (C) 2022 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,10 +23,15 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } -cc_test { - name: "VtsHalWifiOffloadV1_0TargetTest", - defaults: ["VtsHalTargetTestDefaults"], - srcs: ["VtsHalWifiOffloadV1_0TargetTest.cpp"], - static_libs: ["android.hardware.wifi.offload@1.0"], - test_suites: ["general-tests", "vts"], +cc_library_static { + name: "android.hardware.automotive.can-aidl-config-format", + defaults: ["android.hardware.automotive.can@defaults"], + proto: { + export_proto_headers: true, + type: "full", + }, + strip: { + keep_symbols: true, + }, + srcs: ["canbus_config.proto"], } diff --git a/automotive/can/aidl/default/tools/configurator/proto/canbus_config.proto b/automotive/can/aidl/default/tools/configurator/proto/canbus_config.proto new file mode 100644 index 0000000000..b03b03567f --- /dev/null +++ b/automotive/can/aidl/default/tools/configurator/proto/canbus_config.proto @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto3"; + +package android.hardware.automotive.can.config; + +message IfaceNative { + string ifname = 1; + repeated string serialno = 2; +}; + +message IfaceSlcan { + string ttyname = 1; + repeated string serialno = 2; +}; + +message IfaceVirtual { + string ifname = 1; +}; + +message IfaceIndexed { + uint32 index = 1; +}; + +message Bus { + string name = 1; // this is the name presented in the HAL + oneof iface_type { + IfaceNative native = 2; + IfaceSlcan slcan = 3; + IfaceVirtual virtual = 4; + IfaceIndexed indexed = 5; + } + uint32 bitrate = 6; +}; + +message CanBusConfig { + repeated Bus buses = 1; +}; diff --git a/automotive/can/aidl/vts/functional/Android.bp b/automotive/can/aidl/vts/functional/Android.bp new file mode 100644 index 0000000000..b816a4952e --- /dev/null +++ b/automotive/can/aidl/vts/functional/Android.bp @@ -0,0 +1,51 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_test { + name: "VtsHalCanControllerV1_0Test", + defaults: [ + "VtsHalTargetTestDefaults", + "android.hardware.automotive.can@defaults", + "use_libaidlvintf_gtest_helper_static", + ], + cpp_std: "experimental", + srcs: [ + "CanControllerAidlTest.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + ], + static_libs: [ + "android.hardware.automotive.can-V1-ndk", + "android.hardware.automotive.can@libnetdevice", + "libnl++", + "libgmock", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/automotive/can/aidl/vts/functional/CanControllerAidlTest.cpp b/automotive/can/aidl/vts/functional/CanControllerAidlTest.cpp new file mode 100644 index 0000000000..c2b28795b2 --- /dev/null +++ b/automotive/can/aidl/vts/functional/CanControllerAidlTest.cpp @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using aidl::android::hardware::automotive::can::BusConfig; +using aidl::android::hardware::automotive::can::ICanController; +using aidl::android::hardware::automotive::can::VirtualInterface; +using namespace std::chrono_literals; +using namespace std::string_literals; + +class CanControllerAidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + android::base::SetDefaultTag("CAN_HAL_VTS"); + android::base::SetMinimumLogSeverity(android::base::VERBOSE); + const auto instance = ICanController::descriptor + "/default"s; + mCanControllerService = ICanController::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(instance.c_str()))); + + ASSERT_NE(mCanControllerService, nullptr); + } + virtual void TearDown() override {} + + static bool mTestCaseInitialized; + std::shared_ptr mCanControllerService; +}; + +// we can't test a real bus, since we can't make any assumptions about hardware +// this checks upBus, getInterfaceName, and downBus +TEST_P(CanControllerAidlTest, ToggleBus) { + const std::string_view canIface = "vcan50"; + const std::string busName = "VTS_CAN"; + + std::string upBusReturn; // should be vcan50 + BusConfig config = {}; + VirtualInterface iface = {}; + iface.ifname = canIface; + config.interfaceId.set(iface); + config.name = busName; + auto aidlStatus = mCanControllerService->upBus(config, &upBusReturn); + ASSERT_TRUE(aidlStatus.isOk()); + EXPECT_EQ(upBusReturn, canIface); + + std::string ifaceName; + aidlStatus = mCanControllerService->getInterfaceName(busName, &ifaceName); + ASSERT_TRUE(aidlStatus.isOk()); + EXPECT_EQ(ifaceName, canIface); + + aidlStatus = mCanControllerService->downBus(busName); + ASSERT_TRUE(aidlStatus.isOk()); +} + +TEST_P(CanControllerAidlTest, GetSupported) { + LOG(VERBOSE) << "Get the supported iface types"; + std::vector<::aidl::android::hardware::automotive::can::InterfaceType> supportedTypes; + auto aidlStatus = mCanControllerService->getSupportedInterfaceTypes(&supportedTypes); + ASSERT_TRUE(aidlStatus.isOk()); + EXPECT_FALSE(supportedTypes.empty()); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CanControllerAidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, CanControllerAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ICanController::descriptor)), + android::PrintInstanceNameToString); diff --git a/automotive/can/aidl/vts/functional/OWNERS b/automotive/can/aidl/vts/functional/OWNERS new file mode 100644 index 0000000000..85257a3537 --- /dev/null +++ b/automotive/can/aidl/vts/functional/OWNERS @@ -0,0 +1,3 @@ +# Bug component: 533426 +twasilczyk@google.com +chrisweir@google.com diff --git a/automotive/evs/1.1/default/Android.bp b/automotive/evs/1.1/default/Android.bp index 4c08ef364e..4172e63123 100644 --- a/automotive/evs/1.1/default/Android.bp +++ b/automotive/evs/1.1/default/Android.bp @@ -13,6 +13,7 @@ cc_binary { proprietary: true, relative_install_path: "hw", srcs: [ + ":libgui_frame_event_aidl", "*.cpp", ], init_rc: ["android.hardware.automotive.evs@1.1-service.rc"], diff --git a/automotive/evs/1.1/default/GlWrapper.cpp b/automotive/evs/1.1/default/GlWrapper.cpp index 357b67c48a..9ad5729af8 100644 --- a/automotive/evs/1.1/default/GlWrapper.cpp +++ b/automotive/evs/1.1/default/GlWrapper.cpp @@ -37,28 +37,23 @@ constexpr float kDefaultColorInRgba[] = {0.1f, 0.5f, 0.1f, 1.0f}; constexpr float kDisplayAreaRatio = 0.8f; constexpr const char vertexShaderSource[] = - "" - "#version 300 es \n" - "layout(location = 0) in vec4 pos; \n" - "layout(location = 1) in vec2 tex; \n" - "out vec2 uv; \n" - "void main() \n" - "{ \n" - " gl_Position = pos; \n" - " uv = tex; \n" - "} \n"; + "attribute vec4 pos; \n" + "attribute vec2 tex; \n" + "varying vec2 uv; \n" + "void main() \n" + "{ \n" + " gl_Position = pos; \n" + " uv = tex; \n" + "} \n"; constexpr const char pixelShaderSource[] = - "#version 300 es \n" - "precision mediump float; \n" - "uniform sampler2D tex; \n" - "in vec2 uv; \n" - "out vec4 color; \n" - "void main() \n" - "{ \n" - " vec4 texel = texture(tex, uv); \n" - " color = texel; \n" - "} \n"; + "precision mediump float; \n" + "uniform sampler2D tex; \n" + "varying vec2 uv; \n" + "void main() \n" + "{ \n" + " gl_FragColor = texture2D(tex, uv); \n" + "} \n"; const char* getEGLError(void) { switch (eglGetError()) { @@ -157,6 +152,9 @@ GLuint buildShaderProgram(const char* vtxSrc, const char* pxlSrc) { glAttachShader(program, vertexShader); glAttachShader(program, pixelShader); + glBindAttribLocation(program, 0, "pos"); + glBindAttribLocation(program, 1, "tex"); + // Link the program glLinkProgram(program); GLint linked = 0; @@ -235,7 +233,7 @@ bool GlWrapper::initialize(const sp& service, ui return false; } - EGLint major = 3; + EGLint major = 2; EGLint minor = 0; if (!eglInitialize(mDisplay, &major, &minor)) { LOG(ERROR) << "Failed to initialize EGL: " << getEGLError(); diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp index 8aaa1ced54..bafb4af30f 100644 --- a/automotive/evs/aidl/Android.bp +++ b/automotive/evs/aidl/Android.bp @@ -56,6 +56,15 @@ aidl_interface { "android.hardware.graphics.common-V4", ], }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V4", + ], + }, + ], + frozen: true, } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/.hash b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/.hash new file mode 100644 index 0000000000..406943ebf0 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/.hash @@ -0,0 +1 @@ +36c9e7c4f9a0e7264c1e5dd61359cb6397fcd182 diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/BufferDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/BufferDesc.aidl new file mode 100644 index 0000000000..332aca34a6 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/BufferDesc.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable BufferDesc { + android.hardware.graphics.common.HardwareBuffer buffer; + int pixelSizeBytes; + int bufferId; + @utf8InCpp String deviceId; + long timestamp; + byte[] metadata; + @nullable android.hardware.automotive.evs.ExposureParameters[] exposureSettings; + @nullable android.hardware.automotive.evs.Histogram[] histograms; + @nullable android.hardware.automotive.evs.GridStatistics[] grids; + @nullable android.hardware.automotive.evs.EmbeddedData embeddedData; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/CameraDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/CameraDesc.aidl new file mode 100644 index 0000000000..4dadeb88b2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/CameraDesc.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable CameraDesc { + @utf8InCpp String id; + int vendorFlags; + byte[] metadata; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/CameraParam.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/CameraParam.aidl new file mode 100644 index 0000000000..21207b348a --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/CameraParam.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum CameraParam { + BRIGHTNESS, + CONTRAST, + AUTOGAIN, + GAIN, + AUTO_WHITE_BALANCE, + WHITE_BALANCE_TEMPERATURE, + SHARPNESS, + AUTO_EXPOSURE, + ABSOLUTE_EXPOSURE, + ABSOLUTE_FOCUS, + AUTO_FOCUS, + ABSOLUTE_ZOOM, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ColorChannel.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ColorChannel.aidl new file mode 100644 index 0000000000..e59db4cee2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ColorChannel.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum ColorChannel { + R, + G_EVEN, + B, + G_ODD_OR_Y, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DeviceStatus.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DeviceStatus.aidl new file mode 100644 index 0000000000..cc066ac6db --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DeviceStatus.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable DeviceStatus { + @utf8InCpp String id; + android.hardware.automotive.evs.DeviceStatusType status; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DeviceStatusType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DeviceStatusType.aidl new file mode 100644 index 0000000000..92c2247019 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DeviceStatusType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum DeviceStatusType { + CAMERA_AVAILABLE, + CAMERA_NOT_AVAILABLE, + DISPLAY_AVAILABLE, + DISPLAY_NOT_AVAILABLE, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DisplayDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DisplayDesc.aidl new file mode 100644 index 0000000000..4ac029e479 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DisplayDesc.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable DisplayDesc { + @utf8InCpp String id; + int width; + int height; + android.hardware.automotive.evs.Rotation orientation; + int vendorFlags; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DisplayState.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DisplayState.aidl new file mode 100644 index 0000000000..5f03f43e86 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/DisplayState.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum DisplayState { + NOT_OPEN = 0, + NOT_VISIBLE, + VISIBLE_ON_NEXT_FRAME, + VISIBLE, + DEAD, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EmbeddedData.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EmbeddedData.aidl new file mode 100644 index 0000000000..e1f50d2e23 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EmbeddedData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable EmbeddedData { + int widthInBytes; + int heightInLines; + android.hardware.common.Ashmem data; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsEventDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsEventDesc.aidl new file mode 100644 index 0000000000..09b2b9db13 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsEventDesc.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable EvsEventDesc { + android.hardware.automotive.evs.EvsEventType aType; + @utf8InCpp String deviceId; + int[] payload; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsEventType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsEventType.aidl new file mode 100644 index 0000000000..2e75a25328 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsEventType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum EvsEventType { + STREAM_STARTED = 0, + STREAM_STOPPED, + FRAME_DROPPED, + TIMEOUT, + PARAMETER_CHANGED, + MASTER_RELEASED, + STREAM_ERROR, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsResult.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsResult.aidl new file mode 100644 index 0000000000..1f047508e5 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/EvsResult.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum EvsResult { + OK = 0, + INVALID_ARG, + STREAM_ALREADY_RUNNING, + BUFFER_NOT_AVAILABLE, + OWNERSHIP_LOST, + UNDERLYING_SERVICE_ERROR, + PERMISSION_DENIED, + RESOURCE_NOT_AVAILABLE, + RESOURCE_BUSY, + NOT_IMPLEMENTED, + NOT_SUPPORTED, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ExposureParameters.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ExposureParameters.aidl new file mode 100644 index 0000000000..28289ae7e9 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ExposureParameters.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable ExposureParameters { + float[4] analogGain; + float[4] digitalGain; + long coarseIntegrationTimeInLines; + long fineIntegrationTimeInPixelClocks; + int coarseIntegrationTimeLShift; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatisticDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatisticDesc.aidl new file mode 100644 index 0000000000..f9fadd994f --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatisticDesc.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable GridStatisticDesc { + android.hardware.automotive.evs.ColorChannel channel; + android.hardware.automotive.evs.GridStatisticType type; + android.hardware.graphics.common.Rect roi; + android.hardware.automotive.evs.Size cellSize; + int bitDepth; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatisticType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatisticType.aidl new file mode 100644 index 0000000000..c2b2d66301 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatisticType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum GridStatisticType { + USER_DEFINED, + AVERAGE, + SUM, + SATURATION_COUNT, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatistics.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatistics.aidl new file mode 100644 index 0000000000..d87cff3787 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/GridStatistics.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable GridStatistics { + android.hardware.automotive.evs.GridStatisticDesc[] descriptors; + android.hardware.common.Ashmem data; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Histogram.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Histogram.aidl new file mode 100644 index 0000000000..cb73eba88f --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Histogram.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable Histogram { + android.hardware.automotive.evs.ColorChannel channel; + android.hardware.graphics.common.Rect roi; + int size; + int capacity; + long[] bins; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsCamera.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsCamera.aidl new file mode 100644 index 0000000000..ce1b97d16c --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsCamera.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsCamera { + void doneWithFrame(in android.hardware.automotive.evs.BufferDesc[] buffer); + void forcePrimaryClient(in android.hardware.automotive.evs.IEvsDisplay display); + android.hardware.automotive.evs.CameraDesc getCameraInfo(); + byte[] getExtendedInfo(in int opaqueIdentifier); + int[] getIntParameter(in android.hardware.automotive.evs.CameraParam id); + android.hardware.automotive.evs.ParameterRange getIntParameterRange(in android.hardware.automotive.evs.CameraParam id); + android.hardware.automotive.evs.CameraParam[] getParameterList(); + android.hardware.automotive.evs.CameraDesc getPhysicalCameraInfo(in String deviceId); + int importExternalBuffers(in android.hardware.automotive.evs.BufferDesc[] buffers); + void pauseVideoStream(); + void resumeVideoStream(); + void setExtendedInfo(in int opaqueIdentifier, in byte[] opaqueValue); + int[] setIntParameter(in android.hardware.automotive.evs.CameraParam id, in int value); + void setPrimaryClient(); + void setMaxFramesInFlight(in int bufferCount); + void startVideoStream(in android.hardware.automotive.evs.IEvsCameraStream receiver); + void stopVideoStream(); + void unsetPrimaryClient(); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsCameraStream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsCameraStream.aidl new file mode 100644 index 0000000000..6e2e64a3c4 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsCameraStream.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsCameraStream { + oneway void deliverFrame(in android.hardware.automotive.evs.BufferDesc[] buffer); + oneway void notify(in android.hardware.automotive.evs.EvsEventDesc event); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsDisplay.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsDisplay.aidl new file mode 100644 index 0000000000..9b538d43a2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsDisplay.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsDisplay { + android.hardware.automotive.evs.DisplayDesc getDisplayInfo(); + android.hardware.automotive.evs.DisplayState getDisplayState(); + android.hardware.automotive.evs.BufferDesc getTargetBuffer(); + void returnTargetBufferForDisplay(in android.hardware.automotive.evs.BufferDesc buffer); + void setDisplayState(in android.hardware.automotive.evs.DisplayState state); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsEnumerator.aidl new file mode 100644 index 0000000000..4cefdf2f7a --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsEnumerator.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsEnumerator { + void closeCamera(in android.hardware.automotive.evs.IEvsCamera carCamera); + void closeDisplay(in android.hardware.automotive.evs.IEvsDisplay display); + void closeUltrasonicsArray(in android.hardware.automotive.evs.IEvsUltrasonicsArray evsUltrasonicsArray); + android.hardware.automotive.evs.CameraDesc[] getCameraList(); + byte[] getDisplayIdList(); + android.hardware.automotive.evs.DisplayState getDisplayState(); + android.hardware.automotive.evs.Stream[] getStreamList(in android.hardware.automotive.evs.CameraDesc description); + android.hardware.automotive.evs.UltrasonicsArrayDesc[] getUltrasonicsArrayList(); + boolean isHardware(); + android.hardware.automotive.evs.IEvsCamera openCamera(in String cameraId, in android.hardware.automotive.evs.Stream streamCfg); + android.hardware.automotive.evs.IEvsDisplay openDisplay(in int id); + android.hardware.automotive.evs.IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId); + void registerStatusCallback(in android.hardware.automotive.evs.IEvsEnumeratorStatusCallback callback); + android.hardware.automotive.evs.DisplayState getDisplayStateById(in int id); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl new file mode 100644 index 0000000000..c39a4e855e --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsEnumeratorStatusCallback { + oneway void deviceStatusChanged(in android.hardware.automotive.evs.DeviceStatus[] status); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl new file mode 100644 index 0000000000..1183ab392c --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsUltrasonicsArray { + void doneWithDataFrame(in android.hardware.automotive.evs.UltrasonicsDataFrameDesc dataFrameDesc); + android.hardware.automotive.evs.UltrasonicsArrayDesc getUltrasonicArrayInfo(); + void setMaxFramesInFlight(in int bufferCount); + void startStream(in android.hardware.automotive.evs.IEvsUltrasonicsArrayStream stream); + void stopStream(); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl new file mode 100644 index 0000000000..510b0a4692 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +interface IEvsUltrasonicsArrayStream { + oneway void deliverDataFrame(in android.hardware.automotive.evs.UltrasonicsDataFrameDesc dataFrameDesc); + oneway void notify(in android.hardware.automotive.evs.EvsEventDesc event); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ParameterRange.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ParameterRange.aidl new file mode 100644 index 0000000000..44e9b59276 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/ParameterRange.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable ParameterRange { + int min; + int max; + int step; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Rotation.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Rotation.aidl new file mode 100644 index 0000000000..91971fc5e7 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Rotation.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum Rotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/RotationQuaternion.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/RotationQuaternion.aidl new file mode 100644 index 0000000000..d9c8b6e247 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/RotationQuaternion.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable RotationQuaternion { + float x; + float y; + float z; + float w; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/SensorPose.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/SensorPose.aidl new file mode 100644 index 0000000000..4ead9eaf2e --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/SensorPose.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable SensorPose { + android.hardware.automotive.evs.RotationQuaternion rotation; + android.hardware.automotive.evs.Translation translation; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Size.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Size.aidl new file mode 100644 index 0000000000..aa113f7976 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Size.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable Size { + int widthInPixels = (-1) /* -1 */; + int heightInPixels = (-1) /* -1 */; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Stream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Stream.aidl new file mode 100644 index 0000000000..154a693a51 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Stream.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable Stream { + int id; + android.hardware.automotive.evs.StreamType streamType; + int width; + int height; + int framerate; + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.BufferUsage usage; + android.hardware.automotive.evs.Rotation rotation; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/StreamType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/StreamType.aidl new file mode 100644 index 0000000000..9819c8910b --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/StreamType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum StreamType { + OUTPUT = 0, + INPUT = 1, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Translation.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Translation.aidl new file mode 100644 index 0000000000..488d80f479 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/Translation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable Translation { + float x; + float y; + float z; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicSensor.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicSensor.aidl new file mode 100644 index 0000000000..23f81f8093 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicSensor.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable UltrasonicSensor { + android.hardware.automotive.evs.SensorPose pose; + float maxRangeMm; + float angleOfMeasurement; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl new file mode 100644 index 0000000000..4a988759fd --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable UltrasonicsArrayDesc { + @utf8InCpp String ultrasonicsArrayId; + int maxReadingsPerSensorCount; + int maxReceiversCount; + android.hardware.automotive.evs.UltrasonicSensor[] sensors; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl new file mode 100644 index 0000000000..35ec84bdcc --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/2/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable UltrasonicsDataFrameDesc { + long timestampNs; + int id; + byte[] transmittersIdList; + byte[] receiversIdList; + int[] receiversReadingsCountList; + android.hardware.common.Ashmem waveformsData; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl index 31acdb8e27..332aca34a6 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl @@ -40,4 +40,8 @@ parcelable BufferDesc { @utf8InCpp String deviceId; long timestamp; byte[] metadata; + @nullable android.hardware.automotive.evs.ExposureParameters[] exposureSettings; + @nullable android.hardware.automotive.evs.Histogram[] histograms; + @nullable android.hardware.automotive.evs.GridStatistics[] grids; + @nullable android.hardware.automotive.evs.EmbeddedData embeddedData; } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl index ae4ce77192..21207b348a 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl @@ -34,16 +34,16 @@ package android.hardware.automotive.evs; @Backing(type="int") @VintfStability enum CameraParam { - BRIGHTNESS = 0, - CONTRAST = 1, - AUTOGAIN = 2, - GAIN = 3, - AUTO_WHITE_BALANCE = 4, - WHITE_BALANCE_TEMPERATURE = 5, - SHARPNESS = 6, - AUTO_EXPOSURE = 7, - ABSOLUTE_EXPOSURE = 8, - ABSOLUTE_FOCUS = 9, - AUTO_FOCUS = 10, - ABSOLUTE_ZOOM = 11, + BRIGHTNESS, + CONTRAST, + AUTOGAIN, + GAIN, + AUTO_WHITE_BALANCE, + WHITE_BALANCE_TEMPERATURE, + SHARPNESS, + AUTO_EXPOSURE, + ABSOLUTE_EXPOSURE, + ABSOLUTE_FOCUS, + AUTO_FOCUS, + ABSOLUTE_ZOOM, } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ColorChannel.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ColorChannel.aidl new file mode 100644 index 0000000000..e59db4cee2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ColorChannel.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum ColorChannel { + R, + G_EVEN, + B, + G_ODD_OR_Y, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl index d0f1d8e1d6..92c2247019 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl @@ -34,8 +34,8 @@ package android.hardware.automotive.evs; @Backing(type="int") @VintfStability enum DeviceStatusType { - CAMERA_AVAILABLE = 0, - CAMERA_NOT_AVAILABLE = 1, - DISPLAY_AVAILABLE = 2, - DISPLAY_NOT_AVAILABLE = 3, + CAMERA_AVAILABLE, + CAMERA_NOT_AVAILABLE, + DISPLAY_AVAILABLE, + DISPLAY_NOT_AVAILABLE, } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl index a5f43095c8..5f03f43e86 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl @@ -35,8 +35,8 @@ package android.hardware.automotive.evs; @Backing(type="int") @VintfStability enum DisplayState { NOT_OPEN = 0, - NOT_VISIBLE = 1, - VISIBLE_ON_NEXT_FRAME = 2, - VISIBLE = 3, - DEAD = 4, + NOT_VISIBLE, + VISIBLE_ON_NEXT_FRAME, + VISIBLE, + DEAD, } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EmbeddedData.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EmbeddedData.aidl new file mode 100644 index 0000000000..e1f50d2e23 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EmbeddedData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable EmbeddedData { + int widthInBytes; + int heightInLines; + android.hardware.common.Ashmem data; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl index 052a6b3969..2e75a25328 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl @@ -35,10 +35,10 @@ package android.hardware.automotive.evs; @Backing(type="int") @VintfStability enum EvsEventType { STREAM_STARTED = 0, - STREAM_STOPPED = 1, - FRAME_DROPPED = 2, - TIMEOUT = 3, - PARAMETER_CHANGED = 4, - MASTER_RELEASED = 5, - STREAM_ERROR = 6, + STREAM_STOPPED, + FRAME_DROPPED, + TIMEOUT, + PARAMETER_CHANGED, + MASTER_RELEASED, + STREAM_ERROR, } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl index a0418a94ef..1f047508e5 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl @@ -35,14 +35,14 @@ package android.hardware.automotive.evs; @Backing(type="int") @VintfStability enum EvsResult { OK = 0, - INVALID_ARG = 1, - STREAM_ALREADY_RUNNING = 2, - BUFFER_NOT_AVAILABLE = 3, - OWNERSHIP_LOST = 4, - UNDERLYING_SERVICE_ERROR = 5, - PERMISSION_DENIED = 6, - RESOURCE_NOT_AVAILABLE = 7, - RESOURCE_BUSY = 8, - NOT_IMPLEMENTED = 9, - NOT_SUPPORTED = 10, + INVALID_ARG, + STREAM_ALREADY_RUNNING, + BUFFER_NOT_AVAILABLE, + OWNERSHIP_LOST, + UNDERLYING_SERVICE_ERROR, + PERMISSION_DENIED, + RESOURCE_NOT_AVAILABLE, + RESOURCE_BUSY, + NOT_IMPLEMENTED, + NOT_SUPPORTED, } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ExposureParameters.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ExposureParameters.aidl new file mode 100644 index 0000000000..28289ae7e9 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ExposureParameters.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable ExposureParameters { + float[4] analogGain; + float[4] digitalGain; + long coarseIntegrationTimeInLines; + long fineIntegrationTimeInPixelClocks; + int coarseIntegrationTimeLShift; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatisticDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatisticDesc.aidl new file mode 100644 index 0000000000..f9fadd994f --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatisticDesc.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable GridStatisticDesc { + android.hardware.automotive.evs.ColorChannel channel; + android.hardware.automotive.evs.GridStatisticType type; + android.hardware.graphics.common.Rect roi; + android.hardware.automotive.evs.Size cellSize; + int bitDepth; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatisticType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatisticType.aidl new file mode 100644 index 0000000000..c2b2d66301 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatisticType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@Backing(type="int") @VintfStability +enum GridStatisticType { + USER_DEFINED, + AVERAGE, + SUM, + SATURATION_COUNT, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatistics.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatistics.aidl new file mode 100644 index 0000000000..d87cff3787 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/GridStatistics.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable GridStatistics { + android.hardware.automotive.evs.GridStatisticDesc[] descriptors; + android.hardware.common.Ashmem data; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Histogram.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Histogram.aidl new file mode 100644 index 0000000000..cb73eba88f --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Histogram.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable Histogram { + android.hardware.automotive.evs.ColorChannel channel; + android.hardware.graphics.common.Rect roi; + int size; + int capacity; + long[] bins; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl index 225b5041b8..4cefdf2f7a 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl @@ -47,4 +47,5 @@ interface IEvsEnumerator { android.hardware.automotive.evs.IEvsDisplay openDisplay(in int id); android.hardware.automotive.evs.IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId); void registerStatusCallback(in android.hardware.automotive.evs.IEvsEnumeratorStatusCallback callback); + android.hardware.automotive.evs.DisplayState getDisplayStateById(in int id); } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Size.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Size.aidl new file mode 100644 index 0000000000..aa113f7976 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Size.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.evs; +@VintfStability +parcelable Size { + int widthInPixels = (-1) /* -1 */; + int heightInPixels = (-1) /* -1 */; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl index 0604abe1dc..b6c697d22b 100644 --- a/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl +++ b/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl @@ -16,7 +16,12 @@ package android.hardware.automotive.evs; +import android.hardware.automotive.evs.EmbeddedData; +import android.hardware.automotive.evs.ExposureParameters; +import android.hardware.automotive.evs.GridStatistics; +import android.hardware.automotive.evs.Histogram; import android.hardware.graphics.common.HardwareBuffer; +import android.hardware.graphics.common.Rect; /** * Structure representing an image buffer through our APIs @@ -57,4 +62,28 @@ parcelable BufferDesc { * Frame metadata. This is opaque to EvsManager. */ byte[] metadata; + /** + * ExposureParameters are expected to be in the ascending + * order of their exposure time; from the shortest to the + * longest. For example, if the imaging sensor output has + * two exposures, a shorter exposure setting is at index 0 + * and a longer exposure setting is at index 1. + */ + @nullable ExposureParameters[] exposureSettings; + /** + * Histogram statistics calculated on this buffer. This + * may contain zero or more histograms. + */ + @nullable Histogram[] histograms; + /** + * Grid statistics calculated on this buffer. This field + * also may contain zero or more grid statistics. + */ + @nullable GridStatistics[] grids; + /** + * This may contain raw embedded data lines and can be + * used to share data other than exposure parameters, + * histograms, or grid statistics. + */ + @nullable EmbeddedData embeddedData; } diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/ColorChannel.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/ColorChannel.aidl new file mode 100644 index 0000000000..9aba465703 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/ColorChannel.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Color channels. + */ +@VintfStability +@Backing(type="int") +enum ColorChannel { + R, + G_EVEN, // The green channel in even lines. + B, + G_ODD_OR_Y, // The green channel in odd lines of + // color formats that have two green (or + // equivalent) channels, or the luminance + // if it exists in associated data. +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/EmbeddedData.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/EmbeddedData.aidl new file mode 100644 index 0000000000..422cef21b1 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/EmbeddedData.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.common.Ashmem; + +/** + * This structure contains raw embedded data lines and can + * used to share sensor embedded data that is not a type of + * histogram or grid statistics. + */ +@VintfStability +parcelable EmbeddedData { + /** Width of the embedded data lines. */ + int widthInBytes; + /** Number of the embedded data lines. */ + int heightInLines; + /** Raw embedded data lines. */ + Ashmem data; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/ExposureParameters.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/ExposureParameters.aidl new file mode 100644 index 0000000000..e644fedb95 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/ExposureParameters.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Parameters that determine the exposure value. + * + * This data structure assumes that the imaging sensor has 4 channels at most. + */ +@VintfStability +parcelable ExposureParameters { + /** + * Analog gain applied on each channel. + * + * A value for each channel will be indexed by android.hardware.automotive.evs.ColorChannel + * enum type. + */ + float[4] analogGain; + /** + * Digital gain applied on each channel. + * + * A value for each channel will be indexed by android.hardware.automotive.evs.ColorChannel + * enum type. + */ + float[4] digitalGain; + /** Exposure time in lines. */ + long coarseIntegrationTimeInLines; + /** Remainder exposure time in clocks. */ + long fineIntegrationTimeInPixelClocks; + /** + * Logarithm value of coarse integration time multiplier. + */ + int coarseIntegrationTimeLShift; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/GridStatisticDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/GridStatisticDesc.aidl new file mode 100644 index 0000000000..1cd8a1cf26 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/GridStatisticDesc.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.ColorChannel; +import android.hardware.automotive.evs.GridStatisticType; +import android.hardware.automotive.evs.Size; +import android.hardware.graphics.common.Rect; + +/** + * This data structure describes a grid statistic such as the low resolution luminance map. + */ +@VintfStability +parcelable GridStatisticDesc { + /** Source color channel this statistics is calculated from. */ + ColorChannel channel; + /** Type of this grad statistics. */ + GridStatisticType type; + /** Region this statistics is calculated from. */ + Rect roi; + /** Size of a grid cell. */ + Size cellSize; + /** Bit-depth of a single value. */ + int bitDepth; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/GridStatisticType.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/GridStatisticType.aidl new file mode 100644 index 0000000000..1b307c7e8e --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/GridStatisticType.aidl @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Type of grid statistics. + */ +@VintfStability +@Backing(type="int") +enum GridStatisticType { + /** Custom statistics type. */ + USER_DEFINED, + /** Average pixel values of each cell. */ + AVERAGE, + /** Sum of pixel values in each cell. */ + SUM, + /** Number of saturated pixels in each cell. */ + SATURATION_COUNT, +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/GridStatistics.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/GridStatistics.aidl new file mode 100644 index 0000000000..57f72eaf44 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/GridStatistics.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.GridStatisticDesc; +import android.hardware.common.Ashmem; + +/** + * This data type represents grid-type statistics such as + * the luminance map in low-resolution. + */ +@VintfStability +parcelable GridStatistics { + /** Descriptors of grid statistics in shared memory. */ + GridStatisticDesc[] descriptors; + /** + * Shared memory object containing one or more grid statistics. + * + * When multiple statistics exist, they are in the same order with descriptors. For example, + * if the first descriptor represents a statistic whose size is in VGA resolution (640x480) + * and bitdepth (or precision) is 8-bit, the offset to the second statistic is 640x480x1-byte + * = 307200 bytes. + */ + Ashmem data; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/Histogram.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/Histogram.aidl new file mode 100644 index 0000000000..3f3c5a30ba --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/Histogram.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.ColorChannel; +import android.hardware.graphics.common.Rect; + +/** + * This data type represents 1D histogram statistics. + */ +@VintfStability +parcelable Histogram { + /** + * Source color channel this histogram is calculated from. + */ + ColorChannel channel; + /** A region of interests, where this histogram is calculated from. */ + Rect roi; + /** Size of each histogram bin. */ + int size; + /** Capacity of each histogram bin. */ + int capacity; + /** + * Histogram bins; each bin contains values calculated from each ColorChannel. + * + * The size of the histogram data is inversely proportional to the size of a histogram bin. + * When a bin is sized as 1, a histogram has pow(2, bitdepth of the source data) and + * therefore could occupy more than a few kilobytes of 1 megabyte buffer that is shared with + * other processes. To avoid influencing other processes, we strongly recommend keeping the + * number of histogram bins less than 128. If a higher resolution is needed, please consider + * using android.hardware.automotive.evs.EmbeddedData instead. + */ + long[] bins; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl index 86987008c5..37b8ea52d4 100644 --- a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl @@ -78,12 +78,12 @@ interface IEvsEnumerator { byte[] getDisplayIdList(); /** - * This call requests the current state of the display + * This call requests the current state of the primary display * * If there is no open display, this returns DisplayState::NOT_OPEN. otherwise, it returns - * the actual state of the active display. This call is replicated on the IEvsEnumerator - * interface in order to allow secondary clients to monitor the state of the EVS display - * without acquiring exclusive ownership of the display. + * the actual state of the active primary display. This call is replicated on the + * IEvsEnumerator interface in order to allow secondary clients to monitor the state of the EVS + * display without acquiring exclusive ownership of the display. * * @return Current DisplayState of this Display. * @throws EvsResult::OWNERSHIP_LOST if current display is inactive @@ -163,4 +163,19 @@ interface IEvsEnumerator { * @param in callback IEvsEnumeratorStatusCallback implementation */ void registerStatusCallback(in IEvsEnumeratorStatusCallback callback); + + /** + * This call requests the current state of the display + * + * If the requested display is not active, this returns DisplayState::NOT_OPEN. otherwise, it + * returns the actual state of the active display. This call is replicated on the + * IEvsEnumerator interface in order to allow secondary clients to monitor the state of the EVS + * display without acquiring exclusive ownership of the display. + * + * @param in id ID of the requested display. + * @return Current DisplayState of this Display. + * @throws EvsResult::OWNERSHIP_LOST if current display is inactive + * EvsResult::PERMISSION_DENIED if the process is not permitted to do this operation. + */ + DisplayState getDisplayStateById(in int id); } diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/Size.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/Size.aidl new file mode 100644 index 0000000000..4924ec89f9 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/Size.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * This type represents the size of the 2D area. + */ +@VintfStability +parcelable Size { + /** Width of a target 2D area in pixels. */ + int widthInPixels = -1; + /** Width of a target 2D area in pixels. */ + int heightInPixels = -1; +} diff --git a/automotive/evs/aidl/impl/Android.bp b/automotive/evs/aidl/impl/Android.bp index d907047c1b..fa44ebb4d9 100644 --- a/automotive/evs/aidl/impl/Android.bp +++ b/automotive/evs/aidl/impl/Android.bp @@ -20,10 +20,10 @@ package { cc_defaults { name: "EvsHalDefaults", + defaults: ["android.hardware.graphics.common-ndk_static"], static_libs: [ - "android.hardware.automotive.evs-V1-ndk", + "android.hardware.automotive.evs-V2-ndk", "android.hardware.common-V2-ndk", - "android.hardware.graphics.common-V4-ndk", ], shared_libs: [ "libbase", diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp index dbe0314118..70c523b5fa 100644 --- a/automotive/evs/aidl/impl/default/Android.bp +++ b/automotive/evs/aidl/impl/default/Android.bp @@ -24,13 +24,56 @@ package { cc_binary { name: "android.hardware.automotive.evs-aidl-default-service", defaults: ["EvsHalDefaults"], - local_include_dirs: ["include"], - vintf_fragments: ["evs-default-service.xml"], + vintf_fragments: ["manifest_evs-default-service.xml"], init_rc: ["evs-default-service.rc"], vendor: true, relative_install_path: "hw", - srcs: ["src/*.cpp"], - shared_libs: [ - "libbinder_ndk", + cflags: [ + "-DGL_GLEXT_PROTOTYPES", + "-DEGL_EGLEXT_PROTOTYPES", + "-Wall", + "-Wextra", + "-Werror", + "-Wthread-safety", ], + srcs: [ + ":libgui_frame_event_aidl", + "src/*.cpp", + ], + shared_libs: [ + "android.hardware.graphics.bufferqueue@1.0", + "android.hardware.graphics.bufferqueue@2.0", + "android.hidl.token@1.0-utils", + "libEGL", + "libGLESv2", + "libbase", + "libbinder_ndk", + "libbufferqueueconverter", + "libcamera_metadata", + "libhardware_legacy", + "libhidlbase", + "liblog", + "libnativewindow", + "libtinyxml2", + "libui", + "libutils", + "libyuv", + ], + static_libs: [ + "android.frameworks.automotive.display-V1-ndk", + "android.hardware.automotive.evs-V2-ndk", + "android.hardware.common-V2-ndk", + "libaidlcommonsupport", + "libcutils", + ], + local_include_dirs: ["include"], + include_dirs: ["frameworks/native/include/"], + required: ["evs_mock_hal_configuration.xml"], +} + +prebuilt_etc { + name: "evs_mock_hal_configuration.xml", + soc_specific: true, + src: "resources/evs_mock_configuration.xml", + sub_dir: "automotive/evs", } diff --git a/automotive/evs/aidl/impl/default/evs-default-service.rc b/automotive/evs/aidl/impl/default/evs-default-service.rc index ea8e6892dc..3da41ff787 100644 --- a/automotive/evs/aidl/impl/default/evs-default-service.rc +++ b/automotive/evs/aidl/impl/default/evs-default-service.rc @@ -1,5 +1,8 @@ service vendor.evs-hal-default /vendor/bin/hw/android.hardware.automotive.evs-aidl-default-service class early_hal - user automotive_evs - group automotive_evs + priority -20 + user graphics + group automotive_evs camera + onrestart restart cardisplayproxyd + onrestart restart evsmanagerd disabled diff --git a/automotive/evs/aidl/impl/default/include/ConfigManager.h b/automotive/evs/aidl/impl/default/include/ConfigManager.h new file mode 100644 index 0000000000..1d5fe772b2 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/ConfigManager.h @@ -0,0 +1,384 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "ConfigManagerUtil.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +/* + * Please note that this is different from what is defined in + * libhardware/modules/camera/3_4/metadata/types.h; this has one additional + * field to store a framerate. + */ +typedef struct { + int id; + int width; + int height; + ::aidl::android::hardware::graphics::common::PixelFormat format; + int type; + int framerate; +} StreamConfiguration; + +class ConfigManager final { + public: + static std::unique_ptr Create(); + ConfigManager(const ConfigManager&) = delete; + ConfigManager& operator=(const ConfigManager&) = delete; + + /* Camera device's capabilities and metadata */ + class CameraInfo { + public: + CameraInfo() : characteristics(nullptr) {} + + virtual ~CameraInfo(); + + /* Allocate memory for camera_metadata_t */ + bool allocate(size_t entry_cap, size_t data_cap) { + if (characteristics != nullptr) { + LOG(ERROR) << "Camera metadata is already allocated"; + return false; + } + + characteristics = allocate_camera_metadata(entry_cap, data_cap); + return characteristics != nullptr; + } + + /* + * List of supported controls that the primary client can program. + * Paraemters are stored with its valid range + */ + std::unordered_map<::aidl::android::hardware::automotive::evs::CameraParam, + std::tuple> + controls; + + /* + * List of supported output stream configurations. + */ + std::unordered_map streamConfigurations; + + /* + * Internal storage for camera metadata. Each entry holds a pointer to + * data and number of elements + */ + std::unordered_map> cameraMetadata; + + /* Camera module characteristics */ + camera_metadata_t* characteristics; + }; + + class CameraGroupInfo : public CameraInfo { + public: + CameraGroupInfo() {} + + /* ID of member camera devices */ + std::unordered_set devices; + + /* The capture operation of member camera devices are synchronized */ + int32_t synchronized = 0; + }; + + class SystemInfo { + public: + /* number of available cameras */ + int32_t numCameras = 0; + }; + + class DisplayInfo { + public: + /* + * List of supported input stream configurations. + */ + std::unordered_map streamConfigurations; + }; + + /* + * Return system information + * + * @return SystemInfo + * Constant reference of SystemInfo. + */ + const SystemInfo& getSystemInfo() { + std::unique_lock lock(mConfigLock); + mConfigCond.wait(lock, [this] { return mIsReady; }); + return mSystemInfo; + } + + /* + * Return a list of camera identifiers + * + * This function assumes that it is not being called frequently. + * + * @return std::vector + * A vector that contains unique camera device identifiers. + */ + std::vector getCameraIdList() { + std::unique_lock lock(mConfigLock); + mConfigCond.wait(lock, [this] { return mIsReady; }); + + std::vector aList; + aList.reserve(mCameraInfo.size()); + for (auto&& v : mCameraInfo) { + aList.push_back(v.first); + } + + return aList; + } + + /* + * Return a list of camera group identifiers + * + * This function assumes that it is not being called frequently. + * + * @return std::vector + * A vector that contains unique camera device identifiers. + */ + std::vector getCameraGroupIdList() { + std::unique_lock lock(mConfigLock); + mConfigCond.wait(lock, [this] { return mIsReady; }); + + std::vector aList; + aList.reserve(mCameraGroups.size()); + for (auto&& v : mCameraGroups) { + aList.push_back(v.first); + } + + return aList; + } + + /* + * Return a pointer to the camera group + * + * @return CameraGroup + * A pointer to a camera group identified by a given id. + */ + std::unique_ptr& getCameraGroupInfo(const std::string& gid) { + std::unique_lock lock(mConfigLock); + mConfigCond.wait(lock, [this] { return mIsReady; }); + + return mCameraGroups[gid]; + } + + /* + * Return a camera metadata + * + * @param cameraId + * Unique camera node identifier in string + * + * @return unique_ptr + * A pointer to CameraInfo that is associated with a given camera + * ID. This returns a null pointer if this does not recognize a + * given camera identifier. + */ + std::unique_ptr& getCameraInfo(const std::string& cameraId) noexcept { + std::unique_lock lock(mConfigLock); + mConfigCond.wait(lock, [this] { return mIsReady; }); + + return mCameraInfo[cameraId]; + } + + /* + * Tell whether the configuration data is ready to be used + * + * @return bool + * True if configuration data is ready to be consumed. + */ + bool isReady() const { return mIsReady; } + + private: + /* Constructors */ + ConfigManager() : mBinaryFilePath("") {} + + static std::string_view sConfigDefaultPath; + static std::string_view sConfigOverridePath; + + /* System configuration */ + SystemInfo mSystemInfo; + + /* Internal data structure for camera device information */ + std::unordered_map> mCameraInfo; + + /* Internal data structure for camera device information */ + std::unordered_map> mDisplayInfo; + + /* Camera groups are stored in hash map */ + std::unordered_map> mCameraGroups; + + /* + * Camera positions are stored in hash map. + * The position must be one of front, rear, left, and right. + */ + std::unordered_map> mCameraPosition; + + /* Configuration data lock */ + mutable std::mutex mConfigLock; + + /* + * This condition is signalled when it completes a configuration data + * preparation. + */ + std::condition_variable mConfigCond; + + /* A path to a binary configuration file */ + const char* mBinaryFilePath; + + /* Configuration data readiness */ + bool mIsReady = false; + + /* + * Parse a given EVS configuration file and store the information + * internally. + * + * @return bool + * True if it completes parsing a file successfully. + */ + bool readConfigDataFromXML() noexcept; + + /* + * read the information of the vehicle + * + * @param aSysElem + * A pointer to "system" XML element. + */ + void readSystemInfo(const tinyxml2::XMLElement* const aSysElem); + + /* + * read the information of camera devices + * + * @param aCameraElem + * A pointer to "camera" XML element that may contain multiple + * "device" elements. + */ + void readCameraInfo(const tinyxml2::XMLElement* const aCameraElem); + + /* + * read display device information + * + * @param aDisplayElem + * A pointer to "display" XML element that may contain multiple + * "device" elements. + */ + void readDisplayInfo(const tinyxml2::XMLElement* const aDisplayElem); + + /* + * read camera device information + * + * @param aCamera + * A pointer to CameraInfo that will be completed by this + * method. + * aDeviceElem + * A pointer to "device" XML element that contains camera module + * capability info and its characteristics. + * + * @return bool + * Return false upon any failure in reading and processing camera + * device information. + */ + bool readCameraDeviceInfo(CameraInfo* aCamera, const tinyxml2::XMLElement* aDeviceElem); + + /* + * read camera metadata + * + * @param aCapElem + * A pointer to "cap" XML element. + * @param aCamera + * A pointer to CameraInfo that is being filled by this method. + * @param dataSize + * Required size of memory to store camera metadata found in this + * method. This is calculated in this method and returned to the + * caller for camera_metadata allocation. + * + * @return size_t + * Number of camera metadata entries + */ + size_t readCameraCapabilities(const tinyxml2::XMLElement* const aCapElem, CameraInfo* aCamera, + size_t& dataSize); + + /* + * read camera metadata + * + * @param aParamElem + * A pointer to "characteristics" XML element. + * @param aCamera + * A pointer to CameraInfo that is being filled by this method. + * @param dataSize + * Required size of memory to store camera metadata found in this + * method. + * + * @return size_t + * Number of camera metadata entries + */ + size_t readCameraMetadata(const tinyxml2::XMLElement* const aParamElem, CameraInfo* aCamera, + size_t& dataSize); + + /* + * construct camera_metadata_t from camera capabilities and metadata + * + * @param aCamera + * A pointer to CameraInfo that is being filled by this method. + * @param totalEntries + * Number of camera metadata entries to be added. + * @param totalDataSize + * Sum of sizes of camera metadata entries to be added. + * + * @return bool + * False if either it fails to allocate memory for camera metadata + * or its size is not large enough to add all found camera metadata + * entries. + */ + bool constructCameraMetadata(CameraInfo* aCamera, const size_t totalEntries, + const size_t totalDataSize); + + /* + * Read configuration data from the binary file + * + * @return bool + * True if it succeeds to read configuration data from a binary + * file. + */ + bool readConfigDataFromBinary(); + + /* + * Store configuration data to the file + * + * @return bool + * True if it succeeds to serialize mCameraInfo to the file. + */ + bool writeConfigDataToBinary(); + + /* + * debugging method to print out all XML elements and their attributes in + * logcat message. + * + * @param aNode + * A pointer to the root XML element to navigate. + * @param prefix + * A prefix to XML string. + */ + void printElementNames(const tinyxml2::XMLElement* aNode, const std::string& prefix = "") const; +}; diff --git a/automotive/evs/aidl/impl/default/include/ConfigManagerUtil.h b/automotive/evs/aidl/impl/default/include/ConfigManagerUtil.h new file mode 100644 index 0000000000..32b50d3332 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/ConfigManagerUtil.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +class ConfigManagerUtil final { + public: + /** + * Convert a given string into V4L2_CID_* + */ + static bool convertToEvsCameraParam( + const std::string& id, + ::aidl::android::hardware::automotive::evs::CameraParam& camParam); + /** + * Convert a given string into android.hardware.graphics.common.PixelFormat + */ + static bool convertToPixelFormat(const std::string& in, + ::aidl::android::hardware::graphics::common::PixelFormat& out); + /** + * Convert a given string into corresponding camera metadata data tag defined in + * system/media/camera/include/system/camera_metadata_tags.h + */ + static bool convertToMetadataTag(const char* name, camera_metadata_tag& aTag); + /** + * Convert a given string into a floating value array + */ + static float* convertFloatArray(const char* sz, const char* vals, size_t& count, + const char delimiter = ','); + /** + * Trim a string + */ + static std::string trimString(const std::string& src, const std::string& ws = " \n\r\t\f\v"); + + /** + * Convert a given string to corresponding camera capabilities + */ + static bool convertToCameraCapability( + const char* name, camera_metadata_enum_android_request_available_capabilities_t& cap); + + DISALLOW_IMPLICIT_CONSTRUCTORS(ConfigManagerUtil); +}; diff --git a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h deleted file mode 100644 index 03a578d954..0000000000 --- a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef android_hardware_automotive_evs_aidl_impl_evshal_include_DefaultEvsHal_H_ -#define android_hardware_automotive_evs_aidl_impl_evshal_include_DefaultEvsHal_H_ - -#include - -namespace aidl::android::hardware::automotive::evs::implementation { - -class DefaultEvsEnumerator final - : public ::aidl::android::hardware::automotive::evs::BnEvsEnumerator { - ::ndk::ScopedAStatus isHardware(bool* flag) override; - ::ndk::ScopedAStatus openCamera( - const std::string& cameraId, - const ::aidl::android::hardware::automotive::evs::Stream& streamConfig, - std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsCamera>* obj) override; - ::ndk::ScopedAStatus closeCamera( - const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsCamera>& obj) - override; - ::ndk::ScopedAStatus getCameraList( - std::vector<::aidl::android::hardware::automotive::evs::CameraDesc>* list) override; - ::ndk::ScopedAStatus getStreamList( - const ::aidl::android::hardware::automotive::evs::CameraDesc& desc, - std::vector<::aidl::android::hardware::automotive::evs::Stream>* _aidl_return) override; - ::ndk::ScopedAStatus openDisplay( - int32_t displayId, - std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>* obj) override; - ::ndk::ScopedAStatus closeDisplay( - const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& obj) - override; - ::ndk::ScopedAStatus getDisplayIdList(std::vector* list) override; - ::ndk::ScopedAStatus getDisplayState( - ::aidl::android::hardware::automotive::evs::DisplayState* state) override; - ::ndk::ScopedAStatus registerStatusCallback( - const std::shared_ptr< - ::aidl::android::hardware::automotive::evs::IEvsEnumeratorStatusCallback>& - callback) override; - ::ndk::ScopedAStatus openUltrasonicsArray( - const std::string& id, - std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray>* obj) - override; - ::ndk::ScopedAStatus closeUltrasonicsArray( - const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray>& - arr) override; - ::ndk::ScopedAStatus getUltrasonicsArrayList( - std::vector<::aidl::android::hardware::automotive::evs::UltrasonicsArrayDesc>* list) - override; -}; - -} // namespace aidl::android::hardware::automotive::evs::implementation - -#endif // android_hardware_automotive_evs_aidl_impl_evshal_include_DefaultEvsHal_H_ diff --git a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h new file mode 100644 index 0000000000..259c266721 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "ConfigManager.h" +#include "EvsGlDisplay.h" +#include "EvsMockCamera.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsEnumerator final : public ::aidl::android::hardware::automotive::evs::BnEvsEnumerator { + public: + // Methods from ::aidl::android::hardware::automotive::evs::IEvsEnumerator + ndk::ScopedAStatus isHardware(bool* flag) override; + ndk::ScopedAStatus openCamera(const std::string& cameraId, const evs::Stream& streamConfig, + std::shared_ptr* obj) override; + ndk::ScopedAStatus closeCamera(const std::shared_ptr& obj) override; + ndk::ScopedAStatus getCameraList(std::vector* _aidl_return) override; + ndk::ScopedAStatus getStreamList(const evs::CameraDesc& desc, + std::vector* _aidl_return) override; + ndk::ScopedAStatus openDisplay(int32_t displayId, + std::shared_ptr* obj) override; + ndk::ScopedAStatus closeDisplay(const std::shared_ptr& obj) override; + ndk::ScopedAStatus getDisplayIdList(std::vector* list) override; + ndk::ScopedAStatus getDisplayState(evs::DisplayState* state) override; + ndk::ScopedAStatus getDisplayStateById(int32_t displayId, evs::DisplayState* state) override; + ndk::ScopedAStatus registerStatusCallback( + const std::shared_ptr& callback) override; + ndk::ScopedAStatus openUltrasonicsArray( + const std::string& id, std::shared_ptr* obj) override; + ndk::ScopedAStatus closeUltrasonicsArray( + const std::shared_ptr& obj) override; + ndk::ScopedAStatus getUltrasonicsArrayList( + std::vector* list) override; + + // Implementation details + EvsEnumerator(const std::shared_ptr< + ::aidl::android::frameworks::automotive::display::ICarDisplayProxy>& + proxyService); + + void notifyDeviceStatusChange(const std::string_view& deviceName, evs::DeviceStatusType type); + + private: + struct CameraRecord { + evs::CameraDesc desc; + std::weak_ptr activeInstance; + + CameraRecord(const char* cameraId) : desc() { desc.id = cameraId; } + }; + + class ActiveDisplays { + public: + struct DisplayInfo { + int32_t id{-1}; + std::weak_ptr displayWeak; + uintptr_t internalDisplayRawAddr; + }; + + std::optional popDisplay(int32_t id); + + std::optional popDisplay(const std::shared_ptr& display); + + std::unordered_map getAllDisplays(); + + bool tryInsert(int32_t id, const std::shared_ptr& display); + + private: + std::mutex mMutex; + std::unordered_map mIdToDisplay GUARDED_BY(mMutex); + std::unordered_map mDisplayToId GUARDED_BY(mMutex); + }; + + bool checkPermission(); + void closeCamera_impl(const std::shared_ptr& pCamera, + const std::string& cameraId); + ndk::ScopedAStatus getDisplayStateImpl(std::optional displayId, + evs::DisplayState* state); + + static bool qualifyCaptureDevice(const char* deviceName); + static CameraRecord* findCameraById(const std::string& cameraId); + static void enumerateCameras(); + static bool addCaptureDevice(const std::string& deviceName); + static bool removeCaptureDevice(const std::string& deviceName); + // Enumerate available displays and return an id of the internal display + static uint64_t enumerateDisplays(); + + static ActiveDisplays& mutableActiveDisplays(); + + // NOTE: All members values are static so that all clients operate on the same state + // That is to say, this is effectively a singleton despite the fact that HIDL + // constructs a new instance for each client. + // Because our server has a single thread in the thread pool, these values are + // never accessed concurrently despite potentially having multiple instance objects + // using them. + static std::unordered_map sCameraList; + // Object destructs if client dies. + static std::mutex sLock; // Mutex on shared camera device list. + static std::condition_variable sCameraSignal; // Signal on camera device addition. + static std::unique_ptr sConfigManager; // ConfigManager + static std::shared_ptr<::aidl::android::frameworks::automotive::display::ICarDisplayProxy> + sDisplayProxy; + static std::unordered_map sDisplayPortList; + + uint64_t mInternalDisplayId; + std::shared_ptr mCallback; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h b/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h new file mode 100644 index 0000000000..ceabd9e863 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "GlWrapper.h" + +#include +#include +#include +#include +#include + +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsGlDisplay final : public BnEvsDisplay { + public: + // Methods from ::aidl::android::hardware::automotive::evs::IEvsDisplay + // follow. + ndk::ScopedAStatus getDisplayInfo(evs::DisplayDesc* _aidl_return) override; + ndk::ScopedAStatus getDisplayState(evs::DisplayState* _aidl_return) override; + ndk::ScopedAStatus getTargetBuffer(evs::BufferDesc* _aidl_return) override; + ndk::ScopedAStatus returnTargetBufferForDisplay(const evs::BufferDesc& buffer) override; + ndk::ScopedAStatus setDisplayState(evs::DisplayState state) override; + + // Implementation details + EvsGlDisplay(const std::shared_ptr& service, + uint64_t displayId); + virtual ~EvsGlDisplay() override; + + // This gets called if another caller "steals" ownership of the display + void forceShutdown(); + + private: + // A graphics buffer into which we'll store images. This member variable + // will be protected by semaphores. + struct BufferRecord { + ::aidl::android::hardware::graphics::common::HardwareBufferDescription description; + buffer_handle_t handle; + int fingerprint; + } mBuffer; + + // State of a rendering thread + enum RenderThreadStates { + STOPPED = 0, + STOPPING = 1, + RUN = 2, + }; + + uint64_t mDisplayId; + evs::DisplayDesc mInfo; + evs::DisplayState mRequestedState GUARDED_BY(mLock) = evs::DisplayState::NOT_VISIBLE; + std::shared_ptr mDisplayProxy; + + GlWrapper mGlWrapper; + mutable std::mutex mLock; + + // This tells us whether or not our buffer is in use. Protected by + // semaphores. + bool mBufferBusy = false; + + // Variables to synchronize a rendering thread w/ main and binder threads + std::thread mRenderThread; + RenderThreadStates mState GUARDED_BY(mLock) = STOPPED; + bool mBufferReady = false; + void renderFrames(); + bool initializeGlContextLocked() REQUIRES(mLock); + + std::condition_variable mBufferReadyToUse; + std::condition_variable mBufferReadyToRender; + std::condition_variable mBufferDone; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h new file mode 100644 index 0000000000..7e010a29e0 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "ConfigManager.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// #include +#include +#include + +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsMockCamera : public evs::BnEvsCamera { + // This prevents constructors from direct access while it allows this class to + // be instantiated via ndk::SharedRefBase::make<>. + private: + struct Sigil { + explicit Sigil() = default; + }; + + public: + // Methods from ::android::hardware::automotive::evs::IEvsCamera follow. + ndk::ScopedAStatus doneWithFrame(const std::vector& buffers) override; + ndk::ScopedAStatus forcePrimaryClient( + const std::shared_ptr& display) override; + ndk::ScopedAStatus getCameraInfo(evs::CameraDesc* _aidl_return) override; + ndk::ScopedAStatus getExtendedInfo(int32_t opaqueIdentifier, + std::vector* value) override; + ndk::ScopedAStatus getIntParameter(evs::CameraParam id, std::vector* value) override; + ndk::ScopedAStatus getIntParameterRange(evs::CameraParam id, + evs::ParameterRange* _aidl_return) override; + ndk::ScopedAStatus getParameterList(std::vector* _aidl_return) override; + ndk::ScopedAStatus getPhysicalCameraInfo(const std::string& deviceId, + evs::CameraDesc* _aidl_return) override; + ndk::ScopedAStatus importExternalBuffers(const std::vector& buffers, + int32_t* _aidl_return) override; + ndk::ScopedAStatus pauseVideoStream() override; + ndk::ScopedAStatus resumeVideoStream() override; + ndk::ScopedAStatus setExtendedInfo(int32_t opaqueIdentifier, + const std::vector& opaqueValue) override; + ndk::ScopedAStatus setIntParameter(evs::CameraParam id, int32_t value, + std::vector* effectiveValue) override; + ndk::ScopedAStatus setPrimaryClient() override; + ndk::ScopedAStatus setMaxFramesInFlight(int32_t bufferCount) override; + ndk::ScopedAStatus startVideoStream( + const std::shared_ptr& receiver) override; + ndk::ScopedAStatus stopVideoStream() override; + ndk::ScopedAStatus unsetPrimaryClient() override; + + static std::shared_ptr Create(const char* deviceName); + static std::shared_ptr Create( + const char* deviceName, std::unique_ptr& camInfo, + const evs::Stream* streamCfg = nullptr); + EvsMockCamera(const EvsMockCamera&) = delete; + EvsMockCamera& operator=(const EvsMockCamera&) = delete; + + virtual ~EvsMockCamera() override; + void shutdown(); + + const evs::CameraDesc& getDesc() { return mDescription; } + + // Constructors + EvsMockCamera(Sigil sigil, const char* deviceName, + std::unique_ptr& camInfo); + + private: + // These three functions are expected to be called while mAccessLock is held + bool setAvailableFrames_Locked(unsigned bufferCount); + unsigned increaseAvailableFrames_Locked(unsigned numToAdd); + unsigned decreaseAvailableFrames_Locked(unsigned numToRemove); + + void generateFrames(); + void fillMockFrame(buffer_handle_t handle, const AHardwareBuffer_Desc* pDesc); + void returnBufferLocked(const uint32_t bufferId); + ndk::ScopedAStatus stopVideoStream_impl(); + + CameraDesc mDescription = {}; // The properties of this camera + + std::thread mCaptureThread; // The thread we'll use to synthesize frames + + // The callback used to deliver each frame + std::shared_ptr mStream; + + // Horizontal pixel count in the buffers + uint32_t mWidth = 0; + // Vertical pixel count in the buffers + uint32_t mHeight = 0; + // Values from android_pixel_format_t + uint32_t mFormat = HAL_PIXEL_FORMAT_RGBA_8888; + // Values from from Gralloc.h + uint64_t mUsage = + GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_OFTEN; + // Bytes per line in the buffers + uint32_t mStride = 0; + + struct BufferRecord { + buffer_handle_t handle; + bool inUse; + + explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false){}; + }; + + std::vector mBuffers; // Graphics buffers to transfer images + unsigned mFramesAllowed; // How many buffers are we currently using + unsigned mFramesInUse; // How many buffers are currently outstanding + + enum StreamStateValues { + STOPPED, + RUNNING, + STOPPING, + DEAD, + }; + StreamStateValues mStreamState; + + // Synchronization necessary to deconflict mCaptureThread from the main service thread + std::mutex mAccessLock; + + // Static camera module information + std::unique_ptr& mCameraInfo; + + // For the extended info + std::unordered_map> mExtInfo; + + // For the camera parameters. + struct CameraParameterDesc { + CameraParameterDesc(int min = 0, int max = 0, int step = 0, int value = 0) { + this->range.min = min; + this->range.max = max; + this->range.step = step; + this->value = value; + } + + ParameterRange range; + int32_t value; + }; + std::unordered_map> mParams; + void initializeParameters(); +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/include/GlWrapper.h b/automotive/evs/aidl/impl/default/include/GlWrapper.h new file mode 100644 index 0000000000..adb250c8e1 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/GlWrapper.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +namespace automotivedisplay = ::aidl::android::frameworks::automotive::display; + +class GlWrapper { + public: + GlWrapper() : mSurfaceHolder(::android::SurfaceHolderUniquePtr(nullptr, nullptr)) {} + bool initialize(const std::shared_ptr& svc, + uint64_t displayId); + void shutdown(); + + bool updateImageTexture( + buffer_handle_t handle, + const ::aidl::android::hardware::graphics::common::HardwareBufferDescription& + description); + void renderImageToScreen(); + + void showWindow(const std::shared_ptr& svc, + uint64_t displayId); + void hideWindow(const std::shared_ptr& svc, + uint64_t displayId); + + unsigned getWidth() { return mWidth; }; + unsigned getHeight() { return mHeight; }; + + private: + ::android::sp<::android::hardware::graphics::bufferqueue::V2_0::IGraphicBufferProducer> + mGfxBufferProducer; + + EGLDisplay mDisplay; + EGLSurface mSurface; + EGLContext mContext; + + unsigned mWidth = 0; + unsigned mHeight = 0; + + EGLImageKHR mKHRimage = EGL_NO_IMAGE_KHR; + + GLuint mTextureMap = 0; + GLuint mShaderProgram = 0; + + // Opaque handle for a native hardware buffer defined in + // frameworks/native/opengl/include/EGL/eglplatform.h + ANativeWindow* mWindow; + + // Pointer to a Surface wrapper. + ::android::SurfaceHolderUniquePtr mSurfaceHolder; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/evs-default-service.xml b/automotive/evs/aidl/impl/default/manifest_evs-default-service.xml similarity index 51% rename from automotive/evs/aidl/impl/default/evs-default-service.xml rename to automotive/evs/aidl/impl/default/manifest_evs-default-service.xml index 96ff9f6576..50692f7d5d 100644 --- a/automotive/evs/aidl/impl/default/evs-default-service.xml +++ b/automotive/evs/aidl/impl/default/manifest_evs-default-service.xml @@ -1,11 +1,7 @@ android.hardware.automotive.evs - hwbinder + IEvsEnumerator/hw/0 1 - - IEvsEnumerator - hw/0 - diff --git a/automotive/evs/aidl/impl/default/resources/evs_mock_configuration.xml b/automotive/evs/aidl/impl/default/resources/evs_mock_configuration.xml new file mode 100644 index 0000000000..6cbc18eacf --- /dev/null +++ b/automotive/evs/aidl/impl/default/resources/evs_mock_configuration.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/automotive/evs/aidl/impl/default/src/ConfigManager.cpp b/automotive/evs/aidl/impl/default/src/ConfigManager.cpp new file mode 100644 index 0000000000..da791ed0b9 --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/ConfigManager.cpp @@ -0,0 +1,992 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ConfigManager.h" + +#include +#include +#include + +#include +#include +#include +#include + +namespace { + +using ::aidl::android::hardware::automotive::evs::CameraParam; +using ::aidl::android::hardware::graphics::common::PixelFormat; +using ::tinyxml2::XMLAttribute; +using ::tinyxml2::XMLDocument; +using ::tinyxml2::XMLElement; + +} // namespace + +std::string_view ConfigManager::sConfigDefaultPath = + "/vendor/etc/automotive/evs/evs_mock_hal_configuration.xml"; +std::string_view ConfigManager::sConfigOverridePath = + "/vendor/etc/automotive/evs/evs_configuration_override.xml"; + +void ConfigManager::printElementNames(const XMLElement* rootElem, const std::string& prefix) const { + const XMLElement* curElem = rootElem; + + while (curElem != nullptr) { + LOG(VERBOSE) << "[ELEM] " << prefix << curElem->Name(); + const XMLAttribute* curAttr = curElem->FirstAttribute(); + while (curAttr) { + LOG(VERBOSE) << "[ATTR] " << prefix << curAttr->Name() << ": " << curAttr->Value(); + curAttr = curAttr->Next(); + } + + /* recursively go down to descendants */ + printElementNames(curElem->FirstChildElement(), prefix + "\t"); + + curElem = curElem->NextSiblingElement(); + } +} + +void ConfigManager::readCameraInfo(const XMLElement* const aCameraElem) { + if (aCameraElem == nullptr) { + LOG(WARNING) << "XML file does not have required camera element"; + return; + } + + const XMLElement* curElem = aCameraElem->FirstChildElement(); + while (curElem != nullptr) { + if (!strcmp(curElem->Name(), "group")) { + /* camera group identifier */ + const char* id = curElem->FindAttribute("id")->Value(); + + /* create a camera group to be filled */ + CameraGroupInfo* aCamera = new CameraGroupInfo(); + + /* read camera device information */ + if (!readCameraDeviceInfo(aCamera, curElem)) { + LOG(WARNING) << "Failed to read a camera information of " << id; + delete aCamera; + continue; + } + + /* camera group synchronization */ + const char* sync = curElem->FindAttribute("synchronized")->Value(); + if (!strcmp(sync, "CALIBRATED")) { + aCamera->synchronized = ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED; + } else if (!strcmp(sync, "APPROXIMATE")) { + aCamera->synchronized = ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE; + } else { + aCamera->synchronized = 0; // Not synchronized + } + + /* add a group to hash map */ + mCameraGroups.insert_or_assign(id, std::unique_ptr(aCamera)); + } else if (!std::strcmp(curElem->Name(), "device")) { + /* camera unique identifier */ + const char* id = curElem->FindAttribute("id")->Value(); + + /* camera mount location */ + const char* pos = curElem->FindAttribute("position")->Value(); + + /* create a camera device to be filled */ + CameraInfo* aCamera = new CameraInfo(); + + /* read camera device information */ + if (!readCameraDeviceInfo(aCamera, curElem)) { + LOG(WARNING) << "Failed to read a camera information of " << id; + delete aCamera; + continue; + } + + /* store read camera module information */ + mCameraInfo.insert_or_assign(id, std::unique_ptr(aCamera)); + + /* assign a camera device to a position group */ + mCameraPosition[pos].insert(id); + } else { + /* ignore other device types */ + LOG(DEBUG) << "Unknown element " << curElem->Name() << " is ignored"; + } + + curElem = curElem->NextSiblingElement(); + } +} + +bool ConfigManager::readCameraDeviceInfo(CameraInfo* aCamera, const XMLElement* aDeviceElem) { + if (aCamera == nullptr || aDeviceElem == nullptr) { + return false; + } + + /* size information to allocate camera_metadata_t */ + size_t totalEntries = 0; + size_t totalDataSize = 0; + + /* read device capabilities */ + totalEntries += + readCameraCapabilities(aDeviceElem->FirstChildElement("caps"), aCamera, totalDataSize); + + /* read camera metadata */ + totalEntries += readCameraMetadata(aDeviceElem->FirstChildElement("characteristics"), aCamera, + totalDataSize); + + /* construct camera_metadata_t */ + if (!constructCameraMetadata(aCamera, totalEntries, totalDataSize)) { + LOG(WARNING) << "Either failed to allocate memory or " + << "allocated memory was not large enough"; + } + + return true; +} + +size_t ConfigManager::readCameraCapabilities(const XMLElement* const aCapElem, CameraInfo* aCamera, + size_t& dataSize) { + if (aCapElem == nullptr || aCamera == nullptr) { + return 0; + } + + std::string token; + const XMLElement* curElem = nullptr; + + /* a list of supported camera parameters/controls */ + curElem = aCapElem->FirstChildElement("supported_controls"); + if (curElem != nullptr) { + const XMLElement* ctrlElem = curElem->FirstChildElement("control"); + while (ctrlElem != nullptr) { + const char* nameAttr = ctrlElem->FindAttribute("name")->Value(); + int32_t minVal = INT32_MIN, maxVal = INT32_MAX; + if (!android::base::ParseInt(ctrlElem->FindAttribute("min")->Value(), &minVal)) { + LOG(WARNING) << "Failed to parse " << ctrlElem->FindAttribute("min")->Value(); + } + + if (!android::base::ParseInt(ctrlElem->FindAttribute("max")->Value(), &maxVal)) { + LOG(WARNING) << "Failed to parse " << ctrlElem->FindAttribute("max")->Value(); + } + + int32_t stepVal = 1; + const XMLAttribute* stepAttr = ctrlElem->FindAttribute("step"); + if (stepAttr != nullptr) { + if (!android::base::ParseInt(stepAttr->Value(), &stepVal)) { + LOG(WARNING) << "Failed to parse " << stepAttr->Value(); + } + } + + CameraParam aParam; + if (ConfigManagerUtil::convertToEvsCameraParam(nameAttr, aParam)) { + aCamera->controls.insert_or_assign( + aParam, std::move(std::make_tuple(minVal, maxVal, stepVal))); + } + + ctrlElem = ctrlElem->NextSiblingElement("control"); + } + } + + /* a list of camera stream configurations */ + curElem = aCapElem->FirstChildElement("stream"); + while (curElem != nullptr) { + /* read 5 attributes */ + const XMLAttribute* idAttr = curElem->FindAttribute("id"); + const XMLAttribute* widthAttr = curElem->FindAttribute("width"); + const XMLAttribute* heightAttr = curElem->FindAttribute("height"); + const XMLAttribute* fmtAttr = curElem->FindAttribute("format"); + const XMLAttribute* fpsAttr = curElem->FindAttribute("framerate"); + + int32_t id = -1; + int32_t framerate = 0; + if (!android::base::ParseInt(idAttr->Value(), &id)) { + LOG(WARNING) << "Failed to parse " << idAttr->Value(); + } + if (fpsAttr != nullptr) { + if (!android::base::ParseInt(fpsAttr->Value(), &framerate)) { + LOG(WARNING) << "Failed to parse " << fpsAttr->Value(); + } + } + + PixelFormat format = PixelFormat::UNSPECIFIED; + if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), format)) { + StreamConfiguration cfg = { + .id = id, + .format = format, + .type = ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT, + .framerate = framerate, + }; + + if (!android::base::ParseInt(widthAttr->Value(), &cfg.width) || + !android::base::ParseInt(heightAttr->Value(), &cfg.height)) { + LOG(WARNING) << "Failed to parse " << widthAttr->Value() << " and " + << heightAttr->Value(); + } + aCamera->streamConfigurations.insert_or_assign(id, cfg); + } + + curElem = curElem->NextSiblingElement("stream"); + } + + dataSize = calculate_camera_metadata_entry_data_size( + get_camera_metadata_tag_type(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS), + aCamera->streamConfigurations.size() * sizeof(StreamConfiguration)); + + /* a single camera metadata entry contains multiple stream configurations */ + return dataSize > 0 ? 1 : 0; +} + +size_t ConfigManager::readCameraMetadata(const XMLElement* const aParamElem, CameraInfo* aCamera, + size_t& dataSize) { + if (aParamElem == nullptr || aCamera == nullptr) { + return 0; + } + + const XMLElement* curElem = aParamElem->FirstChildElement("parameter"); + size_t numEntries = 0; + camera_metadata_tag_t tag; + while (curElem != nullptr) { + if (ConfigManagerUtil::convertToMetadataTag(curElem->FindAttribute("name")->Value(), tag)) { + switch (tag) { + case ANDROID_LENS_DISTORTION: + case ANDROID_LENS_POSE_ROTATION: + case ANDROID_LENS_POSE_TRANSLATION: + case ANDROID_LENS_INTRINSIC_CALIBRATION: { + /* float[] */ + size_t count = 0; + void* data = ConfigManagerUtil::convertFloatArray( + curElem->FindAttribute("size")->Value(), + curElem->FindAttribute("value")->Value(), count); + + aCamera->cameraMetadata.insert_or_assign(tag, std::make_pair(data, count)); + + ++numEntries; + dataSize += calculate_camera_metadata_entry_data_size( + get_camera_metadata_tag_type(tag), count); + + break; + } + + case ANDROID_REQUEST_AVAILABLE_CAPABILITIES: { + camera_metadata_enum_android_request_available_capabilities_t* data = + new camera_metadata_enum_android_request_available_capabilities_t[1]; + if (ConfigManagerUtil::convertToCameraCapability( + curElem->FindAttribute("value")->Value(), *data)) { + aCamera->cameraMetadata.insert_or_assign(tag, + std::make_pair((void*)data, 1)); + + ++numEntries; + dataSize += calculate_camera_metadata_entry_data_size( + get_camera_metadata_tag_type(tag), 1); + } + break; + } + + case ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS: { + /* a comma-separated list of physical camera devices */ + size_t len = strlen(curElem->FindAttribute("value")->Value()); + char* data = new char[len + 1]; + memcpy(data, curElem->FindAttribute("value")->Value(), len * sizeof(char)); + + /* replace commas with null char */ + char* p = data; + while (*p != '\0') { + if (*p == ',') { + *p = '\0'; + } + ++p; + } + + aCamera->cameraMetadata.insert_or_assign(tag, + std::make_pair((void*)data, len + 1)); + + ++numEntries; + dataSize += calculate_camera_metadata_entry_data_size( + get_camera_metadata_tag_type(tag), len); + break; + } + + /* TODO(b/140416878): add vendor-defined/custom tag support */ + default: + LOG(WARNING) << "Parameter " << curElem->FindAttribute("name")->Value() + << " is not supported"; + break; + } + } else { + LOG(WARNING) << "Unsupported metadata tag " << curElem->FindAttribute("name")->Value() + << " is found."; + } + + curElem = curElem->NextSiblingElement("parameter"); + } + + return numEntries; +} + +bool ConfigManager::constructCameraMetadata(CameraInfo* aCamera, size_t totalEntries, + size_t totalDataSize) { + if (aCamera == nullptr || !aCamera->allocate(totalEntries, totalDataSize)) { + LOG(ERROR) << "Failed to allocate memory for camera metadata"; + return false; + } + + const size_t numStreamConfigs = aCamera->streamConfigurations.size(); + std::unique_ptr data(new int32_t[sizeof(StreamConfiguration) * numStreamConfigs]); + int32_t* ptr = data.get(); + for (auto& cfg : aCamera->streamConfigurations) { + memcpy(ptr, &cfg.second, sizeof(StreamConfiguration)); + ptr += sizeof(StreamConfiguration); + } + int32_t err = add_camera_metadata_entry( + aCamera->characteristics, ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, data.get(), + numStreamConfigs * sizeof(StreamConfiguration)); + + if (err) { + LOG(ERROR) << "Failed to add stream configurations to metadata, ignored"; + return false; + } + + bool success = true; + for (auto& [tag, entry] : aCamera->cameraMetadata) { + /* try to add new camera metadata entry */ + int32_t err = + add_camera_metadata_entry(aCamera->characteristics, tag, entry.first, entry.second); + if (err) { + LOG(ERROR) << "Failed to add an entry with a tag, " << std::hex << tag; + + /* may exceed preallocated capacity */ + LOG(ERROR) << "Camera metadata has " + << get_camera_metadata_entry_count(aCamera->characteristics) << " / " + << get_camera_metadata_entry_capacity(aCamera->characteristics) + << " entries and " + << get_camera_metadata_data_count(aCamera->characteristics) << " / " + << get_camera_metadata_data_capacity(aCamera->characteristics) + << " bytes are filled."; + LOG(ERROR) << "\tCurrent metadata entry requires " + << calculate_camera_metadata_entry_data_size(tag, entry.second) << " bytes."; + + success = false; + } + } + + LOG(VERBOSE) << "Camera metadata has " + << get_camera_metadata_entry_count(aCamera->characteristics) << " / " + << get_camera_metadata_entry_capacity(aCamera->characteristics) << " entries and " + << get_camera_metadata_data_count(aCamera->characteristics) << " / " + << get_camera_metadata_data_capacity(aCamera->characteristics) + << " bytes are filled."; + return success; +} + +void ConfigManager::readSystemInfo(const XMLElement* const aSysElem) { + if (aSysElem == nullptr) { + return; + } + + /* + * Please note that this function assumes that a given system XML element + * and its child elements follow DTD. If it does not, it will cause a + * segmentation fault due to the failure of finding expected attributes. + */ + + /* read number of cameras available in the system */ + const XMLElement* xmlElem = aSysElem->FirstChildElement("num_cameras"); + if (xmlElem != nullptr) { + if (!android::base::ParseInt(xmlElem->FindAttribute("value")->Value(), + &mSystemInfo.numCameras)) { + LOG(WARNING) << "Failed to parse " << xmlElem->FindAttribute("value")->Value(); + } + } +} + +void ConfigManager::readDisplayInfo(const XMLElement* const aDisplayElem) { + if (aDisplayElem == nullptr) { + LOG(WARNING) << "XML file does not have required camera element"; + return; + } + + const XMLElement* curDev = aDisplayElem->FirstChildElement("device"); + while (curDev != nullptr) { + const char* id = curDev->FindAttribute("id")->Value(); + std::unique_ptr dpy(new DisplayInfo()); + if (dpy == nullptr) { + LOG(ERROR) << "Failed to allocate memory for DisplayInfo"; + return; + } + + const XMLElement* cap = curDev->FirstChildElement("caps"); + if (cap != nullptr) { + const XMLElement* curStream = cap->FirstChildElement("stream"); + while (curStream != nullptr) { + /* read 4 attributes */ + const XMLAttribute* idAttr = curStream->FindAttribute("id"); + const XMLAttribute* widthAttr = curStream->FindAttribute("width"); + const XMLAttribute* heightAttr = curStream->FindAttribute("height"); + const XMLAttribute* fmtAttr = curStream->FindAttribute("format"); + + int32_t id = -1; + if (!android::base::ParseInt(idAttr->Value(), &id)) { + LOG(WARNING) << "Failed to parse " << idAttr->Value(); + } + PixelFormat format = PixelFormat::UNSPECIFIED; + if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), format)) { + StreamConfiguration cfg = { + .id = id, + .format = format, + .type = ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT, + }; + if (!android::base::ParseInt(widthAttr->Value(), &cfg.width) || + !android::base::ParseInt(heightAttr->Value(), &cfg.height)) { + LOG(WARNING) << "Failed to parse " << widthAttr->Value() << " and " + << heightAttr->Value(); + } + dpy->streamConfigurations.insert_or_assign(id, cfg); + } + + curStream = curStream->NextSiblingElement("stream"); + } + } + + mDisplayInfo.insert_or_assign(id, std::move(dpy)); + curDev = curDev->NextSiblingElement("device"); + } + + return; +} + +bool ConfigManager::readConfigDataFromXML() noexcept { + XMLDocument xmlDoc; + + const int64_t parsingStart = android::elapsedRealtimeNano(); + + /* load and parse a configuration file */ + xmlDoc.LoadFile(sConfigOverridePath.data()); + if (xmlDoc.ErrorID() != tinyxml2::XML_SUCCESS) { + xmlDoc.LoadFile(sConfigDefaultPath.data()); + if (xmlDoc.ErrorID() != tinyxml2::XML_SUCCESS) { + LOG(ERROR) << "Failed to load and/or parse a configuration file, " << xmlDoc.ErrorStr(); + return false; + } + } + + /* retrieve the root element */ + const XMLElement* rootElem = xmlDoc.RootElement(); + if (std::strcmp(rootElem->Name(), "configuration") != 0) { + LOG(ERROR) << "A configuration file is not in the required format. " + << "See /etc/automotive/evs/evs_configuration.dtd"; + return false; + } + + std::unique_lock lock(mConfigLock); + + /* + * parse camera information; this needs to be done before reading system + * information + */ + readCameraInfo(rootElem->FirstChildElement("camera")); + + /* parse system information */ + readSystemInfo(rootElem->FirstChildElement("system")); + + /* parse display information */ + readDisplayInfo(rootElem->FirstChildElement("display")); + + /* configuration data is ready to be consumed */ + mIsReady = true; + + /* notify that configuration data is ready */ + lock.unlock(); + mConfigCond.notify_all(); + + const int64_t parsingEnd = android::elapsedRealtimeNano(); + LOG(INFO) << "Parsing configuration file takes " << std::scientific + << (double)(parsingEnd - parsingStart) / 1000000.0 << " ms."; + + return true; +} + +bool ConfigManager::readConfigDataFromBinary() { + /* Temporary buffer to hold configuration data read from a binary file */ + char mBuffer[1024]; + + std::fstream srcFile; + const int64_t readStart = android::elapsedRealtimeNano(); + + srcFile.open(mBinaryFilePath, std::fstream::in | std::fstream::binary); + if (!srcFile) { + LOG(ERROR) << "Failed to open a source binary file, " << mBinaryFilePath; + return false; + } + + std::unique_lock lock(mConfigLock); + mIsReady = false; + + /* read configuration data into the internal buffer */ + srcFile.read(mBuffer, sizeof(mBuffer)); + LOG(VERBOSE) << __FUNCTION__ << ": " << srcFile.gcount() << " bytes are read."; + char* p = mBuffer; + size_t sz = 0; + + /* read number of camera group information entries */ + const size_t ngrps = *(reinterpret_cast(p)); + p += sizeof(size_t); + + /* read each camera information entry */ + for (size_t cidx = 0; cidx < ngrps; ++cidx) { + /* read camera identifier */ + std::string cameraId = *(reinterpret_cast(p)); + p += sizeof(std::string); + + /* size of camera_metadata_t */ + const size_t num_entry = *(reinterpret_cast(p)); + p += sizeof(size_t); + const size_t num_data = *(reinterpret_cast(p)); + p += sizeof(size_t); + + /* create CameraInfo and add it to hash map */ + std::unique_ptr aCamera; + if (aCamera == nullptr || !aCamera->allocate(num_entry, num_data)) { + LOG(ERROR) << "Failed to create new CameraInfo object"; + mCameraInfo.clear(); + return false; + } + + /* controls */ + typedef struct { + CameraParam cid; + int32_t min; + int32_t max; + int32_t step; + } CameraCtrl; + sz = *(reinterpret_cast(p)); + p += sizeof(size_t); + CameraCtrl* ptr = reinterpret_cast(p); + for (size_t idx = 0; idx < sz; ++idx) { + CameraCtrl temp = *ptr++; + aCamera->controls.insert_or_assign( + temp.cid, std::move(std::make_tuple(temp.min, temp.max, temp.step))); + } + p = reinterpret_cast(ptr); + + /* stream configurations */ + sz = *(reinterpret_cast(p)); + p += sizeof(size_t); + int32_t* i32_ptr = reinterpret_cast(p); + for (size_t idx = 0; idx < sz; ++idx) { + const int32_t id = *i32_ptr++; + + StreamConfiguration temp; + memcpy(&temp, i32_ptr, sizeof(StreamConfiguration)); + i32_ptr += sizeof(StreamConfiguration); + aCamera->streamConfigurations.insert_or_assign(id, temp); + } + p = reinterpret_cast(i32_ptr); + + /* synchronization */ + aCamera->synchronized = *(reinterpret_cast(p)); + p += sizeof(int32_t); + + for (size_t idx = 0; idx < num_entry; ++idx) { + /* Read camera metadata entries */ + camera_metadata_tag_t tag = *reinterpret_cast(p); + p += sizeof(camera_metadata_tag_t); + const size_t count = *reinterpret_cast(p); + p += sizeof(size_t); + + const int32_t type = get_camera_metadata_tag_type(tag); + switch (type) { + case TYPE_BYTE: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(uint8_t); + break; + } + case TYPE_INT32: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(int32_t); + break; + } + case TYPE_FLOAT: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(float); + break; + } + case TYPE_INT64: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(int64_t); + break; + } + case TYPE_DOUBLE: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(double); + break; + } + case TYPE_RATIONAL: + p += count * sizeof(camera_metadata_rational_t); + break; + default: + LOG(WARNING) << "Type " << type << " is unknown; " + << "data may be corrupted."; + break; + } + } + + mCameraInfo.insert_or_assign(cameraId, std::move(aCamera)); + } + + /* read number of camera information entries */ + const size_t ncams = *(reinterpret_cast(p)); + p += sizeof(size_t); + + /* read each camera information entry */ + for (size_t cidx = 0; cidx < ncams; ++cidx) { + /* read camera identifier */ + std::string cameraId = *(reinterpret_cast(p)); + p += sizeof(std::string); + + /* size of camera_metadata_t */ + const size_t num_entry = *(reinterpret_cast(p)); + p += sizeof(size_t); + const size_t num_data = *(reinterpret_cast(p)); + p += sizeof(size_t); + + /* create CameraInfo and add it to hash map */ + std::unique_ptr aCamera; + if (aCamera == nullptr || !aCamera->allocate(num_entry, num_data)) { + LOG(ERROR) << "Failed to create new CameraInfo object"; + mCameraInfo.clear(); + return false; + } + + /* controls */ + typedef struct { + CameraParam cid; + int32_t min; + int32_t max; + int32_t step; + } CameraCtrl; + sz = *(reinterpret_cast(p)); + p += sizeof(size_t); + CameraCtrl* ptr = reinterpret_cast(p); + for (size_t idx = 0; idx < sz; ++idx) { + CameraCtrl temp = *ptr++; + aCamera->controls.insert_or_assign( + temp.cid, std::move(std::make_tuple(temp.min, temp.max, temp.step))); + } + p = reinterpret_cast(ptr); + + /* stream configurations */ + sz = *(reinterpret_cast(p)); + p += sizeof(size_t); + int32_t* i32_ptr = reinterpret_cast(p); + for (size_t idx = 0; idx < sz; ++idx) { + const int32_t id = *i32_ptr++; + + StreamConfiguration temp; + memcpy(&temp, i32_ptr, sizeof(StreamConfiguration)); + i32_ptr += sizeof(StreamConfiguration); + aCamera->streamConfigurations.insert_or_assign(id, temp); + } + p = reinterpret_cast(i32_ptr); + + for (size_t idx = 0; idx < num_entry; ++idx) { + /* Read camera metadata entries */ + camera_metadata_tag_t tag = *reinterpret_cast(p); + p += sizeof(camera_metadata_tag_t); + const size_t count = *reinterpret_cast(p); + p += sizeof(size_t); + + const int32_t type = get_camera_metadata_tag_type(tag); + switch (type) { + case TYPE_BYTE: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(uint8_t); + break; + } + case TYPE_INT32: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(int32_t); + break; + } + case TYPE_FLOAT: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(float); + break; + } + case TYPE_INT64: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(int64_t); + break; + } + case TYPE_DOUBLE: { + add_camera_metadata_entry(aCamera->characteristics, tag, p, count); + p += count * sizeof(double); + break; + } + case TYPE_RATIONAL: + p += count * sizeof(camera_metadata_rational_t); + break; + default: + LOG(WARNING) << "Type " << type << " is unknown; " + << "data may be corrupted."; + break; + } + } + + mCameraInfo.insert_or_assign(cameraId, std::move(aCamera)); + } + + mIsReady = true; + + /* notify that configuration data is ready */ + lock.unlock(); + mConfigCond.notify_all(); + + int64_t readEnd = android::elapsedRealtimeNano(); + LOG(INFO) << __FUNCTION__ << " takes " << std::scientific + << (double)(readEnd - readStart) / 1000000.0 << " ms."; + + return true; +} + +bool ConfigManager::writeConfigDataToBinary() { + std::fstream outFile; + + const int64_t writeStart = android::elapsedRealtimeNano(); + + outFile.open(mBinaryFilePath, std::fstream::out | std::fstream::binary); + if (!outFile) { + LOG(ERROR) << "Failed to open a destination binary file, " << mBinaryFilePath; + return false; + } + + /* lock a configuration data while it's being written to the filesystem */ + std::lock_guard lock(mConfigLock); + + /* write camera group information */ + size_t sz = mCameraGroups.size(); + outFile.write(reinterpret_cast(&sz), sizeof(size_t)); + for (auto&& [camId, camInfo] : mCameraGroups) { + LOG(INFO) << "Storing camera group " << camId; + + /* write a camera identifier string */ + outFile.write(reinterpret_cast(&camId), sizeof(std::string)); + + /* controls */ + sz = camInfo->controls.size(); + outFile.write(reinterpret_cast(&sz), sizeof(size_t)); + for (auto&& [ctrl, range] : camInfo->controls) { + outFile.write(reinterpret_cast(&ctrl), sizeof(CameraParam)); + outFile.write(reinterpret_cast(&std::get<0>(range)), sizeof(int32_t)); + outFile.write(reinterpret_cast(&std::get<1>(range)), sizeof(int32_t)); + outFile.write(reinterpret_cast(&std::get<2>(range)), sizeof(int32_t)); + } + + /* stream configurations */ + sz = camInfo->streamConfigurations.size(); + outFile.write(reinterpret_cast(&sz), sizeof(size_t)); + for (auto&& [sid, cfg] : camInfo->streamConfigurations) { + outFile.write(reinterpret_cast(sid), sizeof(int32_t)); + outFile.write(reinterpret_cast(&cfg), sizeof(cfg)); + } + + /* synchronization */ + outFile.write(reinterpret_cast(&camInfo->synchronized), sizeof(int32_t)); + + /* size of camera_metadata_t */ + size_t num_entry = 0; + size_t num_data = 0; + if (camInfo->characteristics != nullptr) { + num_entry = get_camera_metadata_entry_count(camInfo->characteristics); + num_data = get_camera_metadata_data_count(camInfo->characteristics); + } + outFile.write(reinterpret_cast(&num_entry), sizeof(size_t)); + outFile.write(reinterpret_cast(&num_data), sizeof(size_t)); + + /* write each camera metadata entry */ + if (num_entry > 0) { + camera_metadata_entry_t entry; + for (size_t idx = 0; idx < num_entry; ++idx) { + if (get_camera_metadata_entry(camInfo->characteristics, idx, &entry)) { + LOG(ERROR) << "Failed to retrieve camera metadata entry " << idx; + outFile.close(); + return false; + } + + outFile.write(reinterpret_cast(&entry.tag), sizeof(entry.tag)); + outFile.write(reinterpret_cast(&entry.count), sizeof(entry.count)); + + int32_t type = get_camera_metadata_tag_type(entry.tag); + switch (type) { + case TYPE_BYTE: + outFile.write(reinterpret_cast(entry.data.u8), + sizeof(uint8_t) * entry.count); + break; + case TYPE_INT32: + outFile.write(reinterpret_cast(entry.data.i32), + sizeof(int32_t) * entry.count); + break; + case TYPE_FLOAT: + outFile.write(reinterpret_cast(entry.data.f), + sizeof(float) * entry.count); + break; + case TYPE_INT64: + outFile.write(reinterpret_cast(entry.data.i64), + sizeof(int64_t) * entry.count); + break; + case TYPE_DOUBLE: + outFile.write(reinterpret_cast(entry.data.d), + sizeof(double) * entry.count); + break; + case TYPE_RATIONAL: + [[fallthrough]]; + default: + LOG(WARNING) << "Type " << type << " is not supported."; + break; + } + } + } + } + + /* write camera device information */ + sz = mCameraInfo.size(); + outFile.write(reinterpret_cast(&sz), sizeof(size_t)); + for (auto&& [camId, camInfo] : mCameraInfo) { + LOG(INFO) << "Storing camera " << camId; + + /* write a camera identifier string */ + outFile.write(reinterpret_cast(&camId), sizeof(std::string)); + + /* controls */ + sz = camInfo->controls.size(); + outFile.write(reinterpret_cast(&sz), sizeof(size_t)); + for (auto& [ctrl, range] : camInfo->controls) { + outFile.write(reinterpret_cast(&ctrl), sizeof(CameraParam)); + outFile.write(reinterpret_cast(&std::get<0>(range)), sizeof(int32_t)); + outFile.write(reinterpret_cast(&std::get<1>(range)), sizeof(int32_t)); + outFile.write(reinterpret_cast(&std::get<2>(range)), sizeof(int32_t)); + } + + /* stream configurations */ + sz = camInfo->streamConfigurations.size(); + outFile.write(reinterpret_cast(&sz), sizeof(size_t)); + for (auto&& [sid, cfg] : camInfo->streamConfigurations) { + outFile.write(reinterpret_cast(sid), sizeof(int32_t)); + outFile.write(reinterpret_cast(&cfg), sizeof(cfg)); + } + + /* size of camera_metadata_t */ + size_t num_entry = 0; + size_t num_data = 0; + if (camInfo->characteristics != nullptr) { + num_entry = get_camera_metadata_entry_count(camInfo->characteristics); + num_data = get_camera_metadata_data_count(camInfo->characteristics); + } + outFile.write(reinterpret_cast(&num_entry), sizeof(size_t)); + outFile.write(reinterpret_cast(&num_data), sizeof(size_t)); + + /* write each camera metadata entry */ + if (num_entry > 0) { + camera_metadata_entry_t entry; + for (size_t idx = 0; idx < num_entry; ++idx) { + if (get_camera_metadata_entry(camInfo->characteristics, idx, &entry)) { + LOG(ERROR) << "Failed to retrieve camera metadata entry " << idx; + outFile.close(); + return false; + } + + outFile.write(reinterpret_cast(&entry.tag), sizeof(entry.tag)); + outFile.write(reinterpret_cast(&entry.count), sizeof(entry.count)); + + int32_t type = get_camera_metadata_tag_type(entry.tag); + switch (type) { + case TYPE_BYTE: + outFile.write(reinterpret_cast(entry.data.u8), + sizeof(uint8_t) * entry.count); + break; + case TYPE_INT32: + outFile.write(reinterpret_cast(entry.data.i32), + sizeof(int32_t) * entry.count); + break; + case TYPE_FLOAT: + outFile.write(reinterpret_cast(entry.data.f), + sizeof(float) * entry.count); + break; + case TYPE_INT64: + outFile.write(reinterpret_cast(entry.data.i64), + sizeof(int64_t) * entry.count); + break; + case TYPE_DOUBLE: + outFile.write(reinterpret_cast(entry.data.d), + sizeof(double) * entry.count); + break; + case TYPE_RATIONAL: + [[fallthrough]]; + default: + LOG(WARNING) << "Type " << type << " is not supported."; + break; + } + } + } + } + + outFile.close(); + int64_t writeEnd = android::elapsedRealtimeNano(); + LOG(INFO) << __FUNCTION__ << " takes " << std::scientific + << (double)(writeEnd - writeStart) / 1000000.0 << " ms."; + + return true; +} + +std::unique_ptr ConfigManager::Create() { + std::unique_ptr cfgMgr(new ConfigManager()); + + /* + * Read a configuration from XML file + * + * If this is too slow, ConfigManager::readConfigDataFromBinary() and + * ConfigManager::writeConfigDataToBinary()can serialize CameraInfo object + * to the filesystem and construct CameraInfo instead; this was + * evaluated as 10x faster. + */ + if (!cfgMgr->readConfigDataFromXML()) { + return nullptr; + } else { + return cfgMgr; + } +} + +ConfigManager::CameraInfo::~CameraInfo() { + free_camera_metadata(characteristics); + + for (auto&& [tag, val] : cameraMetadata) { + switch (tag) { + case ANDROID_LENS_DISTORTION: + case ANDROID_LENS_POSE_ROTATION: + case ANDROID_LENS_POSE_TRANSLATION: + case ANDROID_LENS_INTRINSIC_CALIBRATION: { + delete[] reinterpret_cast(val.first); + break; + } + + case ANDROID_REQUEST_AVAILABLE_CAPABILITIES: { + delete[] reinterpret_cast< + camera_metadata_enum_android_request_available_capabilities_t*>(val.first); + break; + } + + case ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS: { + delete[] reinterpret_cast(val.first); + break; + } + + default: + LOG(WARNING) << "Tag " << std::hex << tag << " is not supported. " + << "Data may be corrupted?"; + break; + } + } +} diff --git a/automotive/evs/aidl/impl/default/src/ConfigManagerUtil.cpp b/automotive/evs/aidl/impl/default/src/ConfigManagerUtil.cpp new file mode 100644 index 0000000000..e5fe6efa57 --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/ConfigManagerUtil.cpp @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ConfigManagerUtil.h" + +#include +#include +#include +#include + +#include +#include + +#include + +using ::aidl::android::hardware::automotive::evs::CameraParam; +using ::aidl::android::hardware::graphics::common::PixelFormat; + +bool ConfigManagerUtil::convertToEvsCameraParam(const std::string& id, CameraParam& camParam) { + std::string trimmed = ConfigManagerUtil::trimString(id); + bool success = true; + + if (!trimmed.compare("BRIGHTNESS")) { + camParam = CameraParam::BRIGHTNESS; + } else if (!trimmed.compare("CONTRAST")) { + camParam = CameraParam::CONTRAST; + } else if (!trimmed.compare("AUTOGAIN")) { + camParam = CameraParam::AUTOGAIN; + } else if (!trimmed.compare("GAIN")) { + camParam = CameraParam::GAIN; + } else if (!trimmed.compare("AUTO_WHITE_BALANCE")) { + camParam = CameraParam::AUTO_WHITE_BALANCE; + } else if (!trimmed.compare("WHITE_BALANCE_TEMPERATURE")) { + camParam = CameraParam::WHITE_BALANCE_TEMPERATURE; + } else if (!trimmed.compare("SHARPNESS")) { + camParam = CameraParam::SHARPNESS; + } else if (!trimmed.compare("AUTO_EXPOSURE")) { + camParam = CameraParam::AUTO_EXPOSURE; + } else if (!trimmed.compare("ABSOLUTE_EXPOSURE")) { + camParam = CameraParam::ABSOLUTE_EXPOSURE; + } else if (!trimmed.compare("ABSOLUTE_FOCUS")) { + camParam = CameraParam::ABSOLUTE_FOCUS; + } else if (!trimmed.compare("AUTO_FOCUS")) { + camParam = CameraParam::AUTO_FOCUS; + } else if (!trimmed.compare("ABSOLUTE_ZOOM")) { + camParam = CameraParam::ABSOLUTE_ZOOM; + } else { + success = false; + } + + return success; +} + +bool ConfigManagerUtil::convertToPixelFormat(const std::string& in, PixelFormat& out) { + std::string trimmed = ConfigManagerUtil::trimString(in); + bool success = true; + + if (!trimmed.compare("RGBA_8888")) { + out = PixelFormat::RGBA_8888; + } else if (!trimmed.compare("YCRCB_420_SP")) { + out = PixelFormat::YCRCB_420_SP; + } else if (!trimmed.compare("YCBCR_422_I")) { + out = PixelFormat::YCBCR_422_I; + } else { + out = PixelFormat::UNSPECIFIED; + success = false; + } + + return success; +} + +bool ConfigManagerUtil::convertToMetadataTag(const char* name, camera_metadata_tag& aTag) { + if (!std::strcmp(name, "LENS_DISTORTION")) { + aTag = ANDROID_LENS_DISTORTION; + } else if (!std::strcmp(name, "LENS_INTRINSIC_CALIBRATION")) { + aTag = ANDROID_LENS_INTRINSIC_CALIBRATION; + } else if (!std::strcmp(name, "LENS_POSE_ROTATION")) { + aTag = ANDROID_LENS_POSE_ROTATION; + } else if (!std::strcmp(name, "LENS_POSE_TRANSLATION")) { + aTag = ANDROID_LENS_POSE_TRANSLATION; + } else if (!std::strcmp(name, "REQUEST_AVAILABLE_CAPABILITIES")) { + aTag = ANDROID_REQUEST_AVAILABLE_CAPABILITIES; + } else if (!std::strcmp(name, "LOGICAL_MULTI_CAMERA_PHYSICAL_IDS")) { + aTag = ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS; + } else { + return false; + } + + return true; +} + +bool ConfigManagerUtil::convertToCameraCapability( + const char* name, camera_metadata_enum_android_request_available_capabilities_t& cap) { + if (!std::strcmp(name, "DEPTH_OUTPUT")) { + cap = ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT; + } else if (!std::strcmp(name, "LOGICAL_MULTI_CAMERA")) { + cap = ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA; + } else if (!std::strcmp(name, "MONOCHROME")) { + cap = ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME; + } else if (!std::strcmp(name, "SECURE_IMAGE_DATA")) { + cap = ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA; + } else { + return false; + } + + return true; +} + +float* ConfigManagerUtil::convertFloatArray(const char* sz, const char* vals, size_t& count, + const char delimiter) { + std::string size_string(sz); + std::string value_string(vals); + + if (!android::base::ParseUint(size_string, &count)) { + LOG(ERROR) << "Failed to parse " << size_string; + return nullptr; + } + float* result = new float[count]; + std::stringstream values(value_string); + + int32_t idx = 0; + std::string token; + while (getline(values, token, delimiter)) { + if (!android::base::ParseFloat(token, &result[idx++])) { + LOG(WARNING) << "Failed to parse " << token; + } + } + + return result; +} + +std::string ConfigManagerUtil::trimString(const std::string& src, const std::string& ws) { + const auto s = src.find_first_not_of(ws); + if (s == std::string::npos) { + return ""; + } + + const auto e = src.find_last_not_of(ws); + const auto r = e - s + 1; + + return src.substr(s, r); +} diff --git a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp deleted file mode 100644 index 5a81d05850..0000000000 --- a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// TODO(b/203661081): Remove below lines to disable compiler warnings. -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-parameter" - -#define LOG_TAG "DefaultEvsEnumerator" - -#include - -namespace aidl::android::hardware::automotive::evs::implementation { - -using ::ndk::ScopedAStatus; - -ScopedAStatus DefaultEvsEnumerator::isHardware(bool* flag) { - // This returns true always. - *flag = true; - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::openCamera(const std::string& cameraId, - const Stream& streamConfig, - std::shared_ptr* obj) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::closeCamera(const std::shared_ptr& obj) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::getCameraList(std::vector* list) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::getStreamList(const CameraDesc& desc, - std::vector* _aidl_return) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::openDisplay(int32_t displayId, - std::shared_ptr* obj) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::closeDisplay(const std::shared_ptr& state) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::getDisplayIdList(std::vector* list) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::getDisplayState(DisplayState* state) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::registerStatusCallback( - const std::shared_ptr& callback) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::openUltrasonicsArray( - const std::string& id, std::shared_ptr* obj) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::closeUltrasonicsArray( - const std::shared_ptr& obj) { - return ScopedAStatus::ok(); -} - -ScopedAStatus DefaultEvsEnumerator::getUltrasonicsArrayList( - std::vector* list) { - return ScopedAStatus::ok(); -} - -} // namespace aidl::android::hardware::automotive::evs::implementation - -#pragma clang diagnostic pop diff --git a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp new file mode 100644 index 0000000000..5178958675 --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp @@ -0,0 +1,560 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsEnumerator.h" + +#include "ConfigManager.h" +#include "EvsGlDisplay.h" +#include "EvsMockCamera.h" + +#include +#include +#include +#include + +#include +#include + +namespace { + +using ::aidl::android::frameworks::automotive::display::ICarDisplayProxy; +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::ndk::ScopedAStatus; +using std::chrono_literals::operator""s; + +// Constants +constexpr std::chrono::seconds kEnumerationTimeout = 10s; +constexpr uint64_t kInvalidDisplayId = std::numeric_limits::max(); +const std::set kAllowedUids = {AID_AUTOMOTIVE_EVS, AID_SYSTEM, AID_ROOT}; + +} // namespace + +namespace aidl::android::hardware::automotive::evs::implementation { + +// NOTE: All members values are static so that all clients operate on the same state +// That is to say, this is effectively a singleton despite the fact that HIDL +// constructs a new instance for each client. +std::unordered_map EvsEnumerator::sCameraList; +std::mutex EvsEnumerator::sLock; +std::condition_variable EvsEnumerator::sCameraSignal; +std::unique_ptr EvsEnumerator::sConfigManager; +std::shared_ptr EvsEnumerator::sDisplayProxy; +std::unordered_map EvsEnumerator::sDisplayPortList; + +EvsEnumerator::ActiveDisplays& EvsEnumerator::mutableActiveDisplays() { + static ActiveDisplays active_displays; + return active_displays; +} + +EvsEnumerator::EvsEnumerator(const std::shared_ptr& proxyService) { + LOG(DEBUG) << "EvsEnumerator is created."; + + if (!sConfigManager) { + /* loads and initializes ConfigManager in a separate thread */ + sConfigManager = ConfigManager::Create(); + } + + if (!sDisplayProxy) { + /* sets a car-window service handle */ + sDisplayProxy = proxyService; + } + + // Enumerate existing devices + enumerateCameras(); + mInternalDisplayId = enumerateDisplays(); +} + +bool EvsEnumerator::checkPermission() { + const auto uid = AIBinder_getCallingUid(); + if (kAllowedUids.find(uid) == kAllowedUids.end()) { + LOG(ERROR) << "EVS access denied: " + << "pid = " << AIBinder_getCallingPid() << ", uid = " << uid; + return false; + } + + return true; +} + +void EvsEnumerator::enumerateCameras() { + if (!sConfigManager) { + return; + } + + for (auto id : sConfigManager->getCameraIdList()) { + CameraRecord rec(id.data()); + std::unique_ptr& pInfo = sConfigManager->getCameraInfo(id); + if (pInfo) { + uint8_t* ptr = reinterpret_cast(pInfo->characteristics); + const size_t len = get_camera_metadata_size(pInfo->characteristics); + rec.desc.metadata.insert(rec.desc.metadata.end(), ptr, ptr + len); + } + sCameraList.insert_or_assign(id, std::move(rec)); + } +} + +uint64_t EvsEnumerator::enumerateDisplays() { + LOG(INFO) << __FUNCTION__ << ": Starting display enumeration"; + uint64_t internalDisplayId = kInvalidDisplayId; + if (!sDisplayProxy) { + LOG(ERROR) << "ICarDisplayProxy is not available!"; + return internalDisplayId; + } + + std::vector displayIds; + if (auto status = sDisplayProxy->getDisplayIdList(&displayIds); !status.isOk()) { + LOG(ERROR) << "Failed to retrieve a display id list" + << ::android::statusToString(status.getStatus()); + return internalDisplayId; + } + + if (displayIds.size() > 0) { + // The first entry of the list is the internal display. See + // SurfaceFlinger::getPhysicalDisplayIds() implementation. + internalDisplayId = displayIds[0]; + for (const auto& id : displayIds) { + const auto port = id & 0xFF; + LOG(INFO) << "Display " << std::hex << id << " is detected on the port, " << port; + sDisplayPortList.insert_or_assign(port, id); + } + } + + LOG(INFO) << "Found " << sDisplayPortList.size() << " displays"; + return internalDisplayId; +} + +// Methods from ::android::hardware::automotive::evs::IEvsEnumerator follow. +ScopedAStatus EvsEnumerator::getCameraList(std::vector* _aidl_return) { + LOG(DEBUG) << __FUNCTION__; + if (!checkPermission()) { + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::PERMISSION_DENIED)); + } + + { + std::unique_lock lock(sLock); + if (sCameraList.size() < 1) { + // No qualified device has been found. Wait until new device is ready, + // for 10 seconds. + if (!sCameraSignal.wait_for(lock, kEnumerationTimeout, + [] { return sCameraList.size() > 0; })) { + LOG(DEBUG) << "Timer expired. No new device has been added."; + } + } + } + + // Build up a packed array of CameraDesc for return + _aidl_return->resize(sCameraList.size()); + unsigned i = 0; + for (const auto& [key, cam] : sCameraList) { + (*_aidl_return)[i++] = cam.desc; + } + + if (sConfigManager) { + // Adding camera groups that represent logical camera devices + auto camGroups = sConfigManager->getCameraGroupIdList(); + for (auto&& id : camGroups) { + if (sCameraList.find(id) != sCameraList.end()) { + // Already exists in the _aidl_return + continue; + } + + std::unique_ptr& tempInfo = + sConfigManager->getCameraGroupInfo(id); + CameraRecord cam(id.data()); + if (tempInfo) { + uint8_t* ptr = reinterpret_cast(tempInfo->characteristics); + const size_t len = get_camera_metadata_size(tempInfo->characteristics); + cam.desc.metadata.insert(cam.desc.metadata.end(), ptr, ptr + len); + } + + sCameraList.insert_or_assign(id, cam); + _aidl_return->push_back(cam.desc); + } + } + + // Send back the results + LOG(DEBUG) << "Reporting " << sCameraList.size() << " cameras available"; + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::getStreamList(const CameraDesc& desc, + std::vector* _aidl_return) { + using AidlPixelFormat = ::aidl::android::hardware::graphics::common::PixelFormat; + + camera_metadata_t* pMetadata = const_cast( + reinterpret_cast(desc.metadata.data())); + camera_metadata_entry_t streamConfig; + if (!find_camera_metadata_entry(pMetadata, ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + &streamConfig)) { + const unsigned numStreamConfigs = streamConfig.count / sizeof(StreamConfiguration); + _aidl_return->resize(numStreamConfigs); + const StreamConfiguration* pCurrentConfig = + reinterpret_cast(streamConfig.data.i32); + for (unsigned i = 0; i < numStreamConfigs; ++i, ++pCurrentConfig) { + // Build ::aidl::android::hardware::automotive::evs::Stream from + // StreamConfiguration. + Stream current = { + .id = pCurrentConfig->id, + .streamType = + pCurrentConfig->type == + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT + ? StreamType::INPUT + : StreamType::OUTPUT, + .width = pCurrentConfig->width, + .height = pCurrentConfig->height, + .format = static_cast(pCurrentConfig->format), + .usage = BufferUsage::CAMERA_INPUT, + .rotation = Rotation::ROTATION_0, + }; + + (*_aidl_return)[i] = current; + } + } + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::openCamera(const std::string& id, const Stream& cfg, + std::shared_ptr* obj) { + LOG(DEBUG) << __FUNCTION__; + if (!checkPermission()) { + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::PERMISSION_DENIED)); + } + + // Is this a recognized camera id? + CameraRecord* pRecord = findCameraById(id); + if (!pRecord) { + LOG(ERROR) << id << " does not exist!"; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + // Has this camera already been instantiated by another caller? + std::shared_ptr pActiveCamera = pRecord->activeInstance.lock(); + if (pActiveCamera) { + LOG(WARNING) << "Killing previous camera because of new caller"; + closeCamera(pActiveCamera); + } + + // Construct a camera instance for the caller + if (!sConfigManager) { + pActiveCamera = EvsMockCamera::Create(id.data()); + } else { + pActiveCamera = EvsMockCamera::Create(id.data(), sConfigManager->getCameraInfo(id), &cfg); + } + + pRecord->activeInstance = pActiveCamera; + if (!pActiveCamera) { + LOG(ERROR) << "Failed to create new EvsMockCamera object for " << id; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::UNDERLYING_SERVICE_ERROR)); + } + + *obj = pActiveCamera; + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::closeCamera(const std::shared_ptr& cameraObj) { + LOG(DEBUG) << __FUNCTION__; + + if (!cameraObj) { + LOG(ERROR) << "Ignoring call to closeCamera with null camera ptr"; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + // Get the camera id so we can find it in our list + CameraDesc desc; + auto status = cameraObj->getCameraInfo(&desc); + if (!status.isOk()) { + LOG(ERROR) << "Failed to read a camera descriptor"; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::UNDERLYING_SERVICE_ERROR)); + } + auto cameraId = desc.id; + closeCamera_impl(cameraObj, cameraId); + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::openDisplay(int32_t id, std::shared_ptr* displayObj) { + LOG(DEBUG) << __FUNCTION__; + if (!checkPermission()) { + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::PERMISSION_DENIED)); + } + + auto& displays = mutableActiveDisplays(); + + if (auto existing_display_search = displays.popDisplay(id)) { + // If we already have a display active, then we need to shut it down so we can + // give exclusive access to the new caller. + std::shared_ptr pActiveDisplay = existing_display_search->displayWeak.lock(); + if (pActiveDisplay) { + LOG(WARNING) << "Killing previous display because of new caller"; + pActiveDisplay->forceShutdown(); + } + } + + // Create a new display interface and return it + uint64_t targetDisplayId = mInternalDisplayId; + auto it = sDisplayPortList.find(id); + if (it != sDisplayPortList.end()) { + targetDisplayId = it->second; + } else { + LOG(WARNING) << "No display is available on the port " << static_cast(id) + << ". The main display " << mInternalDisplayId << " will be used instead"; + } + + // Create a new display interface and return it. + std::shared_ptr pActiveDisplay = + ndk::SharedRefBase::make(sDisplayProxy, targetDisplayId); + + if (auto insert_result = displays.tryInsert(id, pActiveDisplay); !insert_result) { + LOG(ERROR) << "Display ID " << id << " has been used by another caller."; + pActiveDisplay->forceShutdown(); + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::RESOURCE_BUSY)); + } + + LOG(DEBUG) << "Returning new EvsGlDisplay object " << pActiveDisplay.get(); + *displayObj = pActiveDisplay; + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::closeDisplay(const std::shared_ptr& obj) { + LOG(DEBUG) << __FUNCTION__; + + auto& displays = mutableActiveDisplays(); + const auto display_search = displays.popDisplay(obj); + + if (!display_search) { + LOG(WARNING) << "Ignoring close of previously orphaned display - why did a client steal?"; + return ScopedAStatus::ok(); + } + + auto pActiveDisplay = display_search->displayWeak.lock(); + + if (!pActiveDisplay) { + LOG(ERROR) << "Somehow a display is being destroyed " + << "when the enumerator didn't know one existed"; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + pActiveDisplay->forceShutdown(); + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::getDisplayState(DisplayState* state) { + LOG(DEBUG) << __FUNCTION__; + return getDisplayStateImpl(std::nullopt, state); +} + +ScopedAStatus EvsEnumerator::getDisplayStateById(int32_t displayId, DisplayState* state) { + LOG(DEBUG) << __FUNCTION__; + return getDisplayStateImpl(displayId, state); +} + +ScopedAStatus EvsEnumerator::getDisplayStateImpl(std::optional displayId, + DisplayState* state) { + if (!checkPermission()) { + *state = DisplayState::DEAD; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::PERMISSION_DENIED)); + } + + const auto& all_displays = mutableActiveDisplays().getAllDisplays(); + + const auto display_search = displayId ? all_displays.find(*displayId) : all_displays.begin(); + + if (display_search == all_displays.end()) { + *state = DisplayState::NOT_OPEN; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + std::shared_ptr pActiveDisplay = display_search->second.displayWeak.lock(); + if (pActiveDisplay) { + return pActiveDisplay->getDisplayState(state); + } else { + *state = DisplayState::NOT_OPEN; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } +} + +ScopedAStatus EvsEnumerator::getDisplayIdList(std::vector* list) { + std::vector& output = *list; + if (sDisplayPortList.size() > 0) { + output.resize(sDisplayPortList.size()); + unsigned i = 0; + output[i++] = mInternalDisplayId & 0xFF; + for (const auto& [port, id] : sDisplayPortList) { + if (mInternalDisplayId != id) { + output[i++] = port; + } + } + } + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::isHardware(bool* flag) { + *flag = true; + return ScopedAStatus::ok(); +} + +void EvsEnumerator::notifyDeviceStatusChange(const std::string_view& deviceName, + DeviceStatusType type) { + std::lock_guard lock(sLock); + if (!mCallback) { + return; + } + + std::vector status{{.id = std::string(deviceName), .status = type}}; + if (!mCallback->deviceStatusChanged(status).isOk()) { + LOG(WARNING) << "Failed to notify a device status change, name = " << deviceName + << ", type = " << static_cast(type); + } +} + +ScopedAStatus EvsEnumerator::registerStatusCallback( + const std::shared_ptr& callback) { + std::lock_guard lock(sLock); + if (mCallback) { + LOG(INFO) << "Replacing an existing device status callback"; + } + mCallback = callback; + return ScopedAStatus::ok(); +} + +void EvsEnumerator::closeCamera_impl(const std::shared_ptr& pCamera, + const std::string& cameraId) { + // Find the named camera + CameraRecord* pRecord = findCameraById(cameraId); + + // Is the display being destroyed actually the one we think is active? + if (!pRecord) { + LOG(ERROR) << "Asked to close a camera whose name isn't recognized"; + } else { + std::shared_ptr pActiveCamera = pRecord->activeInstance.lock(); + if (!pActiveCamera) { + LOG(WARNING) << "Somehow a camera is being destroyed " + << "when the enumerator didn't know one existed"; + } else if (pActiveCamera != pCamera) { + // This can happen if the camera was aggressively reopened, + // orphaning this previous instance + LOG(WARNING) << "Ignoring close of previously orphaned camera " + << "- why did a client steal?"; + } else { + // Shutdown the active camera + pActiveCamera->shutdown(); + } + } + + return; +} + +EvsEnumerator::CameraRecord* EvsEnumerator::findCameraById(const std::string& cameraId) { + // Find the named camera + auto found = sCameraList.find(cameraId); + if (found != sCameraList.end()) { + // Found a match! + return &found->second; + } + + // We didn't find a match + return nullptr; +} + +std::optional EvsEnumerator::ActiveDisplays::popDisplay( + int32_t id) { + std::lock_guard lck(mMutex); + const auto search = mIdToDisplay.find(id); + if (search == mIdToDisplay.end()) { + return std::nullopt; + } + const auto display_info = search->second; + mIdToDisplay.erase(search); + mDisplayToId.erase(display_info.internalDisplayRawAddr); + return display_info; +} + +std::optional EvsEnumerator::ActiveDisplays::popDisplay( + const std::shared_ptr& display) { + const auto display_ptr_val = reinterpret_cast(display.get()); + std::lock_guard lck(mMutex); + const auto display_to_id_search = mDisplayToId.find(display_ptr_val); + if (display_to_id_search == mDisplayToId.end()) { + LOG(ERROR) << "Unknown display."; + return std::nullopt; + } + const auto id = display_to_id_search->second; + const auto id_to_display_search = mIdToDisplay.find(id); + mDisplayToId.erase(display_to_id_search); + if (id_to_display_search == mIdToDisplay.end()) { + LOG(ERROR) << "No correspsonding ID for the display, probably orphaned."; + return std::nullopt; + } + const auto display_info = id_to_display_search->second; + mIdToDisplay.erase(id); + return display_info; +} + +std::unordered_map +EvsEnumerator::ActiveDisplays::getAllDisplays() { + std::lock_guard lck(mMutex); + auto id_to_display_map_copy = mIdToDisplay; + return id_to_display_map_copy; +} + +bool EvsEnumerator::ActiveDisplays::tryInsert(int32_t id, + const std::shared_ptr& display) { + std::lock_guard lck(mMutex); + const auto display_ptr_val = reinterpret_cast(display.get()); + + auto id_to_display_insert_result = + mIdToDisplay.emplace(id, DisplayInfo{ + .id = id, + .displayWeak = display, + .internalDisplayRawAddr = display_ptr_val, + }); + if (!id_to_display_insert_result.second) { + return false; + } + auto display_to_id_insert_result = mDisplayToId.emplace(display_ptr_val, id); + if (!display_to_id_insert_result.second) { + mIdToDisplay.erase(id); + return false; + } + return true; +} + +ScopedAStatus EvsEnumerator::getUltrasonicsArrayList( + [[maybe_unused]] std::vector* list) { + // TODO(b/149874793): Add implementation for EVS Manager and Sample driver + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::openUltrasonicsArray( + [[maybe_unused]] const std::string& id, + [[maybe_unused]] std::shared_ptr* obj) { + // TODO(b/149874793): Add implementation for EVS Manager and Sample driver + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsEnumerator::closeUltrasonicsArray( + [[maybe_unused]] const std::shared_ptr& obj) { + // TODO(b/149874793): Add implementation for EVS Manager and Sample driver + return ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp b/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp new file mode 100644 index 0000000000..e5f8e4c84a --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp @@ -0,0 +1,417 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsGlDisplay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace { + +using ::aidl::android::frameworks::automotive::display::ICarDisplayProxy; +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::aidl::android::hardware::graphics::common::PixelFormat; +using ::android::base::ScopedLockAssertion; +using ::ndk::ScopedAStatus; + +constexpr auto kTimeout = std::chrono::seconds(1); + +bool debugFirstFrameDisplayed = false; + +int generateFingerPrint(buffer_handle_t handle) { + return static_cast(reinterpret_cast(handle) & 0xFFFFFFFF); +} + +} // namespace + +namespace aidl::android::hardware::automotive::evs::implementation { + +EvsGlDisplay::EvsGlDisplay(const std::shared_ptr& pDisplayProxy, + uint64_t displayId) + : mDisplayId(displayId), mDisplayProxy(pDisplayProxy) { + LOG(DEBUG) << "EvsGlDisplay instantiated"; + + // Set up our self description + // NOTE: These are arbitrary values chosen for testing + mInfo.id = std::to_string(displayId); + mInfo.vendorFlags = 3870; + + // Start a thread to render images on this display + { + std::lock_guard lock(mLock); + mState = RUN; + } + mRenderThread = std::thread([this]() { renderFrames(); }); +} + +EvsGlDisplay::~EvsGlDisplay() { + LOG(DEBUG) << "EvsGlDisplay being destroyed"; + forceShutdown(); +} + +/** + * This gets called if another caller "steals" ownership of the display + */ +void EvsGlDisplay::forceShutdown() { + LOG(DEBUG) << "EvsGlDisplay forceShutdown"; + { + std::lock_guard lock(mLock); + + // If the buffer isn't being held by a remote client, release it now as an + // optimization to release the resources more quickly than the destructor might + // get called. + if (mBuffer.handle != nullptr) { + // Report if we're going away while a buffer is outstanding + if (mBufferBusy || mState == RUN) { + LOG(ERROR) << "EvsGlDisplay going down while client is holding a buffer"; + } + mState = STOPPING; + } + + // Put this object into an unrecoverable error state since somebody else + // is going to own the display now. + mRequestedState = DisplayState::DEAD; + } + mBufferReadyToRender.notify_all(); + + if (mRenderThread.joinable()) { + mRenderThread.join(); + } +} + +/** + * Initialize GL in the context of a caller's thread and prepare a graphic + * buffer to use. + */ +bool EvsGlDisplay::initializeGlContextLocked() { + // Initialize our display window + // NOTE: This will cause the display to become "VISIBLE" before a frame is actually + // returned, which is contrary to the spec and will likely result in a black frame being + // (briefly) shown. + if (!mGlWrapper.initialize(mDisplayProxy, mDisplayId)) { + // Report the failure + LOG(ERROR) << "Failed to initialize GL display"; + return false; + } + + // Assemble the buffer description we'll use for our render target + static_assert(::aidl::android::hardware::graphics::common::PixelFormat::RGBA_8888 == + static_cast<::aidl::android::hardware::graphics::common::PixelFormat>( + HAL_PIXEL_FORMAT_RGBA_8888)); + mBuffer.description = { + .width = static_cast(mGlWrapper.getWidth()), + .height = static_cast(mGlWrapper.getHeight()), + .layers = 1, + .format = PixelFormat::RGBA_8888, + // FIXME: Below line is not using + // ::aidl::android::hardware::graphics::common::BufferUsage because + // BufferUsage enum does not support a bitwise-OR operation; they + // should be BufferUsage::GPU_RENDER_TARGET | + // BufferUsage::COMPOSER_OVERLAY + .usage = static_cast(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER), + }; + + ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); + uint32_t stride = static_cast(mBuffer.description.stride); + buffer_handle_t handle = nullptr; + const ::android::status_t result = + alloc.allocate(mBuffer.description.width, mBuffer.description.height, + static_cast<::android::PixelFormat>(mBuffer.description.format), + mBuffer.description.layers, + static_cast(mBuffer.description.usage), &handle, &stride, + /* requestorName= */ "EvsGlDisplay"); + mBuffer.description.stride = stride; + mBuffer.fingerprint = generateFingerPrint(mBuffer.handle); + if (result != ::android::NO_ERROR) { + LOG(ERROR) << "Error " << result << " allocating " << mBuffer.description.width << " x " + << mBuffer.description.height << " graphics buffer."; + mGlWrapper.shutdown(); + return false; + } + + mBuffer.handle = handle; + if (mBuffer.handle == nullptr) { + LOG(ERROR) << "We didn't get a buffer handle back from the allocator"; + mGlWrapper.shutdown(); + return false; + } + + LOG(DEBUG) << "Allocated new buffer " << mBuffer.handle << " with stride " + << mBuffer.description.stride; + return true; +} + +/** + * This method runs in a separate thread and renders the contents of the buffer. + */ +void EvsGlDisplay::renderFrames() { + { + std::lock_guard lock(mLock); + + if (!initializeGlContextLocked()) { + LOG(ERROR) << "Failed to initialize GL context"; + return; + } + + // Display buffer is ready. + mBufferBusy = false; + } + mBufferReadyToUse.notify_all(); + + while (true) { + { + std::unique_lock lock(mLock); + ScopedLockAssertion lock_assertion(mLock); + mBufferReadyToRender.wait( + lock, [this]() REQUIRES(mLock) { return mBufferReady || mState != RUN; }); + if (mState != RUN) { + LOG(DEBUG) << "A rendering thread is stopping"; + break; + } + mBufferReady = false; + } + + // Update the texture contents with the provided data + if (!mGlWrapper.updateImageTexture(mBuffer.handle, mBuffer.description)) { + LOG(WARNING) << "Failed to update the image texture"; + continue; + } + + // Put the image on the screen + mGlWrapper.renderImageToScreen(); + if (!debugFirstFrameDisplayed) { + LOG(DEBUG) << "EvsFirstFrameDisplayTiming start time: " << ::android::elapsedRealtime() + << " ms."; + debugFirstFrameDisplayed = true; + } + + // Mark current frame is consumed. + { + std::lock_guard lock(mLock); + mBufferBusy = false; + } + mBufferDone.notify_all(); + } + + LOG(DEBUG) << "A rendering thread is stopped."; + + // Drop the graphics buffer we've been using + ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); + alloc.free(mBuffer.handle); + mBuffer.handle = nullptr; + + mGlWrapper.hideWindow(mDisplayProxy, mDisplayId); + mGlWrapper.shutdown(); + + std::lock_guard lock(mLock); + mState = STOPPED; +} + +/** + * Returns basic information about the EVS display provided by the system. + * See the description of the DisplayDesc structure for details. + */ +ScopedAStatus EvsGlDisplay::getDisplayInfo(DisplayDesc* _aidl_return) { + if (!mDisplayProxy) { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::UNDERLYING_SERVICE_ERROR)); + } + + ::aidl::android::frameworks::automotive::display::DisplayDesc proxyDisplay; + auto status = mDisplayProxy->getDisplayInfo(mDisplayId, &proxyDisplay); + if (!status.isOk()) { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::UNDERLYING_SERVICE_ERROR)); + } + + _aidl_return->width = proxyDisplay.width; + _aidl_return->height = proxyDisplay.height; + _aidl_return->orientation = static_cast(proxyDisplay.orientation); + _aidl_return->id = mInfo.id; // FIXME: what should be ID here? + _aidl_return->vendorFlags = mInfo.vendorFlags; + return ::ndk::ScopedAStatus::ok(); +} + +/** + * Clients may set the display state to express their desired state. + * The HAL implementation must gracefully accept a request for any state + * while in any other state, although the response may be to ignore the request. + * The display is defined to start in the NOT_VISIBLE state upon initialization. + * The client is then expected to request the VISIBLE_ON_NEXT_FRAME state, and + * then begin providing video. When the display is no longer required, the client + * is expected to request the NOT_VISIBLE state after passing the last video frame. + */ +ScopedAStatus EvsGlDisplay::setDisplayState(DisplayState state) { + LOG(DEBUG) << __FUNCTION__; + std::lock_guard lock(mLock); + + if (mRequestedState == DisplayState::DEAD) { + // This object no longer owns the display -- it's been superceeded! + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + // Ensure we recognize the requested state so we don't go off the rails + static constexpr ::ndk::enum_range kDisplayStateRange; + if (std::find(kDisplayStateRange.begin(), kDisplayStateRange.end(), state) == + kDisplayStateRange.end()) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + switch (state) { + case DisplayState::NOT_VISIBLE: + mGlWrapper.hideWindow(mDisplayProxy, mDisplayId); + break; + case DisplayState::VISIBLE: + mGlWrapper.showWindow(mDisplayProxy, mDisplayId); + break; + default: + break; + } + + // Record the requested state + mRequestedState = state; + + return ScopedAStatus::ok(); +} + +/** + * The HAL implementation should report the actual current state, which might + * transiently differ from the most recently requested state. Note, however, that + * the logic responsible for changing display states should generally live above + * the device layer, making it undesirable for the HAL implementation to + * spontaneously change display states. + */ +ScopedAStatus EvsGlDisplay::getDisplayState(DisplayState* _aidl_return) { + LOG(DEBUG) << __FUNCTION__; + std::lock_guard lock(mLock); + *_aidl_return = mRequestedState; + return ScopedAStatus::ok(); +} + +/** + * This call returns a handle to a frame buffer associated with the display. + * This buffer may be locked and written to by software and/or GL. This buffer + * must be returned via a call to returnTargetBufferForDisplay() even if the + * display is no longer visible. + */ +ScopedAStatus EvsGlDisplay::getTargetBuffer(BufferDesc* _aidl_return) { + LOG(DEBUG) << __FUNCTION__; + std::unique_lock lock(mLock); + ScopedLockAssertion lock_assertion(mLock); + if (mRequestedState == DisplayState::DEAD) { + LOG(ERROR) << "Rejecting buffer request from object that lost ownership of the display."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + // If we don't already have a buffer, allocate one now + // mBuffer.memHandle is a type of buffer_handle_t, which is equal to + // native_handle_t*. + mBufferReadyToUse.wait(lock, [this]() REQUIRES(mLock) { return !mBufferBusy; }); + + // Do we have a frame available? + if (mBufferBusy) { + // This means either we have a 2nd client trying to compete for buffers + // (an unsupported mode of operation) or else the client hasn't returned + // a previously issued buffer yet (they're behaving badly). + // NOTE: We have to make the callback even if we have nothing to provide + LOG(ERROR) << "getTargetBuffer called while no buffers available."; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + } + + // Mark our buffer as busy + mBufferBusy = true; + + // Send the buffer to the client + LOG(VERBOSE) << "Providing display buffer handle " << mBuffer.handle; + + BufferDesc bufferDescToSend = { + .buffer = + { + .handle = std::move(::android::dupToAidl(mBuffer.handle)), + .description = mBuffer.description, + }, + .pixelSizeBytes = 4, // RGBA_8888 is 4-byte-per-pixel format + .bufferId = mBuffer.fingerprint, + }; + *_aidl_return = std::move(bufferDescToSend); + + return ScopedAStatus::ok(); +} + +/** + * This call tells the display that the buffer is ready for display. + * The buffer is no longer valid for use by the client after this call. + */ +ScopedAStatus EvsGlDisplay::returnTargetBufferForDisplay(const BufferDesc& buffer) { + LOG(VERBOSE) << __FUNCTION__; + std::unique_lock lock(mLock); + ScopedLockAssertion lock_assertion(mLock); + + // Nobody should call us with a null handle + if (buffer.buffer.handle.fds.size() < 1) { + LOG(ERROR) << __FUNCTION__ << " called without a valid buffer handle."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + if (buffer.bufferId != mBuffer.fingerprint) { + LOG(ERROR) << "Got an unrecognized frame returned."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + if (!mBufferBusy) { + LOG(ERROR) << "A frame was returned with no outstanding frames."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + // If we've been displaced by another owner of the display, then we can't do anything else + if (mRequestedState == DisplayState::DEAD) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + // If we were waiting for a new frame, this is it! + if (mRequestedState == DisplayState::VISIBLE_ON_NEXT_FRAME) { + mRequestedState = DisplayState::VISIBLE; + mGlWrapper.showWindow(mDisplayProxy, mDisplayId); + } + + // Validate we're in an expected state + if (mRequestedState != DisplayState::VISIBLE) { + // Not sure why a client would send frames back when we're not visible. + LOG(WARNING) << "Got a frame returned while not visible - ignoring."; + return ScopedAStatus::ok(); + } + mBufferReady = true; + mBufferReadyToRender.notify_all(); + + if (!mBufferDone.wait_for(lock, kTimeout, [this]() REQUIRES(mLock) { return !mBufferBusy; })) { + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::UNDERLYING_SERVICE_ERROR)); + } + + return ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp new file mode 100644 index 0000000000..797b22154b --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp @@ -0,0 +1,735 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsMockCamera.h" +#include "ConfigManager.h" +#include "EvsEnumerator.h" + +#include +#include +#include +#include + +#include + +namespace { + +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::ndk::ScopedAStatus; + +// Arbitrary limit on number of graphics buffers allowed to be allocated +// Safeguards against unreasonable resource consumption and provides a testable limit +constexpr unsigned kMaxBuffersInFlight = 100; + +// Minimum number of buffers to run a video stream +constexpr int kMinimumBuffersInFlight = 1; + +// Colors for the colorbar test pattern in ABGR format +constexpr uint32_t kColors[] = { + 0xFFFFFFFF, // white + 0xFF00FFFF, // yellow + 0xFFFFFF00, // cyan + 0xFF00FF00, // green + 0xFFFF00FF, // fuchsia + 0xFF0000FF, // red + 0xFFFF0000, // blue + 0xFF000000, // black +}; +constexpr size_t kNumColors = sizeof(kColors) / sizeof(kColors[0]); + +} // namespace + +namespace aidl::android::hardware::automotive::evs::implementation { + +EvsMockCamera::EvsMockCamera([[maybe_unused]] Sigil sigil, const char* id, + std::unique_ptr& camInfo) + : mFramesAllowed(0), mFramesInUse(0), mStreamState(STOPPED), mCameraInfo(camInfo) { + LOG(DEBUG) << __FUNCTION__; + + /* set a camera id */ + mDescription.id = id; + + /* set camera metadata */ + if (camInfo) { + uint8_t* ptr = reinterpret_cast(camInfo->characteristics); + const size_t len = get_camera_metadata_size(camInfo->characteristics); + mDescription.metadata.insert(mDescription.metadata.end(), ptr, ptr + len); + } + + // Initialize parameters. + initializeParameters(); +} + +EvsMockCamera::~EvsMockCamera() { + LOG(DEBUG) << __FUNCTION__; + shutdown(); +} + +void EvsMockCamera::initializeParameters() { + mParams.emplace( + CameraParam::BRIGHTNESS, + new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); + mParams.emplace( + CameraParam::CONTRAST, + new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); + mParams.emplace( + CameraParam::SHARPNESS, + new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); +} + +// This gets called if another caller "steals" ownership of the camera +void EvsMockCamera::shutdown() { + LOG(DEBUG) << __FUNCTION__; + + // Make sure our output stream is cleaned up + // (It really should be already) + stopVideoStream_impl(); + + // Claim the lock while we work on internal state + std::lock_guard lock(mAccessLock); + + // Drop all the graphics buffers we've been using + if (mBuffers.size() > 0) { + ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); + for (auto&& rec : mBuffers) { + if (rec.inUse) { + LOG(WARNING) << "WARNING: releasing a buffer remotely owned."; + } + alloc.free(rec.handle); + rec.handle = nullptr; + } + mBuffers.clear(); + } + + // Put this object into an unrecoverable error state since somebody else + // is going to own the underlying camera now + mStreamState = DEAD; +} + +// Methods from ::aidl::android::hardware::automotive::evs::IEvsCamera follow. +ScopedAStatus EvsMockCamera::getCameraInfo(CameraDesc* _aidl_return) { + LOG(DEBUG) << __FUNCTION__; + + // Send back our self description + *_aidl_return = mDescription; + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::setMaxFramesInFlight(int32_t bufferCount) { + LOG(DEBUG) << __FUNCTION__ << ", bufferCount = " << bufferCount; + ; + + std::lock_guard lock(mAccessLock); + + // If we've been displaced by another owner of the camera, then we can't do anything else + if (mStreamState == DEAD) { + LOG(ERROR) << "Ignoring setMaxFramesInFlight call when camera has been lost."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + // We cannot function without at least one video buffer to send data + if (bufferCount < 1) { + LOG(ERROR) << "Ignoring setMaxFramesInFlight with less than one buffer requested."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + // Update our internal state + if (!setAvailableFrames_Locked(bufferCount)) { + LOG(ERROR) << "Failed to adjust the maximum number of frames in flight."; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + } + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::startVideoStream(const std::shared_ptr& cb) { + LOG(DEBUG) << __FUNCTION__; + + if (!cb) { + LOG(ERROR) << "A given stream callback is invalid."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + std::lock_guard lock(mAccessLock); + + // If we've been displaced by another owner of the camera, then we can't do anything else + if (mStreamState == DEAD) { + LOG(ERROR) << "Ignoring startVideoStream call when camera has been lost."; + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); + } + + if (mStreamState != STOPPED) { + LOG(ERROR) << "Ignoring startVideoStream call when a stream is already running."; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::STREAM_ALREADY_RUNNING)); + } + + // If the client never indicated otherwise, configure ourselves for a single streaming buffer + if (mFramesAllowed < kMinimumBuffersInFlight && + !setAvailableFrames_Locked(kMinimumBuffersInFlight)) { + LOG(ERROR) << "Failed to start stream because we couldn't get a graphics buffer"; + return ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + } + + // Record the user's callback for use when we have a frame ready + mStream = cb; + + // Start the frame generation thread + mStreamState = RUNNING; + mCaptureThread = std::thread([this]() { generateFrames(); }); + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::doneWithFrame(const std::vector& list) { + std::lock_guard lock(mAccessLock); + for (const auto& desc : list) { + returnBufferLocked(desc.bufferId); + } + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::stopVideoStream() { + LOG(DEBUG) << __FUNCTION__; + return stopVideoStream_impl(); +} + +ScopedAStatus EvsMockCamera::stopVideoStream_impl() { + std::unique_lock lock(mAccessLock); + + if (mStreamState != RUNNING) { + // Safely return here because a stream is not running. + return ScopedAStatus::ok(); + } + + // Tell the GenerateFrames loop we want it to stop + mStreamState = STOPPING; + + // Block outside the mutex until the "stop" flag has been acknowledged + // We won't send any more frames, but the client might still get some already in flight + LOG(DEBUG) << "Waiting for stream thread to end..."; + lock.unlock(); + if (mCaptureThread.joinable()) { + mCaptureThread.join(); + } + lock.lock(); + + mStreamState = STOPPED; + mStream = nullptr; + LOG(DEBUG) << "Stream marked STOPPED."; + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::getExtendedInfo(int32_t opaqueIdentifier, + std::vector* opaqueValue) { + const auto it = mExtInfo.find(opaqueIdentifier); + if (it == mExtInfo.end()) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } else { + *opaqueValue = mExtInfo[opaqueIdentifier]; + } + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::setExtendedInfo(int32_t opaqueIdentifier, + const std::vector& opaqueValue) { + mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue); + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::getPhysicalCameraInfo([[maybe_unused]] const std::string& id, + CameraDesc* _aidl_return) { + LOG(DEBUG) << __FUNCTION__; + + // This method works exactly same as getCameraInfo() in EVS HW module. + *_aidl_return = mDescription; + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::pauseVideoStream() { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); +} + +ScopedAStatus EvsMockCamera::resumeVideoStream() { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); +} + +ScopedAStatus EvsMockCamera::setPrimaryClient() { + /* Because EVS HW module reference implementation expects a single client at + * a time, this returns a success code always. + */ + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::forcePrimaryClient(const std::shared_ptr&) { + /* Because EVS HW module reference implementation expects a single client at + * a time, this returns a success code always. + */ + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::unsetPrimaryClient() { + /* Because EVS HW module reference implementation expects a single client at + * a time, there is no chance that this is called by the secondary client and + * therefore returns a success code always. + */ + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::getParameterList(std::vector* _aidl_return) { + if (mCameraInfo) { + _aidl_return->resize(mCameraInfo->controls.size()); + auto idx = 0; + for (auto& [name, range] : mCameraInfo->controls) { + (*_aidl_return)[idx++] = name; + } + } + + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::getIntParameterRange(CameraParam id, ParameterRange* _aidl_return) { + auto it = mParams.find(id); + if (it == mParams.end()) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); + } + + _aidl_return->min = it->second->range.min; + _aidl_return->max = it->second->range.max; + _aidl_return->step = it->second->range.step; + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::setIntParameter(CameraParam id, int32_t value, + std::vector* effectiveValue) { + auto it = mParams.find(id); + if (it == mParams.end()) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); + } + + // Rounding down to the closest value. + int32_t candidate = value / it->second->range.step * it->second->range.step; + if (candidate < it->second->range.min || candidate > it->second->range.max) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); + } + + it->second->value = candidate; + effectiveValue->push_back(candidate); + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::getIntParameter(CameraParam id, std::vector* value) { + auto it = mParams.find(id); + if (it == mParams.end()) { + return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); + } + + value->push_back(it->second->value); + return ScopedAStatus::ok(); +} + +ScopedAStatus EvsMockCamera::importExternalBuffers(const std::vector& buffers, + int32_t* _aidl_return) { + size_t numBuffersToAdd = buffers.size(); + if (numBuffersToAdd < 1) { + LOG(DEBUG) << "Ignoring a request to import external buffers with an empty list."; + return ScopedAStatus::ok(); + } + + std::lock_guard lock(mAccessLock); + if (numBuffersToAdd > (kMaxBuffersInFlight - mFramesAllowed)) { + numBuffersToAdd -= (kMaxBuffersInFlight - mFramesAllowed); + LOG(WARNING) << "Exceed the limit on the number of buffers. " << numBuffersToAdd + << " buffers will be imported only."; + } + + ::android::GraphicBufferMapper& mapper = ::android::GraphicBufferMapper::get(); + const size_t before = mFramesAllowed; + for (size_t i = 0; i < numBuffersToAdd; ++i) { + auto& b = buffers[i]; + const AHardwareBuffer_Desc* pDesc = + reinterpret_cast(&b.buffer.description); + + buffer_handle_t handleToImport = ::android::dupFromAidl(b.buffer.handle); + buffer_handle_t handleToStore = nullptr; + if (handleToImport == nullptr) { + LOG(WARNING) << "Failed to duplicate a memory handle. Ignoring a buffer " << b.bufferId; + continue; + } + + ::android::status_t result = + mapper.importBuffer(handleToImport, pDesc->width, pDesc->height, pDesc->layers, + pDesc->format, pDesc->usage, pDesc->stride, &handleToStore); + if (result != ::android::NO_ERROR || handleToStore == nullptr) { + LOG(WARNING) << "Failed to import a buffer " << b.bufferId; + continue; + } + + bool stored = false; + for (auto&& rec : mBuffers) { + if (rec.handle != nullptr) { + continue; + } + + // Use this existing entry. + rec.handle = handleToStore; + rec.inUse = false; + stored = true; + break; + } + + if (!stored) { + // Add a BufferRecord wrapping this handle to our set of available buffers. + mBuffers.push_back(BufferRecord(handleToStore)); + } + ++mFramesAllowed; + } + + *_aidl_return = mFramesAllowed - before; + return ScopedAStatus::ok(); +} + +bool EvsMockCamera::setAvailableFrames_Locked(unsigned bufferCount) { + if (bufferCount < 1) { + LOG(ERROR) << "Ignoring request to set buffer count to zero"; + return false; + } + if (bufferCount > kMaxBuffersInFlight) { + LOG(ERROR) << "Rejecting buffer request in excess of internal limit"; + return false; + } + + // Is an increase required? + if (mFramesAllowed < bufferCount) { + // An increase is required + auto needed = bufferCount - mFramesAllowed; + LOG(INFO) << "Allocating " << needed << " buffers for camera frames"; + + auto added = increaseAvailableFrames_Locked(needed); + if (added != needed) { + // If we didn't add all the frames we needed, then roll back to the previous state + LOG(ERROR) << "Rolling back to previous frame queue size"; + decreaseAvailableFrames_Locked(added); + return false; + } + } else if (mFramesAllowed > bufferCount) { + // A decrease is required + auto framesToRelease = mFramesAllowed - bufferCount; + LOG(INFO) << "Returning " << framesToRelease << " camera frame buffers"; + + auto released = decreaseAvailableFrames_Locked(framesToRelease); + if (released != framesToRelease) { + // This shouldn't happen with a properly behaving client because the client + // should only make this call after returning sufficient outstanding buffers + // to allow a clean resize. + LOG(ERROR) << "Buffer queue shrink failed -- too many buffers currently in use?"; + } + } + + return true; +} + +unsigned EvsMockCamera::increaseAvailableFrames_Locked(unsigned numToAdd) { + // Acquire the graphics buffer allocator + ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); + + unsigned added = 0; + while (added < numToAdd) { + unsigned pixelsPerLine = 0; + buffer_handle_t memHandle = nullptr; + auto result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, &memHandle, + &pixelsPerLine, 0, "EvsMockCamera"); + if (result != ::android::NO_ERROR) { + LOG(ERROR) << "Error " << result << " allocating " << mWidth << " x " << mHeight + << " graphics buffer"; + break; + } + if (memHandle == nullptr) { + LOG(ERROR) << "We didn't get a buffer handle back from the allocator"; + break; + } + if (mStride > 0) { + if (mStride != pixelsPerLine) { + LOG(ERROR) << "We did not expect to get buffers with different strides!"; + } + } else { + // Gralloc defines stride in terms of pixels per line + mStride = pixelsPerLine; + } + + // Find a place to store the new buffer + auto stored = false; + for (auto&& rec : mBuffers) { + if (rec.handle == nullptr) { + // Use this existing entry + rec.handle = memHandle; + rec.inUse = false; + stored = true; + break; + } + } + if (!stored) { + // Add a BufferRecord wrapping this handle to our set of available buffers + mBuffers.push_back(BufferRecord(memHandle)); + } + + ++mFramesAllowed; + ++added; + } + + return added; +} + +unsigned EvsMockCamera::decreaseAvailableFrames_Locked(unsigned numToRemove) { + // Acquire the graphics buffer allocator + ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); + + unsigned removed = 0; + for (auto&& rec : mBuffers) { + // Is this record not in use, but holding a buffer that we can free? + if ((rec.inUse == false) && (rec.handle != nullptr)) { + // Release buffer and update the record so we can recognize it as "empty" + alloc.free(rec.handle); + rec.handle = nullptr; + + --mFramesAllowed; + ++removed; + + if (removed == numToRemove) { + break; + } + } + } + + return removed; +} + +// This is the asynchronous frame generation thread that runs in parallel with the +// main serving thread. There is one for each active camera instance. +void EvsMockCamera::generateFrames() { + LOG(DEBUG) << "Frame generation loop started."; + + unsigned idx = 0; + while (true) { + bool timeForFrame = false; + const nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC); + + // Lock scope for updating shared state + { + std::lock_guard lock(mAccessLock); + + if (mStreamState != RUNNING) { + // Break out of our main thread loop + break; + } + + // Are we allowed to issue another buffer? + if (mFramesInUse >= mFramesAllowed) { + // Can't do anything right now -- skip this frame + LOG(WARNING) << "Skipped a frame because too many are in flight."; + } else { + // Identify an available buffer to fill + for (idx = 0; idx < mBuffers.size(); idx++) { + if (!mBuffers[idx].inUse) { + if (mBuffers[idx].handle != nullptr) { + // Found an available record, so stop looking + break; + } + } + } + if (idx >= mBuffers.size()) { + // This shouldn't happen since we already checked mFramesInUse vs mFramesAllowed + ALOGE("Failed to find an available buffer slot\n"); + } else { + // We're going to make the frame busy + mBuffers[idx].inUse = true; + mFramesInUse++; + timeForFrame = true; + } + } + } + + if (timeForFrame) { + using AidlPixelFormat = ::aidl::android::hardware::graphics::common::PixelFormat; + + // Assemble the buffer description we'll transmit below + buffer_handle_t memHandle = mBuffers[idx].handle; + BufferDesc newBuffer = { + .buffer = + { + .description = + { + .width = static_cast(mWidth), + .height = static_cast(mHeight), + .layers = 1, + .format = static_cast(mFormat), + .usage = static_cast(mUsage), + .stride = static_cast(mStride), + }, + .handle = ::android::dupToAidl(memHandle), + }, + .bufferId = static_cast(idx), + .deviceId = mDescription.id, + .timestamp = static_cast(::android::elapsedRealtimeNano() * + 1e+3), // timestamps is in microseconds + }; + + // Write test data into the image buffer + fillMockFrame(memHandle, reinterpret_cast( + &newBuffer.buffer.description)); + + // Issue the (asynchronous) callback to the client -- can't be holding the lock + auto flag = false; + if (mStream) { + std::vector frames; + frames.push_back(std::move(newBuffer)); + flag = mStream->deliverFrame(frames).isOk(); + } + + if (flag) { + LOG(DEBUG) << "Delivered " << memHandle << ", id = " << mBuffers[idx].handle; + } else { + // This can happen if the client dies and is likely unrecoverable. + // To avoid consuming resources generating failing calls, we stop sending + // frames. Note, however, that the stream remains in the "STREAMING" state + // until cleaned up on the main thread. + LOG(ERROR) << "Frame delivery call failed in the transport layer."; + + // Since we didn't actually deliver it, mark the frame as available + std::lock_guard lock(mAccessLock); + mBuffers[idx].inUse = false; + mFramesInUse--; + } + } + + // We arbitrarily choose to generate frames at 15 fps to ensure we pass the 10fps test + // requirement + static const int kTargetFrameRate = 15; + static const nsecs_t kTargetFrameIntervalUs = 1000 * 1000 / kTargetFrameRate; + const nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); + const nsecs_t elapsedTimeUs = (now - startTime) / 1000; + const nsecs_t sleepDurationUs = kTargetFrameIntervalUs - elapsedTimeUs; + if (sleepDurationUs > 0) { + usleep(sleepDurationUs); + } + } + + // If we've been asked to stop, send an event to signal the actual end of stream + EvsEventDesc event = { + .aType = EvsEventType::STREAM_STOPPED, + }; + if (!mStream->notify(event).isOk()) { + ALOGE("Error delivering end of stream marker"); + } + + return; +} + +void EvsMockCamera::fillMockFrame(buffer_handle_t handle, const AHardwareBuffer_Desc* pDesc) { + // Lock our output buffer for writing + uint32_t* pixels = nullptr; + ::android::GraphicBufferMapper& mapper = ::android::GraphicBufferMapper::get(); + mapper.lock(handle, GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_NEVER, + ::android::Rect(pDesc->width, pDesc->height), (void**)&pixels); + + // If we failed to lock the pixel buffer, we're about to crash, but log it first + if (!pixels) { + ALOGE("Camera failed to gain access to image buffer for writing"); + return; + } + + // Fill in the test pixels; the colorbar in ABGR format + for (unsigned row = 0; row < pDesc->height; row++) { + for (unsigned col = 0; col < pDesc->width; col++) { + const uint32_t index = col * kNumColors / pDesc->width; + pixels[col] = kColors[index]; + } + // Point to the next row + // NOTE: stride retrieved from gralloc is in units of pixels + pixels = pixels + pDesc->stride; + } + + // Release our output buffer + mapper.unlock(handle); +} + +void EvsMockCamera::returnBufferLocked(const uint32_t bufferId) { + if (bufferId >= mBuffers.size()) { + ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)", bufferId, + mBuffers.size() - 1); + return; + } + + if (!mBuffers[bufferId].inUse) { + ALOGE("ignoring doneWithFrame called on frame %d which is already free", bufferId); + return; + } + + // Mark the frame as available + mBuffers[bufferId].inUse = false; + mFramesInUse--; + + // If this frame's index is high in the array, try to move it down + // to improve locality after mFramesAllowed has been reduced. + if (bufferId >= mFramesAllowed) { + // Find an empty slot lower in the array (which should always exist in this case) + for (auto&& rec : mBuffers) { + if (rec.handle == nullptr) { + rec.handle = mBuffers[bufferId].handle; + mBuffers[bufferId].handle = nullptr; + break; + } + } + } +} + +std::shared_ptr EvsMockCamera::Create(const char* deviceName) { + std::unique_ptr nullCamInfo = nullptr; + + return Create(deviceName, nullCamInfo); +} + +std::shared_ptr EvsMockCamera::Create( + const char* deviceName, std::unique_ptr& camInfo, + [[maybe_unused]] const Stream* streamCfg) { + std::shared_ptr c = + ndk::SharedRefBase::make(Sigil{}, deviceName, camInfo); + if (!c) { + LOG(ERROR) << "Failed to instantiate EvsMockCamera."; + return nullptr; + } + + // Use the first resolution from the list for the testing + // TODO(b/214835237): Uses a given Stream configuration to choose the best + // stream configuration. + auto it = camInfo->streamConfigurations.begin(); + c->mWidth = it->second.width; + c->mHeight = it->second.height; + c->mDescription.vendorFlags = 0xFFFFFFFF; // Arbitrary test value + + c->mFormat = HAL_PIXEL_FORMAT_RGBA_8888; + c->mUsage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_CAMERA_WRITE | + GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY; + + return c; +} + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/GlWrapper.cpp b/automotive/evs/aidl/impl/default/src/GlWrapper.cpp new file mode 100644 index 0000000000..0ee5ecb734 --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/GlWrapper.cpp @@ -0,0 +1,465 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "GlWrapper.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +namespace { + +using ::aidl::android::frameworks::automotive::display::DisplayDesc; +using ::aidl::android::frameworks::automotive::display::ICarDisplayProxy; +using ::aidl::android::frameworks::automotive::display::Rotation; +using ::aidl::android::hardware::common::NativeHandle; +using ::aidl::android::hardware::graphics::common::HardwareBufferDescription; +using ::android::GraphicBuffer; +using ::android::sp; + +constexpr const char vertexShaderSource[] = + "attribute vec4 pos; \n" + "attribute vec2 tex; \n" + "varying vec2 uv; \n" + "void main() \n" + "{ \n" + " gl_Position = pos; \n" + " uv = tex; \n" + "} \n"; + +constexpr const char pixelShaderSource[] = + "precision mediump float; \n" + "uniform sampler2D tex; \n" + "varying vec2 uv; \n" + "void main() \n" + "{ \n" + " gl_FragColor = texture2D(tex, uv);\n" + "} \n"; + +const char* getEGLError(void) { + switch (eglGetError()) { + case EGL_SUCCESS: + return "EGL_SUCCESS"; + case EGL_NOT_INITIALIZED: + return "EGL_NOT_INITIALIZED"; + case EGL_BAD_ACCESS: + return "EGL_BAD_ACCESS"; + case EGL_BAD_ALLOC: + return "EGL_BAD_ALLOC"; + case EGL_BAD_ATTRIBUTE: + return "EGL_BAD_ATTRIBUTE"; + case EGL_BAD_CONTEXT: + return "EGL_BAD_CONTEXT"; + case EGL_BAD_CONFIG: + return "EGL_BAD_CONFIG"; + case EGL_BAD_CURRENT_SURFACE: + return "EGL_BAD_CURRENT_SURFACE"; + case EGL_BAD_DISPLAY: + return "EGL_BAD_DISPLAY"; + case EGL_BAD_SURFACE: + return "EGL_BAD_SURFACE"; + case EGL_BAD_MATCH: + return "EGL_BAD_MATCH"; + case EGL_BAD_PARAMETER: + return "EGL_BAD_PARAMETER"; + case EGL_BAD_NATIVE_PIXMAP: + return "EGL_BAD_NATIVE_PIXMAP"; + case EGL_BAD_NATIVE_WINDOW: + return "EGL_BAD_NATIVE_WINDOW"; + case EGL_CONTEXT_LOST: + return "EGL_CONTEXT_LOST"; + default: + return "Unknown error"; + } +} + +// Given shader source, load and compile it +GLuint loadShader(GLenum type, const char* shaderSrc) { + // Create the shader object + GLuint shader = glCreateShader(type); + if (shader == 0) { + return 0; + } + + // Load and compile the shader + glShaderSource(shader, 1, &shaderSrc, nullptr); + glCompileShader(shader); + + // Verify the compilation worked as expected + GLint compiled = 0; + glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); + if (!compiled) { + LOG(ERROR) << "Error compiling shader"; + + GLint size = 0; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &size); + if (size > 0) { + // Get and report the error message + char* infoLog = (char*)malloc(size); + glGetShaderInfoLog(shader, size, nullptr, infoLog); + LOG(ERROR) << " msg:" << std::endl << infoLog; + free(infoLog); + } + + glDeleteShader(shader); + return 0; + } + + return shader; +} + +// Create a program object given vertex and pixels shader source +GLuint buildShaderProgram(const char* vtxSrc, const char* pxlSrc) { + GLuint program = glCreateProgram(); + if (program == 0) { + LOG(ERROR) << "Failed to allocate program object"; + return 0; + } + + // Compile the shaders and bind them to this program + GLuint vertexShader = loadShader(GL_VERTEX_SHADER, vtxSrc); + if (vertexShader == 0) { + LOG(ERROR) << "Failed to load vertex shader"; + glDeleteProgram(program); + return 0; + } + GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pxlSrc); + if (pixelShader == 0) { + LOG(ERROR) << "Failed to load pixel shader"; + glDeleteProgram(program); + glDeleteShader(vertexShader); + return 0; + } + glAttachShader(program, vertexShader); + glAttachShader(program, pixelShader); + + glBindAttribLocation(program, 0, "pos"); + glBindAttribLocation(program, 1, "tex"); + + // Link the program + glLinkProgram(program); + GLint linked = 0; + glGetProgramiv(program, GL_LINK_STATUS, &linked); + if (!linked) { + LOG(ERROR) << "Error linking program"; + GLint size = 0; + glGetProgramiv(program, GL_INFO_LOG_LENGTH, &size); + if (size > 0) { + // Get and report the error message + char* infoLog = (char*)malloc(size); + glGetProgramInfoLog(program, size, nullptr, infoLog); + LOG(ERROR) << " msg: " << infoLog; + free(infoLog); + } + + glDeleteProgram(program); + glDeleteShader(vertexShader); + glDeleteShader(pixelShader); + return 0; + } + + return program; +} + +::android::sp convertNativeHandleToHGBP(const NativeHandle& aidlHandle) { + native_handle_t* handle = ::android::dupFromAidl(aidlHandle); + if (handle->numFds != 0 || handle->numInts < std::ceil(sizeof(size_t) / sizeof(int))) { + LOG(ERROR) << "Invalid native handle"; + return nullptr; + } + ::android::hardware::hidl_vec halToken; + halToken.setToExternal(reinterpret_cast(const_cast(&(handle->data[1]))), + handle->data[0]); + ::android::sp hgbp = + HGraphicBufferProducer::castFrom(::android::retrieveHalInterface(halToken)); + return std::move(hgbp); +} + +} // namespace + +namespace aidl::android::hardware::automotive::evs::implementation { + +// Main entry point +bool GlWrapper::initialize(const std::shared_ptr& pWindowProxy, + uint64_t displayId) { + LOG(DEBUG) << __FUNCTION__; + + if (!pWindowProxy) { + LOG(ERROR) << "Could not get ICarDisplayProxy."; + return false; + } + + DisplayDesc displayDesc; + auto status = pWindowProxy->getDisplayInfo(displayId, &displayDesc); + if (!status.isOk()) { + LOG(ERROR) << "Failed to read the display information"; + return false; + } + + mWidth = displayDesc.width; + mHeight = displayDesc.height; + if ((displayDesc.orientation != Rotation::ROTATION_0) && + (displayDesc.orientation != Rotation::ROTATION_180)) { + std::swap(mWidth, mHeight); + } + LOG(INFO) << "Display resolution is " << mWidth << "x" << mHeight; + + NativeHandle aidlHandle; + status = pWindowProxy->getHGraphicBufferProducer(displayId, &aidlHandle); + if (!status.isOk()) { + LOG(ERROR) << "Failed to get IGraphicBufferProducer from ICarDisplayProxy."; + return false; + } + + mGfxBufferProducer = convertNativeHandleToHGBP(aidlHandle); + if (!mGfxBufferProducer) { + LOG(ERROR) << "Failed to convert a NativeHandle to HGBP."; + return false; + } + + mSurfaceHolder = getSurfaceFromHGBP(mGfxBufferProducer); + if (mSurfaceHolder == nullptr) { + LOG(ERROR) << "Failed to get a Surface from HGBP."; + return false; + } + + mWindow = getNativeWindow(mSurfaceHolder.get()); + if (mWindow == nullptr) { + LOG(ERROR) << "Failed to get a native window from Surface."; + return false; + } + + // Set up our OpenGL ES context associated with the default display + mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); + if (mDisplay == EGL_NO_DISPLAY) { + LOG(ERROR) << "Failed to get egl display"; + return false; + } + + EGLint major = 2; + EGLint minor = 0; + if (!eglInitialize(mDisplay, &major, &minor)) { + LOG(ERROR) << "Failed to initialize EGL: " << getEGLError(); + return false; + } + + const EGLint config_attribs[] = { + // clang-format off + // Tag Value + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_DEPTH_SIZE, 0, + EGL_NONE + // clang-format on + }; + + // Pick the default configuration without constraints (is this good enough?) + EGLConfig egl_config = {0}; + EGLint numConfigs = -1; + eglChooseConfig(mDisplay, config_attribs, &egl_config, 1, &numConfigs); + if (numConfigs != 1) { + LOG(ERROR) << "Didn't find a suitable format for our display window, " << getEGLError(); + return false; + } + + // Create the EGL render target surface + mSurface = eglCreateWindowSurface(mDisplay, egl_config, mWindow, nullptr); + if (mSurface == EGL_NO_SURFACE) { + LOG(ERROR) << "eglCreateWindowSurface failed, " << getEGLError(); + return false; + } + + // Create the EGL context + // NOTE: Our shader is (currently at least) written to require version 3, so this + // is required. + const EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE}; + mContext = eglCreateContext(mDisplay, egl_config, EGL_NO_CONTEXT, context_attribs); + if (mContext == EGL_NO_CONTEXT) { + LOG(ERROR) << "Failed to create OpenGL ES Context: " << getEGLError(); + return false; + } + + // Activate our render target for drawing + if (!eglMakeCurrent(mDisplay, mSurface, mSurface, mContext)) { + LOG(ERROR) << "Failed to make the OpenGL ES Context current: " << getEGLError(); + return false; + } + + // Create the shader program for our simple pipeline + mShaderProgram = buildShaderProgram(vertexShaderSource, pixelShaderSource); + if (!mShaderProgram) { + LOG(ERROR) << "Failed to build shader program: " << getEGLError(); + return false; + } + + // Create a GL texture that will eventually wrap our externally created texture surface(s) + glGenTextures(1, &mTextureMap); + if (mTextureMap <= 0) { + LOG(ERROR) << "Didn't get a texture handle allocated: " << getEGLError(); + return false; + } + + // Turn off mip-mapping for the created texture surface + // (the inbound camera imagery doesn't have MIPs) + glBindTexture(GL_TEXTURE_2D, mTextureMap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, 0); + + return true; +} + +void GlWrapper::shutdown() { + // Drop our device textures + if (mKHRimage != EGL_NO_IMAGE_KHR) { + eglDestroyImageKHR(mDisplay, mKHRimage); + mKHRimage = EGL_NO_IMAGE_KHR; + } + + // Release all GL resources + if (eglGetCurrentContext() == mContext) { + eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + } + eglDestroySurface(mDisplay, mSurface); + eglDestroyContext(mDisplay, mContext); + eglTerminate(mDisplay); + mSurface = EGL_NO_SURFACE; + mContext = EGL_NO_CONTEXT; + mDisplay = EGL_NO_DISPLAY; + + // Release the window + mSurfaceHolder = nullptr; +} + +void GlWrapper::showWindow(const std::shared_ptr& pWindowProxy, uint64_t id) { + if (pWindowProxy) { + pWindowProxy->showWindow(id); + } else { + LOG(ERROR) << "ICarDisplayProxy is not available."; + } +} + +void GlWrapper::hideWindow(const std::shared_ptr& pWindowProxy, uint64_t id) { + if (pWindowProxy) { + pWindowProxy->hideWindow(id); + } else { + LOG(ERROR) << "ICarDisplayProxy is not available."; + } +} + +bool GlWrapper::updateImageTexture(buffer_handle_t handle, + const HardwareBufferDescription& description) { + if (mKHRimage != EGL_NO_IMAGE_KHR) { + return true; + } + + // Create a temporary GraphicBuffer to wrap the provided handle. + sp pGfxBuffer = + new GraphicBuffer(description.width, description.height, + static_cast<::android::PixelFormat>(description.format), + description.layers, static_cast(description.usage), + description.stride, const_cast(handle), + /* keepOwnership= */ false); + if (!pGfxBuffer) { + LOG(ERROR) << "Failed to allocate GraphicBuffer to wrap our native handle"; + return false; + } + + // Get a GL compatible reference to the graphics buffer we've been given + EGLint eglImageAttributes[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; + EGLClientBuffer cbuf = static_cast(pGfxBuffer->getNativeBuffer()); + mKHRimage = eglCreateImageKHR(mDisplay, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, cbuf, + eglImageAttributes); + if (mKHRimage == EGL_NO_IMAGE_KHR) { + LOG(ERROR) << "Error creating EGLImage: " << getEGLError(); + return false; + } + + // Update the texture handle we already created to refer to this gralloc buffer + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, mTextureMap); + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast(mKHRimage)); + + return true; +} + +void GlWrapper::renderImageToScreen() { + // Set the viewport + glViewport(0, 0, mWidth, mHeight); + + // Clear the color buffer + glClearColor(0.1f, 0.5f, 0.1f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + // Select our screen space simple texture shader + glUseProgram(mShaderProgram); + + // Bind the texture and assign it to the shader's sampler + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, mTextureMap); + GLint sampler = glGetUniformLocation(mShaderProgram, "tex"); + glUniform1i(sampler, 0); + + // We want our image to show up opaque regardless of alpha values + glDisable(GL_BLEND); + + // Draw a rectangle on the screen + GLfloat vertsCarPos[] = { + // clang-format off + -0.8, 0.8, 0.0f, // left top in window space + 0.8, 0.8, 0.0f, // right top + -0.8, -0.8, 0.0f, // left bottom + 0.8, -0.8, 0.0f // right bottom + // clang-format on + }; + + // NOTE: We didn't flip the image in the texture, so V=0 is actually the top of the image + GLfloat vertsCarTex[] = { + // clang-format off + 0.0f, 0.0f, // left top + 1.0f, 0.0f, // right top + 0.0f, 1.0f, // left bottom + 1.0f, 1.0f // right bottom + // clang-format on + }; + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vertsCarPos); + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, vertsCarTex); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + // Clean up and flip the rendered result to the front so it is visible + glDisableVertexAttribArray(0); + glDisableVertexAttribArray(1); + + glFinish(); + + if (eglSwapBuffers(mDisplay, mSurface) == EGL_FALSE) { + LOG(WARNING) << "Failed to swap EGL buffers, " << getEGLError(); + } +} + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/service.cpp b/automotive/evs/aidl/impl/default/src/service.cpp index 0a0913fd3c..7532d8735f 100644 --- a/automotive/evs/aidl/impl/default/src/service.cpp +++ b/automotive/evs/aidl/impl/default/src/service.cpp @@ -14,38 +14,75 @@ * limitations under the License. */ -#define LOG_TAG "EvsService" - -#include +#include "EvsEnumerator.h" +#include "EvsGlDisplay.h" #include #include #include -using ::aidl::android::hardware::automotive::evs::implementation::DefaultEvsEnumerator; +#include -int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) { - std::shared_ptr vhal = ndk::SharedRefBase::make(); +#include +#include +#include - ALOGI("Registering as service..."); - binder_exception_t err = - AServiceManager_addService(vhal->asBinder().get(), "android.hardware.automotive.evs"); +namespace { + +using ::aidl::android::frameworks::automotive::display::ICarDisplayProxy; +using ::aidl::android::hardware::automotive::evs::implementation::EvsEnumerator; + +constexpr std::string_view kDisplayServiceInstanceName = "/default"; +constexpr std::string_view kHwInstanceName = "/hw/0"; +constexpr int kNumBinderThreads = 1; + +} // namespace + +int main() { + LOG(INFO) << "EVS Hardware Enumerator service is starting"; + + const std::string displayServiceInstanceName = + std::string(ICarDisplayProxy::descriptor) + std::string(kDisplayServiceInstanceName); + if (!AServiceManager_isDeclared(displayServiceInstanceName.data())) { + // TODO: We may just want to disable EVS display. + LOG(ERROR) << displayServiceInstanceName << " is required."; + return EXIT_FAILURE; + } + + std::shared_ptr displayService = ICarDisplayProxy::fromBinder( + ::ndk::SpAIBinder(AServiceManager_waitForService(displayServiceInstanceName.data()))); + if (!displayService) { + LOG(ERROR) << "Cannot use " << displayServiceInstanceName << ". Exiting."; + return EXIT_FAILURE; + } + + // Register our service -- if somebody is already registered by our name, + // they will be killed (their thread pool will throw an exception). + std::shared_ptr service = + ndk::SharedRefBase::make(displayService); + if (!service) { + LOG(ERROR) << "Failed to instantiate the service"; + return EXIT_FAILURE; + } + + const std::string instanceName = + std::string(EvsEnumerator::descriptor) + std::string(kHwInstanceName); + auto err = AServiceManager_addService(service->asBinder().get(), instanceName.data()); if (err != EX_NONE) { - ALOGE("failed to register android.hardware.automotive.evs service, exception: %d", err); - return 1; + LOG(ERROR) << "Failed to register " << instanceName << ", exception = " << err; + return EXIT_FAILURE; } - if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) { - ALOGE("%s", "failed to set thread pool max thread count"); - return 1; + if (!ABinderProcess_setThreadPoolMaxThreadCount(kNumBinderThreads)) { + LOG(ERROR) << "Failed to set thread pool"; + return EXIT_FAILURE; } + ABinderProcess_startThreadPool(); - - ALOGI("Evs Service Ready"); + LOG(INFO) << "EVS Hardware Enumerator is ready"; ABinderProcess_joinThreadPool(); - - ALOGI("Evs Service Exiting"); - - return 0; + // In normal operation, we don't expect the thread pool to exit + LOG(INFO) << "EVS Hardware Enumerator is shutting down"; + return EXIT_SUCCESS; } diff --git a/automotive/evs/aidl/vts/Android.bp b/automotive/evs/aidl/vts/Android.bp index e2e5b93e30..e50c913584 100644 --- a/automotive/evs/aidl/vts/Android.bp +++ b/automotive/evs/aidl/vts/Android.bp @@ -30,6 +30,7 @@ cc_test { ], defaults: [ "VtsHalTargetTestDefaults", + "android.hardware.graphics.common-ndk_static", "use_libaidlvintf_gtest_helper_static", ], shared_libs: [ @@ -40,9 +41,8 @@ cc_test { ], static_libs: [ "android.hardware.automotive.evs@common-default-lib", - "android.hardware.automotive.evs-V1-ndk", + "android.hardware.automotive.evs-V2-ndk", "android.hardware.common-V2-ndk", - "android.hardware.graphics.common-V4-ndk", "libaidlcommonsupport", ], test_suites: [ diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index 3cab204aec..3419b3c98d 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -619,6 +620,7 @@ TEST_P(EvsAidlTest, CameraToDisplayRoundTrip) { getPhysicalCameraIds(cam.id, isLogicalCam); if (mIsHwModule && isLogicalCam) { LOG(INFO) << "Skip a logical device " << cam.id << " for HW target."; + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); continue; } @@ -1437,7 +1439,8 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { ASSERT_TRUE(pCam1->getParameterList(&cam1Cmds).isOk()); if (cam0Cmds.size() < 1 || cam1Cmds.size() < 1) { // Cannot execute this test. - return; + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + continue; } // Set up a frame receiver object which will fire up its own thread. @@ -2195,6 +2198,207 @@ TEST_P(EvsAidlTest, UltrasonicsSetFramesInFlight) { } } +/* + * DisplayOpen: + * Test both clean shut down and "aggressive open" device stealing behavior. + */ +TEST_P(EvsAidlTest, DisplayOpen) { + LOG(INFO) << "Starting DisplayOpen test"; + + // Request available display IDs. + std::vector displayIds; + ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); + EXPECT_GT(displayIds.size(), 0); + + for (const auto displayId : displayIds) { + std::shared_ptr pDisplay; + + // Request exclusive access to each EVS display, then let it go. + ASSERT_TRUE(mEnumerator->openDisplay(displayId, &pDisplay).isOk()); + ASSERT_NE(pDisplay, nullptr); + + { + // Ask the display what its name is. + DisplayDesc desc; + ASSERT_TRUE(pDisplay->getDisplayInfo(&desc).isOk()); + LOG(DEBUG) << "Found display " << desc.id; + } + + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + + // Ensure we can reopen the display after it has been closed. + ASSERT_TRUE(mEnumerator->openDisplay(displayId, &pDisplay).isOk()); + ASSERT_NE(pDisplay, nullptr); + + // Open the display while its already open -- ownership should be transferred. + std::shared_ptr pDisplay2; + ASSERT_TRUE(mEnumerator->openDisplay(displayId, &pDisplay2).isOk()); + ASSERT_NE(pDisplay2, nullptr); + + { + // Ensure the old display properly reports its assassination. + DisplayState badState; + EXPECT_TRUE(pDisplay->getDisplayState(&badState).isOk()); + EXPECT_EQ(badState, DisplayState::DEAD); + } + + // Close only the newest display instance -- the other should already be a zombie. + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay2).isOk()); + + // Finally, validate that we can open the display after the provoked failure above. + ASSERT_TRUE(mEnumerator->openDisplay(displayId, &pDisplay).isOk()); + ASSERT_NE(pDisplay, nullptr); + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + } +} + +/* + * DisplayStates: + * Validate that display states transition as expected and can be queried from either the display + * object itself or the owning enumerator. + */ +TEST_P(EvsAidlTest, DisplayStates) { + using std::literals::chrono_literals::operator""ms; + + LOG(INFO) << "Starting DisplayStates test"; + + // Request available display IDs. + std::vector displayIds; + ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); + EXPECT_GT(displayIds.size(), 0); + + for (const auto displayId : displayIds) { + // Ensure the display starts in the expected state. + { + DisplayState state; + EXPECT_FALSE(mEnumerator->getDisplayState(&state).isOk()); + } + for (const auto displayIdToQuery : displayIds) { + DisplayState state; + EXPECT_FALSE(mEnumerator->getDisplayStateById(displayIdToQuery, &state).isOk()); + } + + // Scope to limit the lifetime of the pDisplay pointer, and thus the IEvsDisplay object. + { + // Request exclusive access to the EVS display. + std::shared_ptr pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(displayId, &pDisplay).isOk()); + ASSERT_NE(pDisplay, nullptr); + { + DisplayState state; + EXPECT_TRUE(mEnumerator->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::NOT_VISIBLE); + } + for (const auto displayIdToQuery : displayIds) { + DisplayState state; + bool get_state_ok = + mEnumerator->getDisplayStateById(displayIdToQuery, &state).isOk(); + if (displayIdToQuery != displayId) { + EXPECT_FALSE(get_state_ok); + } else if (get_state_ok) { + EXPECT_EQ(state, DisplayState::NOT_VISIBLE); + } + } + + // Activate the display. + EXPECT_TRUE(pDisplay->setDisplayState(DisplayState::VISIBLE_ON_NEXT_FRAME).isOk()); + { + DisplayState state; + EXPECT_TRUE(mEnumerator->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::VISIBLE_ON_NEXT_FRAME); + } + { + DisplayState state; + EXPECT_TRUE(pDisplay->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::VISIBLE_ON_NEXT_FRAME); + } + for (const auto displayIdToQuery : displayIds) { + DisplayState state; + bool get_state_ok = + mEnumerator->getDisplayStateById(displayIdToQuery, &state).isOk(); + if (displayIdToQuery != displayId) { + EXPECT_FALSE(get_state_ok); + } else if (get_state_ok) { + EXPECT_EQ(state, DisplayState::VISIBLE_ON_NEXT_FRAME); + } + } + + // Get the output buffer we'd use to display the imagery. + BufferDesc tgtBuffer; + ASSERT_TRUE(pDisplay->getTargetBuffer(&tgtBuffer).isOk()); + + // Send the target buffer back for display (we didn't actually fill anything). + EXPECT_TRUE(pDisplay->returnTargetBufferForDisplay(tgtBuffer).isOk()); + + // Sleep for a tenth of a second to ensure the driver has time to get the image + // displayed. + std::this_thread::sleep_for(100ms); + { + DisplayState state; + EXPECT_TRUE(mEnumerator->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::VISIBLE); + } + { + DisplayState state; + EXPECT_TRUE(pDisplay->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::VISIBLE); + } + for (const auto displayIdToQuery : displayIds) { + DisplayState state; + bool get_state_ok = + mEnumerator->getDisplayStateById(displayIdToQuery, &state).isOk(); + if (displayIdToQuery != displayId) { + EXPECT_FALSE(get_state_ok); + } else if (get_state_ok) { + EXPECT_EQ(state, DisplayState::VISIBLE); + } + } + + // Turn off the display. + EXPECT_TRUE(pDisplay->setDisplayState(DisplayState::NOT_VISIBLE).isOk()); + std::this_thread::sleep_for(100ms); + { + DisplayState state; + EXPECT_TRUE(mEnumerator->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::NOT_VISIBLE); + } + { + DisplayState state; + EXPECT_TRUE(pDisplay->getDisplayState(&state).isOk()); + EXPECT_EQ(state, DisplayState::NOT_VISIBLE); + } + for (const auto displayIdToQuery : displayIds) { + DisplayState state; + bool get_state_ok = + mEnumerator->getDisplayStateById(displayIdToQuery, &state).isOk(); + if (displayIdToQuery != displayId) { + EXPECT_FALSE(get_state_ok); + } else if (get_state_ok) { + EXPECT_EQ(state, DisplayState::NOT_VISIBLE); + } + } + + // Close the display. + mEnumerator->closeDisplay(pDisplay); + } + + // Now that the display pointer has gone out of scope, causing the IEvsDisplay interface + // object to be destroyed, we should be back to the "not open" state. + // NOTE: If we want this to pass without the sleep above, we'd have to add the + // (now recommended) closeDisplay() call instead of relying on the smarter pointer + // going out of scope. I've not done that because I want to verify that the deletion + // of the object does actually clean up (eventually). + { + DisplayState state; + EXPECT_FALSE(mEnumerator->getDisplayState(&state).isOk()); + } + for (const auto displayIdToQuery : displayIds) { + DisplayState state; + EXPECT_FALSE(mEnumerator->getDisplayStateById(displayIdToQuery, &state).isOk()); + } + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EvsAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, EvsAidlTest, diff --git a/automotive/evs/common/utils/default/test/fuzz/FormatConvertFuzzer.cpp b/automotive/evs/common/utils/default/test/fuzz/FormatConvertFuzzer.cpp index 58423c8187..7f90501ee5 100644 --- a/automotive/evs/common/utils/default/test/fuzz/FormatConvertFuzzer.cpp +++ b/automotive/evs/common/utils/default/test/fuzz/FormatConvertFuzzer.cpp @@ -32,9 +32,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, std::size_t size) { // API have a requirement that width must be divied by 16 except yuyvtorgb int min_height = 2; - int max_height = (image_pixel_size / 16) & ~(1); // must be even number + int max_height = (image_pixel_size / 16); int height = fdp.ConsumeIntegralInRange(min_height, max_height); - int width = (image_pixel_size / height) & ~(16); // must be divisible by 16 + height &= ~(1); // must be even number + int width = (image_pixel_size / height) & ~(0xF); // must be divisible by 16 uint8_t* src = (uint8_t*)(data + 4); uint32_t* tgt = (uint32_t*)malloc(sizeof(uint32_t) * image_pixel_size); diff --git a/automotive/ivn_android_device/aidl/Android.bp b/automotive/ivn_android_device/aidl/Android.bp new file mode 100644 index 0000000000..9af709fd6c --- /dev/null +++ b/automotive/ivn_android_device/aidl/Android.bp @@ -0,0 +1,51 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +aidl_interface { + name: "android.hardware.automotive.ivn", + vendor_available: true, + srcs: [ + "android/hardware/automotive/ivn/*.aidl", + ], + frozen: true, + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], + }, + }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/.hash b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/.hash new file mode 100644 index 0000000000..58de5d69fa --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/.hash @@ -0,0 +1 @@ +50960edf7eaa130e8103dba62c96f62d7eac84bf diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/ConnectProtocol.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/ConnectProtocol.aidl new file mode 100644 index 0000000000..80d7a2a2af --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/ConnectProtocol.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@Backing(type="int") @VintfStability +enum ConnectProtocol { + TCP_IP = 0, +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/EndpointInfo.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/EndpointInfo.aidl new file mode 100644 index 0000000000..5693520eb5 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/EndpointInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable EndpointInfo { + android.hardware.automotive.ivn.ConnectProtocol connectProtocol; + String ipAddress; + int portNumber; + android.hardware.automotive.ivn.HardwareIdentifiers hardwareId; +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/HardwareIdentifiers.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/HardwareIdentifiers.aidl new file mode 100644 index 0000000000..1a8b21de7f --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/HardwareIdentifiers.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable HardwareIdentifiers { + @nullable String brandName; + @nullable String deviceName; + @nullable String productName; + @nullable String manufacturerName; + @nullable String modelName; + @nullable String serialNumber; +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl new file mode 100644 index 0000000000..a04d829583 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@VintfStability +interface IIvnAndroidDevice { + int getMyDeviceId(); + int[] getOtherDeviceIds(); + int getDeviceIdForOccupantZone(int zoneId); + android.hardware.automotive.ivn.OccupantZoneInfo[] getOccupantZonesForDevice(int androidDeviceId); + android.hardware.automotive.ivn.EndpointInfo getMyEndpointInfo(); + android.hardware.automotive.ivn.EndpointInfo getEndpointInfoForDevice(int androidDeviceId); +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/OccupantType.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/OccupantType.aidl new file mode 100644 index 0000000000..6dd0c07d16 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/OccupantType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@Backing(type="int") @VintfStability +enum OccupantType { + DRIVER = 1, + FRONT_PASSENGER = 2, + REAR_PASSENGER = 3, +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/OccupantZoneInfo.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/OccupantZoneInfo.aidl new file mode 100644 index 0000000000..41108e9c78 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/1/android/hardware/automotive/ivn/OccupantZoneInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable OccupantZoneInfo { + int zoneId; + android.hardware.automotive.ivn.OccupantType occupantType; + int seat; +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/ConnectProtocol.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/ConnectProtocol.aidl new file mode 100644 index 0000000000..80d7a2a2af --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/ConnectProtocol.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@Backing(type="int") @VintfStability +enum ConnectProtocol { + TCP_IP = 0, +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/EndpointInfo.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/EndpointInfo.aidl new file mode 100644 index 0000000000..5693520eb5 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/EndpointInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable EndpointInfo { + android.hardware.automotive.ivn.ConnectProtocol connectProtocol; + String ipAddress; + int portNumber; + android.hardware.automotive.ivn.HardwareIdentifiers hardwareId; +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/HardwareIdentifiers.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/HardwareIdentifiers.aidl new file mode 100644 index 0000000000..1a8b21de7f --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/HardwareIdentifiers.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable HardwareIdentifiers { + @nullable String brandName; + @nullable String deviceName; + @nullable String productName; + @nullable String manufacturerName; + @nullable String modelName; + @nullable String serialNumber; +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl new file mode 100644 index 0000000000..a04d829583 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@VintfStability +interface IIvnAndroidDevice { + int getMyDeviceId(); + int[] getOtherDeviceIds(); + int getDeviceIdForOccupantZone(int zoneId); + android.hardware.automotive.ivn.OccupantZoneInfo[] getOccupantZonesForDevice(int androidDeviceId); + android.hardware.automotive.ivn.EndpointInfo getMyEndpointInfo(); + android.hardware.automotive.ivn.EndpointInfo getEndpointInfoForDevice(int androidDeviceId); +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/OccupantType.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/OccupantType.aidl new file mode 100644 index 0000000000..6dd0c07d16 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/OccupantType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@Backing(type="int") @VintfStability +enum OccupantType { + DRIVER = 1, + FRONT_PASSENGER = 2, + REAR_PASSENGER = 3, +} diff --git a/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/OccupantZoneInfo.aidl b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/OccupantZoneInfo.aidl new file mode 100644 index 0000000000..41108e9c78 --- /dev/null +++ b/automotive/ivn_android_device/aidl/aidl_api/android.hardware.automotive.ivn/current/android/hardware/automotive/ivn/OccupantZoneInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.ivn; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable OccupantZoneInfo { + int zoneId; + android.hardware.automotive.ivn.OccupantType occupantType; + int seat; +} diff --git a/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/ConnectProtocol.aidl b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/ConnectProtocol.aidl new file mode 100644 index 0000000000..9f621b3e6f --- /dev/null +++ b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/ConnectProtocol.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.ivn; + +/** + * Connect protocol for In-vehicle network Android device. + */ +@VintfStability +@Backing(type="int") +enum ConnectProtocol { + TCP_IP = 0, +} diff --git a/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/EndpointInfo.aidl b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/EndpointInfo.aidl new file mode 100644 index 0000000000..32f697160d --- /dev/null +++ b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/EndpointInfo.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.ivn; + +import android.hardware.automotive.ivn.ConnectProtocol; +import android.hardware.automotive.ivn.HardwareIdentifiers; + +/** + * Network endpoint information for an Android instance running on a difference device. + * + * The device is in the same vehicle as this device. + */ +@JavaDerive(equals=true, toString=true) +@VintfStability +parcelable EndpointInfo { + /** + * The connection protocol. Only supports TCP/IP for now. + */ + ConnectProtocol connectProtocol; + /** + * The IP address. + */ + String ipAddress; + /** + * The port number exposed for connecting. + */ + int portNumber; + /** + * Hardware identifiers. + * + * The hardware identifiers for the endpoint as defined in [Attestation Hardware Identifiers] + * {@link + * https://source.android.com/docs/security/features/keystore/attestation#hardware-identifiers} + */ + HardwareIdentifiers hardwareId; +} diff --git a/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/HardwareIdentifiers.aidl b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/HardwareIdentifiers.aidl new file mode 100644 index 0000000000..ffa09e67ba --- /dev/null +++ b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/HardwareIdentifiers.aidl @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.ivn; + +/** + * Hardware Identifiers for an Android device. + * + *

These identifiers are embedded in the ID attestation certificate and are + * used to restrict what devices this device can connect to. All fields are + * optional but at least one of the fields must be specified. + */ +@JavaDerive(equals=true, toString=true) +@VintfStability +parcelable HardwareIdentifiers { + /** + * Optional brand name, as returned by {@code Build.BRAND} in Android. + * + * If unspecified, we assume the other device has the same brand name as this device. + */ + @nullable String brandName; + /** + * Optional brand name, as returned by {@code Build.DEVICE} in Android. + * + * If unspecified, we assume the other device has the same device name as this device. + */ + @nullable String deviceName; + /** + * Optional model name, as returned by {@code Build.PRODUCT} in Android. + * + * If unspecified, we assume the other device has the same product name as this device. + */ + @nullable String productName; + /** + * Optional manufacturer name, as returned by {@code Build.MANUFACTURER} in Android. + * + * If unspecified, we assume the other device has the same manufacturer name as this device. + */ + @nullable String manufacturerName; + /** + * Optional model name, as returned by {@code Build.MODEL} in Android. + * + * If unspecified, we assume the other device has the same model name as this device. + */ + @nullable String modelName; + /** + * Optional serial number. + * + * If unspecified, we allow the endpoint to have any serial number. + */ + @nullable String serialNumber; +} diff --git a/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl new file mode 100644 index 0000000000..107b7a6b6c --- /dev/null +++ b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/IIvnAndroidDevice.aidl @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.ivn; + +import android.hardware.automotive.ivn.EndpointInfo; +import android.hardware.automotive.ivn.OccupantZoneInfo; + +/** + * Interface for In-Vehicle Network(IVN) Android devices. + * + * This is used in a multi-zone multi-SoC environment where there are multiple + * SoCs running Android in a vehicle. Each support one or multiple occupant + * zones. E.g., one SoC for front passenger, one SoC for backseat left-zone + * and middle/right zone passengers. + */ +@VintfStability +interface IIvnAndroidDevice { + /** + * Returns the unique ID for this Android device. + * + *

This ID has to be unique among all the android devices in the whole vehicle. It is usually + * a hard-coded value, e.g. serial number. + * + * @return an ID representing this device. + */ + int getMyDeviceId(); + + /** + * Returns a list of unique IDs for other IVN Android devices. + * + * The returned list does not contain the current Android device ID. This list is usually + * pre-configured for this HAL, either hard-coded or read from configuration file. + * + * @return A list of IDs representing connected Android devices. + */ + int[] getOtherDeviceIds(); + + /** + * Returns the Android device ID for a specified occupant zone. + * + * @pararm zoneID the occupant zone ID returned from {@link android.car.CarOccupantZoneManager}. + * @return an ID representing an Android device. + */ + int getDeviceIdForOccupantZone(int zoneId); + + /** + * Returns all the occupant zones supported for a specified IVN Android device. + * + * @param androidDeviceId the android device ID. + * @return A list of supported occupant zone info. + */ + OccupantZoneInfo[] getOccupantZonesForDevice(int androidDeviceId); + + /** + * Returns the connection endpoint info for this android device. + * + * @return The endpoint info. + */ + EndpointInfo getMyEndpointInfo(); + + /** + * Returns the connection endpoint info for the specified IVN Android device. + * + * @return The endpoint info. + */ + EndpointInfo getEndpointInfoForDevice(int androidDeviceId); +} diff --git a/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/OccupantType.aidl b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/OccupantType.aidl new file mode 100644 index 0000000000..72542a7ae6 --- /dev/null +++ b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/OccupantType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.ivn; + +/** + * Occupant type. + * + * This enum might be extended in the future. + */ +@VintfStability +@Backing(type="int") +enum OccupantType { + /** + * Represents the driver. There can be one or zero driver for the system. Zero driver situation + * can happen if the system is configured to support only passengers. + */ + DRIVER = 1, + /** + * Represents front passengers who sit in front side of car. Most cars will have only + * one passenger of this type but this can be multiple. + */ + FRONT_PASSENGER = 2, + /** Represents passengers in rear seats. There can be multiple passengers of this type. */ + REAR_PASSENGER = 3, +} diff --git a/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/OccupantZoneInfo.aidl b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/OccupantZoneInfo.aidl new file mode 100644 index 0000000000..af45444d9b --- /dev/null +++ b/automotive/ivn_android_device/aidl/android/hardware/automotive/ivn/OccupantZoneInfo.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.ivn; + +import android.hardware.automotive.ivn.OccupantType; + +/** + * Represents an occupant zone in a car. + * + *

Each occupant does not necessarily represent single person but it is for mapping to one + * set of displays. For example, for display located in center rear seat, both left and right + * side passengers may use it but it is abstracted as a single occupant zone.

+ */ +@JavaDerive(equals=true, toString=true) +@VintfStability +parcelable OccupantZoneInfo { + /** + * This is an unique id to distinguish each occupant zone. + * + *

This can be helpful to distinguish different zones when {@link #occupantType} and + * {@link #seat} are the same for multiple occupant / passenger zones.

+ * + *

This id will remain the same for the same zone across configuration changes like + * user switching or display changes

+ */ + int zoneId; + /** Represents type of passenger */ + OccupantType occupantType; + /** + * Represents seat assigned for the occupant. In some system, this can have value of + * {@code VehicleAreaSeat#SEAT_UNKNOWN}. + * + *

This might be one of {@code VehicleAreaSeat} or a combination of {@code VehicleAreaSeat}. + */ + int seat; +} diff --git a/automotive/ivn_android_device/impl/default/Android.bp b/automotive/ivn_android_device/impl/default/Android.bp new file mode 100644 index 0000000000..98c1f58ee5 --- /dev/null +++ b/automotive/ivn_android_device/impl/default/Android.bp @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library { + name: "IvnAndroidDeviceService", + vendor_available: true, + local_include_dirs: ["include"], + export_include_dirs: ["include"], + srcs: [ + "src/IvnAndroidDeviceService.cpp", + ], + whole_static_libs: [ + "android.hardware.automotive.ivn-V1-ndk", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "libjsoncpp", + "liblog", + "libutils", + ], +} + +cc_binary { + name: "android.hardware.automotive.ivn@V1-default-service", + vendor: true, + relative_install_path: "hw", + local_include_dirs: ["include"], + srcs: ["src/IvnAndroidDeviceImpl.cpp"], + whole_static_libs: ["IvnAndroidDeviceService"], + shared_libs: [ + "libbase", + "libbinder_ndk", + "libjsoncpp", + "liblog", + "libutils", + ], + required: ["Prebuilt_IvnAndroidDeviceServiceDefaultConfig_JSON"], + vintf_fragments: ["ivn-default-service.xml"], + init_rc: ["ivn-default-service.rc"], +} diff --git a/automotive/ivn_android_device/impl/default/config/Android.bp b/automotive/ivn_android_device/impl/default/config/Android.bp new file mode 100644 index 0000000000..03c4d1b215 --- /dev/null +++ b/automotive/ivn_android_device/impl/default/config/Android.bp @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +filegroup { + name: "IvnAndroidDeviceServiceDefaultConfig_Json", + srcs: ["DefaultConfig.json"], +} + +prebuilt_etc { + name: "Prebuilt_IvnAndroidDeviceServiceDefaultConfig_JSON", + filename_from_src: true, + src: "DefaultConfig.json", + sub_dir: "automotive/IvnConfig/", + vendor: true, +} diff --git a/automotive/ivn_android_device/impl/default/config/DefaultConfig.json b/automotive/ivn_android_device/impl/default/config/DefaultConfig.json new file mode 100644 index 0000000000..45663e2645 --- /dev/null +++ b/automotive/ivn_android_device/impl/default/config/DefaultConfig.json @@ -0,0 +1,61 @@ +{ + "MyDeviceId": 0, + "Devices": [ + { + "DeviceId": 0, + "OccupantZones": [ + { + "ZoneId": 0, + "OccupantType": "DRIVER", + "Seat": 1, + "Comments": "Occupant zone for driver and FRONT_LEFT seat" + }, + { + "ZoneId": 1, + "OccupantType": "FRONT_PASSENGER", + "Seat": 4, + "Comments": "Occupant zone for FRONT_RIGHT passenger" + } + ], + "EndpointInfo": { + "IpAddress": "10.10.10.1", + "PortNumber": 1234, + "BrandName": "MyBrand", + "DeviceName": "MyDevice", + "ProductName": "MyProduct", + "ManufacturerName": "MyCompany", + "ModelName": "MyModel", + "SerialNumber": "Serial1234" + }, + "Comments": "Device for front row" + }, + { + "DeviceId": 1, + "OccupantZones": [ + { + "ZoneId": 2, + "OccupantType": "REAR_PASSENGER", + "Seat": 16 + }, + { + "ZoneId": 3, + "OccupantType": "REAR_PASSENGER", + "Seat": 64 + } + ], + "EndpointInfo": { + "IpAddress": "10.10.10.2", + "PortNumber": 2345, + "BrandName": "MyBrand", + "DeviceName": "MyDevice", + "ProductName": "MyProduct", + "ManufacturerName": "MyCompany", + "ModelName": "MyModel", + "SerialNumber": "Serial2345" + }, + "Comments": "Device for back row" + } + ], + "Comment": + "This simulates a vehicle with two Android devices, one for front row, one for back row" +} diff --git a/automotive/ivn_android_device/impl/default/include/IvnAndroidDeviceService.h b/automotive/ivn_android_device/impl/default/include/IvnAndroidDeviceService.h new file mode 100644 index 0000000000..0cff8fe19a --- /dev/null +++ b/automotive/ivn_android_device/impl/default/include/IvnAndroidDeviceService.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace ivn { + +struct DeviceInfo { + std::vector occupantZones; + aidl::android::hardware::automotive::ivn::EndpointInfo endpointInfo; +}; + +class IvnAndroidDeviceService + : public aidl::android::hardware::automotive::ivn::BnIvnAndroidDevice { + public: + explicit IvnAndroidDeviceService(std::string_view configPath); + + // Initialize the service, returns true on success. + bool init(); + + ndk::ScopedAStatus getMyDeviceId(int* deviceId) override; + + ndk::ScopedAStatus getOtherDeviceIds(std::vector* deviceIds) override; + + ndk::ScopedAStatus getDeviceIdForOccupantZone(int zoneId, int* deviceId) override; + + ndk::ScopedAStatus getOccupantZonesForDevice( + int androidDeviceId, + std::vector* occupantZones) + override; + + ndk::ScopedAStatus getMyEndpointInfo( + aidl::android::hardware::automotive::ivn::EndpointInfo* endpointInfo) override; + + ndk::ScopedAStatus getEndpointInfoForDevice( + int androidDeviceId, + aidl::android::hardware::automotive::ivn::EndpointInfo* endpointInfo) override; + + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + + private: + Json::Value mConfigRootNode; + int mMyDeviceId; + std::unordered_map mDeviceInfoById; + std::string_view mConfigPath; +}; + +} // namespace ivn +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/ivn_android_device/impl/default/ivn-default-service.rc b/automotive/ivn_android_device/impl/default/ivn-default-service.rc new file mode 100644 index 0000000000..070b2591be --- /dev/null +++ b/automotive/ivn_android_device/impl/default/ivn-default-service.rc @@ -0,0 +1,4 @@ +service vendor.ivn-default /vendor/bin/hw/android.hardware.automotive.ivn@V1-default-service + class hal + user vehicle_network + group system inet diff --git a/automotive/ivn_android_device/impl/default/ivn-default-service.xml b/automotive/ivn_android_device/impl/default/ivn-default-service.xml new file mode 100644 index 0000000000..481bc0a08f --- /dev/null +++ b/automotive/ivn_android_device/impl/default/ivn-default-service.xml @@ -0,0 +1,7 @@ + + + android.hardware.automotive.ivn + 1 + IIvnAndroidDevice/default + + diff --git a/automotive/ivn_android_device/impl/default/src/IvnAndroidDeviceImpl.cpp b/automotive/ivn_android_device/impl/default/src/IvnAndroidDeviceImpl.cpp new file mode 100644 index 0000000000..fdf677661a --- /dev/null +++ b/automotive/ivn_android_device/impl/default/src/IvnAndroidDeviceImpl.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "IvnAndroidDeviceImpl" + +#include "IvnAndroidDeviceService.h" + +#include +#include +#include +#include + +constexpr char SERVICE_NAME[] = "android.hardware.automotive.ivn.IIvnAndroidDevice/default"; +constexpr char DEFAULT_CONFIG_DIR[] = "/vendor/etc/automotive/IvnConfig/DefaultConfig.json"; + +int main(int /* argc */, char* /* argv */[]) { + LOG(INFO) << "Registering IvnAndroidDeviceService as service..."; + auto service = + ndk::SharedRefBase::make( + DEFAULT_CONFIG_DIR); + if (!service->init()) { + LOG(ERROR) << "Failed to init IvnAndroidDeviceService"; + exit(1); + } + + binder_exception_t err = AServiceManager_addService(service->asBinder().get(), SERVICE_NAME); + if (err != EX_NONE) { + LOG(ERROR) << "Failed to register IvnAndroidDeviceService service, exception: " << err; + exit(1); + } + + if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) { + LOG(ERROR) << "Failed to set thread pool max thread count"; + exit(1); + } + ABinderProcess_startThreadPool(); + + LOG(INFO) << "IvnAndroidDeviceService Ready"; + + ABinderProcess_joinThreadPool(); + + LOG(ERROR) << "IvnAndroidDeviceService init failed! Should not reach here"; + + return 0; +} diff --git a/automotive/ivn_android_device/impl/default/src/IvnAndroidDeviceService.cpp b/automotive/ivn_android_device/impl/default/src/IvnAndroidDeviceService.cpp new file mode 100644 index 0000000000..81f18b2267 --- /dev/null +++ b/automotive/ivn_android_device/impl/default/src/IvnAndroidDeviceService.cpp @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "IvnAndroidDeviceService.h" + +#include +#include +#include +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace ivn { + +namespace { + +using ::aidl::android::hardware::automotive::ivn::ConnectProtocol; +using ::aidl::android::hardware::automotive::ivn::EndpointInfo; +using ::aidl::android::hardware::automotive::ivn::HardwareIdentifiers; +using ::aidl::android::hardware::automotive::ivn::OccupantType; +using ::aidl::android::hardware::automotive::ivn::OccupantZoneInfo; +using ::ndk::ScopedAStatus; + +constexpr int IVN_ERROR_GENERIC = -1; + +} // namespace + +IvnAndroidDeviceService::IvnAndroidDeviceService(std::string_view configPath) { + mConfigPath = configPath; +} + +bool IvnAndroidDeviceService::init() { + std::ifstream configStream(mConfigPath); + if (!configStream) { + LOG(ERROR) << "couldn't open " << mConfigPath << " for parsing."; + return false; + } + Json::CharReaderBuilder builder; + std::string errs; + if (!Json::parseFromStream(builder, configStream, &mConfigRootNode, &errs)) { + LOG(ERROR) << "Failed to parse config JSON stream, error: " << errs; + return false; + } + if (!mConfigRootNode.isObject()) { + LOG(ERROR) << "Root must be an object"; + return false; + } + if (!mConfigRootNode.isMember("MyDeviceId")) { + LOG(ERROR) << "Must contain 'MyDeviceId' field"; + return false; + } + mMyDeviceId = mConfigRootNode["MyDeviceId"].asInt(); + if (!mConfigRootNode.isMember("Devices") || !mConfigRootNode["Devices"].isArray()) { + LOG(ERROR) << "Must contain 'Devices' field as array"; + return false; + } + Json::Value& devices = mConfigRootNode["Devices"]; + for (unsigned int i = 0; i < devices.size(); i++) { + Json::Value& device = devices[i]; + int deviceId = device["DeviceId"].asInt(); + DeviceInfo deviceInfo = {}; + Json::Value& occupantZones = device["OccupantZones"]; + for (unsigned int j = 0; j < occupantZones.size(); j++) { + Json::Value& occupantZone = occupantZones[j]; + int zoneId = occupantZone["ZoneId"].asInt(); + std::string occupantTypeStr = occupantZone["OccupantType"].asString(); + int seat = occupantZone["Seat"].asInt(); + OccupantType occupantType; + if (occupantTypeStr == "DRIVER") { + occupantType = OccupantType::DRIVER; + } else if (occupantTypeStr == "FRONT_PASSENGER") { + occupantType = OccupantType::FRONT_PASSENGER; + } else if (occupantTypeStr == "REAR_PASSENGER") { + occupantType = OccupantType::REAR_PASSENGER; + } else { + LOG(ERROR) << "Unknown occupant type: " << occupantTypeStr; + return false; + } + OccupantZoneInfo occupantZoneInfo = { + .zoneId = zoneId, .occupantType = occupantType, .seat = seat}; + deviceInfo.occupantZones.push_back(std::move(occupantZoneInfo)); + } + Json::Value& ep = device["EndpointInfo"]; + EndpointInfo endpointInfo = {}; + endpointInfo.connectProtocol = ConnectProtocol::TCP_IP; + endpointInfo.ipAddress = ep["IpAddress"].asString(); + endpointInfo.portNumber = ep["PortNumber"].asInt(); + HardwareIdentifiers hardwareId = {}; + if (ep.isMember("BrandName")) { + hardwareId.brandName = ep["BrandName"].asString(); + } + if (ep.isMember("DeviceName")) { + hardwareId.deviceName = ep["DeviceName"].asString(); + } + if (ep.isMember("ProductName")) { + hardwareId.productName = ep["ProductName"].asString(); + } + if (ep.isMember("ManufacturerName")) { + hardwareId.manufacturerName = ep["ManufacturerName"].asString(); + } + if (ep.isMember("ModelName")) { + hardwareId.modelName = ep["ModelName"].asString(); + } + if (ep.isMember("SerialNumber")) { + hardwareId.serialNumber = ep["SerialNumber"].asString(); + } + endpointInfo.hardwareId = hardwareId; + deviceInfo.endpointInfo = endpointInfo; + mDeviceInfoById[deviceId] = deviceInfo; + } + if (mDeviceInfoById.find(mMyDeviceId) == mDeviceInfoById.end()) { + LOG(ERROR) << "My device ID is not in the device info list"; + return false; + } + return true; +} + +ScopedAStatus IvnAndroidDeviceService::getMyDeviceId(int* deviceId) { + *deviceId = mMyDeviceId; + return ScopedAStatus::ok(); +} + +ScopedAStatus IvnAndroidDeviceService::getOtherDeviceIds(std::vector* deviceIds) { + deviceIds->clear(); + for (const auto& [deviceId, _] : mDeviceInfoById) { + if (deviceId == mMyDeviceId) { + continue; + } + deviceIds->push_back(deviceId); + } + return ScopedAStatus::ok(); +} + +ScopedAStatus IvnAndroidDeviceService::getDeviceIdForOccupantZone(int zoneId, int* outDeviceId) { + for (const auto& [deviceId, deviceInfo] : mDeviceInfoById) { + for (const auto& occupantZoneInfo : deviceInfo.occupantZones) { + if (occupantZoneInfo.zoneId == zoneId) { + *outDeviceId = deviceId; + return ScopedAStatus::ok(); + } + } + } + return ScopedAStatus::fromServiceSpecificErrorWithMessage(IVN_ERROR_GENERIC, + "Occupant zone not found"); +} + +ScopedAStatus IvnAndroidDeviceService::getOccupantZonesForDevice( + int androidDeviceId, std::vector* occupantZones) { + if (mDeviceInfoById.find(androidDeviceId) == mDeviceInfoById.end()) { + return ScopedAStatus::fromServiceSpecificErrorWithMessage(IVN_ERROR_GENERIC, + "Android device ID not found"); + } + for (const auto& occupantZoneInfo : mDeviceInfoById[androidDeviceId].occupantZones) { + occupantZones->push_back(occupantZoneInfo); + } + return ScopedAStatus::ok(); +} + +ScopedAStatus IvnAndroidDeviceService::getMyEndpointInfo(EndpointInfo* endpointInfo) { + *endpointInfo = mDeviceInfoById[mMyDeviceId].endpointInfo; + return ScopedAStatus::ok(); +} + +ScopedAStatus IvnAndroidDeviceService::getEndpointInfoForDevice(int androidDeviceId, + EndpointInfo* endpointInfo) { + if (mDeviceInfoById.find(androidDeviceId) == mDeviceInfoById.end()) { + return ScopedAStatus::fromServiceSpecificErrorWithMessage(IVN_ERROR_GENERIC, + "Android device ID not found"); + } + *endpointInfo = mDeviceInfoById[androidDeviceId].endpointInfo; + return ScopedAStatus::ok(); +} + +binder_status_t IvnAndroidDeviceService::dump(int fd, [[maybe_unused]] const char** args, + [[maybe_unused]] uint32_t numArgs) { + dprintf(fd, "IVN Android Device debug interface, Config: \n%s\n", + mConfigRootNode.toStyledString().c_str()); + return STATUS_OK; +} + +} // namespace ivn +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/ivn_android_device/impl/default/test/Android.bp b/automotive/ivn_android_device/impl/default/test/Android.bp new file mode 100644 index 0000000000..a100575de3 --- /dev/null +++ b/automotive/ivn_android_device/impl/default/test/Android.bp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "IvnAndroidDeviceServiceUnitTest", + vendor: true, + srcs: ["*.cpp"], + whole_static_libs: [ + "IvnAndroidDeviceService", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "libjsoncpp", + "liblog", + "libutils", + ], + static_libs: [ + "libgtest", + ], + data: [ + ":IvnAndroidDeviceServiceDefaultConfig_Json", + ], + test_suites: ["device-tests"], +} diff --git a/automotive/ivn_android_device/impl/default/test/IvnAndroidDeviceServiceUnittest.cpp b/automotive/ivn_android_device/impl/default/test/IvnAndroidDeviceServiceUnittest.cpp new file mode 100644 index 0000000000..6a4d26d8c3 --- /dev/null +++ b/automotive/ivn_android_device/impl/default/test/IvnAndroidDeviceServiceUnittest.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "IvnAndroidDeviceService.h" + +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace ivn { + +using ::aidl::android::hardware::automotive::ivn::ConnectProtocol; +using ::aidl::android::hardware::automotive::ivn::EndpointInfo; +using ::aidl::android::hardware::automotive::ivn::OccupantType; +using ::aidl::android::hardware::automotive::ivn::OccupantZoneInfo; +using ::ndk::ScopedAStatus; + +class IvnAndroidDeviceServiceUnitTest : public ::testing::Test { + public: + virtual void SetUp() override { + mService = ndk::SharedRefBase::make( + android::base::GetExecutableDirectory() + "/DefaultConfig.json"); + mService->init(); + } + + std::shared_ptr mService; +}; + +TEST_F(IvnAndroidDeviceServiceUnitTest, TestGetMyDeviceId) { + int deviceId = -1; + + ScopedAStatus status = mService->getMyDeviceId(&deviceId); + + ASSERT_TRUE(status.isOk()); + ASSERT_EQ(deviceId, 0); +} + +TEST_F(IvnAndroidDeviceServiceUnitTest, TestGetOtherDeviceIds) { + std::vector deviceIds; + + ScopedAStatus status = mService->getOtherDeviceIds(&deviceIds); + + ASSERT_TRUE(status.isOk()); + ASSERT_EQ(deviceIds, std::vector({1})); +} + +TEST_F(IvnAndroidDeviceServiceUnitTest, TestGetDeviceIdForOccupantZone) { + int deviceId = -1; + + ScopedAStatus status = mService->getDeviceIdForOccupantZone(/*zoneId=*/0, &deviceId); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(deviceId, 0); + + status = mService->getDeviceIdForOccupantZone(/*zoneId=*/1, &deviceId); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(deviceId, 0); + + status = mService->getDeviceIdForOccupantZone(/*zoneId=*/2, &deviceId); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(deviceId, 1); + + status = mService->getDeviceIdForOccupantZone(/*zoneId=*/3, &deviceId); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(deviceId, 1); + + status = mService->getDeviceIdForOccupantZone(/*zoneId=*/4, &deviceId); + + ASSERT_FALSE(status.isOk()); +} + +TEST_F(IvnAndroidDeviceServiceUnitTest, TestGetOccupantZonesForDevice) { + std::vector occupantZones; + + ScopedAStatus status = + mService->getOccupantZonesForDevice(/*androidDeviceId=*/0, &occupantZones); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(occupantZones.size(), 2); + if (occupantZones.size() == 2) { + EXPECT_EQ(occupantZones[0].zoneId, 0); + EXPECT_EQ(occupantZones[0].occupantType, OccupantType::DRIVER); + EXPECT_EQ(occupantZones[0].seat, 1); + EXPECT_EQ(occupantZones[1].zoneId, 1); + EXPECT_EQ(occupantZones[1].occupantType, OccupantType::FRONT_PASSENGER); + EXPECT_EQ(occupantZones[1].seat, 4); + } +} + +TEST_F(IvnAndroidDeviceServiceUnitTest, TestGetMyEndpointInfo) { + EndpointInfo endpointInfo; + + ScopedAStatus status = mService->getMyEndpointInfo(&endpointInfo); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(endpointInfo.connectProtocol, ConnectProtocol::TCP_IP); + EXPECT_EQ(endpointInfo.ipAddress, "10.10.10.1"); + EXPECT_EQ(endpointInfo.portNumber, 1234); + EXPECT_EQ(endpointInfo.hardwareId.brandName, "MyBrand"); + EXPECT_EQ(endpointInfo.hardwareId.deviceName, "MyDevice"); + EXPECT_EQ(endpointInfo.hardwareId.productName, "MyProduct"); + EXPECT_EQ(endpointInfo.hardwareId.manufacturerName, "MyCompany"); + EXPECT_EQ(endpointInfo.hardwareId.modelName, "MyModel"); + EXPECT_EQ(endpointInfo.hardwareId.serialNumber, "Serial1234"); +} + +TEST_F(IvnAndroidDeviceServiceUnitTest, TestGetEndpointInfoForDevice) { + EndpointInfo endpointInfo; + + ScopedAStatus status = mService->getEndpointInfoForDevice(/*androidDeviceId=*/0, &endpointInfo); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(endpointInfo.connectProtocol, ConnectProtocol::TCP_IP); + EXPECT_EQ(endpointInfo.ipAddress, "10.10.10.1"); + EXPECT_EQ(endpointInfo.portNumber, 1234); + + status = mService->getEndpointInfoForDevice(/*androidDeviceId=*/1, &endpointInfo); + + ASSERT_TRUE(status.isOk()); + EXPECT_EQ(endpointInfo.connectProtocol, ConnectProtocol::TCP_IP); + EXPECT_EQ(endpointInfo.ipAddress, "10.10.10.2"); + EXPECT_EQ(endpointInfo.portNumber, 2345); +} + +} // namespace ivn +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/ivn_android_device/vts/Android.bp b/automotive/ivn_android_device/vts/Android.bp new file mode 100644 index 0000000000..e4b9d641ae --- /dev/null +++ b/automotive/ivn_android_device/vts/Android.bp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_test { + name: "VtsHalIvnTargetTest", + srcs: [ + "src/*.cpp", + ], + defaults: ["use_libaidlvintf_gtest_helper_static"], + static_libs: [ + "libgmock", + "libgtest", + "android.hardware.automotive.ivn-V1-ndk", + ], + shared_libs: [ + "libbinder_ndk", + ], + test_suites: [ + "general-tests", + "vts", + "automotive-tests", + "automotive-general-tests", + ], + require_root: true, +} diff --git a/automotive/ivn_android_device/vts/OWNERS b/automotive/ivn_android_device/vts/OWNERS new file mode 100644 index 0000000000..d6969e5eb5 --- /dev/null +++ b/automotive/ivn_android_device/vts/OWNERS @@ -0,0 +1,2 @@ +ericjeong@google.com +shanyu@google.com diff --git a/automotive/ivn_android_device/vts/src/VtsHalIvnTargetTest.cpp b/automotive/ivn_android_device/vts/src/VtsHalIvnTargetTest.cpp new file mode 100644 index 0000000000..73b9a5e708 --- /dev/null +++ b/automotive/ivn_android_device/vts/src/VtsHalIvnTargetTest.cpp @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::automotive::ivn { + +using ::ndk::ScopedAStatus; +using ::ndk::SpAIBinder; + +using ::testing::Contains; +using ::testing::Not; + +class VtsHalIvnTargetTest : public ::testing::TestWithParam { + public: + void SetUp() override { + std::string descriptor = GetParam(); + AIBinder* binder = AServiceManager_checkService(descriptor.c_str()); + ASSERT_NE(binder, nullptr) << "Failed to connect to IVN HAL"; + mIvnHal = IIvnAndroidDevice::fromBinder(SpAIBinder(binder)); + } + + std::shared_ptr getHal() { return mIvnHal; } + + private: + std::shared_ptr mIvnHal; + + protected: + ScopedAStatus getAllDeviceIds(std::unordered_set* deviceIds); +}; + +TEST_P(VtsHalIvnTargetTest, testDeviceIdIsUnique) { + std::unordered_set foundDeviceIds; + int myDeviceId = 0; + + ScopedAStatus status = getHal()->getMyDeviceId(&myDeviceId); + + ASSERT_TRUE(status.isOk()) << "Failed to call getMyDeviceId, status: " << status; + foundDeviceIds.insert(myDeviceId); + + std::vector otherDeviceIds; + + status = getHal()->getOtherDeviceIds(&otherDeviceIds); + + ASSERT_TRUE(status.isOk()) << "Failed to call getOtherDeviceIds, status: " << status; + + for (int deviceId : otherDeviceIds) { + EXPECT_THAT(foundDeviceIds, Not(Contains(deviceId))) << "Duplicate device ID: " << deviceId; + foundDeviceIds.insert(deviceId); + } +} + +ScopedAStatus VtsHalIvnTargetTest::getAllDeviceIds(std::unordered_set* deviceIds) { + int myDeviceId = 0; + ScopedAStatus status = getHal()->getMyDeviceId(&myDeviceId); + + if (!status.isOk()) { + return status; + } + deviceIds->insert(myDeviceId); + std::vector otherDeviceIds; + status = getHal()->getOtherDeviceIds(&otherDeviceIds); + if (!status.isOk()) { + return status; + } + for (int otherDeviceId : otherDeviceIds) { + deviceIds->insert(otherDeviceId); + } + return ScopedAStatus::ok(); +} + +TEST_P(VtsHalIvnTargetTest, testDeviceIdOccupantZoneMapping) { + std::unordered_set allDeviceIds; + + ScopedAStatus status = getAllDeviceIds(&allDeviceIds); + + ASSERT_FALSE(allDeviceIds.empty()); + ASSERT_TRUE(status.isOk()) << "Failed to get all device IDs, status: " << status; + + std::unordered_set foundOccupantZoneIds; + + for (int deviceId : allDeviceIds) { + std::vector occupantZones; + status = getHal()->getOccupantZonesForDevice(deviceId, &occupantZones); + + ASSERT_TRUE(status.isOk()) + << "Failed to call getOccupantZonesForDevice, status: " << status; + ASSERT_FALSE(occupantZones.empty()) << "No occupant zones for device: " << deviceId; + + for (const OccupantZoneInfo& occupantZone : occupantZones) { + int zoneId = occupantZone.zoneId; + + EXPECT_THAT(foundOccupantZoneIds, Not(Contains(zoneId))) + << "Duplicate zone ID: " << zoneId; + + foundOccupantZoneIds.insert(zoneId); + + int gotDeviceId = 0; + status = getHal()->getDeviceIdForOccupantZone(zoneId, &gotDeviceId); + + ASSERT_TRUE(status.isOk()) + << "Failed to call getDeviceIdForOccupantZone, status: " << status; + EXPECT_EQ(deviceId, gotDeviceId); + } + } +} + +TEST_P(VtsHalIvnTargetTest, testGetEndpointInfo) { + EndpointInfo endpointInfo; + std::vector foundEndpointInfo; + + ScopedAStatus status = getHal()->getMyEndpointInfo(&endpointInfo); + + foundEndpointInfo.push_back(endpointInfo); + + ASSERT_TRUE(status.isOk()) << "Failed to call getMyEndpointInfo, status: " << status; + EXPECT_EQ(endpointInfo.connectProtocol, ConnectProtocol::TCP_IP); + + std::vector otherDeviceIds; + status = getHal()->getOtherDeviceIds(&otherDeviceIds); + + ASSERT_TRUE(status.isOk()) << "Failed to call getOtherDeviceIds, status: " << status; + + for (int deviceId : otherDeviceIds) { + status = getHal()->getEndpointInfoForDevice(deviceId, &endpointInfo); + + ASSERT_TRUE(status.isOk()) << "Failed to call getEndpointInfoForDevice, status: " << status; + EXPECT_EQ(endpointInfo.connectProtocol, ConnectProtocol::TCP_IP); + + for (EndpointInfo foundInfo : foundEndpointInfo) { + ASSERT_NE(foundInfo, endpointInfo) + << "Found duplicate endpoint info" << endpointInfo.toString(); + } + + foundEndpointInfo.push_back(endpointInfo); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VtsHalIvnTargetTest); + +INSTANTIATE_TEST_SUITE_P( + PerInstance, VtsHalIvnTargetTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IIvnAndroidDevice::descriptor)), + ::android::PrintInstanceNameToString); + +} // namespace aidl::android::hardware::automotive::ivn diff --git a/automotive/occupant_awareness/aidl/default/Android.bp b/automotive/occupant_awareness/aidl/default/Android.bp index 1ae8689f22..dc280dfd3f 100644 --- a/automotive/occupant_awareness/aidl/default/Android.bp +++ b/automotive/occupant_awareness/aidl/default/Android.bp @@ -40,3 +40,21 @@ cc_binary { "android.hardware.automotive.occupant_awareness-V1-ndk", ], } + +cc_fuzz { + name: "android.hardware.automotive.occupant_awareness-service.fuzzer", + defaults: ["service_fuzzer_defaults"], + static_libs: [ + "android.hardware.automotive.occupant_awareness-V1-ndk", + "liblog", + ], + srcs: [ + "fuzzer.cpp", + "OccupantAwareness.cpp", + ], + fuzz_config: { + cc: [ + "keithmok@google.com", + ], + }, +} diff --git a/automotive/occupant_awareness/aidl/default/fuzzer.cpp b/automotive/occupant_awareness/aidl/default/fuzzer.cpp new file mode 100644 index 0000000000..551b83a0e8 --- /dev/null +++ b/automotive/occupant_awareness/aidl/default/fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include + +#include "OccupantAwareness.h" + +using ::aidl::android::hardware::automotive::occupant_awareness::IOccupantAwareness; +using ::android::fuzzService; +using ::android::hardware::automotive::occupant_awareness::V1_0::implementation::OccupantAwareness; +using ::ndk::ScopedAStatus; +using ::ndk::SharedRefBase; + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + auto occupantAwareness = SharedRefBase::make(); + + fuzzService(occupantAwareness->asBinder().get(), FuzzedDataProvider(data, size)); + + return 0; +} diff --git a/automotive/remoteaccess/Android.bp b/automotive/remoteaccess/Android.bp index ac04354609..7cd6f60fe9 100644 --- a/automotive/remoteaccess/Android.bp +++ b/automotive/remoteaccess/Android.bp @@ -36,4 +36,12 @@ aidl_interface { ], }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/.hash b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/.hash new file mode 100644 index 0000000000..66eed7f0fa --- /dev/null +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/.hash @@ -0,0 +1 @@ +67d4a3a069e9240732d2945a4b5f7868f266431b diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/ApState.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/ApState.aidl new file mode 100644 index 0000000000..da4f1d4304 --- /dev/null +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/ApState.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.remoteaccess; +@VintfStability +parcelable ApState { + boolean isReadyForRemoteTask; + boolean isWakeupRequired; +} diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl new file mode 100644 index 0000000000..b0935c2fb2 --- /dev/null +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.remoteaccess; +@VintfStability +interface IRemoteAccess { + String getVehicleId(); + String getWakeupServiceName(); + String getProcessorId(); + void setRemoteTaskCallback(android.hardware.automotive.remoteaccess.IRemoteTaskCallback callback); + void clearRemoteTaskCallback(); + void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state); +} diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl new file mode 100644 index 0000000000..295100ea51 --- /dev/null +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/1/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.remoteaccess; +@VintfStability +interface IRemoteTaskCallback { + oneway void onRemoteTaskRequested(String clientId, in byte[] data); +} diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index 9b6eb2f297..b0935c2fb2 100644 --- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -34,8 +34,9 @@ package android.hardware.automotive.remoteaccess; @VintfStability interface IRemoteAccess { - String getDeviceId(); + String getVehicleId(); String getWakeupServiceName(); + String getProcessorId(); void setRemoteTaskCallback(android.hardware.automotive.remoteaccess.IRemoteTaskCallback callback); void clearRemoteTaskCallback(); void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state); diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index a198b038a5..0f4125f475 100644 --- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -28,19 +28,19 @@ import android.hardware.automotive.remoteaccess.IRemoteTaskCallback; @VintfStability interface IRemoteAccess { /** - * Gets a unique device ID that could be recognized by wake up server. + * Gets a unique vehicle ID that could be recognized by wake up server. * - * This device ID is provisioned during car production and is registered + *

This vehicle ID is provisioned during car production and is registered * with the wake up server. * - * @return a unique device ID. + * @return a unique vehicle ID. */ - String getDeviceId(); + String getVehicleId(); /** * Gets the name for the remote wakeup server. * - * This name will be provided to remote task server during registration + *

This name will be provided to remote task server during registration * and used by remote task server to find the remote wakeup server to * use for waking up the device. This name must be pre-negotiated between * the remote wakeup server/client and the remote task server/client and @@ -50,6 +50,17 @@ interface IRemoteAccess { */ String getWakeupServiceName(); + /** + * Gets a unique processor ID that could be recognized by wake up client. + * + *

This processor ID is used to identify each processor in the vehicle. + * The wake up client which handles many processors determines which + * processor to wake up from the processor ID. + * + *

The processor ID must be unique in the vehicle. + */ + String getProcessorId(); + /** * Sets a callback to be called when a remote task is requested. * diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl index 7a1616f107..2cd7a5db6b 100644 --- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl +++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl @@ -24,6 +24,10 @@ interface IRemoteTaskCallback { /** * A callback that is called when a remote task is requested. * + * The data is passed down from the remote server to the remote task client + * which is an Android application, and is not interpreted/parsed by the + * Android system. + * * @param clientId An ID to uniquely identify a remote task client. * @param data Opaque task data passed to the remote task client. */ diff --git a/automotive/remoteaccess/bind_to_device_socket_mutator/Android.bp b/automotive/remoteaccess/bind_to_device_socket_mutator/Android.bp new file mode 100644 index 0000000000..cde021938f --- /dev/null +++ b/automotive/remoteaccess/bind_to_device_socket_mutator/Android.bp @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_defaults { + name: "BindToDeviceSocketMutatorDefaults", + static_libs: [ + "android.hardware.automotive.can@libnetdevice", + "libnl++", + ], + shared_libs: [ + "libbase", + "liblog", + "libgrpc++", + ], + cflags: [ + "-Wno-unused-parameter", + ], +} + +cc_library { + name: "BindToDeviceSocketMutatorLib", + vendor_available: true, + srcs: ["src/BindToDeviceSocketMutator.cpp"], + export_include_dirs: ["include"], + defaults: ["BindToDeviceSocketMutatorDefaults"], + header_libs: ["libgrpc++_internal_headers"], +} diff --git a/automotive/remoteaccess/bind_to_device_socket_mutator/include/BindToDeviceSocketMutator.h b/automotive/remoteaccess/bind_to_device_socket_mutator/include/BindToDeviceSocketMutator.h new file mode 100644 index 0000000000..5974c4b366 --- /dev/null +++ b/automotive/remoteaccess/bind_to_device_socket_mutator/include/BindToDeviceSocketMutator.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::remoteaccess { + +grpc_socket_mutator* MakeBindToDeviceSocketMutator(std::string_view interface_name); + +} // namespace android::hardware::automotive::remoteaccess diff --git a/automotive/remoteaccess/bind_to_device_socket_mutator/src/BindToDeviceSocketMutator.cpp b/automotive/remoteaccess/bind_to_device_socket_mutator/src/BindToDeviceSocketMutator.cpp new file mode 100644 index 0000000000..04a4c5bde9 --- /dev/null +++ b/automotive/remoteaccess/bind_to_device_socket_mutator/src/BindToDeviceSocketMutator.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BindToDeviceSocketMutator.h" + +#include +#include +#include +#include + +#include + +namespace android::hardware::automotive::remoteaccess { +namespace { + +struct BindToDeviceMutator : grpc_socket_mutator { + std::string ifname; +}; + +bool MutateFd(int fd, grpc_socket_mutator* mutator) { + auto* bdm = static_cast(mutator); + int ret = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, bdm->ifname.c_str(), bdm->ifname.size()); + if (ret != 0) { + PLOG(ERROR) << "Can't bind socket to interface " << bdm->ifname; + return false; + } + return true; +} + +int Compare(grpc_socket_mutator* a, grpc_socket_mutator* b) { + return ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0)); +} + +void Destroy(grpc_socket_mutator* mutator) { + auto* bdm = static_cast(mutator); + delete bdm; +} + +constexpr grpc_socket_mutator_vtable kMutatorVtable = { + .mutate_fd = MutateFd, + .compare = Compare, + .destroy = Destroy, +}; + +} // namespace + +grpc_socket_mutator* MakeBindToDeviceSocketMutator(std::string_view interface_name) { + auto* bdm = new BindToDeviceMutator; + grpc_socket_mutator_init(bdm, &kMutatorVtable); + bdm->ifname = interface_name; + return bdm; +} + +} // namespace android::hardware::automotive::remoteaccess diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp index f27b8f86e6..01556670ec 100644 --- a/automotive/remoteaccess/hal/default/Android.bp +++ b/automotive/remoteaccess/hal/default/Android.bp @@ -22,22 +22,27 @@ cc_defaults { name: "remote-access-hal-defaults", vendor: true, relative_install_path: "hw", - srcs: ["src/RemoteAccessImpl.cpp"], + srcs: [ + "src/RemoteAccessImpl.cpp", + ], whole_static_libs: [ "RemoteAccessService", ], + static_libs: [ + "BindToDeviceSocketMutatorLib", + ], shared_libs: [ - "libbase", "libbinder_ndk", - "liblog", "libutils", - "libgrpc++", "libprotobuf-cpp-full", ], defaults: [ "vhalclient_defaults", + "BindToDeviceSocketMutatorDefaults", ], cflags: [ + // This is already included in BindToDeviceSocketMutatorDefaults but + // might be overridden by vhalclient_defaults. "-Wno-unused-parameter", ], } @@ -59,6 +64,7 @@ cc_binary { init_rc: ["remoteaccess-tcu-test-service.rc"], cflags: [ "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"", + "-DGRPC_SERVICE_IFNAME=\"eth1\"", ], } diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h index 74c2af4c9f..b18986adac 100644 --- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h +++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h @@ -62,7 +62,9 @@ class RemoteAccessService ~RemoteAccessService(); - ndk::ScopedAStatus getDeviceId(std::string* deviceId) override; + ndk::ScopedAStatus getVehicleId(std::string* vehicleId) override; + + ndk::ScopedAStatus getProcessorId(std::string* processorId) override; ndk::ScopedAStatus getWakeupServiceName(std::string* wakeupServiceName) override; @@ -95,19 +97,32 @@ class RemoteAccessService bool mTaskWaitStopped GUARDED_BY(mLock); // A mutex to make sure startTaskLoop does not overlap with stopTaskLoop. std::mutex mStartStopTaskLoopLock; - bool mTaskLoopRunning GUARDED_BY(mStartStopTaskLoopLock); + bool mTaskLoopRunning GUARDED_BY(mStartStopTaskLoopLock) = false; + bool mGrpcConnected GUARDED_BY(mLock) = false; + std::unordered_map mClientIdToTaskCount GUARDED_BY(mLock); + // Default wait time before retry connecting to remote access client is 10s. size_t mRetryWaitInMs = 10'000; std::shared_ptr mDebugCallback; + std::thread mInjectDebugTaskThread; + void runTaskLoop(); void maybeStartTaskLoop(); void maybeStopTaskLoop(); - ndk::ScopedAStatus getDeviceIdWithClient( - android::frameworks::automotive::vhal::IVhalClient& client, std::string* deviceId); + ndk::ScopedAStatus getVehicleIdWithClient( + android::frameworks::automotive::vhal::IVhalClient& client, std::string* vehicleId); void setRetryWaitInMs(size_t retryWaitInMs) { mRetryWaitInMs = retryWaitInMs; } void dumpHelp(int fd); + void printCurrentStatus(int fd); + std::string clientIdToTaskCountToStringLocked() REQUIRES(mLock); + void debugInjectTask(int fd, std::string_view clientId, std::string_view taskData); + void debugInjectTaskNextReboot(int fd, std::string_view clientId, std::string_view taskData, + const char* latencyInSecStr); + void updateGrpcConnected(bool connected); + android::base::Result deliverRemoteTaskThroughCallback(const std::string& clientId, + std::string_view taskData); }; } // namespace remoteaccess diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc index 6437d70f08..59315ebe0b 100644 --- a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc +++ b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc @@ -2,3 +2,4 @@ service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.r class hal user vehicle_network group system inet + capabilities NET_RAW diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp index 8720c2f5c6..b091162000 100644 --- a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp +++ b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp @@ -18,45 +18,60 @@ #include "RemoteAccessService.h" +#include "BindToDeviceSocketMutator.h" + +#include #include #include #include +#include #include -#include constexpr char SERVICE_NAME[] = "android.hardware.automotive.remoteaccess.IRemoteAccess/default"; int main(int /* argc */, char* /* argv */[]) { - ALOGI("Registering RemoteAccessService as service..."); + LOG(INFO) << "Registering RemoteAccessService as service..."; #ifndef GRPC_SERVICE_ADDRESS - ALOGE("GRPC_SERVICE_ADDRESS is not defined, exiting"); + LOG(ERROR) << "GRPC_SERVICE_ADDRESS is not defined, exiting"; exit(1); #endif - auto channel = grpc::CreateChannel(GRPC_SERVICE_ADDRESS, grpc::InsecureChannelCredentials()); + grpc::ChannelArguments grpcargs = {}; + +#ifdef GRPC_SERVICE_IFNAME + grpcargs.SetSocketMutator( + android::hardware::automotive::remoteaccess::MakeBindToDeviceSocketMutator( + GRPC_SERVICE_IFNAME)); + LOG(DEBUG) << "GRPC_SERVICE_IFNAME specified as: " << GRPC_SERVICE_IFNAME; + LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME; + android::netdevice::waitFor({GRPC_SERVICE_IFNAME}, + android::netdevice::WaitCondition::PRESENT_AND_UP); + LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME << " done"; +#endif + auto channel = grpc::CreateCustomChannel(GRPC_SERVICE_ADDRESS, + grpc::InsecureChannelCredentials(), grpcargs); auto clientStub = android::hardware::automotive::remoteaccess::WakeupClient::NewStub(channel); auto service = ndk::SharedRefBase::make< android::hardware::automotive::remoteaccess::RemoteAccessService>(clientStub.get()); binder_exception_t err = AServiceManager_addService(service->asBinder().get(), SERVICE_NAME); if (err != EX_NONE) { - ALOGE("failed to register android.hardware.automotive.remote.IRemoteAccess service, " - "exception: %d", - err); + LOG(ERROR) << "failed to register android.hardware.automotive.remote.IRemoteAccess service" + << ", exception: " << err; exit(1); } if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) { - ALOGE("%s", "failed to set thread pool max thread count"); + LOG(ERROR) << "failed to set thread pool max thread count"; exit(1); } ABinderProcess_startThreadPool(); - ALOGI("RemoteAccess service Ready"); + LOG(INFO) << "RemoteAccess service Ready"; ABinderProcess_joinThreadPool(); - ALOGW("Should not reach here"); + LOG(ERROR) << "Should not reach here"; return 0; } diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp index 4be30a20fa..5081ac0a9b 100644 --- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp +++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp @@ -18,12 +18,16 @@ #include #include +#include #include #include #include #include +#include #include #include +#include +#include #include namespace android { @@ -36,6 +40,9 @@ namespace { using ::aidl::android::hardware::automotive::remoteaccess::ApState; using ::aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::android::base::Error; +using ::android::base::ParseInt; +using ::android::base::Result; using ::android::base::ScopedLockAssertion; using ::android::base::StringAppendF; using ::android::base::StringPrintf; @@ -48,13 +55,19 @@ using ::grpc::StatusCode; using ::ndk::ScopedAStatus; const std::string WAKEUP_SERVICE_NAME = "com.google.vehicle.wakeup"; +const std::string PROCESSOR_ID = "application_processor"; constexpr char COMMAND_SET_AP_STATE[] = "--set-ap-state"; constexpr char COMMAND_START_DEBUG_CALLBACK[] = "--start-debug-callback"; constexpr char COMMAND_STOP_DEBUG_CALLBACK[] = "--stop-debug-callback"; constexpr char COMMAND_SHOW_TASK[] = "--show-task"; -constexpr char COMMAND_GET_DEVICE_ID[] = "--get-device-id"; +constexpr char COMMAND_GET_VEHICLE_ID[] = "--get-vehicle-id"; +constexpr char COMMAND_INJECT_TASK[] = "--inject-task"; +constexpr char COMMAND_INJECT_TASK_NEXT_REBOOT[] = "--inject-task-next-reboot"; +constexpr char COMMAND_STATUS[] = "--status"; -std::vector stringToBytes(const std::string& s) { +constexpr char DEBUG_TASK_FILE[] = "/data/vendor/remoteaccess/debugTask"; + +std::vector stringToBytes(std::string_view s) { const char* data = s.data(); return std::vector(data, data + s.size()); } @@ -80,13 +93,50 @@ void dprintErrorStatus(int fd, const char* detail, const ScopedAStatus& status) dprintf(fd, "%s, code: %d, error: %s\n", detail, status.getStatus(), status.getMessage()); } +std::string boolToString(bool x) { + return x ? "true" : "false"; +} + } // namespace RemoteAccessService::RemoteAccessService(WakeupClient::StubInterface* grpcStub) - : mGrpcStub(grpcStub){}; + : mGrpcStub(grpcStub) { + std::ifstream debugTaskFile; + debugTaskFile.open(DEBUG_TASK_FILE, std::ios::in); + if (!debugTaskFile.is_open()) { + ALOGD("No debug task available"); + return; + } + + char buffer[1024] = {}; + debugTaskFile.getline(buffer, sizeof(buffer)); + std::string clientId = std::string(buffer); + debugTaskFile.getline(buffer, sizeof(buffer)); + std::string taskData = std::string(buffer); + int latencyInSec; + debugTaskFile >> latencyInSec; + debugTaskFile.close(); + + ALOGD("Task for client: %s, data: [%s], latency: %d\n", clientId.c_str(), taskData.c_str(), + latencyInSec); + + mInjectDebugTaskThread = std::thread([this, clientId, taskData, latencyInSec] { + std::this_thread::sleep_for(std::chrono::seconds(latencyInSec)); + if (auto result = deliverRemoteTaskThroughCallback(clientId, taskData); !result.ok()) { + ALOGE("Failed to inject debug task, clientID: %s, taskData: %s, error: %s", + clientId.c_str(), taskData.c_str(), result.error().message().c_str()); + return; + } + ALOGD("Task for client: %s, data: [%s] successfully injected\n", clientId.c_str(), + taskData.c_str()); + }); +} RemoteAccessService::~RemoteAccessService() { maybeStopTaskLoop(); + if (mInjectDebugTaskThread.joinable()) { + mInjectDebugTaskThread.join(); + } } void RemoteAccessService::maybeStartTaskLoop() { @@ -125,6 +175,33 @@ void RemoteAccessService::maybeStopTaskLoop() { mTaskLoopRunning = false; } +void RemoteAccessService::updateGrpcConnected(bool connected) { + std::lock_guard lockGuard(mLock); + mGrpcConnected = connected; +} + +Result RemoteAccessService::deliverRemoteTaskThroughCallback(const std::string& clientId, + std::string_view taskData) { + std::shared_ptr callback; + { + std::lock_guard lockGuard(mLock); + callback = mRemoteTaskCallback; + mClientIdToTaskCount[clientId] += 1; + } + if (callback == nullptr) { + return Error() << "No callback registered, task ignored"; + } + ALOGD("Calling onRemoteTaskRequested callback for client ID: %s", clientId.c_str()); + ScopedAStatus callbackStatus = + callback->onRemoteTaskRequested(clientId, stringToBytes(taskData)); + if (!callbackStatus.isOk()) { + return Error() << "Failed to call onRemoteTaskRequested callback, status: " + << callbackStatus.getStatus() + << ", message: " << callbackStatus.getMessage(); + } + return {}; +} + void RemoteAccessService::runTaskLoop() { GetRemoteTasksRequest request = {}; std::unique_ptr> reader; @@ -134,28 +211,19 @@ void RemoteAccessService::runTaskLoop() { mGetRemoteTasksContext.reset(new ClientContext()); reader = mGrpcStub->GetRemoteTasks(mGetRemoteTasksContext.get(), request); } + updateGrpcConnected(true); GetRemoteTasksResponse response; while (reader->Read(&response)) { ALOGI("Receiving one task from remote task client"); - std::shared_ptr callback; - { - std::lock_guard lockGuard(mLock); - callback = mRemoteTaskCallback; - } - if (callback == nullptr) { - ALOGD("No callback registered, task ignored"); + if (auto result = + deliverRemoteTaskThroughCallback(response.clientid(), response.data()); + !result.ok()) { + ALOGE("%s", result.error().message().c_str()); continue; } - ALOGD("Calling onRemoteTaskRequested callback for client ID: %s", - response.clientid().c_str()); - ScopedAStatus callbackStatus = callback->onRemoteTaskRequested( - response.clientid(), stringToBytes(response.data())); - if (!callbackStatus.isOk()) { - ALOGE("Failed to call onRemoteTaskRequested callback, status: %d, message: %s", - callbackStatus.getStatus(), callbackStatus.getMessage()); - } } + updateGrpcConnected(false); Status status = reader->Finish(); mGetRemoteTasksContext.reset(); @@ -176,23 +244,23 @@ void RemoteAccessService::runTaskLoop() { } } -ScopedAStatus RemoteAccessService::getDeviceId(std::string* deviceId) { +ScopedAStatus RemoteAccessService::getVehicleId(std::string* vehicleId) { #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION auto vhalClient = IVhalClient::tryCreate(); if (vhalClient == nullptr) { ALOGE("Failed to connect to VHAL"); return ScopedAStatus::fromServiceSpecificErrorWithMessage( - /*errorCode=*/0, "Failed to connect to VHAL to get device ID"); + /*errorCode=*/0, "Failed to connect to VHAL to get vehicle ID"); } - return getDeviceIdWithClient(*vhalClient.get(), deviceId); + return getVehicleIdWithClient(*vhalClient.get(), vehicleId); #else // Don't use VHAL client in fuzzing since IPC is not allowed. return ScopedAStatus::ok(); #endif } -ScopedAStatus RemoteAccessService::getDeviceIdWithClient(IVhalClient& vhalClient, - std::string* deviceId) { +ScopedAStatus RemoteAccessService::getVehicleIdWithClient(IVhalClient& vhalClient, + std::string* vehicleId) { auto result = vhalClient.getValueSync( *vhalClient.createHalPropValue(toInt(VehicleProperty::INFO_VIN))); if (!result.ok()) { @@ -200,7 +268,12 @@ ScopedAStatus RemoteAccessService::getDeviceIdWithClient(IVhalClient& vhalClient /*errorCode=*/0, ("failed to get INFO_VIN from VHAL: " + result.error().message()).c_str()); } - *deviceId = (*result)->getStringValue(); + *vehicleId = (*result)->getStringValue(); + return ScopedAStatus::ok(); +} + +ScopedAStatus RemoteAccessService::getProcessorId(std::string* processorId) { + *processorId = PROCESSOR_ID; return ScopedAStatus::ok(); } @@ -246,15 +319,20 @@ bool RemoteAccessService::checkDumpPermission() { } void RemoteAccessService::dumpHelp(int fd) { - dprintf(fd, "%s", - (std::string("RemoteAccess HAL debug interface, Usage: \n") + COMMAND_SET_AP_STATE + - " [0/1](isReadyForRemoteTask) [0/1](isWakeupRequired) Set the new AP state\n" + - COMMAND_START_DEBUG_CALLBACK + - " Start a debug callback that will record the received tasks\n" + - COMMAND_STOP_DEBUG_CALLBACK + " Stop the debug callback\n" + COMMAND_SHOW_TASK + - " Show tasks received by debug callback\n" + COMMAND_GET_DEVICE_ID + - " Get device id\n") - .c_str()); + dprintf(fd, + "RemoteAccess HAL debug interface, Usage: \n" + "%s [0/1](isReadyForRemoteTask) [0/1](isWakeupRequired): Set the new AP state\n" + "%s: Start a debug callback that will record the received tasks\n" + "%s: Stop the debug callback\n" + "%s: Show tasks received by debug callback\n" + "%s: Get vehicle id\n" + "%s [client_id] [task_data]: Inject a task\n" + "%s [client_id] [task_data] [latencyInSec]: " + "Inject a task on next reboot after latencyInSec seconds\n" + "%s: Show status\n", + COMMAND_SET_AP_STATE, COMMAND_START_DEBUG_CALLBACK, COMMAND_STOP_DEBUG_CALLBACK, + COMMAND_SHOW_TASK, COMMAND_GET_VEHICLE_ID, COMMAND_INJECT_TASK, + COMMAND_INJECT_TASK_NEXT_REBOOT, COMMAND_STATUS); } binder_status_t RemoteAccessService::dump(int fd, const char** args, uint32_t numArgs) { @@ -265,6 +343,7 @@ binder_status_t RemoteAccessService::dump(int fd, const char** args, uint32_t nu if (numArgs == 0) { dumpHelp(fd); + printCurrentStatus(fd); return STATUS_OK; } @@ -316,14 +395,28 @@ binder_status_t RemoteAccessService::dump(int fd, const char** args, uint32_t nu dprintf(fd, "Debug callback is not currently used, use \"%s\" first.\n", COMMAND_START_DEBUG_CALLBACK); } - } else if (!strcmp(args[0], COMMAND_GET_DEVICE_ID)) { - std::string deviceId; - auto status = getDeviceId(&deviceId); + } else if (!strcmp(args[0], COMMAND_GET_VEHICLE_ID)) { + std::string vehicleId; + auto status = getVehicleId(&vehicleId); if (!status.isOk()) { - dprintErrorStatus(fd, "Failed to get device ID", status); + dprintErrorStatus(fd, "Failed to get vehicle ID", status); } else { - dprintf(fd, "Device Id: %s\n", deviceId.c_str()); + dprintf(fd, "Vehicle Id: %s\n", vehicleId.c_str()); } + } else if (!strcmp(args[0], COMMAND_INJECT_TASK)) { + if (numArgs < 3) { + dumpHelp(fd); + return STATUS_OK; + } + debugInjectTask(fd, args[1], args[2]); + } else if (!strcmp(args[0], COMMAND_INJECT_TASK_NEXT_REBOOT)) { + if (numArgs < 4) { + dumpHelp(fd); + return STATUS_OK; + } + debugInjectTaskNextReboot(fd, args[1], args[2], args[3]); + } else if (!strcmp(args[0], COMMAND_STATUS)) { + printCurrentStatus(fd); } else { dumpHelp(fd); } @@ -331,6 +424,65 @@ binder_status_t RemoteAccessService::dump(int fd, const char** args, uint32_t nu return STATUS_OK; } +void RemoteAccessService::printCurrentStatus(int fd) { + std::lock_guard lockGuard(mLock); + dprintf(fd, + "\nRemoteAccess HAL status \n" + "Remote task callback registered: %s\n" + "Task receiving GRPC connection established: %s\n" + "Received task count by clientId: \n%s\n", + boolToString(mRemoteTaskCallback.get()).c_str(), boolToString(mGrpcConnected).c_str(), + clientIdToTaskCountToStringLocked().c_str()); +} + +void RemoteAccessService::debugInjectTask(int fd, std::string_view clientId, + std::string_view taskData) { + std::string clientIdCopy = std::string(clientId); + if (auto result = deliverRemoteTaskThroughCallback(clientIdCopy, taskData); !result.ok()) { + dprintf(fd, "Failed to inject task: %s\n", result.error().message().c_str()); + return; + } + dprintf(fd, "Task for client: %s, data: [%s] successfully injected\n", clientId.data(), + taskData.data()); +} + +void RemoteAccessService::debugInjectTaskNextReboot(int fd, std::string_view clientId, + std::string_view taskData, + const char* latencyInSecStr) { + int latencyInSec; + if (!ParseInt(latencyInSecStr, &latencyInSec)) { + dprintf(fd, "The input latency in second is not a valid integer"); + return; + } + std::ofstream debugTaskFile; + debugTaskFile.open(DEBUG_TASK_FILE, std::ios::out); + if (!debugTaskFile.is_open()) { + dprintf(fd, + "Failed to open debug task file, please run the command: " + "'adb shell touch %s' first\n", + DEBUG_TASK_FILE); + return; + } + if (taskData.find("\n") != std::string::npos) { + dprintf(fd, "Task data must not contain newline\n"); + return; + } + debugTaskFile << clientId << "\n" << taskData << "\n" << latencyInSec; + debugTaskFile.close(); + dprintf(fd, + "Task with clientId: %s, task data: %s, latency: %d sec scheduled for next reboot\n", + clientId.data(), taskData.data(), latencyInSec); +} + +std::string RemoteAccessService::clientIdToTaskCountToStringLocked() { + // Print the table header + std::string output = "| ClientId | Count |\n"; + for (const auto& [clientId, taskCount] : mClientIdToTaskCount) { + output += StringPrintf(" %-9s %-6zu\n", clientId.c_str(), taskCount); + } + return output; +} + ScopedAStatus DebugRemoteTaskCallback::onRemoteTaskRequested(const std::string& clientId, const std::vector& data) { std::lock_guard lockGuard(mLock); diff --git a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp index a220aebc5b..c5afd6300f 100644 --- a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp +++ b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp @@ -42,6 +42,7 @@ using ::android::frameworks::automotive::vhal::IHalPropValue; using ::android::frameworks::automotive::vhal::ISubscriptionCallback; using ::android::frameworks::automotive::vhal::ISubscriptionClient; using ::android::frameworks::automotive::vhal::IVhalClient; +using ::android::frameworks::automotive::vhal::VhalClientResult; using ::aidl::android::hardware::automotive::remoteaccess::ApState; using ::aidl::android::hardware::automotive::remoteaccess::BnRemoteTaskCallback; @@ -91,9 +92,6 @@ class MockGrpcClientStub : public WakeupClient::StubInterface { class FakeVhalClient final : public android::frameworks::automotive::vhal::IVhalClient { public: - template - using VhalClientResult = android::hardware::automotive::vehicle::VhalResult; - inline bool isAidlVhal() { return true; } VhalClientResult> getValueSync( @@ -189,8 +187,8 @@ class RemoteAccessServiceUnitTest : public ::testing::Test { void setRetryWaitInMs(size_t retryWaitInMs) { mService->setRetryWaitInMs(retryWaitInMs); } - ScopedAStatus getDeviceIdWithClient(IVhalClient& vhalClient, std::string* deviceId) { - return mService->getDeviceIdWithClient(vhalClient, deviceId); + ScopedAStatus getVehicleIdWithClient(IVhalClient& vhalClient, std::string* vehicleId) { + return mService->getVehicleIdWithClient(vhalClient, vehicleId); } private: @@ -360,13 +358,13 @@ TEST_F(RemoteAccessServiceUnitTest, TestGetRemoteTasksNotReadyAfterReady) { std::this_thread::sleep_for(std::chrono::milliseconds(150)); } -TEST_F(RemoteAccessServiceUnitTest, testGetDeviceId) { - std::string deviceId; +TEST_F(RemoteAccessServiceUnitTest, testGetVehicleId) { + std::string vehicleId; FakeVhalClient vhalClient; - ASSERT_TRUE(getDeviceIdWithClient(vhalClient, &deviceId).isOk()); - ASSERT_EQ(deviceId, kTestVin); + ASSERT_TRUE(getVehicleIdWithClient(vhalClient, &vehicleId).isOk()); + ASSERT_EQ(vehicleId, kTestVin); } } // namespace remoteaccess diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index 55a7720fc2..cfa3b0cd39 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -144,7 +144,7 @@ const ConfigDeclaration kVehicleProperties[]{ (int)VehicleUnit::MILES_PER_HOUR, (int)VehicleUnit::KILOMETERS_PER_HOUR}, }, - .initialValue = {.int32Values = {(int)VehicleUnit::KILOMETERS_PER_HOUR}}}, + .initialValue = {.int32Values = {(int)VehicleUnit::MILES_PER_HOUR}}}, {.config = { @@ -372,6 +372,15 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {0}}}, + {.config = + { + .prop = toInt(VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {(int)VehicleUnit::LITER, (int)VehicleUnit::US_GALLON}, + }, + .initialValue = {.int32Values = {(int)VehicleUnit::US_GALLON}}}, + {.config = { .prop = toInt(VehicleProperty::HW_KEY_INPUT), @@ -1174,13 +1183,14 @@ const ConfigDeclaration kVehicleProperties[]{ { .config = { - // VHAL_SUPPORTED_PROPERTY_IDS + // SUPPORTED_PROPERTY_IDS .prop = 289476424, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::STATIC, // Fetch 100 configs in one request. This number is just arbitrarily // chosen here. But some HAL impl with bigger config data may need a - // smaller number. + // smaller number to make sure the configs returned in one request + // fits the binder data size limitation. .configArray = {100}, }, // All supported property IDs. This list is checked by @@ -1192,22 +1202,22 @@ const ConfigDeclaration kVehicleProperties[]{ 289408517, 356518832, 356516106, 291504644, 291504649, 291504656, 291504901, 291504903, 287310600, 291504905, 287310602, 287310603, 291504908, 291504904, 392168201, 392168202, 289408514, 289408001, - 287310850, 287310851, 287310853, 289475088, 289475104, 289475120, - 354419984, 320865540, 320865556, 354419975, 354419976, 354419986, - 354419973, 354419974, 354419978, 354419977, 356517120, 356517121, - 356582673, 356517139, 289408269, 356517131, 358614275, 291570965, - 291505923, 289408270, 289408512, 287310855, 289408000, 289408008, - 289408009, 289407747, 291504900, 568332561, 371198722, 373295872, - 320867268, 322964416, 290521862, 287310858, 287310859, 289475072, - 289475073, 289409539, 299896064, 299896065, 299896066, 299896067, - 289410560, 289410561, 289410562, 289410563, 289410576, 289410577, - 289410578, 289410579, 289476368, 299895808, 639631617, 627048706, - 591397123, 554696964, 289410873, 289410874, 287313669, 299896583, - 299896584, 299896585, 299896586, 299896587, 286265121, 286265122, - 286265123, 290457094, 290459441, 299896626, 290459443, 289410868, - 289476405, 299896630, 289410871, 292556600, 557853201, 559950353, - 555756049, 554707473, 289410887, 557846324, 557911861, 568332086, - 557846327, 560992056, 289476424}}, + 287310850, 287310851, 287310853, 289408513, 289475088, 289475104, + 289475120, 354419984, 320865540, 320865556, 354419975, 354419976, + 354419986, 354419973, 354419974, 354419978, 354419977, 356517120, + 356517121, 356582673, 356517139, 289408269, 356517131, 358614275, + 291570965, 291505923, 289408270, 289408512, 287310855, 289408000, + 289408008, 289408009, 289407747, 291504900, 568332561, 371198722, + 373295872, 320867268, 322964416, 290521862, 287310858, 287310859, + 289475072, 289475073, 289409539, 299896064, 299896065, 299896066, + 299896067, 289410560, 289410561, 289410562, 289410563, 289410576, + 289410577, 289410578, 289410579, 289476368, 299895808, 639631617, + 627048706, 591397123, 554696964, 289410873, 289410874, 287313669, + 299896583, 299896584, 299896585, 299896586, 299896587, 286265121, + 286265122, 286265123, 290457094, 290459441, 299896626, 290459443, + 289410868, 289476405, 299896630, 289410871, 292556600, 557853201, + 559950353, 555756049, 554707473, 289410887, 557846324, 557911861, + 568332086, 557846327, 560992056, 289476424}}, }, #endif // ENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS }; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/GeneratorHub.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/GeneratorHub.cpp index 9be9ea7c8e..503afd2eb2 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/GeneratorHub.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/GeneratorHub.cpp @@ -28,11 +28,18 @@ namespace V2_0 { namespace impl { -GeneratorHub::GeneratorHub(const OnHalEvent& onHalEvent) - : mOnHalEvent(onHalEvent), mThread(&GeneratorHub::run, this) {} +GeneratorHub::GeneratorHub(const OnHalEvent& onHalEvent) : mOnHalEvent(onHalEvent) { + mThread = std::thread(&GeneratorHub::run, this); +} GeneratorHub::~GeneratorHub() { - mShuttingDownFlag.store(true); + { + // Even if the shared variable is atomic, it must be modified under the + // mutex in order to correctly publish the modification to the waiting + // thread. + std::unique_lock g(mLock); + mShuttingDownFlag.store(true); + } mCond.notify_all(); if (mThread.joinable()) { mThread.join(); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp index 25a1940e0e..edd4484016 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp @@ -124,6 +124,17 @@ class DefaultVhalImplTest : public ::testing::Test { android::ConcurrentQueue mEventQueue; android::ConcurrentQueue mHeartBeatQueue; + // Wait until receive enough events in receivedEvents. + void waitForEvents(std::vector* receivedEvents, size_t count) { + while (receivedEvents->size() < count) { + mEventQueue.waitForItems(); + auto newEvents = mEventQueue.flush(); + for (size_t i = 0; i < newEvents.size(); i++) { + receivedEvents->push_back(std::move(newEvents[i])); + } + } + } + private: void onHalEvent(VehiclePropValuePtr v) { if (v->prop != toInt(VehicleProperty::VHAL_HEARTBEAT)) { @@ -141,7 +152,7 @@ class DefaultVhalImplTest : public ::testing::Test { TEST_F(DefaultVhalImplTest, testListProperties) { std::vector configs = mHal->listProperties(); - EXPECT_EQ((size_t)123, configs.size()); + EXPECT_EQ((size_t)124, configs.size()); } TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) { @@ -314,26 +325,25 @@ TEST_F(DefaultVhalImplTest, testSubscribe) { ASSERT_EQ(StatusCode::OK, status); - std::this_thread::sleep_for(std::chrono::milliseconds(500)); + std::vector receivedEvents; + waitForEvents(&receivedEvents, 5); - // Modify the speed after 0.5 seconds. + // Modify the speed after 5 events arrive. VehiclePropValue value; value.prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED); value.value.floatValues.resize(1); value.value.floatValues[0] = 1.0f; ASSERT_EQ(StatusCode::OK, mHal->set(value)); - std::this_thread::sleep_for(std::chrono::milliseconds(500)); - - auto events = mEventQueue.flush(); - ASSERT_LE((size_t)10, events.size()); + waitForEvents(&receivedEvents, 10); // The first event should be the default value. - ASSERT_EQ((size_t)1, events[0]->value.floatValues.size()); - EXPECT_EQ(0.0f, events[0]->value.floatValues[0]); + ASSERT_EQ((size_t)1, receivedEvents[0]->value.floatValues.size()); + EXPECT_EQ(0.0f, receivedEvents[0]->value.floatValues[0]); // The last event should be the value after update. - ASSERT_EQ((size_t)1, events[events.size() - 1]->value.floatValues.size()); - EXPECT_EQ(1.0f, events[events.size() - 1]->value.floatValues[0]); + const auto& lastEvent = receivedEvents[receivedEvents.size() - 1]; + ASSERT_EQ((size_t)1, lastEvent->value.floatValues.size()); + EXPECT_EQ(1.0f, lastEvent->value.floatValues[0]); } TEST_F(DefaultVhalImplTest, testSubscribeInvalidProp) { @@ -402,7 +412,7 @@ TEST_F(DefaultVhalImplTest, testDump) { gotValue->timestamp = 0; std::string infoMake = toString(*gotValue); - EXPECT_THAT(std::string(buf), HasSubstr(infoMake)); + EXPECT_THAT(std::string(buf, sizeof(buf)), HasSubstr(infoMake)); } TEST_F(DefaultVhalImplTest, testSetPropInvalidAreaId) { @@ -746,8 +756,9 @@ TEST_F(DefaultVhalImplTest, testDebugGenFakeDataLinear) { // Clear existing events. mEventQueue.flush(); std::this_thread::sleep_for(std::chrono::milliseconds(500)); - // There should be no new events generated. - EXPECT_EQ((size_t)0, mEventQueue.flush().size()); + // Technically there should be no new events generated, however, there might still be one event + // in the queue while we are stopping the generator. + EXPECT_LE(mEventQueue.flush().size(), 1u); } std::string getTestFilePath(const char* filename) { diff --git a/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp b/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp index d7547f6556..2e59dbfc90 100644 --- a/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp +++ b/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp @@ -69,7 +69,7 @@ TEST(RecurrentTimerTest, multipleIntervals) { std::this_thread::sleep_for(milliseconds(100)); // This test is unstable, so set the tolerance to 50. ASSERT_EQ_WITH_TOLERANCE(100, counter1ms.load(), 50); - ASSERT_EQ_WITH_TOLERANCE(20, counter5ms.load(), 5); + ASSERT_EQ_WITH_TOLERANCE(20, counter5ms.load(), 10); } } // anonymous namespace diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index 9e4f252342..5b0a5055c1 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -57,46 +57,25 @@ enum VehiclePropertyType : int32_t { }; /** - * Vehicle Areas + * List of different supported area types for vehicle properties. * Used to construct property IDs in the VehicleProperty enum. * - * Some properties may be associated with particular vehicle areas. For - * example, VehicleProperty:DOOR_LOCK property must be associated with - * particular door, thus this property must be marked with - * VehicleArea:DOOR flag. + * Some properties may be associated with particular areas in the vehicle. For example, + * VehicleProperty#DOOR_LOCK property must be associated with a particular door, thus this property + * must be of the VehicleArea#DOOR area type. * - * Other properties may not be associated with particular vehicle area. - * These kinds of properties must have VehicleArea:GLOBAL flag. + * Other properties may not be associated with a particular area in the vehicle. These kinds of + * properties must be of the VehicleArea#GLOBAL area type. * - * [Definition] Area: An area represents a unique element of an AreaType. - * For instance, if AreaType is WINDOW, then an area may be FRONT_WINDSHIELD. - * - * [Definition] AreaID: An AreaID is a combination of one or more areas, - * and is represented using a bitmask of Area enums. Different AreaTypes may - * not be mixed in a single AreaID. For instance, a window area cannot be - * combined with a seat area in an AreaID. - * - * Rules for mapping a zoned property to AreaIDs: - * - A property must be mapped to an array of AreaIDs that are impacted when - * the property value changes. - * - Each element in the array must represent an AreaID, in which the - * property value can only be changed together in all the areas within - * the AreaID and never independently. That is, when the property value - * changes in one of the areas in an AreaID in the array, then it must - * automatically change in all other areas in the AreaID. - * - The property value must be independently controllable in any two - * different AreaIDs in the array. - * - An area must only appear once in the array of AreaIDs. That is, an - * area must only be part of a single AreaID in the array. - * - * [Definition] Global Property: A property that applies to the entire car - * and is not associated with a specific area. For example, FUEL_LEVEL, - * HVAC_STEERING_WHEEL_HEAT. - * - * Rules for mapping a global property to AreaIDs: - * - A global property must not be mapped to AreaIDs. -*/ + * Note: This is not the same as areaId used in VehicleAreaConfig. E.g. for a global property, the + * property ID is of the VehicleArea#GLOBAL area type, however, the area ID must be 0. + */ +// A better name would be VehicleAreaType enum VehicleArea : int32_t { + /** + * A global property is a property that applies to the entire vehicle and is not associated with + * a specific area. For example, FUEL_LEVEL, HVAC_STEERING_WHEEL_HEAT are global properties. + */ GLOBAL = 0x01000000, /** WINDOW maps to enum VehicleAreaWindow */ WINDOW = 0x03000000, @@ -829,10 +808,10 @@ enum VehicleProperty : int32_t { /* * HVAC Properties * - * Additional rules for mapping a zoned HVAC property (except - * HVAC_MAX_DEFROST_ON) to AreaIDs: - * - Every seat in VehicleAreaSeat that is available in the car, must be - * part of an AreaID in the AreaID array. + * Additional rules for mapping non-GLOBAL VehicleArea type HVAC properties + * to AreaIDs: + * - Every “area” for a specific VehicleArea type that is affected by the + * property, must be included in an area ID for that property. * * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two @@ -860,6 +839,16 @@ enum VehicleProperty : int32_t { * - ROW_1_LEFT * - ROW_1_RIGHT * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT + * + * Example 3: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three + * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). Suppose the car + * supports HVAC_AUTO_ON for just the two front seats. + * - A valid mapping set of AreaIDs for HVAC_AUTO_ON would be: + * - ROW_1_LEFT | ROW_1_RIGHT + * - If HVAC_AUTO_ON had two separate control units for the driver side + * and passenger side, an alternative mapping would be: + * - ROW_1_LEFT + * - ROW_1_RIGHT */ /** @@ -1800,11 +1789,11 @@ enum VehicleProperty : int32_t { * * This parameter selects the memory preset to use to select the seat * position. The minValue is always 0, and the maxValue determines the - * number of seat positions available. + * number of seat positions available (i.e. numSeatPositions - 1). * * For instance, if the driver's seat has 3 memory presets, the maxValue - * will be 3. When the user wants to select a preset, the desired preset - * number (1, 2, or 3) is set. + * will be 2. When the user wants to select a preset, the desired preset + * number (0, 1, or 2) is set. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:WRITE @@ -2117,6 +2106,12 @@ enum VehicleProperty : int32_t { | VehicleArea:SEAT), /** + * DO NOT USE + * + * This property is defined as type VehicleArea:GLOBAL, which means all seats use the same + * value. Use SEAT_HEADREST_HEIGHT_POS_V2 instead which fixes this issue by being defined as + * type VehicleArea:SEAT. + * * Headrest height position * * Sets the headrest height. diff --git a/automotive/vehicle/Android.bp b/automotive/vehicle/Android.bp new file mode 100644 index 0000000000..c0d71d7dac --- /dev/null +++ b/automotive/vehicle/Android.bp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_defaults { + name: "VehicleHalInterfaceDefaults", + static_libs: [ + "android.hardware.automotive.vehicle-V2-ndk", + "android.hardware.automotive.vehicle.property-V2-ndk", + ], +} diff --git a/automotive/vehicle/README.md b/automotive/vehicle/README.md new file mode 100644 index 0000000000..e0f03e224c --- /dev/null +++ b/automotive/vehicle/README.md @@ -0,0 +1,26 @@ +# Vehicle Hardware Abstraction Layer (VHAL) +--- + +This directory stores the VHAL interface definition and VHAL reference +implementation. + +## 2.0 (deprecated) + +HIDL based VHAL interface and reference implementation. + +## aidl + +AIDL based VHAL interfadce and reference implementation. + +## proto + +Protobuf used to pass message between emulator VHAL and emulator. + +## tools + +Dev tools related to VHAL. + +## vts + +VTS test for VHAL. The VTS test works for both AIDL and HIDL VHAL +implementation. Vendor implementation of VHAL must passes VTS. diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index 7e425540f5..da8416cd73 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -6,9 +6,24 @@ { "name": "VehicleHalDefaultConfigTest" }, + { + "name": "VehicleHalDefaultConfigTestEnableTestProperties" + }, + { + "name": "JsonConfigLoaderUnitTest" + }, + { + "name": "JsonConfigLoaderUnitTestEnableTestProperties" + }, { "name": "VehicleHalVehicleUtilsTest" }, + { + "name": "VehiclePropertyAnnotationCppTest" + }, + { + "name": "VehiclePropertyAnnotationJavaTest" + }, { "name": "FakeVehicleHardwareTest" }, diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp index 88d1c74eab..3b93bca76c 100644 --- a/automotive/vehicle/aidl/Android.bp +++ b/automotive/vehicle/aidl/Android.bp @@ -25,7 +25,7 @@ aidl_interface { name: "android.hardware.automotive.vehicle", vendor_available: true, srcs: [ - "android/hardware/automotive/vehicle/**/*.aidl", + "android/hardware/automotive/vehicle/*.aidl", ], frozen: true, stability: "vintf", @@ -47,6 +47,11 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], } diff --git a/automotive/vehicle/aidl/README.md b/automotive/vehicle/aidl/README.md new file mode 100644 index 0000000000..09f03b434e --- /dev/null +++ b/automotive/vehicle/aidl/README.md @@ -0,0 +1,23 @@ +# AIDL Vehicle Hardware Abstraction Layer (VHAL) +--- + +This directory stores the AIDL VHAL interface and reference implementation. + +## aidl_api + +Auto-generated current and previous versions of AIDL VHAL api. + +## aidl_test + +Contains a test to test that all HIDL VHAL properties are supported in +AIDL VHAL. + +## android + +Contains AIDL VHAL interface definition. The main interface file is +`android/hardware/automotive/vehicle/IVehicle.aidl`. + +## impl + +Reference implementation for AIDL VHAL and useful libraries for implementing +vendor AIDL VHAL. diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash index f4785043b5..d9fd5adc1d 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash @@ -1 +1,2 @@ 8610b651e162c614a97542d6f4ed039c969823e5 +0678e142246842695c1ba0524592fe2c3b789fc6 diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash new file mode 100644 index 0000000000..b04a6b5bbd --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash @@ -0,0 +1 @@ +a741c2814ba6e9852e106bc26e820d741f66ebb8 diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl new file mode 100644 index 0000000000..d88cd8b076 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueRequest { + long requestId; + android.hardware.automotive.vehicle.VehiclePropValue prop; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequests.aidl new file mode 100644 index 0000000000..a7df2ff24d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequests.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueRequests { + android.hardware.automotive.vehicle.GetValueRequest[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl new file mode 100644 index 0000000000..25f3575862 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueResult { + long requestId; + android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK; + @nullable android.hardware.automotive.vehicle.VehiclePropValue prop; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResults.aidl new file mode 100644 index 0000000000..4c365b1074 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResults.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueResults { + android.hardware.automotive.vehicle.GetValueResult[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/IVehicle.aidl new file mode 100644 index 0000000000..b5f62aa3bf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/IVehicle.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@VintfStability +interface IVehicle { + android.hardware.automotive.vehicle.VehiclePropConfigs getAllPropConfigs(); + android.hardware.automotive.vehicle.VehiclePropConfigs getPropConfigs(in int[] props); + void getValues(android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.GetValueRequests requests); + void setValues(android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SetValueRequests requests); + void subscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SubscribeOptions[] options, int maxSharedMemoryFileCount); + void unsubscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in int[] propIds); + void returnSharedMemory(in android.hardware.automotive.vehicle.IVehicleCallback callback, long sharedMemoryId); + const long INVALID_MEMORY_ID = 0; + const int MAX_SHARED_MEMORY_FILES_PER_CLIENT = 3; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/IVehicleCallback.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/IVehicleCallback.aidl new file mode 100644 index 0000000000..2c5a333dde --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/IVehicleCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@VintfStability +interface IVehicleCallback { + oneway void onGetValues(in android.hardware.automotive.vehicle.GetValueResults responses); + oneway void onSetValues(in android.hardware.automotive.vehicle.SetValueResults responses); + oneway void onPropertyEvent(in android.hardware.automotive.vehicle.VehiclePropValues propValues, int sharedMemoryFileCount); + oneway void onPropertySetError(in android.hardware.automotive.vehicle.VehiclePropErrors errors); +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl new file mode 100644 index 0000000000..e7b0a137cf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable RawPropValues { + int[] int32Values = {}; + float[] floatValues; + long[] int64Values; + byte[] byteValues; + @utf8InCpp String stringValue; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl new file mode 100644 index 0000000000..6a65307f3c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueRequest { + long requestId; + android.hardware.automotive.vehicle.VehiclePropValue value; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequests.aidl new file mode 100644 index 0000000000..15fd7ea8a8 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequests.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueRequests { + android.hardware.automotive.vehicle.SetValueRequest[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl new file mode 100644 index 0000000000..ec5fabb0b4 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueResult { + long requestId; + android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResults.aidl new file mode 100644 index 0000000000..47f16563ce --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResults.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueResults { + android.hardware.automotive.vehicle.SetValueResult[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/StatusCode.aidl new file mode 100644 index 0000000000..f7e8c5abf7 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/StatusCode.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum StatusCode { + OK = 0, + TRY_AGAIN = 1, + INVALID_ARG = 2, + NOT_AVAILABLE = 3, + ACCESS_DENIED = 4, + INTERNAL_ERROR = 5, + NOT_AVAILABLE_DISABLED = 6, + NOT_AVAILABLE_SPEED_LOW = 7, + NOT_AVAILABLE_SPEED_HIGH = 8, + NOT_AVAILABLE_POOR_VISIBILITY = 9, + NOT_AVAILABLE_SAFETY = 10, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl new file mode 100644 index 0000000000..91e7c1499a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SubscribeOptions { + int propId; + int[] areaIds; + float sampleRate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl new file mode 100644 index 0000000000..6960894f13 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehicleAreaConfig { + int areaId; + int minInt32Value; + int maxInt32Value; + long minInt64Value; + long maxInt64Value; + float minFloatValue; + float maxFloatValue; + @nullable long[] supportedEnumValues; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl new file mode 100644 index 0000000000..8602d2d03d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropConfig { + int prop; + android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE; + android.hardware.automotive.vehicle.VehiclePropertyChangeMode changeMode = android.hardware.automotive.vehicle.VehiclePropertyChangeMode.STATIC; + android.hardware.automotive.vehicle.VehicleAreaConfig[] areaConfigs; + int[] configArray; + @utf8InCpp String configString; + float minSampleRate; + float maxSampleRate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl new file mode 100644 index 0000000000..04c8006983 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropConfigs { + android.hardware.automotive.vehicle.VehiclePropConfig[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl new file mode 100644 index 0000000000..983529542f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropError { + int propId; + int areaId; + android.hardware.automotive.vehicle.StatusCode errorCode = android.hardware.automotive.vehicle.StatusCode.OK; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropErrors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropErrors.aidl new file mode 100644 index 0000000000..9dcb10bc9e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropErrors.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropErrors { + android.hardware.automotive.vehicle.VehiclePropError[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl new file mode 100644 index 0000000000..c87379fd9b --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropValue { + long timestamp; + int areaId; + int prop; + android.hardware.automotive.vehicle.VehiclePropertyStatus status = android.hardware.automotive.vehicle.VehiclePropertyStatus.AVAILABLE; + android.hardware.automotive.vehicle.RawPropValues value; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValues.aidl new file mode 100644 index 0000000000..e09a6b95df --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValues.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropValues { + android.hardware.automotive.vehicle.VehiclePropValue[] payloads; + long sharedMemoryId; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl new file mode 100644 index 0000000000..dde9a88fd3 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehiclePropertyAccess { + NONE = 0x00, + READ = 0x01, + WRITE = 0x02, + READ_WRITE = 0x03, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl new file mode 100644 index 0000000000..2f9d107e88 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehiclePropertyChangeMode { + STATIC = 0x00, + ON_CHANGE = 0x01, + CONTINUOUS = 0x02, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl new file mode 100644 index 0000000000..642ce83f21 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehiclePropertyStatus { + AVAILABLE = 0x00, + UNAVAILABLE = 0x01, + ERROR = 0x02, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl index 9b724126af..f7e8c5abf7 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl @@ -40,4 +40,9 @@ enum StatusCode { NOT_AVAILABLE = 3, ACCESS_DENIED = 4, INTERNAL_ERROR = 5, + NOT_AVAILABLE_DISABLED = 6, + NOT_AVAILABLE_SPEED_LOW = 7, + NOT_AVAILABLE_SPEED_HIGH = 8, + NOT_AVAILABLE_POOR_VISIBILITY = 9, + NOT_AVAILABLE_SAFETY = 10, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl index b93a11b60f..6960894f13 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -41,4 +41,5 @@ parcelable VehicleAreaConfig { long maxInt64Value; float minFloatValue; float maxFloatValue; + @nullable long[] supportedEnumValues; } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl deleted file mode 100644 index 04f8fa3b80..0000000000 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.automotive.vehicle; -@Backing(type="int") @VintfStability -enum VehicleProperty { - INVALID = 0, - INFO_VIN = 286261504, - INFO_MAKE = 286261505, - INFO_MODEL = 286261506, - INFO_MODEL_YEAR = 289407235, - INFO_FUEL_CAPACITY = 291504388, - INFO_FUEL_TYPE = 289472773, - INFO_EV_BATTERY_CAPACITY = 291504390, - INFO_EV_CONNECTOR_TYPE = 289472775, - INFO_FUEL_DOOR_LOCATION = 289407240, - INFO_EV_PORT_LOCATION = 289407241, - INFO_DRIVER_SEAT = 356516106, - INFO_EXTERIOR_DIMENSIONS = 289472779, - INFO_MULTI_EV_PORT_LOCATIONS = 289472780, - PERF_ODOMETER = 291504644, - PERF_VEHICLE_SPEED = 291504647, - PERF_VEHICLE_SPEED_DISPLAY = 291504648, - PERF_STEERING_ANGLE = 291504649, - PERF_REAR_STEERING_ANGLE = 291504656, - ENGINE_COOLANT_TEMP = 291504897, - ENGINE_OIL_LEVEL = 289407747, - ENGINE_OIL_TEMP = 291504900, - ENGINE_RPM = 291504901, - WHEEL_TICK = 290521862, - FUEL_LEVEL = 291504903, - FUEL_DOOR_OPEN = 287310600, - EV_BATTERY_LEVEL = 291504905, - EV_CHARGE_PORT_OPEN = 287310602, - EV_CHARGE_PORT_CONNECTED = 287310603, - EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 291504908, - RANGE_REMAINING = 291504904, - TIRE_PRESSURE = 392168201, - CRITICALLY_LOW_TIRE_PRESSURE = 392168202, - GEAR_SELECTION = 289408000, - CURRENT_GEAR = 289408001, - PARKING_BRAKE_ON = 287310850, - PARKING_BRAKE_AUTO_APPLY = 287310851, - FUEL_LEVEL_LOW = 287310853, - NIGHT_MODE = 287310855, - TURN_SIGNAL_STATE = 289408008, - IGNITION_STATE = 289408009, - ABS_ACTIVE = 287310858, - TRACTION_CONTROL_ACTIVE = 287310859, - HVAC_FAN_SPEED = 356517120, - HVAC_FAN_DIRECTION = 356517121, - HVAC_TEMPERATURE_CURRENT = 358614274, - HVAC_TEMPERATURE_SET = 358614275, - HVAC_DEFROSTER = 320865540, - HVAC_AC_ON = 354419973, - HVAC_MAX_AC_ON = 354419974, - HVAC_MAX_DEFROST_ON = 354419975, - HVAC_RECIRC_ON = 354419976, - HVAC_DUAL_ON = 354419977, - HVAC_AUTO_ON = 354419978, - HVAC_SEAT_TEMPERATURE = 356517131, - HVAC_SIDE_MIRROR_HEAT = 339739916, - HVAC_STEERING_WHEEL_HEAT = 289408269, - HVAC_TEMPERATURE_DISPLAY_UNITS = 289408270, - HVAC_ACTUAL_FAN_SPEED_RPM = 356517135, - HVAC_POWER_ON = 354419984, - HVAC_FAN_DIRECTION_AVAILABLE = 356582673, - HVAC_AUTO_RECIRC_ON = 354419986, - HVAC_SEAT_VENTILATION = 356517139, - HVAC_ELECTRIC_DEFROSTER_ON = 320865556, - HVAC_TEMPERATURE_VALUE_SUGGESTION = 291570965, - DISTANCE_DISPLAY_UNITS = 289408512, - FUEL_VOLUME_DISPLAY_UNITS = 289408513, - TIRE_PRESSURE_DISPLAY_UNITS = 289408514, - EV_BATTERY_DISPLAY_UNITS = 289408515, - FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 287311364, - VEHICLE_SPEED_DISPLAY_UNITS = 289408517, - EXTERNAL_CAR_TIME = 290457096, - ANDROID_EPOCH_TIME = 290457094, - STORAGE_ENCRYPTION_BINDING_SEED = 292554247, - ENV_OUTSIDE_TEMPERATURE = 291505923, - AP_POWER_STATE_REQ = 289475072, - AP_POWER_STATE_REPORT = 289475073, - AP_POWER_BOOTUP_REASON = 289409538, - DISPLAY_BRIGHTNESS = 289409539, - HW_KEY_INPUT = 289475088, - HW_ROTARY_INPUT = 289475104, - HW_CUSTOM_INPUT = 289475120, - DOOR_POS = 373295872, - DOOR_MOVE = 373295873, - DOOR_LOCK = 371198722, - MIRROR_Z_POS = 339741504, - MIRROR_Z_MOVE = 339741505, - MIRROR_Y_POS = 339741506, - MIRROR_Y_MOVE = 339741507, - MIRROR_LOCK = 287312708, - MIRROR_FOLD = 287312709, - SEAT_MEMORY_SELECT = 356518784, - SEAT_MEMORY_SET = 356518785, - SEAT_BELT_BUCKLED = 354421634, - SEAT_BELT_HEIGHT_POS = 356518787, - SEAT_BELT_HEIGHT_MOVE = 356518788, - SEAT_FORE_AFT_POS = 356518789, - SEAT_FORE_AFT_MOVE = 356518790, - SEAT_BACKREST_ANGLE_1_POS = 356518791, - SEAT_BACKREST_ANGLE_1_MOVE = 356518792, - SEAT_BACKREST_ANGLE_2_POS = 356518793, - SEAT_BACKREST_ANGLE_2_MOVE = 356518794, - SEAT_HEIGHT_POS = 356518795, - SEAT_HEIGHT_MOVE = 356518796, - SEAT_DEPTH_POS = 356518797, - SEAT_DEPTH_MOVE = 356518798, - SEAT_TILT_POS = 356518799, - SEAT_TILT_MOVE = 356518800, - SEAT_LUMBAR_FORE_AFT_POS = 356518801, - SEAT_LUMBAR_FORE_AFT_MOVE = 356518802, - SEAT_LUMBAR_SIDE_SUPPORT_POS = 356518803, - SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 356518804, - SEAT_HEADREST_HEIGHT_POS = 289409941, - SEAT_HEADREST_HEIGHT_MOVE = 356518806, - SEAT_HEADREST_ANGLE_POS = 356518807, - SEAT_HEADREST_ANGLE_MOVE = 356518808, - SEAT_HEADREST_FORE_AFT_POS = 356518809, - SEAT_HEADREST_FORE_AFT_MOVE = 356518810, - SEAT_OCCUPANCY = 356518832, - WINDOW_POS = 322964416, - WINDOW_MOVE = 322964417, - WINDOW_LOCK = 320867268, - VEHICLE_MAP_SERVICE = 299895808, - OBD2_LIVE_FRAME = 299896064, - OBD2_FREEZE_FRAME = 299896065, - OBD2_FREEZE_FRAME_INFO = 299896066, - OBD2_FREEZE_FRAME_CLEAR = 299896067, - HEADLIGHTS_STATE = 289410560, - HIGH_BEAM_LIGHTS_STATE = 289410561, - FOG_LIGHTS_STATE = 289410562, - HAZARD_LIGHTS_STATE = 289410563, - HEADLIGHTS_SWITCH = 289410576, - HIGH_BEAM_LIGHTS_SWITCH = 289410577, - FOG_LIGHTS_SWITCH = 289410578, - HAZARD_LIGHTS_SWITCH = 289410579, - CABIN_LIGHTS_STATE = 289410817, - CABIN_LIGHTS_SWITCH = 289410818, - READING_LIGHTS_STATE = 356519683, - READING_LIGHTS_SWITCH = 356519684, - SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 287313669, - DISABLED_OPTIONAL_FEATURES = 286265094, - INITIAL_USER_INFO = 299896583, - SWITCH_USER = 299896584, - CREATE_USER = 299896585, - REMOVE_USER = 299896586, - USER_IDENTIFICATION_ASSOCIATION = 299896587, - EVS_SERVICE_REQUEST = 289476368, - POWER_POLICY_REQ = 286265121, - POWER_POLICY_GROUP_REQ = 286265122, - CURRENT_POWER_POLICY = 286265123, - WATCHDOG_ALIVE = 290459441, - WATCHDOG_TERMINATED_PROCESS = 299896626, - VHAL_HEARTBEAT = 290459443, - CLUSTER_SWITCH_UI = 289410868, - CLUSTER_DISPLAY_STATE = 289476405, - CLUSTER_REPORT_STATE = 299896630, - CLUSTER_REQUEST_DISPLAY = 289410871, - CLUSTER_NAVIGATION_STATE = 292556600, - ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 289410873, - ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 289410874, - FRONT_FOG_LIGHTS_STATE = 289410875, - FRONT_FOG_LIGHTS_SWITCH = 289410876, - REAR_FOG_LIGHTS_STATE = 289410877, - REAR_FOG_LIGHTS_SWITCH = 289410878, - EV_CHARGE_CURRENT_DRAW_LIMIT = 291508031, - EV_CHARGE_PERCENT_LIMIT = 291508032, - EV_CHARGE_STATE = 289410881, - EV_CHARGE_SWITCH = 287313730, - EV_CHARGE_TIME_REMAINING = 289410883, - EV_REGENERATIVE_BRAKING_STATE = 289410884, - TRAILER_PRESENT = 289410885, - VEHICLE_CURB_WEIGHT = 289410886, -} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl index ec9587f60c..dde9a88fd3 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl @@ -34,8 +34,8 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehiclePropertyAccess { - NONE = 0, - READ = 1, - WRITE = 2, - READ_WRITE = 3, + NONE = 0x00, + READ = 0x01, + WRITE = 0x02, + READ_WRITE = 0x03, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl index 5455fdd5ca..2f9d107e88 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl @@ -34,7 +34,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehiclePropertyChangeMode { - STATIC = 0, - ON_CHANGE = 1, - CONTINUOUS = 2, + STATIC = 0x00, + ON_CHANGE = 0x01, + CONTINUOUS = 0x02, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl index 6d0e041ff6..642ce83f21 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl @@ -34,7 +34,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehiclePropertyStatus { - AVAILABLE = 0, - UNAVAILABLE = 1, - ERROR = 2, + AVAILABLE = 0x00, + UNAVAILABLE = 0x01, + ERROR = 0x02, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl deleted file mode 100644 index 58524f3c66..0000000000 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.automotive.vehicle; -@Backing(type="int") @VintfStability -enum VehicleVendorPermission { - PERMISSION_DEFAULT = 0, - PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 1, - PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 2, - PERMISSION_SET_VENDOR_CATEGORY_DOOR = 3, - PERMISSION_GET_VENDOR_CATEGORY_DOOR = 4, - PERMISSION_SET_VENDOR_CATEGORY_SEAT = 5, - PERMISSION_GET_VENDOR_CATEGORY_SEAT = 6, - PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 7, - PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 8, - PERMISSION_SET_VENDOR_CATEGORY_INFO = 9, - PERMISSION_GET_VENDOR_CATEGORY_INFO = 10, - PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 11, - PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 12, - PERMISSION_SET_VENDOR_CATEGORY_HVAC = 13, - PERMISSION_GET_VENDOR_CATEGORY_HVAC = 14, - PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 15, - PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 16, - PERMISSION_SET_VENDOR_CATEGORY_1 = 65536, - PERMISSION_GET_VENDOR_CATEGORY_1 = 69632, - PERMISSION_SET_VENDOR_CATEGORY_2 = 131072, - PERMISSION_GET_VENDOR_CATEGORY_2 = 135168, - PERMISSION_SET_VENDOR_CATEGORY_3 = 196608, - PERMISSION_GET_VENDOR_CATEGORY_3 = 200704, - PERMISSION_SET_VENDOR_CATEGORY_4 = 262144, - PERMISSION_GET_VENDOR_CATEGORY_4 = 266240, - PERMISSION_SET_VENDOR_CATEGORY_5 = 327680, - PERMISSION_GET_VENDOR_CATEGORY_5 = 331776, - PERMISSION_SET_VENDOR_CATEGORY_6 = 393216, - PERMISSION_GET_VENDOR_CATEGORY_6 = 397312, - PERMISSION_SET_VENDOR_CATEGORY_7 = 458752, - PERMISSION_GET_VENDOR_CATEGORY_7 = 462848, - PERMISSION_SET_VENDOR_CATEGORY_8 = 524288, - PERMISSION_GET_VENDOR_CATEGORY_8 = 528384, - PERMISSION_SET_VENDOR_CATEGORY_9 = 589824, - PERMISSION_GET_VENDOR_CATEGORY_9 = 593920, - PERMISSION_SET_VENDOR_CATEGORY_10 = 655360, - PERMISSION_GET_VENDOR_CATEGORY_10 = 659456, - PERMISSION_NOT_ACCESSIBLE = -268435456, -} diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp index 5284a0a8e1..44d7445d25 100644 --- a/automotive/vehicle/aidl/aidl_test/Android.bp +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -20,7 +20,7 @@ package { cc_test { name: "VehicleHalAidlHidlCompatibilityTest", - srcs: ["*.cpp"], + srcs: ["AidlHidlCompatibilityTest.cpp"], shared_libs: [ "libbinder_ndk", "libhidlbase", @@ -35,3 +35,26 @@ cc_test { test_suites: ["device-tests"], vendor: true, } + +cc_test { + name: "VehiclePropertyAnnotationCppTest", + srcs: ["VehiclePropertyAnnotationCppTest.cpp"], + header_libs: ["IVehicleGeneratedHeaders"], + defaults: ["VehicleHalInterfaceDefaults"], + test_suites: ["general-tests"], +} + +android_test { + name: "VehiclePropertyAnnotationJavaTest", + srcs: [ + "VehiclePropertyAnnotationJavaTest.java", + ":IVehicleGeneratedJavaFiles", + ], + static_libs: [ + "android.hardware.automotive.vehicle-V2-java", + "android.hardware.automotive.vehicle.property-V2-java", + "androidx.test.runner", + "truth-prebuilt", + ], + test_suites: ["general-tests"], +} diff --git a/automotive/vehicle/aidl/aidl_test/AndroidManifest.xml b/automotive/vehicle/aidl/aidl_test/AndroidManifest.xml new file mode 100644 index 0000000000..00fdf507ff --- /dev/null +++ b/automotive/vehicle/aidl/aidl_test/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + \ No newline at end of file diff --git a/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp new file mode 100644 index 0000000000..a4bbbe84e2 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include + +namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle; +using aidl_vehicle::AccessForVehicleProperty; +using aidl_vehicle::ChangeModeForVehicleProperty; +using aidl_vehicle::VehicleProperty; + +namespace { + template + bool doesAnnotationMapContainsAllProps(std::unordered_map annotationMap) { + for (const VehicleProperty& v : ::ndk::enum_range()) { + std::string name = aidl_vehicle::toString(v); + if (name == "INVALID") { + continue; + } + if (annotationMap.find(v) == annotationMap.end()) { + return false; + } + } + return true; + } + +} // namespace + +TEST(VehiclePropertyAnnotationCppTest, testChangeMode) { + ASSERT_TRUE(doesAnnotationMapContainsAllProps(ChangeModeForVehicleProperty)) + << "Outdated annotation-generated AIDL files. Please run " + << "generate_annotation_enums.py to update."; +} + +TEST(VehiclePropertyAnnotationCppTest, testAccess) { + ASSERT_TRUE(doesAnnotationMapContainsAllProps(AccessForVehicleProperty)) + << "Outdated annotation-generated AIDL files. Please run " + << "generate_annotation_enums.py to update."; +} diff --git a/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationJavaTest.java b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationJavaTest.java new file mode 100644 index 0000000000..ef49299475 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationJavaTest.java @@ -0,0 +1,60 @@ +package android.hardware.automotive.vehicle; + +import static com.google.common.truth.Truth.assertWithMessage; + +import static org.junit.Assert.fail; + +import androidx.test.filters.SmallTest; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Map; + +@RunWith(JUnit4.class) +public class VehiclePropertyAnnotationJavaTest { + + private boolean doesAnnotationMapContainsAllProps(Map annotationMap) { + for (Field field : VehicleProperty.class.getDeclaredFields()) { + int modifiers = field.getModifiers(); + try { + if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers) + && Modifier.isPublic(modifiers) && field.getType().equals(int.class)) { + int propId = field.getInt(/* obj= */ null); + if (propId == VehicleProperty.INVALID) { + // Skip INVALID_PROP. + continue; + } + if (annotationMap.get(propId) == null) { + return false; + } + } + } catch (IllegalAccessException e) { + throw new IllegalStateException( + "Cannot access a member for VehicleProperty.class", e); + } + } + return true; + } + + @Test + @SmallTest + public void testChangeMode() { + assertWithMessage("Outdated annotation-generated AIDL files. Please run " + + "generate_annotation_enums.py to update.") + .that(doesAnnotationMapContainsAllProps(ChangeModeForVehicleProperty.values)) + .isTrue(); + } + + @Test + @SmallTest + public void testAccess() { + assertWithMessage("Outdated annotation-generated AIDL files. Please run " + + "generate_annotation_enums.py to update.") + .that(doesAnnotationMapContainsAllProps(AccessForVehicleProperty.values)) + .isTrue(); + } +} \ No newline at end of file diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl index 47fc54b8dc..c896d143a7 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl @@ -190,6 +190,14 @@ interface IVehicle { * what the sampleRate specified in {@code options}, the timestamp for * the timestamp is updated 10 times/s. * + * If a property is unavailable for reading because it depends on some power + * state which is off, property change event may not be generated until the + * property becomes available. For ON_CHANGE property, if the property + * changes from NOT_AVAILABLE to OKAY for reading some or all area(s), for + * each area that becomes available for reading, one property change event + * must be generated. The event must contain the current value for the area + * and must have {@code AVAILABLE} status. + * * @param callback The subscription callbacks. * {@link IVehicleCallback#onPropertyEvent} would be called when a new * property event arrives. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl index 9c6875b0b5..28ccc1da01 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl @@ -20,8 +20,8 @@ package android.hardware.automotive.vehicle; @JavaDerive(equals=true, toString=true) parcelable RawPropValues { /** - * This is used for properties of types VehiclePropertyType#INT - * and VehiclePropertyType#INT_VEC + * This is used for properties of types VehiclePropertyType#INT32, + * VehiclePropertyType#BOOLEAN and VehiclePropertyType#INT32_VEC */ int[] int32Values = {}; @@ -31,7 +31,10 @@ parcelable RawPropValues { */ float[] floatValues; - /** This is used for properties of type VehiclePropertyType#INT64 */ + /** + * This is used for properties of type VehiclePropertyType#INT64 and + * VehiclePropertyType#INT64_VEC + */ long[] int64Values; /** This is used for properties of type VehiclePropertyType#BYTES */ diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl index 23019cada8..fd4b199bdb 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl @@ -17,14 +17,21 @@ package android.hardware.automotive.vehicle; /** - * Error codes used in vehicle HAL interface. + * Error codes used in vehicle HAL interface. System defined error codes will have the range from + * 0x0000 to 0xffff and vendor error codes will have the range from 0x0001 to 0xffff. The error code + * is formatted as [VENDOR_ERROR] << 16 | [SYSTEM_ERROR]. A vendor error code of 0 indicates vendor + * code not set. */ @VintfStability @Backing(type="int") enum StatusCode { OK = 0, /** - * Try again. + * Caller should try again. + * + * This code must be returned when an ephemeral error happens and a retry + * will likely succeed. E.g., when the device is currently booting up + * and the property is not ready yet. */ TRY_AGAIN = 1, /** @@ -32,9 +39,22 @@ enum StatusCode { */ INVALID_ARG = 2, /** + * The property is currently unavailable and will be unavailable unless + * some other state changes. + * * This code must be returned when device that associated with the vehicle * property is not available. For example, when client tries to set HVAC * temperature when the whole HVAC unit is turned OFF. + * + * The difference between this and TRY_AGAIN is that if NOT_AVAILABLE is + * returned for a property, it will remain NOT_AVAILABLE unless some other + * state changes. This means a retry will likely still return NOT_AVAILABLE. + * However, for TRY_AGAIN error, a retry will likely return OK. + * + * When subscribing to a property that is currently unavailable for getting. + * VHAL must return OK even if getting/setting must return NOT_AVAILABLE. + * VHAL must not generate property change event when the property is not + * available for getting. */ NOT_AVAILABLE = 3, /** @@ -45,4 +65,35 @@ enum StatusCode { * Something unexpected has happened in Vehicle HAL */ INTERNAL_ERROR = 5, + + /** + * The following error codes were added in version 2 of this interface. + */ + + /** + * For features that are not available because the underlying feature is + * disabled. + */ + NOT_AVAILABLE_DISABLED = 6, + /** + * For features that are not available because the vehicle speed is too low. + */ + NOT_AVAILABLE_SPEED_LOW = 7, + /** + * For features that are not available because the vehicle speed is too + * high. + */ + NOT_AVAILABLE_SPEED_HIGH = 8, + /** + * For features that are not available because of bad camera or sensor + * visibility. Examples might be bird poop blocking the camera or a bumper + * cover blocking an ultrasonic sensor. + */ + NOT_AVAILABLE_POOR_VISIBILITY = 9, + /** + * The feature cannot be accessed due to safety reasons. Eg. System could be + * in a faulty state, an object or person could be blocking the requested + * operation such as closing a trunk door, etc. + */ + NOT_AVAILABLE_SAFETY = 10, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl index b44996dc7e..20c046d574 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; @JavaDerive(equals=true, toString=true) parcelable VehicleAreaConfig { /** - * Area id is ignored for VehiclePropertyGroup:GLOBAL properties. + * Area id is always 0 for VehicleArea#GLOBAL properties. */ int areaId; @@ -40,4 +40,11 @@ parcelable VehicleAreaConfig { float minFloatValue; float maxFloatValue; + + /** + * If the property has a @data_enum, then it is possible to specify a supported subset of the + * @data_enum. If the property has a @data_enum and supportedEnumValues is null, then it is + * assumed all @data_enum values are supported unless specified through another mechanism. + */ + @nullable long[] supportedEnumValues; } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl index 1b48f0b1b6..61b936932d 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl @@ -37,7 +37,25 @@ parcelable VehiclePropConfig { VehiclePropertyChangeMode changeMode = VehiclePropertyChangeMode.STATIC; /** - * Contains per-area configuration. + * Contains per-areaId configuration. + * + * [Definition] area: An area represents a unique element of a VehicleArea. For instance, if the + * VehicleArea is WINDOW, then an example area is FRONT_WINDSHIELD. + * + * [Definition] area ID: An area ID is a combination of one or more areas, and is created by + * bitwise "OR"ing the areas together. Areas from different VehicleArea values may not be + * mixed in a single area ID. For example, a VehicleAreaWindow area cannot be combined with a + * VehicleAreaSeat area in an area ID. + * + * For VehicleArea#GLOBAL properties, they must map only to a single area ID of 0. + * + * Rules for mapping a non VehicleArea#GLOBAL property to area IDs: + * - A property must be mapped to a set of area IDs that are impacted when the property value + * changes. + * - An area cannot be part of multiple area IDs, it must only be part of a single area ID. + * - When the property value changes in one of the areas in an area ID, then it must + * automatically change in all other areas in the area ID. + * - The property value must be independently controllable in any two different area IDs. */ VehicleAreaConfig[] areaConfigs; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl deleted file mode 100644 index 727b949a37..0000000000 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ /dev/null @@ -1,2843 +0,0 @@ -/* - * Copyright (C) 2021 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.VehiclePropertyType; -/** - * Declares all vehicle properties. VehicleProperty has a bitwise structure. - * Each property must have: - * - a unique id from range 0x0100 - 0xffff - * - associated data type using VehiclePropertyType - * - property group (VehiclePropertyGroup) - * - vehicle area (VehicleArea) - * - * Vendors are allowed to extend this enum with their own properties. In this - * case they must use VehiclePropertyGroup:VENDOR flag when the property is - * declared. - * - * When a property's status field is not set to AVAILABLE: - * - IVehicle#set may return StatusCode::NOT_AVAILABLE. - * - IVehicle#get is not guaranteed to work. - * - * Properties set to values out of range must be ignored and no action taken - * in response to such ill formed requests. - */ -@VintfStability -@Backing(type="int") -enum VehicleProperty { - /** - * Undefined property. - */ - INVALID = 0x00000000, - /** - * VIN of vehicle - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - INFO_VIN = 0x0100 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Manufacturer of vehicle - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - INFO_MAKE = 0x0101 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Model of vehicle - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - INFO_MODEL = 0x0102 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Model year of vehicle. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:YEAR - */ - INFO_MODEL_YEAR = 0x0103 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Fuel capacity of the vehicle in milliliters - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:MILLILITER - */ - INFO_FUEL_CAPACITY = 0x0104 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * List of fuels the vehicle may use - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @data_enum FuelType - */ - INFO_FUEL_TYPE = 0x0105 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Battery capacity of the vehicle, if EV or hybrid. This is the nominal - * battery capacity when the vehicle is new. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:WH - */ - INFO_EV_BATTERY_CAPACITY = 0x0106 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * List of connectors this EV may use - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @data_enum EvConnectorType - * @access VehiclePropertyAccess:READ - */ - INFO_EV_CONNECTOR_TYPE = 0x0107 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Fuel door location - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @data_enum PortLocationType - * @access VehiclePropertyAccess:READ - */ - INFO_FUEL_DOOR_LOCATION = 0x0108 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * EV port location - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @data_enum PortLocationType - */ - INFO_EV_PORT_LOCATION = 0x0109 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Driver's seat location - * VHAL implementations must ignore the areaId. Use VehicleArea:GLOBAL. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @data_enum VehicleAreaSeat - * @access VehiclePropertyAccess:READ - */ - INFO_DRIVER_SEAT = 0x010A + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Exterior dimensions of vehicle. - * - * int32Values[0] = height - * int32Values[1] = length - * int32Values[2] = width - * int32Values[3] = width including mirrors - * int32Values[4] = wheel base - * int32Values[5] = track width front - * int32Values[6] = track width rear - * int32Values[7] = curb to curb turning radius - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:MILLIMETER - */ - INFO_EXTERIOR_DIMENSIONS = 0x010B + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Multiple EV port locations - * - * Implement this property if the vehicle has multiple EV ports. - * Port locations are defined in PortLocationType. - * For example, a car has one port in front left and one port in rear left: - * int32Values[0] = PortLocationType::FRONT_LEFT - * int32Values[0] = PortLocationType::REAR_LEFT - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @data_enum PortLocationType - */ - INFO_MULTI_EV_PORT_LOCATIONS = 0x010C + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Current odometer value of the vehicle - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:KILOMETER - */ - PERF_ODOMETER = 0x0204 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Speed of the vehicle - * - * The value must be positive when the vehicle is moving forward and negative when - * the vehicle is moving backward. This value is independent of gear value - * (CURRENT_GEAR or GEAR_SELECTION), for example, if GEAR_SELECTION is GEAR_NEUTRAL, - * PERF_VEHICLE_SPEED is positive when the vehicle is moving forward, negative when moving - * backward, and zero when not moving. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:METER_PER_SEC - */ - PERF_VEHICLE_SPEED = 0x0207 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Speed of the vehicle for displays - * - * Some cars display a slightly slower speed than the actual speed. This is - * usually displayed on the speedometer. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:METER_PER_SEC - */ - PERF_VEHICLE_SPEED_DISPLAY = 0x0208 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Front bicycle model steering angle for vehicle - * - * Angle is in degrees. Left is negative. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:DEGREES - */ - PERF_STEERING_ANGLE = 0x0209 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Rear bicycle model steering angle for vehicle - * - * Angle is in degrees. Left is negative. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:DEGREES - */ - PERF_REAR_STEERING_ANGLE = 0x0210 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Temperature of engine coolant - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:CELSIUS - */ - ENGINE_COOLANT_TEMP = 0x0301 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Engine oil level - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleOilLevel - */ - ENGINE_OIL_LEVEL = 0x0303 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Temperature of engine oil - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:CELSIUS - */ - ENGINE_OIL_TEMP = 0x0304 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Engine rpm - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:RPM - */ - ENGINE_RPM = 0x0305 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Reports wheel ticks - * - * The first element in the vector is a reset count. A reset indicates - * previous tick counts are not comparable with this and future ones. Some - * sort of discontinuity in tick counting has occurred. - * - * The next four elements represent ticks for individual wheels in the - * following order: front left, front right, rear right, rear left. All - * tick counts are cumulative. Tick counts increment when the vehicle - * moves forward, and decrement when vehicles moves in reverse. The ticks - * should be reset to 0 when the vehicle is started by the user. - * - * int64Values[0] = reset count - * int64Values[1] = front left ticks - * int64Values[2] = front right ticks - * int64Values[3] = rear right ticks - * int64Values[4] = rear left ticks - * - * configArray is used to indicate the micrometers-per-wheel-tick value and - * which wheels are supported. configArray is set as follows: - * - * configArray[0], bits [0:3] = supported wheels. Uses enum Wheel. - * configArray[1] = micrometers per front left wheel tick - * configArray[2] = micrometers per front right wheel tick - * configArray[3] = micrometers per rear right wheel tick - * configArray[4] = micrometers per rear left wheel tick - * - * NOTE: If a wheel is not supported, its value shall always be set to 0. - * - * VehiclePropValue.timestamp must be correctly filled in. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - */ - WHEEL_TICK = 0x0306 + 0x10000000 + 0x01000000 - + 0x00510000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64_VEC - /** - * Fuel remaining in the vehicle, in milliliters - * - * Value may not exceed INFO_FUEL_CAPACITY - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:MILLILITER - */ - FUEL_LEVEL = 0x0307 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Fuel door open - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - FUEL_DOOR_OPEN = 0x0308 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * EV battery level in WH, if EV or hybrid - * - * Value may not exceed INFO_EV_BATTERY_CAPACITY - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:WH - */ - EV_BATTERY_LEVEL = 0x0309 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * EV charge port open - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - EV_CHARGE_PORT_OPEN = 0x030A + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * EV charge port connected - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - EV_CHARGE_PORT_CONNECTED = 0x030B + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * EV instantaneous charge rate in milliwatts - * - * Positive value indicates battery is being charged. - * Negative value indicates battery being discharged. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:MW - */ - EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 0x030C + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Range remaining - * - * Meters remaining of fuel and charge. Range remaining shall account for - * all energy sources in a vehicle. For example, a hybrid car's range will - * be the sum of the ranges based on fuel and battery. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ_WRITE - * @unit VehicleUnit:METER - */ - RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Tire pressure - * - * Each tires is identified by its areaConfig.areaId config and their - * minFloatValue/maxFloatValue are used to store OEM recommended pressure - * range. - * The Min value in the areaConfig data represents the lower bound of - * the recommended tire pressure. - * The Max value in the areaConfig data represents the upper bound of - * the recommended tire pressure. - * For example: - * The following areaConfig indicates the recommended tire pressure - * of left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL. - * .areaConfigs = { - * VehicleAreaConfig { - * .areaId = VehicleAreaWheel::LEFT_FRONT, - * .minFloatValue = 200.0, - * .maxFloatValue = 240.0, - * } - * }, - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:KILOPASCAL - */ - TIRE_PRESSURE = 0x0309 + 0x10000000 + 0x07000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT - /** - * Critically low tire pressure - * - * This property indicates the critically low pressure threshold for each tire. - * It indicates when it is time for tires to be replaced or fixed. The value - * must be less than or equal to minFloatValue in TIRE_PRESSURE. - * Minimum and maximum property values (that is, minFloatValue, maxFloatValue) - * are not applicable to this property. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:KILOPASCAL - */ - CRITICALLY_LOW_TIRE_PRESSURE = 0x030A + 0x10000000 + 0x07000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT - /** - * Currently selected gear - * - * This is the gear selected by the user. - * - * Values in the config data must represent the list of supported gears - * for this vehicle. For example, config data for an automatic transmission - * must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_DRIVE, - * GEAR_1, GEAR_2,...} and for manual transmission the list must be - * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...} - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleGear - */ - GEAR_SELECTION = 0x0400 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Current gear. In non-manual case, selected gear may not - * match the current gear. For example, if the selected gear is GEAR_DRIVE, - * the current gear will be one of GEAR_1, GEAR_2 etc, which reflects - * the actual gear the transmission is currently running in. - * - * Values in the config data must represent the list of supported gears - * for this vehicle. For example, config data for an automatic transmission - * must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...} - * and for manual transmission the list must be - * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the - * same as that of the supported gears reported in GEAR_SELECTION. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleGear - */ - CURRENT_GEAR = 0x0401 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Parking brake state. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - PARKING_BRAKE_ON = 0x0402 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Auto-apply parking brake. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - PARKING_BRAKE_AUTO_APPLY = 0x0403 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Warning for fuel low level. - * - * This property corresponds to the low fuel warning on the dashboard. - * Once FUEL_LEVEL_LOW is set, it should not be cleared until more fuel is - * added to the vehicle. This property may take into account all fuel - * sources for a vehicle - for example: - * - * For a gas powered vehicle, this property is based soley on gas level. - * For a battery powered vehicle, this property is based solely on battery level. - * For a hybrid vehicle, this property may be based on the combination of gas and battery - * levels, at the OEM's discretion. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - FUEL_LEVEL_LOW = 0x0405 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Night mode - * - * True indicates that the night mode sensor has detected that the car cabin environment has - * low light. The platform could use this, for example, to enable appropriate UI for - * better viewing in dark or low light environments. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - NIGHT_MODE = 0x0407 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * State of the vehicles turn signals - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleTurnSignal - */ - TURN_SIGNAL_STATE = 0x0408 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Represents ignition state - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleIgnitionState - */ - IGNITION_STATE = 0x0409 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * ABS is active - * - * Set to true when ABS is active. Reset to false when ABS is off. This - * property may be intermittently set (pulsing) based on the real-time - * state of the ABS system. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - ABS_ACTIVE = 0x040A + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Traction Control is active - * - * Set to true when traction control (TC) is active. Reset to false when - * TC is off. This property may be intermittently set (pulsing) based on - * the real-time state of the TC system. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - TRACTION_CONTROL_ACTIVE = 0x040B + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /* - * HVAC Properties - * - * Additional rules for mapping a zoned HVAC property (except - * HVAC_MAX_DEFROST_ON) to AreaIDs: - * - Every seat in VehicleAreaSeat that is available in the car, must be - * part of an AreaID in the AreaID array. - * - * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three - * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two - * temperature control units -- driver side and passenger side. - * - A valid mapping set of AreaIDs for HVAC_TEMPERATURE_SET would be a - * two element array: - * - ROW_1_LEFT | ROW_2_LEFT - * - ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT - * - An alternative mapping for the same hardware configuration would be: - * - ROW_1_LEFT | ROW_2_CENTER | ROW_2_LEFT - * - ROW_1_RIGHT | ROW_2_RIGHT - * The temperature controllers are assigned to the seats which they - * "most influence", but every seat must be included exactly once. The - * assignment of the center rear seat to the left or right AreaID may seem - * arbitrary, but the inclusion of every seat in exactly one AreaID ensures - * that the seats in the car are all expressed and that a "reasonable" way - * to affect each seat is available. - * - * Example 2: A car has three seat rows with two seats in the front row (ROW_1_LEFT, - * ROW_1_RIGHT) and three seats in the second (ROW_2_LEFT, ROW_2_CENTER, - * ROW_2_RIGHT) and third rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). There - * are three temperature control units -- driver side, passenger side, and rear. - * - A reasonable way to map HVAC_TEMPERATURE_SET to AreaIDs is a three - * element array: - * - ROW_1_LEFT - * - ROW_1_RIGHT - * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT - * - * - * Fan speed setting - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Fan direction setting - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleHvacFanDirection - */ - HVAC_FAN_DIRECTION = 0x0501 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * HVAC current temperature. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:CELSIUS - */ - HVAC_TEMPERATURE_CURRENT = 0x0502 + 0x10000000 + 0x05000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT - /** - * HVAC, target temperature set. - * - * The configArray is used to indicate the valid values for HVAC in Fahrenheit and Celsius. - * Android might use it in the HVAC app UI. - * The configArray is set as follows: - * configArray[0] = [the lower bound of the supported temperature in Celsius] * 10. - * configArray[1] = [the upper bound of the supported temperature in Celsius] * 10. - * configArray[2] = [the increment in Celsius] * 10. - * configArray[3] = [the lower bound of the supported temperature in Fahrenheit] * 10. - * configArray[4] = [the upper bound of the supported temperature in Fahrenheit] * 10. - * configArray[5] = [the increment in Fahrenheit] * 10. - * For example, if the vehicle supports temperature values as: - * [16.0, 16.5, 17.0 ,..., 28.0] in Celsius - * [60.5, 61.5, 62.5 ,..., 85.5] in Fahrenheit. - * The configArray should be configArray = {160, 280, 5, 605, 825, 10}. - * - * If the vehicle supports HVAC_TEMPERATURE_VALUE_SUGGESTION, the application can use - * that property to get the suggested value before setting HVAC_TEMPERATURE_SET. Otherwise, - * the application may choose the value in HVAC_TEMPERATURE_SET configArray by itself. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @unit VehicleUnit:CELSIUS - */ - HVAC_TEMPERATURE_SET = 0x0503 + 0x10000000 + 0x05000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT - /** - * Fan-based defrost for designated window. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_DEFROSTER = 0x0504 + 0x10000000 + 0x03000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN - /** - * On/off AC for designated areaId - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @config_flags Supported areaIds - */ - HVAC_AC_ON = 0x0505 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * On/off max AC - * - * When MAX AC is on, the ECU may adjust the vent position, fan speed, - * temperature, etc as necessary to cool the vehicle as quickly as possible. - * Any parameters modified as a side effect of turning on/off the MAX AC - * parameter shall generate onPropertyEvent() callbacks to the VHAL. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_MAX_AC_ON = 0x0506 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * On/off max defrost - * - * When MAX DEFROST is on, the ECU may adjust the vent position, fan speed, - * temperature, etc as necessary to defrost the windows as quickly as - * possible. Any parameters modified as a side effect of turning on/off - * the MAX DEFROST parameter shall generate onPropertyEvent() callbacks to - * the VHAL. - * The AreaIDs for HVAC_MAX_DEFROST_ON indicate MAX DEFROST can be controlled - * in the area. - * For example: - * areaConfig.areaId = {ROW_1_LEFT | ROW_1_RIGHT} indicates HVAC_MAX_DEFROST_ON - * only can be controlled for the front rows. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_MAX_DEFROST_ON = 0x0507 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * Recirculation on/off - * - * Controls the supply of exterior air to the cabin. Recirc “on” means the - * majority of the airflow into the cabin is originating in the cabin. - * Recirc “off” means the majority of the airflow into the cabin is coming - * from outside the car. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_RECIRC_ON = 0x0508 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * Enable temperature coupling between areas. - * - * The AreaIDs for HVAC_DUAL_ON property shall contain a combination of - * HVAC_TEMPERATURE_SET AreaIDs that can be coupled together. If - * HVAC_TEMPERATURE_SET is mapped to AreaIDs [a_1, a_2, ..., a_n], and if - * HVAC_DUAL_ON can be enabled to couple a_i and a_j, then HVAC_DUAL_ON - * property must be mapped to [a_i | a_j]. Further, if a_k and a_l can also - * be coupled together separately then HVAC_DUAL_ON must be mapped to - * [a_i | a_j, a_k | a_l]. - * - * Example: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three - * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two - * temperature control units -- driver side and passenger side -- which can - * be optionally synchronized. This may be expressed in the AreaIDs this way: - * - HVAC_TEMPERATURE_SET->[ROW_1_LEFT | ROW_2_LEFT, ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT] - * - HVAC_DUAL_ON->[ROW_1_LEFT | ROW_2_LEFT | ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT] - * - * When the property is enabled, the ECU must synchronize the temperature - * for the affected areas. Any parameters modified as a side effect - * of turning on/off the DUAL_ON parameter shall generate - * onPropertyEvent() callbacks to the VHAL. In addition, if setting - * a temperature (i.e. driver's temperature) changes another temperature - * (i.e. front passenger's temperature), then the appropriate - * onPropertyEvent() callbacks must be generated. If a user changes a - * temperature that breaks the coupling (e.g. setting the passenger - * temperature independently) then the VHAL must send the appropriate - * onPropertyEvent() callbacks (i.e. HVAC_DUAL_ON = false, - * HVAC_TEMPERATURE_SET[AreaID] = xxx, etc). - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_DUAL_ON = 0x0509 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * On/off automatic mode - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_AUTO_ON = 0x050A + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * Seat heating/cooling - * - * Negative values indicate cooling. - * 0 indicates off. - * Positive values indicate heating. - * - * Some vehicles may have multiple levels of heating and cooling. The - * min/max range defines the allowable range and number of steps in each - * direction. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_SEAT_TEMPERATURE = 0x050B + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Side Mirror Heat - * - * Increasing values denote higher heating levels for side mirrors. - * The Max value in the config data represents the highest heating level. - * The Min value in the config data MUST be zero and indicates no heating. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_SIDE_MIRROR_HEAT = 0x050C + 0x10000000 + 0x04000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 - /** - * Steering Wheel Heating/Cooling - * - * Sets the amount of heating/cooling for the steering wheel - * config data Min and Max MUST be set appropriately. - * Positive value indicates heating. - * Negative value indicates cooling. - * 0 indicates temperature control is off. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_STEERING_WHEEL_HEAT = 0x050D + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Temperature units for display - * - * Indicates whether the vehicle is displaying temperature to the user as - * Celsius or Fahrenheit. - * VehiclePropConfig.configArray is used to indicate the supported temperature display units. - * For example: configArray[0] = CELSIUS - * configArray[1] = FAHRENHEIT - * - * This parameter MAY be used for displaying any HVAC temperature in the system. - * Values must be one of VehicleUnit::CELSIUS or VehicleUnit::FAHRENHEIT - * Note that internally, all temperatures are represented in floating point Celsius. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleUnit - */ - HVAC_TEMPERATURE_DISPLAY_UNITS = 0x050E + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Actual fan speed - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - HVAC_ACTUAL_FAN_SPEED_RPM = 0x050F + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Represents global power state for HVAC. Setting this property to false - * MAY mark some properties that control individual HVAC features/subsystems - * to UNAVAILABLE state. Setting this property to true MAY mark some - * properties that control individual HVAC features/subsystems to AVAILABLE - * state (unless any/all of them are UNAVAILABLE on their own individual - * merits). - * - * [Definition] HvacPower_DependentProperties: Properties that need HVAC to be - * powered on in order to enable their functionality. For example, in some cars, - * in order to turn on the AC, HVAC must be powered on first. - * - * HvacPower_DependentProperties list must be set in the - * VehiclePropConfig.configArray. HvacPower_DependentProperties must only contain - * properties that are associated with VehicleArea:SEAT. Properties that are not - * associated with VehicleArea:SEAT, for example, HVAC_DEFROSTER, must never - * depend on HVAC_POWER_ON property and must never be part of - * HvacPower_DependentProperties list. - * - * AreaID mapping for HVAC_POWER_ON property must contain all AreaIDs that - * HvacPower_DependentProperties are mapped to. - * - * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three back - * seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). If the HVAC features (AC, - * Temperature etc.) throughout the car are dependent on a single HVAC power - * controller then HVAC_POWER_ON must be mapped to - * [ROW_1_LEFT | ROW_1_RIGHT | ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT]. - * - * Example 2: A car has two seats in the front row (ROW_1_LEFT, ROW_1_RIGHT) and - * three seats in the second (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT) and third - * rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). If the car has temperature - * controllers in the front row which can operate entirely independently of - * temperature controllers in the back of the vehicle, then HVAC_POWER_ON - * must be mapped to a two element array: - * - ROW_1_LEFT | ROW_1_RIGHT - * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * Fan Positions Available - * - * This is a bit mask of fan positions available for the zone. Each - * available fan direction is denoted by a separate entry in the vector. A - * fan direction may have multiple bits from vehicle_hvac_fan_direction set. - * For instance, a typical car may have the following fan positions: - * - FAN_DIRECTION_FACE (0x1) - * - FAN_DIRECTION_FLOOR (0x2) - * - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) - * - FAN_DIRECTION_DEFROST (0x4) - * - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6) - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @data_enum VehicleHvacFanDirection - */ - HVAC_FAN_DIRECTION_AVAILABLE = 0x0511 + 0x10000000 + 0x05000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32_VEC - /** - * Automatic recirculation on/off - * - * When automatic recirculation is ON, the HVAC system may automatically - * switch to recirculation mode if the vehicle detects poor incoming air - * quality. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_AUTO_RECIRC_ON = 0x0512 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * Seat ventilation - * - * 0 indicates off. - * Positive values indicates ventilation level. - * - * Used by HVAC apps and Assistant to enable, change, or read state of seat - * ventilation. This is different than seating cooling. It can be on at the - * same time as cooling, or not. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_SEAT_VENTILATION = 0x0513 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Electric defrosters' status - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_ELECTRIC_DEFROSTER_ON = 0x0514 + 0x10000000 + 0x03000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN - /** - * Suggested values for setting HVAC temperature. - * - * Implement the property to help applications understand the closest supported temperature - * value in Celsius or Fahrenheit. - * - * floatValues[0] = the requested value that an application wants to set a temperature to. - * floatValues[1] = the unit for floatValues[0]. It should be one of - * {VehicleUnit:CELSIUS, VehicleUnit:FAHRENHEIT}. - * floatValues[2] = the value OEMs suggested in CELSIUS. This value is not included - * in the request. - * floatValues[3] = the value OEMs suggested in FAHRENHEIT. This value is not included - * in the request. - * - * An application calls set(VehiclePropValue propValue) with the requested value and unit for - * the value. OEMs need to return the suggested values in floatValues[2] and floatValues[3] by - * onPropertyEvent() callbacks. - * - * For example, when a user uses the voice assistant to set HVAC temperature to 66.2 in - * Fahrenheit. - * First, an application will set this property with the value - * [66.2, (float)VehicleUnit:FAHRENHEIT,0,0]. - * If OEMs suggest to set 19.0 in Celsius or 66.5 in Fahrenheit for user's request, then VHAL - * must generate a callback with property value - * [66.2, (float)VehicleUnit:FAHRENHEIT, 19.0, 66.5]. After the voice assistant gets the - * callback, it will inform the user and set HVAC temperature to the suggested value. - * - * Another example, an application receives 21 Celsius as the current temperature value by - * querying HVC_TEMPERATURE_SET. But the application wants to know what value is displayed on - * the car's UI in Fahrenheit. - * For this, the application sets the property to [21, (float)VehicleUnit:CELSIUS, 0, 0]. If - * the suggested value by the OEM for 21 Celsius is 70 Fahrenheit, then VHAL must generate a - * callback with property value [21, (float)VehicleUnit:CELSIUS, 21.0, 70.0]. - * In this case, the application can know that the value is 70.0 Fahrenheit in the car’s UI. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - HVAC_TEMPERATURE_VALUE_SUGGESTION = 0x0515 + 0x10000000 + 0x01000000 - + 0x00610000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT_VEC - /** - * Distance units for display - * - * Indicates which units the car is using to display distances to the user. Eg. Mile, Meter - * Kilometer. - * - * Distance units are defined in VehicleUnit. - * VehiclePropConfig.configArray is used to indicate the supported distance display units. - * For example: configArray[0] = METER - * configArray[1] = KILOMETER - * configArray[2] = MILE - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleUnit - */ - DISTANCE_DISPLAY_UNITS = 0x0600 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Fuel volume units for display - * - * Indicates which units the car is using to display fuel volume to the user. Eg. Liter or - * Gallon. - * - * VehiclePropConfig.configArray is used to indicate the supported fuel volume display units. - * Volume units are defined in VehicleUnit. - * For example: configArray[0] = LITER - * configArray[1] = GALLON - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleUnit - */ - FUEL_VOLUME_DISPLAY_UNITS = 0x0601 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Tire pressure units for display - * - * Indicates which units the car is using to display tire pressure to the user. Eg. PSI, Bar or - * Kilopascal. - * - * VehiclePropConfig.configArray is used to indicate the supported pressure display units. - * Pressure units are defined in VehicleUnit. - * For example: configArray[0] = KILOPASCAL - * configArray[1] = PSI - * configArray[2] = BAR - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleUnit - */ - TIRE_PRESSURE_DISPLAY_UNITS = 0x0602 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * EV battery units for display - * - * Indicates which units the car is using to display EV battery information to the user. Eg. - * watt-hours(Wh), kilowatt-hours(kWh) or ampere-hours(Ah). - * - * VehiclePropConfig.configArray is used to indicate the supported electrical energy units. - * Electrical energy units are defined in VehicleUnit. - * For example: configArray[0] = WATT_HOUR - * configArray[1] = AMPERE_HOURS - * configArray[2] = KILOWATT_HOUR - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleUnit - */ - EV_BATTERY_DISPLAY_UNITS = 0x0603 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Fuel consumption units for display - * - * Indicates type of units the car is using to display fuel consumption information to user - * True indicates units are distance over volume such as MPG. - * False indicates units are volume over distance such as L/100KM. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 0x0604 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Speed units for display - * - * Indicates type of units the car is using to display speed to user. Eg. m/s, km/h, or mph. - * - * VehiclePropConfig.configArray is used to indicate the supported speed display units. - * Pressure units are defined in VehicleUnit. - * For example: configArray[0] = METER_PER_SEC - * configArray[1] = MILES_PER_HOUR - * configArray[2] = KILOMETERS_PER_HOUR - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - VEHICLE_SPEED_DISPLAY_UNITS = 0x0605 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Current date and time suggestion for the Car, encoded as Epoch time - * (in milliseconds). This value denotes the number of milliseconds seconds - * that have elapsed since 1/1/1970 UTC. - * - * This property signals a change in CarTime to Android. If the property is supported, VHAL - * must report the most accurate current CarTime when this property is read, and publish a - * change to this property when the CarTime value has changed. An on-change event for this - * property must be published when CarTime changes for any reason other than the natural elapse - * of time (time delta smaller than 500ms should not trigger an on change event). Android will - * read and subscribe to this property to fetch time from VHAL. This can be useful to - * synchronize Android's time with other vehicle systems (dash clock etc). - * int64Values[0] = provided Epoch time (in milliseconds) - * - * Whenever a new Value for the property is received, AAOS will create - * and send an "ExternalTimeSuggestion" to the "TimeDetectorService". - * If other sources do not have a higher priority, Android will use this - * to set the system time. For information on how to adjust time source - * priorities and how time suggestions are handled (including how Android - * handles gitter, drift, and minimum resolution) see Time Detector Service - * documentation. - * - * Note that the property may take >0 ms to get propagated through the stack - * and, having a timestamped property helps reduce any time drift. So, - * for all reads to the property, the timestamp can be used to negate this - * drift: - * drift = elapsedTime - PropValue.timestamp - * effectiveTime = PropValue.value.int64Values[0] + drift - * - * It is strongly recommended that this property must not be used to retrieve - * time from ECUs using protocols (GNSS, NTP, Telephony etc). Since these - * protocols are already supported by Android, it is recommended to use - * Android’s own systems for them instead of wiring those through the VHAL - * using this property. - * - * WARNING: The value available through this property should not be dependent - * on value written by Android to ANDROID_EPOCH_TIME property in any way. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_ONLY - * @unit VehicleUnit:MILLI_SECS - */ - EXTERNAL_CAR_TIME = 0x0608 + 0x10000000 // VehiclePropertyGroup:SYSTEM - + 0x01000000 // VehicleArea:GLOBAL - + 0x00500000, // VehiclePropertyType:INT64 - /** - * Current date and time, encoded as Epoch time (in milliseconds). - * This value denotes the number of milliseconds seconds that have - * elapsed since 1/1/1970 UTC. - * - * CarServices will write to this value to give VHAL the Android system's - * time, if the VHAL supports this property. This can be useful to - * synchronize other vehicle systems (dash clock etc) with Android's time. - * - * AAOS writes to this property once during boot, and - * will thereafter write only when some time-source changes are propagated. - * AAOS will fill in VehiclePropValue.timestamp correctly. - * Note that AAOS will not send updates for natural elapse of time. - * int64Values[0] = provided Unix time (in milliseconds) - * - * Note that the property may take >0 ms to get propagated through the stack - * and, having a timestamped property helps reduce any time drift. So, - * for all writes to the property, the timestamp can be used to negate this - * drift: - * drift = elapsedTime - PropValue.timestamp - * effectiveTime = PropValue.value.int64Values[0] + drift - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE_ONLY - * @unit VehicleUnit:MILLI_SECS - */ - ANDROID_EPOCH_TIME = 0x0606 + 0x10000000 + 0x01000000 - + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 - /** - * External encryption binding seed. - * - * This value is mixed with the local key storage encryption key. - * This property holds 16 bytes, and is expected to be persisted on an ECU separate from - * the IVI. The property is initially set by AAOS, who generates it using a CSRNG. - * AAOS will then read the property on subsequent boots. The binding seed is expected to be - * reliably persisted. Any loss of the seed results in a factory reset of the IVI. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - STORAGE_ENCRYPTION_BINDING_SEED = 0x0607 + 0x10000000 + 0x01000000 - + 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES - /** - * Outside temperature - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:CELSIUS - */ - ENV_OUTSIDE_TEMPERATURE = 0x0703 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - /** - * Property to control power state of application processor - * - * It is assumed that AP's power state is controlled by a separate power - * controller. - * - * For configuration information, VehiclePropConfig.configArray can have bit flag combining - * values in VehicleApPowerStateConfigFlag. - * - * int32Values[0] : VehicleApPowerStateReq enum value - * int32Values[1] : additional parameter relevant for each state, - * 0 if not used. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - AP_POWER_STATE_REQ = 0x0A00 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Property to report power state of application processor - * - * It is assumed that AP's power state is controller by separate power - * controller. - * - * int32Values[0] : VehicleApPowerStateReport enum value - * int32Values[1] : Time in ms to wake up, if necessary. Otherwise 0. - - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - AP_POWER_STATE_REPORT = 0x0A01 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Property to report bootup reason for the current power on. This is a - * static property that will not change for the whole duration until power - * off. For example, even if user presses power on button after automatic - * power on with door unlock, bootup reason must stay with - * VehicleApPowerBootupReason#USER_UNLOCK. - * - * int32Values[0] must be VehicleApPowerBootupReason. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - AP_POWER_BOOTUP_REASON = 0x0A02 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Property to represent brightness of the display. Some cars have single - * control for the brightness of all displays and this property is to share - * change in that control. - * - * If this is writable, android side can set this value when user changes - * display brightness from Settings. If this is read only, user may still - * change display brightness from Settings, but that must not be reflected - * to other displays. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - DISPLAY_BRIGHTNESS = 0x0A03 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Property to feed H/W input events to android - * - * int32Values[0] : action defined by VehicleHwKeyInputAction - * int32Values[1] : key code, must use standard android key code - * int32Values[2] : target display defined in VehicleDisplay. Events not - * tied to specific display must be sent to - * VehicleDisplay#MAIN. - * int32Values[3] : [optional] Number of ticks. The value must be equal or - * greater than 1. When omitted, Android will default to 1. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @config_flags - */ - HW_KEY_INPUT = 0x0A10 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Property to feed H/W rotary events to android - * - * int32Values[0] : RotaryInputType identifying which rotary knob rotated - * int32Values[1] : number of detents (clicks), positive for clockwise, - * negative for counterclockwise - * int32Values[2] : target display defined in VehicleDisplay. Events not - * tied to specific display must be sent to - * VehicleDisplay#MAIN. - * int32values[3 .. 3 + abs(number of detents) - 2]: - * nanosecond deltas between pairs of consecutive detents, - * if the number of detents is > 1 or < -1 - * - * VehiclePropValue.timestamp: when the rotation occurred. If the number of - * detents is > 1 or < -1, this is when the - * first detent of rotation occurred. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @data_enum RotaryInputType - * @access VehiclePropertyAccess:READ - */ - HW_ROTARY_INPUT = 0x0A20 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Defines a custom OEM partner input event. - * - * This input event must be used by OEM partners who wish to propagate events not supported - * by Android. It is composed by an array of int32 values only. - * - * The Android properties are: - * - * int32Values[0] : Input code identifying the function representing this event. Valid event - * types are defined by CustomInputType.CUSTOM_EVENT_F1 up to - * CustomInputType.CUSTOM_EVENT_F10. They represent the custom event to be - * defined by OEM partners. - * int32Values[1] : target display type defined in VehicleDisplay. Events not tied to specific - * display must be sent to VehicleDisplay#MAIN. - * int32Values[2] : repeat counter, if 0 then event is not repeated. Values 1 or above means - * how many times this event repeated. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @data_enum CustomInputType - * @access VehiclePropertyAccess:READ - */ - HW_CUSTOM_INPUT = 0X0A30 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /*************************************************************************** - * Most Car Cabin properties have both a POSition and MOVE parameter. These - * are used to control the various movements for seats, doors, and windows - * in a vehicle. - * - * A POS parameter allows the user to set the absolution position. For - * instance, for a door, 0 indicates fully closed and max value indicates - * fully open. Thus, a value halfway between min and max must indicate - * the door is halfway open. - * - * A MOVE parameter moves the device in a particular direction. The sign - * indicates direction, and the magnitude indicates speed (if multiple - * speeds are available). For a door, a move of -1 will close the door, and - * a move of +1 will open it. Once a door reaches the limit of open/close, - * the door should automatically stop moving. The user must NOT need to - * send a MOVE(0) command to stop the door at the end of its range. - **************************************************************************/ - - /** - * Door position - * - * This is an integer in case a door may be set to a particular position. - * Max value indicates fully open, min value (0) indicates fully closed. - * - * Some vehicles (minivans) can open the door electronically. Hence, the - * ability to write this property. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - DOOR_POS = 0x0B00 + 0x10000000 + 0x06000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 - /** - * Door move - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - DOOR_MOVE = 0x0B01 + 0x10000000 + 0x06000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 - /** - * Door lock - * - * 'true' indicates door is locked - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - DOOR_LOCK = 0x0B02 + 0x10000000 + 0x06000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:BOOLEAN - /** - * Mirror Z Position - * - * Positive value indicates tilt upwards, negative value is downwards - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - MIRROR_Z_POS = 0x0B40 + 0x10000000 + 0x04000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 - /** - * Mirror Z Move - * - * Positive value indicates tilt upwards, negative value is downwards - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - MIRROR_Z_MOVE = 0x0B41 + 0x10000000 + 0x04000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 - /** - * Mirror Y Position - * - * Positive value indicate tilt right, negative value is left - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - MIRROR_Y_POS = 0x0B42 + 0x10000000 + 0x04000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 - /** - * Mirror Y Move - * - * Positive value indicate tilt right, negative value is left - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - MIRROR_Y_MOVE = 0x0B43 + 0x10000000 + 0x04000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 - /** - * Mirror Lock - * - * True indicates mirror positions are locked and not changeable - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - MIRROR_LOCK = 0x0B44 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Mirror Fold - * - * True indicates mirrors are folded - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - MIRROR_FOLD = 0x0B45 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Seat memory select - * - * This parameter selects the memory preset to use to select the seat - * position. The minValue is always 0, and the maxValue determines the - * number of seat positions available. - * - * For instance, if the driver's seat has 3 memory presets, the maxValue - * will be 3. When the user wants to select a preset, the desired preset - * number (1, 2, or 3) is set. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - SEAT_MEMORY_SELECT = 0x0B80 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat memory set - * - * This setting allows the user to save the current seat position settings - * into the selected preset slot. The maxValue for each seat position - * must match the maxValue for SEAT_MEMORY_SELECT. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - SEAT_MEMORY_SET = 0x0B81 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seatbelt buckled - * - * True indicates belt is buckled. - * - * Write access indicates automatic seat buckling capabilities. There are - * no known cars at this time, but you never know... - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BELT_BUCKLED = 0x0B82 + 0x10000000 + 0x05000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN - /** - * Seatbelt height position - * - * Adjusts the shoulder belt anchor point. - * Max value indicates highest position - * Min value indicates lowest position - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BELT_HEIGHT_POS = 0x0B83 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seatbelt height move - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BELT_HEIGHT_MOVE = 0x0B84 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat fore/aft position - * - * Sets the seat position forward (closer to steering wheel) and backwards. - * Max value indicates closest to wheel, min value indicates most rearward - * position. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_FORE_AFT_POS = 0x0B85 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat fore/aft move - * - * Moves the seat position forward and aft. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_FORE_AFT_MOVE = 0x0B86 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat backrest angle 1 position - * - * Backrest angle 1 is the actuator closest to the bottom of the seat. - * Max value indicates angling forward towards the steering wheel. - * Min value indicates full recline. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BACKREST_ANGLE_1_POS = 0x0B87 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat backrest angle 1 move - * - * Moves the backrest forward or recline. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BACKREST_ANGLE_1_MOVE = 0x0B88 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat backrest angle 2 position - * - * Backrest angle 2 is the next actuator up from the bottom of the seat. - * Max value indicates angling forward towards the steering wheel. - * Min value indicates full recline. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BACKREST_ANGLE_2_POS = 0x0B89 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat backrest angle 2 move - * - * Moves the backrest forward or recline. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_BACKREST_ANGLE_2_MOVE = 0x0B8A + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat height position - * - * Sets the seat height. - * Max value indicates highest position. - * Min value indicates lowest position. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEIGHT_POS = 0x0B8B + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat height move - * - * Moves the seat height. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEIGHT_MOVE = 0x0B8C + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat depth position - * - * Sets the seat depth, distance from back rest to front edge of seat. - * Max value indicates longest depth position. - * Min value indicates shortest position. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_DEPTH_POS = 0x0B8D + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat depth move - * - * Adjusts the seat depth. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_DEPTH_MOVE = 0x0B8E + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat tilt position - * - * Sets the seat tilt. - * Max value indicates front edge of seat higher than back edge. - * Min value indicates front edge of seat lower than back edge. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_TILT_POS = 0x0B8F + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat tilt move - * - * Tilts the seat. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_TILT_MOVE = 0x0B90 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Lumber fore/aft position - * - * Pushes the lumbar support forward and backwards - * Max value indicates most forward position. - * Min value indicates most rearward position. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_LUMBAR_FORE_AFT_POS = 0x0B91 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Lumbar fore/aft move - * - * Adjusts the lumbar support. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_LUMBAR_FORE_AFT_MOVE = 0x0B92 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Lumbar side support position - * - * Sets the amount of lateral lumbar support. - * Max value indicates widest lumbar setting (i.e. least support) - * Min value indicates thinnest lumbar setting. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_LUMBAR_SIDE_SUPPORT_POS = 0x0B93 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Lumbar side support move - * - * Adjusts the amount of lateral lumbar support. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 0x0B94 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Headrest height position - * - * Sets the headrest height. - * Max value indicates tallest setting. - * Min value indicates shortest setting. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEADREST_HEIGHT_POS = 0x0B95 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Headrest height move - * - * Moves the headrest up and down. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEADREST_HEIGHT_MOVE = 0x0B96 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Headrest angle position - * - * Sets the angle of the headrest. - * Max value indicates most upright angle. - * Min value indicates shallowest headrest angle. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEADREST_ANGLE_POS = 0x0B97 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Headrest angle move - * - * Adjusts the angle of the headrest - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEADREST_ANGLE_MOVE = 0x0B98 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Headrest fore/aft position - * - * Adjusts the headrest forwards and backwards. - * Max value indicates position closest to front of car. - * Min value indicates position closest to rear of car. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEADREST_FORE_AFT_POS = 0x0B99 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Headrest fore/aft move - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SEAT_HEADREST_FORE_AFT_MOVE = 0x0B9A + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Seat Occupancy - * - * Indicates whether a particular seat is occupied or not, to the best of the car's ability - * to determine. Valid values are from the VehicleSeatOccupancyState enum. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleSeatOccupancyState - */ - SEAT_OCCUPANCY = 0x0BB0 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Window Position - * - * Min = window up / closed - * Max = window down / open - * - * For a window that may open out of plane (i.e. vent mode of sunroof) this - * parameter will work with negative values as follows: - * Max = sunroof completely open - * 0 = sunroof closed. - * Min = sunroof vent completely open - * - * Note that in this mode, 0 indicates the window is closed. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - WINDOW_POS = 0x0BC0 + 0x10000000 + 0x03000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 - /** - * Window Move - * - * Max = Open the window as fast as possible - * Min = Close the window as fast as possible - * Magnitude denotes relative speed. I.e. +2 is faster than +1 in closing - * the window. - * - * For a window that may open out of plane (i.e. vent mode of sunroof) this - * parameter will work as follows: - * - * If sunroof is open: - * Max = open the sunroof further, automatically stop when fully open. - * Min = close the sunroof, automatically stop when sunroof is closed. - * - * If vent is open: - * Max = close the vent, automatically stop when vent is closed. - * Min = open the vent further, automatically stop when vent is fully open. - * - * If sunroof is in the closed position: - * Max = open the sunroof, automatically stop when sunroof is fully open. - * Min = open the vent, automatically stop when vent is fully open. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 - /** - * Window Lock - * - * True indicates windows are locked and can't be moved. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - WINDOW_LOCK = 0x0BC4 + 0x10000000 + 0x03000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN - /** - * Vehicle Maps Service (VMS) message - * - * This property uses MIXED data to communicate vms messages. - * - * Its contents are to be interpreted as follows: - * the indices defined in VmsMessageIntegerValuesIndex are to be used to - * read from int32Values; - * bytes is a serialized VMS message as defined in the vms protocol - * which is opaque to the framework; - * - * IVehicle#get must always return StatusCode::NOT_AVAILABLE. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - VEHICLE_MAP_SERVICE = 0x0C00 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * OBD2 Live Sensor Data - * - * Reports a snapshot of the current (live) values of the OBD2 sensors available. - * - * The configArray is set as follows: - * configArray[0] = number of vendor-specific integer-valued sensors - * configArray[1] = number of vendor-specific float-valued sensors - * - * The values of this property are to be interpreted as in the following example. - * Considering a configArray = {2,3} - * int32Values must be a vector containing Obd2IntegerSensorIndex.LAST_SYSTEM_INDEX + 2 - * elements (that is, 33 elements); - * floatValues must be a vector containing Obd2FloatSensorIndex.LAST_SYSTEM_INDEX + 3 - * elements (that is, 73 elements); - * - * It is possible for each frame to contain a different subset of sensor values, both system - * provided sensors, and vendor-specific ones. In order to support that, the bytes element - * of the property value is used as a bitmask,. - * - * bytes must have a sufficient number of bytes to represent the total number of possible - * sensors (in this case, 14 bytes to represent 106 possible values); it is to be read as - * a contiguous bitmask such that each bit indicates the presence or absence of a sensor - * from the frame, starting with as many bits as the size of int32Values, immediately - * followed by as many bits as the size of floatValues. - * - * For example, should bytes[0] = 0x4C (0b01001100) it would mean that: - * int32Values[0 and 1] are not valid sensor values - * int32Values[2 and 3] are valid sensor values - * int32Values[4 and 5] are not valid sensor values - * int32Values[6] is a valid sensor value - * int32Values[7] is not a valid sensor value - * Should bytes[5] = 0x61 (0b01100001) it would mean that: - * int32Values[32] is a valid sensor value - * floatValues[0 thru 3] are not valid sensor values - * floatValues[4 and 5] are valid sensor values - * floatValues[6] is not a valid sensor value - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - OBD2_LIVE_FRAME = 0x0D00 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * OBD2 Freeze Frame Sensor Data - * - * Reports a snapshot of the value of the OBD2 sensors available at the time that a fault - * occurred and was detected. - * - * A configArray must be provided with the same meaning as defined for OBD2_LIVE_FRAME. - * - * The values of this property are to be interpreted in a similar fashion as those for - * OBD2_LIVE_FRAME, with the exception that the stringValue field may contain a non-empty - * diagnostic troubleshooting code (DTC). - * - * A IVehicle#get request of this property must provide a value for int64Values[0]. - * This will be interpreted as the timestamp of the freeze frame to retrieve. A list of - * timestamps can be obtained by a IVehicle#get of OBD2_FREEZE_FRAME_INFO. - * - * Should no freeze frame be available at the given timestamp, a response of NOT_AVAILABLE - * must be returned by the implementation. Because vehicles may have limited storage for - * freeze frames, it is possible for a frame request to respond with NOT_AVAILABLE even if - * the associated timestamp has been recently obtained via OBD2_FREEZE_FRAME_INFO. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - OBD2_FREEZE_FRAME = 0x0D01 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * OBD2 Freeze Frame Information - * - * This property describes the current freeze frames stored in vehicle - * memory and available for retrieval via OBD2_FREEZE_FRAME. - * - * The values are to be interpreted as follows: - * each element of int64Values must be the timestamp at which a a fault code - * has been detected and the corresponding freeze frame stored, and each - * such element can be used as the key to OBD2_FREEZE_FRAME to retrieve - * the corresponding freeze frame. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - OBD2_FREEZE_FRAME_INFO = 0x0D02 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * OBD2 Freeze Frame Clear - * - * This property allows deletion of any of the freeze frames stored in - * vehicle memory, as described by OBD2_FREEZE_FRAME_INFO. - * - * The configArray is set as follows: - * configArray[0] = 1 if the implementation is able to clear individual freeze frames - * by timestamp, 0 otherwise - * - * IVehicle#set of this property is to be interpreted as follows: - * if int64Values contains no elements, then all frames stored must be cleared; - * if int64Values contains one or more elements, then frames at the timestamps - * stored in int64Values must be cleared, and the others not cleared. Should the - * vehicle not support selective clearing of freeze frames, this latter mode must - * return NOT_AVAILABLE. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - OBD2_FREEZE_FRAME_CLEAR = 0x0D03 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Headlights State - * - * Return the current state of headlights. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - HEADLIGHTS_STATE = 0x0E00 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * High beam lights state - * - * Return the current state of high beam lights. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - HIGH_BEAM_LIGHTS_STATE = 0x0E01 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Fog light state - * - * Return the current state of fog lights. - * - * If the car has both front and rear fog lights: - * If front and rear fog lights can only be controlled together: FOG_LIGHTS_STATE must be - * implemented. FRONT_FOG_LIGHTS_STATE and REAR_FOG_LIGHTS_STATE must not be implemented. - * - * If the front and rear fog lights can only be controlled independently: FOG_LIGHTS_STATE - * must not be implemented. FRONT_FOG_LIGHTS_STATE and REAR_FOG_LIGHTS_STATE must be - * implemented. - * - * If the car has only front fog lights: - * Only one of FOG_LIGHTS_STATE or FRONT_FOG_LIGHTS_STATE must be implemented and not both. - * REAR_FOG_LIGHTS_STATE must not be implemented. - * - * If the car has only rear fog lights: - * Only one of FOG_LIGHTS_STATE or REAR_FOG_LIGHTS_STATE must be implemented and not both. - * FRONT_FOG_LIGHTS_STATE must not be implemented. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - FOG_LIGHTS_STATE = 0x0E02 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Hazard light status - * - * Return the current status of hazard lights. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - HAZARD_LIGHTS_STATE = 0x0E03 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Headlight switch - * - * The setting that the user wants. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - HEADLIGHTS_SWITCH = 0x0E10 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * High beam light switch - * - * The setting that the user wants. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - HIGH_BEAM_LIGHTS_SWITCH = 0x0E11 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Fog light switch - * - * The setting that the user wants. - * - * If the car has both front and rear fog lights: - * If front and rear fog lights can only be controlled together: FOG_LIGHTS_SWITCH must be - * implemented. FRONT_FOG_LIGHTS_SWITCH and REAR_FOG_LIGHTS_SWITCH must not be implemented. - * - * If the front and rear fog lights can only be controlled independently: FOG_LIGHTS_SWITCH - * must not be implemented. FRONT_FOG_LIGHTS_SWITCH and REAR_FOG_LIGHTS_SWITCH must be - * implemented. - * - * If the car has only front fog lights: - * Only one of FOG_LIGHTS_SWITCH or FRONT_FOG_LIGHTS_SWITCH must be implemented and not both. - * REAR_FOG_LIGHTS_SWITCH must not be implemented. - * - * If the car has only rear fog lights: - * Only one of FOG_LIGHTS_SWITCH or REAR_FOG_LIGHTS_SWITCH must be implemented and not both. - * FRONT_FOG_LIGHTS_SWITCH must not be implemented. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - FOG_LIGHTS_SWITCH = 0x0E12 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Hazard light switch - * - * The setting that the user wants. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - HAZARD_LIGHTS_SWITCH = 0x0E13 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Cabin lights - * - * Return current status of cabin lights. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - CABIN_LIGHTS_STATE = 0x0F01 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Cabin lights switch - * - * The position of the physical switch which controls the cabin lights. - * This might be different than the CABIN_LIGHTS_STATE if the lights are on because a door - * is open or because of a voice command. - * For example, while the switch is in the "off" or "automatic" position. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - CABIN_LIGHTS_SWITCH = 0x0F02 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Reading lights - * - * Return current status of reading lights. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - READING_LIGHTS_STATE = 0x0F03 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Reading lights switch - * - * The position of the physical switch which controls the reading lights. - * This might be different than the READING_LIGHTS_STATE if the lights are on because a door - * is open or because of a voice command. - * For example, while the switch is in the "off" or "automatic" position. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - READING_LIGHTS_SWITCH = 0x0F04 + 0x10000000 + 0x05000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 - /** - * Support customize permissions for vendor properties - * - * Implement this property if vehicle hal support customize vendor permissions feature. - * VehiclePropConfig.configArray is used to indicate vendor properties and permissions - * which selected for this vendor property. The permission must be one of enum in - * VehicleVendorPermission. - * The configArray is set as follows: - * configArray[n] = propId : property ID for the vendor property - * configArray[n+1] = one of enums in VehicleVendorPermission. It indicates the permission - * for reading value of the property. - * configArray[n+2] = one of enums in VehicleVendorPermission. It indicates the permission - * for writing value of the property. - * - * For example: - * configArray = { - * vendor_prop_1, PERMISSION_VENDOR_SEAT_READ, PERMISSION_VENDOR_SEAT_WRITE, - * vendor_prop_2, PERMISSION_VENDOR_INFO, PERMISSION_NOT_ACCESSIBLE, - * } - * If vendor properties are not in this array, they will have the default vendor permission. - * If vendor chose PERMISSION_NOT_ACCESSIBLE, android will not have access to the property. In - * the example, Android can not write value for vendor_prop_2. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 0x0F05 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - /** - * Allow disabling optional featurs from vhal. - * - * This property reports optional features that should be disabled. - * All allowed optional features for the system is declared in Car service overlay, - * config_allowed_optional_car_features. - * This property allows disabling features defined in the overlay. Without this property, - * all the features declared in the overlay will be enabled. - * - * Value read should include all features disabled with ',' separation. - * ex) "com.android.car.user.CarUserNoticeService,storage_monitoring" - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - DISABLED_OPTIONAL_FEATURES = 0x0F06 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Defines the initial Android user to be used during initialization. - * - * This property is called by the Android system when it initializes and it lets the HAL - * define which Android user should be started. - * - * This request is made by setting a VehiclePropValue (defined by InitialUserInfoRequest), - * and the HAL must respond with a property change event (defined by InitialUserInfoResponse). - * If the HAL doesn't respond after some time (defined by the Android system), the Android - * system will proceed as if HAL returned a response of action - * InitialUserInfoResponseAction:DEFAULT. - * - * For example, on first boot, the request could be: - * - * int32[0]: 42 // request id (arbitrary number set by Android system) - * int32[1]: 1 // InitialUserInfoRequestType::FIRST_BOOT - * int32[2]: 0 // id of current user (usersInfo.currentUser.userId) - * int32[3]: 1 // flag of current user (usersInfo.currentUser.flags = SYSTEM) - * int32[4]: 1 // number of existing users (usersInfo.numberUsers); - * int32[5]: 0 // user #0 (usersInfo.existingUsers[0].userId) - * int32[6]: 1 // flags of user #0 (usersInfo.existingUsers[0].flags) - * - * And if the HAL want to respond with the creation of an admin user called "Owner", the - * response would be: - * - * int32[0]: 42 // must match the request id from the request - * int32[1]: 2 // action = InitialUserInfoResponseAction::CREATE - * int32[2]: -10000 // userToSwitchOrCreate.userId (not used as user will be created) - * int32[3]: 8 // userToSwitchOrCreate.flags = ADMIN - * string: "||Owner" // userLocales + separator + userNameToCreate - * - * Notice the string value represents multiple values, separated by ||. The first value is the - * (optional) system locales for the user to be created (in this case, it's empty, meaning it - * will use Android's default value), while the second value is the (also optional) name of the - * to user to be created (when the type of response is InitialUserInfoResponseAction:CREATE). - * For example, to create the same "Owner" user with "en-US" and "pt-BR" locales, the string - * value of the response would be "en-US,pt-BR||Owner". As such, neither the locale nor the - * name can have || on it, although a single | is fine. - * - * NOTE: if the HAL doesn't support user management, then it should not define this property, - * which in turn would disable the other user-related properties (for example, the Android - * system would never issue them and user-related requests from the HAL layer would be ignored - * by the Android System). But if it supports user management, then it must support all core - * user-related properties (INITIAL_USER_INFO, SWITCH_USER, CREATE_USER, and REMOVE_USER). - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - INITIAL_USER_INFO = 0x0F07 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Defines a request to switch the foreground Android user. - * - * This property is used primarily by the Android System to inform the HAL that the - * current foreground Android user is switching, but it could also be used by the HAL to request - * the Android system to switch users - the - * - * When the request is made by Android, it sets a VehiclePropValue and the HAL must responde - * with a property change event; when the HAL is making the request, it must also do it through - * a property change event (the main difference is that the request id will be positive in the - * former case, and negative in the latter; the SwitchUserMessageType will also be different). - * - * The format of both request is defined by SwitchUserRequest and the format of the response - * (when needed) is defined by SwitchUserResponse. How the HAL (or Android System) should - * proceed depends on the message type (which is defined by the SwitchUserMessageType - * parameter), as defined below. - * - * 1.LEGACY_ANDROID_SWITCH - * ----------------------- - * - * Called by the Android System to indicate the Android user is about to change, when the change - * request was made in a way that is not integrated with the HAL (for example, through - * adb shell am switch-user). - * - * The HAL can switch its internal user once it receives this request, but it doesn't need to - * reply back to the Android System. If its internal user cannot be changed for some reason, - * then it must wait for the SWITCH_USER(type=ANDROID_POST_SWITCH) call to recover - * (for example, it could issue a SWITCH_USER(type=VEHICLE_REQUEST) to switch back to - * the previous user), but ideally it should never fail (as switching back could result in a - * confusing experience for the end user). - * - * For example, if the system have users (0, 10, 11) and it's switching from 0 to 11 (where none - * of them have any special flag), the request would be: - * - * int32[0]: 42 // request id - * int32[1]: 1 // SwitchUserMessageType::LEGACY_ANDROID_SWITCH - * int32[2]: 11 // target user id - * int32[3]: 0 // target user flags (none) - * int32[4]: 10 // current user - * int32[5]: 0 // current user flags (none) - * int32[6]: 3 // number of users - * int32[7]: 0 // user #0 (Android user id 0) - * int32[8]: 0 // flags of user #0 (none) - * int32[9]: 10 // user #1 (Android user id 10) - * int32[10]: 0 // flags of user #1 (none) - * int32[11]: 11 // user #2 (Android user id 11) - * int32[12]: 0 // flags of user #2 (none) - * - * 2.ANDROID_SWITCH - * ---------------- - * Called by the Android System to indicate the Android user is about to change, but Android - * will wait for the HAL's response (up to some time) before proceeding. - * - * The HAL must switch its internal user once it receives this request, then respond back to - * Android with a SWITCH_USER(type=VEHICLE_RESPONSE) indicating whether its internal - * user was switched or not (through the SwitchUserStatus enum). - * - * For example, if Android has users (0, 10, 11) and it's switching from 10 to 11 (where - * none of them have any special flag), the request would be: - * - * int32[0]: 42 // request id - * int32[1]: 2 // SwitchUserMessageType::ANDROID_SWITCH - * int32[2]: 11 // target user id - * int32[3]: 0 // target user flags (none) - * int32[4]: 10 // current user - * int32[5]: 0 // current user flags (none) - * int32[6]: 3 // number of users - * int32[7]: 0 // 1st user (user 0) - * int32[8]: 1 // 1st user flags (SYSTEM) - * int32[9]: 10 // 2nd user (user 10) - * int32[10]: 0 // 2nd user flags (none) - * int32[11]: 11 // 3rd user (user 11) - * int32[12]: 0 // 3rd user flags (none) - * - * If the request succeeded, the HAL must update the property with: - * - * int32[0]: 42 // request id - * int32[1]: 3 // messageType = SwitchUserMessageType::VEHICLE_RESPONSE - * int32[2]: 1 // status = SwitchUserStatus::SUCCESS - * - * But if it failed, the response would be something like: - * - * int32[0]: 42 // request id - * int32[1]: 3 // messageType = SwitchUserMessageType::VEHICLE_RESPONSE - * int32[2]: 2 // status = SwitchUserStatus::FAILURE - * string: "108-D'OH!" // OEM-specific error message - * - * 3.VEHICLE_RESPONSE - * ------------------ - * Called by the HAL to indicate whether a request of type ANDROID_SWITCH should proceed or - * abort - see the ANDROID_SWITCH section above for more info. - * - * 4.VEHICLE_REQUEST - * ------------------ - * Called by the HAL to request that the current foreground Android user is switched. - * - * This is useful in situations where Android started as one user, but the vehicle identified - * the driver as another user. For example, user A unlocked the car using the key fob of user B; - * the INITIAL_USER_INFO request returned user B, but then a face recognition subsubsystem - * identified the user as A. - * - * The HAL makes this request by a property change event (passing a negative request id), and - * the Android system will response by issue an ANDROID_POST_SWITCH call which the same - * request id. - * - * For example, if the current foreground Android user is 10 and the HAL asked it to switch to - * 11, the request would be: - * - * int32[0]: -108 // request id - * int32[1]: 4 // messageType = SwitchUserMessageType::VEHICLE_REQUEST - * int32[2]: 11 // Android user id - * - * If the request succeeded and Android has 3 users (0, 10, 11), the response would be: - * - * int32[0]: -108 // request id - * int32[1]: 5 // messageType = SwitchUserMessageType::ANDROID_POST_SWITCH - * int32[2]: 11 // target user id - * int32[3]: 0 // target user id flags (none) - * int32[4]: 11 // current user - * int32[5]: 0 // current user flags (none) - * int32[6]: 3 // number of users - * int32[7]: 0 // 1st user (user 0) - * int32[8]: 0 // 1st user flags (none) - * int32[9]: 10 // 2nd user (user 10) - * int32[10]: 4 // 2nd user flags (none) - * int32[11]: 11 // 3rd user (user 11) - * int32[12]: 3 // 3rd user flags (none) - * - * Notice that both the current and target user ids are the same - if the request failed, then - * they would be different (i.e, target user would be 11, but current user would still be 10). - * - * 5.ANDROID_POST_SWITCH - * --------------------- - * Called by the Android System after a request to switch a user was made. - * - * This property is called after switch requests of any type (i.e., LEGACY_ANDROID_SWITCH, - * ANDROID_SWITCH, or VEHICLE_REQUEST) and can be used to determine if the request succeeded or - * failed: - * - * 1. When it succeeded, it's called when the Android user is in the unlocked state and the - * value of the current and target users ids in the response are the same. This would be - * equivalent to receiving an Intent.ACTION_USER_UNLOCKED in an Android app. - * 2. When it failed it's called right away and the value of the current and target users ids - * in the response are different (as the current user didn't change to the target). - * 3. If a new switch request is made before the HAL responded to the previous one or before - * the user was unlocked, then the ANDROID_POST_SWITCH request is not made. For example, - * the driver could accidentally switch to the wrong user which has lock credentials, then - * switch to the right one before entering the credentials. - * - * The HAL can update its internal state once it receives this request, but it doesn't need to - * reply back to the Android System. - * - * Request: the first N values as defined by INITIAL_USER_INFO (where the request-specific - * value at index 1 is SwitchUserMessageType::ANDROID_POST_SWITCH), then 2 more values for the - * target user id (i.e., the Android user id that was requested to be switched to) and its flags - * (as defined by UserFlags). - * - * Response: none. - * - * Example: see VEHICLE_REQUEST section above. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - SWITCH_USER = 0x0F08 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Called by the Android System after an Android user was created. - * - * The HAL can use this property to create its equivalent user. - * - * This is an async request: Android makes the request by setting a VehiclePropValue, and HAL - * must respond with a property change indicating whether the request succeeded or failed. If - * it failed, the Android system will remove the user. - * - * The format of the request is defined by CreateUserRequest and the format of the response by - * CreateUserResponse. - * - * For example, if system had 2 users (0 and 10) and a 3rd one (which is an ephemeral guest) was - * created, the request would be: - * - * int32[0]: 42 // request id - * int32[1]: 11 // Android id of the created user - * int32[2]: 6 // Android flags (ephemeral guest) of the created user - * int32[3]: 10 // current user - * int32[4]: 0 // current user flags (none) - * int32[5]: 3 // number of users - * int32[6]: 0 // 1st user (user 0) - * int32[7]: 0 // 1st user flags (none) - * int32[8]: 10 // 2nd user (user 10) - * int32[9]: 0 // 2nd user flags (none) - * int32[19]: 11 // 3rd user (user 11) - * int32[11]: 6 // 3rd user flags (ephemeral guest) - * string: "ElGuesto" // name of the new user - * - * Then if the request succeeded, the HAL would return: - * - * int32[0]: 42 // request id - * int32[1]: 1 // CreateUserStatus::SUCCESS - * - * But if it failed: - * - * int32[0]: 42 // request id - * int32[1]: 2 // CreateUserStatus::FAILURE - * string: "D'OH!" // The meaning is a blackbox - it's passed to the caller (like Settings UI), - * // which in turn can take the proper action. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - CREATE_USER = 0x0F09 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Called by the Android System after an Android user was removed. - * - * The HAL can use this property to remove its equivalent user. - * - * This is write-only call - the Android System is not expecting a reply from the HAL. Hence, - * this request should not fail - if the equivalent HAL user cannot be removed, then HAL should - * mark it as inactive or recover in some other way. - * - * The request is made by setting the VehiclePropValue with the contents defined by - * RemoveUserRequest. - * - * For example, if system had 3 users (0, 10, and 11) and user 11 was removed, the request - * would be: - * - * int32[0]: 42 // request id - * int32[1]: 11 // (Android user id of the removed user) - * int32[2]: 0 // (Android user flags of the removed user) - * int32[3]: 10 // current user - * int32[4]: 0 // current user flags (none) - * int32[5]: 2 // number of users - * int32[6]: 0 // 1st user (user 0) - * int32[7]: 0 // 1st user flags (none) - * int32[8]: 10 // 2nd user (user 10) - * int32[9]: 0 // 2nd user flags (none) - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:WRITE - */ - REMOVE_USER = 0x0F0A + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Property used to associate (or query the association) the current user with vehicle-specific - * identification mechanisms (such as key FOB). - * - * This is an optional user management property - the OEM could still support user management - * without defining it. In fact, this property could be used without supporting the core - * user-related functions described on INITIAL_USER_INFO. - * - * To query the association, the Android system gets the property, passing a VehiclePropValue - * containing the types of associations are being queried, as defined by - * UserIdentificationGetRequest. The HAL must return right away, returning a VehiclePropValue - * with a UserIdentificationResponse. Notice that user identification should have already - * happened while system is booting up and the VHAL implementation should only return the - * already identified association (like the key FOB used to unlock the car), instead of starting - * a new association from the get call. - * - * To associate types, the Android system sets the property, passing a VehiclePropValue - * containing the types and values of associations being set, as defined by the - * UserIdentificationSetRequest. The HAL will then use a property change event (whose - * VehiclePropValue is defined by UserIdentificationResponse) indicating the current status of - * the types after the request. - * - * For example, to query if the current user (10) is associated with the FOB that unlocked the - * car and a custom mechanism provided by the OEM, the request would be: - * - * int32[0]: 42 // request id - * int32[1]: 10 (Android user id) - * int32[2]: 0 (Android user flags) - * int32[3]: 2 (number of types queried) - * int32[4]: 1 (1st type queried, UserIdentificationAssociationType::KEY_FOB) - * int32[5]: 101 (2nd type queried, UserIdentificationAssociationType::CUSTOM_1) - * - * If the user is associated with the FOB but not with the custom mechanism, the response would - * be: - * - * int32[0]: 42 // request id - * int32[1]: 2 (number of associations in the response) - * int32[2]: 1 (1st type: UserIdentificationAssociationType::KEY_FOB) - * int32[3]: 2 (1st value: UserIdentificationAssociationValue::ASSOCIATED_CURRENT_USER) - * int32[4]: 101 (2st type: UserIdentificationAssociationType::CUSTOM_1) - * int32[5]: 4 (2nd value: UserIdentificationAssociationValue::NOT_ASSOCIATED_ANY_USER) - * - * Then to associate the user with the custom mechanism, a set request would be made: - * - * int32[0]: 43 // request id - * int32[1]: 10 (Android user id) - * int32[2]: 0 (Android user flags) - * int32[3]: 1 (number of associations being set) - * int32[4]: 101 (1st type: UserIdentificationAssociationType::CUSTOM_1) - * int32[5]: 1 (1st value: UserIdentificationAssociationSetValue::ASSOCIATE_CURRENT_USER) - * - * If the request succeeded, the response would be simply: - * - * int32[0]: 43 // request id - * int32[1]: 1 (number of associations in the response) - * int32[2]: 101 (1st type: UserIdentificationAssociationType::CUSTOM_1) - * int32[3]: 1 (1st value: UserIdentificationAssociationValue::ASSOCIATED_CURRENT_USER) - * - * Notice that the set request adds associations, but doesn't remove the existing ones. In the - * example above, the end state would be 2 associations (FOB and CUSTOM_1). If we wanted to - * associate the user with just CUSTOM_1 but not FOB, then the request should have been: - * - * int32[0]: 43 // request id - * int32[1]: 10 (Android user id) - * int32[2]: 2 (number of types set) - * int32[3]: 1 (1st type: UserIdentificationAssociationType::KEY_FOB) - * int32[4]: 2 (1st value: UserIdentificationAssociationValue::DISASSOCIATE_CURRENT_USER) - * int32[5]: 101 (2nd type: UserIdentificationAssociationType::CUSTOM_1) - * int32[6]: 1 (2nd value: UserIdentificationAssociationValue::ASSOCIATE_CURRENT_USER) - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - USER_IDENTIFICATION_ASSOCIATION = 0x0F0B + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Enable/request an EVS service. - * - * The property provides a generalized way to trigger EVS services. VHAL - * should use this property to request Android to start or stop EVS service. - * - * int32Values[0] = a type of the EVS service. The value must be one of enums in - * EvsServiceType. - * int32Values[1] = the state of the EVS service. The value must be one of enums in - * EvsServiceState. - * - * For example, to enable rear view EVS service, android side can set the property value as - * [EvsServiceType::REAR_VIEW, EvsServiceState::ON]. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - EVS_SERVICE_REQUEST = 0x0F10 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Defines a request to apply power policy. - * - * VHAL sets this property to change car power policy. Car power policy service subscribes to - * this property and actually changes the power policy. - * The request is made by setting the VehiclePropValue with the ID of a power policy which is - * defined at /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy - * service ignores the request and the current power policy is maintained. - * - * string: "sample_policy_id" // power policy ID - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - POWER_POLICY_REQ = 0x0F21 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Defines a request to set the power polic group used to decide a default power policy per - * power status transition. - * - * VHAL sets this property with the ID of a power policy group in order to set the default power - * policy applied at power status transition. Power policy groups are defined at - * /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy service - * ignores the request. - * Car power policy service subscribes to this property and sets the power policy group. - * The actual application of power policy takes place when the system power status changes and - * there is a valid mapped power policy for the new power status. - * - * string: "sample_policy_group_id" // power policy group ID - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - POWER_POLICY_GROUP_REQ = 0x0F22 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Notifies the current power policy to VHAL layer. - * - * Car power policy service sets this property when the current power policy is changed. - * - * string: "sample_policy_id" // power policy ID - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - CURRENT_POWER_POLICY = 0x0F23 + 0x10000000 + 0x01000000 - + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING - /** - * Defines an event that car watchdog updates to tell it's alive. - * - * Car watchdog sets this property to system uptime in milliseconds at every 3 second. - * During the boot, the update may take longer time. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - WATCHDOG_ALIVE = 0xF31 + 0x10000000 + 0x01000000 - + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 - /** - * Defines a process terminated by car watchdog and the reason of termination. - * - * int32Values[0]: 1 // ProcessTerminationReason showing why a process is terminated. - * string: "/system/bin/log" // Process execution command. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - WATCHDOG_TERMINATED_PROCESS = 0x0F32 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Defines an event that VHAL signals to car watchdog as a heartbeat. - * - * If VHAL supports this property, VHAL should write system uptime to this property at every 3 - * second. Car watchdog subscribes to this property and checks if the property is updated at - * every 3 second. With the buffer time of 3 second, car watchdog waits for a heart beat to be - * signaled up to 6 seconds from the last heart beat. If it isn’t, car watchdog considers - * VHAL unhealthy and terminates it. - * If this property is not supported by VHAL, car watchdog doesn't check VHAL health status. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - VHAL_HEARTBEAT = 0x0F33 + 0x10000000 + 0x01000000 - + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 - /** - * Starts the ClusterUI in cluster display. - * - * int32: the type of ClusterUI to show - * 0 indicates ClusterHome, that is a home screen of cluster display, and provides - * the default UI and a kind of launcher functionality for cluster display. - * the other values are followed by OEM's definition. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - CLUSTER_SWITCH_UI = 0x0F34 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Changes the state of the cluster display. - * - * Bounds: the area to render the cluster Activity. - * Inset: the area which Activity should avoid from placing any important - * information. - * - * int32[0]: on/off: 0 - off, 1 - on, -1 - don't care - * int32[1]: Bounds - left: positive number - left position in pixels - -1 - don't care (should set all Bounds fields) - * int32[2]: Bounds - top: same format with 'left' - * int32[3]: Bounds - right: same format with 'left' - * int32[4]: Bounds - bottom: same format with 'left' - * int32[5]: Inset - left: positive number - actual left inset value in pixels - -1 - don't care (should set "don't care" all Inset fields) - * int32[6]: Inset - top: same format with 'left' - * int32[7]: Inset - right: same format with 'left' - * int32[8]: Inset - bottom: same format with 'left' - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - */ - CLUSTER_DISPLAY_STATE = 0x0F35 + 0x10000000 + 0x01000000 - + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC - /** - * Reports the current display state and ClusterUI state. - * - * ClusterHome will send this message when it handles CLUSTER_SWITCH_UI, CLUSTER_DISPLAY_STATE. - * - * In addition, ClusterHome should send this message when it starts for the first time. - * When ClusterOS receives this message and if the internal expectation is different with the - * received message, then it should send CLUSTER_SWITCH_UI, CLUSTER_DISPLAY_STATE again to - * match the state. - * - * int32[0]: on/off: 0 - off, 1 - on - * int32[1]: Bounds - left - * int32[2]: Bounds - top - * int32[3]: Bounds - right - * int32[4]: Bounds - bottom - * int32[5]: Inset - left - * int32[6]: Inset - top - * int32[7]: Inset - right - * int32[8]: Inset - bottom - * int32[9]: the type of ClusterUI in the fullscreen or main screen. - * 0 indicates ClusterHome. - * the other values are followed by OEM's definition. - * int32[10]: the type of ClusterUI in sub screen if the currently two UIs are shown. - * -1 indicates the area isn't used any more. - * bytes: the array to represent the availability of ClusterUI. - * 0 indicates non-available and 1 indicates available. - * For example, let's assume a car supports 3 OEM defined ClusterUI like HOME, MAPS, CALL, - * and it only supports CALL UI only when the cellular network is available. Then, if the - * nework is avaibale, it'll send [1 1 1], and if it's out of network, it'll send [1 1 0]. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - CLUSTER_REPORT_STATE = 0x0F36 + 0x10000000 + 0x01000000 - + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED - /** - * Requests to change the cluster display state to show some ClusterUI. - * - * When the current display state is off and ClusterHome sends this message to ClusterOS to - * request to turn the display on to show some specific ClusterUI. - * ClusterOS should response this with CLUSTER_DISPLAY_STATE. - * - * int32: the type of ClusterUI to show - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Informs the current navigation state. - * - * bytes: the serialized message of NavigationStateProto. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:WRITE - */ - CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x10000000 + 0x01000000 - + 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES - /** - * Electronic Toll Collection card type. - * - * This property indicates the type of ETC card in this vehicle. - * If the head unit is aware of an ETC card attached to the vehicle, this property should - * return the type of card attached; otherwise, this property should be UNAVAILABLE. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum ElectronicTollCollectionCardType - */ - ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 0x0F39 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Electronic Toll Collection card status. - * - * This property indicates the status of ETC card in this vehicle. - * If the head unit is aware of an ETC card attached to the vehicle, - * ELECTRONIC_TOLL_COLLECTION_CARD_TYPE gives that status of the card; otherwise, - * this property should be UNAVAILABLE. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum ElectronicTollCollectionCardStatus - */ - ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 0x0F3A + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - /** - * Front fog lights state - * - * Return the current state of the front fog lights. - * Only one of FOG_LIGHTS_STATE or FRONT_FOG_LIGHTS_STATE must be implemented. Please refer to - * the documentation on FOG_LIGHTS_STATE for more information. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - FRONT_FOG_LIGHTS_STATE = 0x0F3B + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Front fog lights switch - * - * The setting that the user wants. - * Only one of FOG_LIGHTS_SWITCH or FRONT_FOG_LIGHTS_SWITCH must be implemented. Please refer to - * the documentation on FOG_LIGHTS_SWITCH for more information. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - FRONT_FOG_LIGHTS_SWITCH = 0x0F3C + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Rear fog lights state - * - * Return the current state of the rear fog lights. - * Only one of FOG_LIGHTS_STATE or REAR_FOG_LIGHTS_STATE must be implemented. Please refer to - * the documentation on FOG_LIGHTS_STATE for more information. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum VehicleLightState - */ - REAR_FOG_LIGHTS_STATE = 0x0F3D + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Rear fog lights switch - * - * The setting that the user wants. - * Only one of FOG_LIGHTS_SWITCH or REAR_FOG_LIGHTS_SWITCH must be implemented. Please refer to - * the documentation on FOG_LIGHTS_SWITCH for more information. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @data_enum VehicleLightSwitch - */ - REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Indicates the maximum current draw threshold for charging set by the user - * - * configArray[0] is used to specify the max current draw allowed by - * the vehicle in Amperes. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @unit VehicleUnit:AMPERE - */ - EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - - /** - * Indicates the maximum charge percent threshold set by the user - * - * Returns a float value from 0 to 100. - * - * configArray is used to specify the valid values. - * For example, if the vehicle supports the following charge percent limit values: - * [20, 40, 60, 80, 100] - * then the configArray should be {20, 40, 60, 80, 100} - * If the configArray is empty then all values from 0 to 100 must be valid. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000 - + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT - - /** - * Charging state of the car - * - * Returns the current charging state of the car. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum EvChargeState - */ - EV_CHARGE_STATE = 0x0F41 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Start or stop charging the EV battery - * - * The setting that the user wants. Setting this property to true starts the battery charging - * and setting to false stops charging. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000 - + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN - - /** - * Estimated charge time remaining in seconds - * - * Returns 0 if the vehicle is not charging. - * - * @change_mode VehiclePropertyChangeMode:CONTINUOUS - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:SECS - */ - EV_CHARGE_TIME_REMAINING = 0x0F43 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Regenerative braking or one-pedal drive state of the car - * - * Returns the current state associated with the regenerative braking - * setting in the car - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum EvRegenerativeBrakingState - */ - EV_REGENERATIVE_BRAKING_STATE = 0x0F44 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Indicates if there is a trailer present or not. - * - * Returns the trailer state of the car. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ - * @data_enum TrailerState - */ - TRAILER_PRESENT = 0x0F45 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - - /** - * Vehicle’s curb weight - * - * Returns the vehicle's curb weight in kilograms. Curb weight is - * the total weight of the vehicle with standard equipment and all - * necessary operating consumables such as motor oil,transmission oil, - * brake fluid, coolant, air conditioning refrigerant, and weight of - * fuel at nominal tank capacity, while not loaded with either passengers - * or cargo. - * - * configArray[0] is used to specify the vehicle’s gross weight in kilograms. - * The vehicle’s gross weight is the maximum operating weight of the vehicle - * as specified by the manufacturer including the vehicle's chassis, body, engine, - * engine fluids, fuel, accessories, driver, passengers and cargo but excluding - * that of any trailers. - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:KILOGRAM - */ - - VEHICLE_CURB_WEIGHT = 0x0F46 + 0x10000000 + 0x01000000 - + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 - -} diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h new file mode 100644 index 0000000000..d0c6e83ebe --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -0,0 +1,283 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DO NOT EDIT MANUALLY!!! + * + * Generated by tools/generate_annotation_enums.py. + */ + +// clang-format off + +#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_ +#define android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_ + +#include +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +std::unordered_map AccessForVehicleProperty = { + {VehicleProperty::INFO_VIN, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_MAKE, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_MODEL, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_MODEL_YEAR, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_FUEL_CAPACITY, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_FUEL_TYPE, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_EV_BATTERY_CAPACITY, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_EV_CONNECTOR_TYPE, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_FUEL_DOOR_LOCATION, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_EV_PORT_LOCATION, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_DRIVER_SEAT, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_EXTERIOR_DIMENSIONS, VehiclePropertyAccess::READ}, + {VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS, VehiclePropertyAccess::READ}, + {VehicleProperty::PERF_ODOMETER, VehiclePropertyAccess::READ}, + {VehicleProperty::PERF_VEHICLE_SPEED, VehiclePropertyAccess::READ}, + {VehicleProperty::PERF_VEHICLE_SPEED_DISPLAY, VehiclePropertyAccess::READ}, + {VehicleProperty::PERF_STEERING_ANGLE, VehiclePropertyAccess::READ}, + {VehicleProperty::PERF_REAR_STEERING_ANGLE, VehiclePropertyAccess::READ}, + {VehicleProperty::ENGINE_COOLANT_TEMP, VehiclePropertyAccess::READ}, + {VehicleProperty::ENGINE_OIL_LEVEL, VehiclePropertyAccess::READ}, + {VehicleProperty::ENGINE_OIL_TEMP, VehiclePropertyAccess::READ}, + {VehicleProperty::ENGINE_RPM, VehiclePropertyAccess::READ}, + {VehicleProperty::WHEEL_TICK, VehiclePropertyAccess::READ}, + {VehicleProperty::FUEL_LEVEL, VehiclePropertyAccess::READ}, + {VehicleProperty::FUEL_DOOR_OPEN, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_BATTERY_LEVEL, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_CHARGE_PORT_OPEN, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_CHARGE_PORT_CONNECTED, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyAccess::READ}, + {VehicleProperty::RANGE_REMAINING, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::TIRE_PRESSURE, VehiclePropertyAccess::READ}, + {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess::READ}, + {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::GEAR_SELECTION, VehiclePropertyAccess::READ}, + {VehicleProperty::CURRENT_GEAR, VehiclePropertyAccess::READ}, + {VehicleProperty::PARKING_BRAKE_ON, VehiclePropertyAccess::READ}, + {VehicleProperty::PARKING_BRAKE_AUTO_APPLY, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::FUEL_LEVEL_LOW, VehiclePropertyAccess::READ}, + {VehicleProperty::NIGHT_MODE, VehiclePropertyAccess::READ}, + {VehicleProperty::TURN_SIGNAL_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::IGNITION_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::ABS_ACTIVE, VehiclePropertyAccess::READ}, + {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess::READ}, + {VehicleProperty::HVAC_TEMPERATURE_SET, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_DEFROSTER, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_AC_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_MAX_AC_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_MAX_DEFROST_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_RECIRC_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_DUAL_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_AUTO_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_SEAT_TEMPERATURE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_SIDE_MIRROR_HEAT, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_STEERING_WHEEL_HEAT, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM, VehiclePropertyAccess::READ}, + {VehicleProperty::HVAC_POWER_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE, VehiclePropertyAccess::READ}, + {VehicleProperty::HVAC_AUTO_RECIRC_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_SEAT_VENTILATION, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DISTANCE_DISPLAY_UNITS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_BATTERY_DISPLAY_UNITS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EXTERNAL_CAR_TIME, VehiclePropertyAccess::READ}, + {VehicleProperty::ANDROID_EPOCH_TIME, VehiclePropertyAccess::WRITE}, + {VehicleProperty::STORAGE_ENCRYPTION_BINDING_SEED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::ENV_OUTSIDE_TEMPERATURE, VehiclePropertyAccess::READ}, + {VehicleProperty::AP_POWER_STATE_REQ, VehiclePropertyAccess::READ}, + {VehicleProperty::AP_POWER_STATE_REPORT, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyAccess::READ}, + {VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HW_KEY_INPUT, VehiclePropertyAccess::READ}, + {VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyAccess::READ}, + {VehicleProperty::HW_MOTION_INPUT, VehiclePropertyAccess::READ}, + {VehicleProperty::HW_ROTARY_INPUT, VehiclePropertyAccess::READ}, + {VehicleProperty::HW_CUSTOM_INPUT, VehiclePropertyAccess::READ}, + {VehicleProperty::DOOR_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DOOR_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DOOR_LOCK, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DOOR_CHILD_LOCK_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_Z_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_Z_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_Y_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_Y_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_LOCK, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_FOLD, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::MIRROR_AUTO_TILT_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_MEMORY_SELECT, VehiclePropertyAccess::WRITE}, + {VehicleProperty::SEAT_MEMORY_SET, VehiclePropertyAccess::WRITE}, + {VehicleProperty::SEAT_BELT_BUCKLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BELT_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BELT_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_FORE_AFT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_FORE_AFT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_1_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_2_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_DEPTH_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_DEPTH_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_TILT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_TILT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_LUMBAR_FORE_AFT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_LUMBAR_FORE_AFT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_ANGLE_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_ANGLE_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyAccess::READ}, + {VehicleProperty::WINDOW_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::WINDOW_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::WINDOW_LOCK, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess::READ}, + {VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_LOCKED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ}, + {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, + {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, + {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, + {VehicleProperty::OBD2_FREEZE_FRAME_CLEAR, VehiclePropertyAccess::WRITE}, + {VehicleProperty::HEADLIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::HIGH_BEAM_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::FOG_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::HAZARD_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::HEADLIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::FOG_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HAZARD_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::CABIN_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::CABIN_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::READING_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::READING_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION, VehiclePropertyAccess::READ}, + {VehicleProperty::DISABLED_OPTIONAL_FEATURES, VehiclePropertyAccess::READ}, + {VehicleProperty::INITIAL_USER_INFO, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SWITCH_USER, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::CREATE_USER, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::REMOVE_USER, VehiclePropertyAccess::WRITE}, + {VehicleProperty::USER_IDENTIFICATION_ASSOCIATION, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EVS_SERVICE_REQUEST, VehiclePropertyAccess::READ}, + {VehicleProperty::POWER_POLICY_REQ, VehiclePropertyAccess::READ}, + {VehicleProperty::POWER_POLICY_GROUP_REQ, VehiclePropertyAccess::READ}, + {VehicleProperty::CURRENT_POWER_POLICY, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::WATCHDOG_ALIVE, VehiclePropertyAccess::WRITE}, + {VehicleProperty::WATCHDOG_TERMINATED_PROCESS, VehiclePropertyAccess::WRITE}, + {VehicleProperty::VHAL_HEARTBEAT, VehiclePropertyAccess::READ}, + {VehicleProperty::CLUSTER_SWITCH_UI, VehiclePropertyAccess::READ}, + {VehicleProperty::CLUSTER_DISPLAY_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::CLUSTER_REPORT_STATE, VehiclePropertyAccess::WRITE}, + {VehicleProperty::CLUSTER_REQUEST_DISPLAY, VehiclePropertyAccess::WRITE}, + {VehicleProperty::CLUSTER_NAVIGATION_STATE, VehiclePropertyAccess::WRITE}, + {VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, VehiclePropertyAccess::READ}, + {VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, VehiclePropertyAccess::READ}, + {VehicleProperty::FRONT_FOG_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::FRONT_FOG_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::REAR_FOG_LIGHTS_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::REAR_FOG_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_CHARGE_PERCENT_LIMIT, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_CHARGE_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_CHARGE_SWITCH, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_CHARGE_TIME_REMAINING, VehiclePropertyAccess::READ}, + {VehicleProperty::EV_REGENERATIVE_BRAKING_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::TRAILER_PRESENT, VehiclePropertyAccess::READ}, + {VehicleProperty::VEHICLE_CURB_WEIGHT, VehiclePropertyAccess::READ}, + {VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyAccess::READ}, + {VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess::READ}, + {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyAccess::WRITE}, + {VehicleProperty::VEHICLE_IN_USE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE}, + {VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE}, + {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyAccess::READ}, + {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess::READ}, +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android +} // aidl + +#endif // android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_ diff --git a/automotive/vehicle/aidl/generated_lib/cpp/Android.bp b/automotive/vehicle/aidl/generated_lib/cpp/Android.bp new file mode 100644 index 0000000000..11d3693b50 --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/cpp/Android.bp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library_headers { + name: "IVehicleGeneratedHeaders", + vendor_available: true, + local_include_dirs: ["."], + export_include_dirs: ["."], + defaults: ["VehicleHalInterfaceDefaults"], +} diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h new file mode 100644 index 0000000000..48532c93ca --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -0,0 +1,283 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DO NOT EDIT MANUALLY!!! + * + * Generated by tools/generate_annotation_enums.py. + */ + +// clang-format off + +#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_ +#define android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_ + +#include +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +std::unordered_map ChangeModeForVehicleProperty = { + {VehicleProperty::INFO_VIN, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_MAKE, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_MODEL, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_MODEL_YEAR, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_FUEL_CAPACITY, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_FUEL_TYPE, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_EV_BATTERY_CAPACITY, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_EV_CONNECTOR_TYPE, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_FUEL_DOOR_LOCATION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_EV_PORT_LOCATION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_DRIVER_SEAT, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_EXTERIOR_DIMENSIONS, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::PERF_ODOMETER, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::PERF_VEHICLE_SPEED, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::PERF_VEHICLE_SPEED_DISPLAY, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::PERF_STEERING_ANGLE, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::PERF_REAR_STEERING_ANGLE, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::ENGINE_COOLANT_TEMP, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::ENGINE_OIL_LEVEL, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ENGINE_OIL_TEMP, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::ENGINE_RPM, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::WHEEL_TICK, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::FUEL_LEVEL, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::FUEL_DOOR_OPEN, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_BATTERY_LEVEL, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_PORT_OPEN, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_PORT_CONNECTED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::RANGE_REMAINING, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::TIRE_PRESSURE, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::GEAR_SELECTION, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CURRENT_GEAR, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::PARKING_BRAKE_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::PARKING_BRAKE_AUTO_APPLY, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FUEL_LEVEL_LOW, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::NIGHT_MODE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::TURN_SIGNAL_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::IGNITION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ABS_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_STOPPING_MODE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_TEMPERATURE_SET, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_DEFROSTER, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_AC_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_MAX_AC_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_MAX_DEFROST_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_RECIRC_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_DUAL_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_AUTO_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_SEAT_TEMPERATURE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_SIDE_MIRROR_HEAT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_STEERING_WHEEL_HEAT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_POWER_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::HVAC_AUTO_RECIRC_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_SEAT_VENTILATION, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DISTANCE_DISPLAY_UNITS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_BATTERY_DISPLAY_UNITS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EXTERNAL_CAR_TIME, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ANDROID_EPOCH_TIME, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STORAGE_ENCRYPTION_BINDING_SEED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ENV_OUTSIDE_TEMPERATURE, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::AP_POWER_STATE_REQ, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::AP_POWER_STATE_REPORT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HW_KEY_INPUT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HW_MOTION_INPUT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HW_ROTARY_INPUT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HW_CUSTOM_INPUT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DOOR_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DOOR_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DOOR_LOCK, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DOOR_CHILD_LOCK_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_Z_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_Z_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_Y_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_Y_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_LOCK, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_FOLD, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::MIRROR_AUTO_TILT_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_MEMORY_SELECT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_MEMORY_SET, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BELT_BUCKLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BELT_HEIGHT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BELT_HEIGHT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_FORE_AFT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_FORE_AFT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_1_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_2_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEIGHT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEIGHT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_DEPTH_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_DEPTH_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_TILT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_TILT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_LUMBAR_FORE_AFT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_LUMBAR_FORE_AFT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_HEIGHT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_HEIGHT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_ANGLE_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_ANGLE_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDOW_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDOW_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDOW_LOCK, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_LOCKED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::OBD2_FREEZE_FRAME_CLEAR, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HEADLIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HIGH_BEAM_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FOG_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HAZARD_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HEADLIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FOG_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HAZARD_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CABIN_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CABIN_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::READING_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::READING_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::DISABLED_OPTIONAL_FEATURES, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::INITIAL_USER_INFO, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SWITCH_USER, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CREATE_USER, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::REMOVE_USER, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::USER_IDENTIFICATION_ASSOCIATION, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EVS_SERVICE_REQUEST, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::POWER_POLICY_REQ, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::POWER_POLICY_GROUP_REQ, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CURRENT_POWER_POLICY, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WATCHDOG_ALIVE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::WATCHDOG_TERMINATED_PROCESS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VHAL_HEARTBEAT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CLUSTER_SWITCH_UI, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CLUSTER_DISPLAY_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CLUSTER_REPORT_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CLUSTER_REQUEST_DISPLAY, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CLUSTER_NAVIGATION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FRONT_FOG_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FRONT_FOG_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::REAR_FOG_LIGHTS_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::REAR_FOG_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_PERCENT_LIMIT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EV_CHARGE_TIME_REMAINING, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::EV_REGENERATIVE_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::TRAILER_PRESENT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VEHICLE_CURB_WEIGHT, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VEHICLE_IN_USE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android +} // aidl + +#endif // android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_ diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java new file mode 100644 index 0000000000..758670d588 --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -0,0 +1,269 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DO NOT EDIT MANUALLY!!! + * + * Generated by tools/generate_annotation_enums.py. + */ + +// clang-format off + +package android.hardware.automotive.vehicle; + +import java.util.Map; + +public final class AccessForVehicleProperty { + + public static final Map values = Map.ofEntries( + Map.entry(VehicleProperty.INFO_VIN, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_MAKE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_MODEL, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_MODEL_YEAR, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_FUEL_CAPACITY, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_FUEL_TYPE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_EV_BATTERY_CAPACITY, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_EV_CONNECTOR_TYPE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_FUEL_DOOR_LOCATION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_EV_PORT_LOCATION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_DRIVER_SEAT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_EXTERIOR_DIMENSIONS, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INFO_MULTI_EV_PORT_LOCATIONS, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PERF_ODOMETER, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PERF_VEHICLE_SPEED, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PERF_VEHICLE_SPEED_DISPLAY, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PERF_STEERING_ANGLE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PERF_REAR_STEERING_ANGLE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ENGINE_COOLANT_TEMP, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ENGINE_OIL_LEVEL, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ENGINE_OIL_TEMP, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ENGINE_RPM, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.WHEEL_TICK, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.FUEL_LEVEL, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.FUEL_DOOR_OPEN, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_BATTERY_LEVEL, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_CHARGE_PORT_OPEN, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_CHARGE_PORT_CONNECTED, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.RANGE_REMAINING, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.GEAR_SELECTION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CURRENT_GEAR, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PARKING_BRAKE_ON, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.PARKING_BRAKE_AUTO_APPLY, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.FUEL_LEVEL_LOW, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.NIGHT_MODE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.TURN_SIGNAL_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.IGNITION_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_SET, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_DEFROSTER, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_AC_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_MAX_AC_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_MAX_DEFROST_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_RECIRC_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_DUAL_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_AUTO_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_SEAT_TEMPERATURE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_SIDE_MIRROR_HEAT, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_STEERING_WHEEL_HEAT, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_DISPLAY_UNITS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_ACTUAL_FAN_SPEED_RPM, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HVAC_POWER_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HVAC_AUTO_RECIRC_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_SEAT_VENTILATION, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_ELECTRIC_DEFROSTER_ON, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_VALUE_SUGGESTION, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DISTANCE_DISPLAY_UNITS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.FUEL_VOLUME_DISPLAY_UNITS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.TIRE_PRESSURE_DISPLAY_UNITS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_BATTERY_DISPLAY_UNITS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.VEHICLE_SPEED_DISPLAY_UNITS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EXTERNAL_CAR_TIME, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ANDROID_EPOCH_TIME, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.STORAGE_ENCRYPTION_BINDING_SEED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.ENV_OUTSIDE_TEMPERATURE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.AP_POWER_STATE_REQ, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.AP_POWER_STATE_REPORT, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.AP_POWER_BOOTUP_REASON, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HW_ROTARY_INPUT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HW_CUSTOM_INPUT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.DOOR_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DOOR_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DOOR_LOCK, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DOOR_CHILD_LOCK_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_Z_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_Z_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_Y_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_Y_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_LOCK, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_FOLD, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.MIRROR_AUTO_TILT_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_MEMORY_SELECT, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.SEAT_MEMORY_SET, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.SEAT_BELT_BUCKLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BELT_HEIGHT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BELT_HEIGHT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_FORE_AFT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_FORE_AFT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_1_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_1_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_2_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_2_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEIGHT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEIGHT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_DEPTH_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_DEPTH_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_TILT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_TILT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_LUMBAR_FORE_AFT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_LUMBAR_FORE_AFT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_LUMBAR_SIDE_SUPPORT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_LUMBAR_SIDE_SUPPORT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_HEIGHT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_HEIGHT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_ANGLE_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_ANGLE_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_WALK_IN_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.WINDOW_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.WINDOW_LOCK, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_THEFT_LOCK_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_LOCKED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_EASY_ACCESS_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.GLOVE_BOX_DOOR_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_CLEAR, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.HEADLIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.FOG_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HAZARD_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HEADLIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.FOG_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HAZARD_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.CABIN_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CABIN_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.READING_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.READING_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SUPPORT_CUSTOMIZE_VENDOR_PERMISSION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.DISABLED_OPTIONAL_FEATURES, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.INITIAL_USER_INFO, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SWITCH_USER, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.CREATE_USER, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.REMOVE_USER, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.USER_IDENTIFICATION_ASSOCIATION, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EVS_SERVICE_REQUEST, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.POWER_POLICY_REQ, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.POWER_POLICY_GROUP_REQ, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CURRENT_POWER_POLICY, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.WATCHDOG_ALIVE, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.WATCHDOG_TERMINATED_PROCESS, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.VHAL_HEARTBEAT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CLUSTER_SWITCH_UI, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CLUSTER_DISPLAY_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CLUSTER_REPORT_STATE, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.CLUSTER_REQUEST_DISPLAY, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.CLUSTER_NAVIGATION_STATE, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.REAR_FOG_LIGHTS_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.REAR_FOG_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_CHARGE_CURRENT_DRAW_LIMIT, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_CHARGE_PERCENT_LIMIT, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_CHARGE_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_CHARGE_SWITCH, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_CHARGE_TIME_REMAINING, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EV_REGENERATIVE_BRAKING_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.TRAILER_PRESENT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.VEHICLE_CURB_WEIGHT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CRUISE_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.CRUISE_CONTROL_TYPE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess.READ) + ); + +} diff --git a/automotive/vehicle/aidl/generated_lib/java/Android.bp b/automotive/vehicle/aidl/generated_lib/java/Android.bp new file mode 100644 index 0000000000..1d612e8292 --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/java/Android.bp @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +filegroup { + name: "IVehicleGeneratedJavaFiles", + srcs: [ + "*.java", + ], +} diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java new file mode 100644 index 0000000000..29069f8de4 --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -0,0 +1,269 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DO NOT EDIT MANUALLY!!! + * + * Generated by tools/generate_annotation_enums.py. + */ + +// clang-format off + +package android.hardware.automotive.vehicle; + +import java.util.Map; + +public final class ChangeModeForVehicleProperty { + + public static final Map values = Map.ofEntries( + Map.entry(VehicleProperty.INFO_VIN, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_MAKE, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_MODEL, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_MODEL_YEAR, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_FUEL_CAPACITY, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_FUEL_TYPE, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_EV_BATTERY_CAPACITY, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_EV_CONNECTOR_TYPE, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_FUEL_DOOR_LOCATION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_EV_PORT_LOCATION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_DRIVER_SEAT, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_EXTERIOR_DIMENSIONS, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INFO_MULTI_EV_PORT_LOCATIONS, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.PERF_ODOMETER, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.PERF_VEHICLE_SPEED, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.PERF_VEHICLE_SPEED_DISPLAY, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.PERF_STEERING_ANGLE, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.PERF_REAR_STEERING_ANGLE, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.ENGINE_COOLANT_TEMP, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.ENGINE_OIL_LEVEL, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ENGINE_OIL_TEMP, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.ENGINE_RPM, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.WHEEL_TICK, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.FUEL_LEVEL, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.FUEL_DOOR_OPEN, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_BATTERY_LEVEL, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_PORT_OPEN, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_PORT_CONNECTED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.RANGE_REMAINING, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.GEAR_SELECTION, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CURRENT_GEAR, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.PARKING_BRAKE_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.PARKING_BRAKE_AUTO_APPLY, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FUEL_LEVEL_LOW, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.NIGHT_MODE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.TURN_SIGNAL_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.IGNITION_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_SET, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_DEFROSTER, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_AC_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_MAX_AC_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_MAX_DEFROST_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_RECIRC_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_DUAL_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_AUTO_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_SEAT_TEMPERATURE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_SIDE_MIRROR_HEAT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_STEERING_WHEEL_HEAT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_DISPLAY_UNITS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_ACTUAL_FAN_SPEED_RPM, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_POWER_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.HVAC_AUTO_RECIRC_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_SEAT_VENTILATION, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_ELECTRIC_DEFROSTER_ON, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_VALUE_SUGGESTION, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DISTANCE_DISPLAY_UNITS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FUEL_VOLUME_DISPLAY_UNITS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.TIRE_PRESSURE_DISPLAY_UNITS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_BATTERY_DISPLAY_UNITS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.VEHICLE_SPEED_DISPLAY_UNITS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EXTERNAL_CAR_TIME, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ANDROID_EPOCH_TIME, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STORAGE_ENCRYPTION_BINDING_SEED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ENV_OUTSIDE_TEMPERATURE, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.AP_POWER_STATE_REQ, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.AP_POWER_STATE_REPORT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HW_ROTARY_INPUT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HW_CUSTOM_INPUT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DOOR_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DOOR_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DOOR_LOCK, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DOOR_CHILD_LOCK_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_Z_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_Z_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_Y_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_Y_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_LOCK, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_FOLD, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.MIRROR_AUTO_TILT_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_MEMORY_SELECT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_MEMORY_SET, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BELT_BUCKLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BELT_HEIGHT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BELT_HEIGHT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_FORE_AFT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_FORE_AFT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_1_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_1_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_2_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BACKREST_ANGLE_2_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEIGHT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEIGHT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_DEPTH_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_DEPTH_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_TILT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_TILT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_LUMBAR_FORE_AFT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_LUMBAR_FORE_AFT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_LUMBAR_SIDE_SUPPORT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_LUMBAR_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_HEIGHT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_HEIGHT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_ANGLE_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_ANGLE_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_HEADREST_FORE_AFT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_WALK_IN_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDOW_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDOW_LOCK, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_PERIOD, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_HEIGHT_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_THEFT_LOCK_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_LOCKED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.GLOVE_BOX_DOOR_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_CLEAR, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HEADLIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FOG_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HAZARD_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HEADLIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FOG_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HAZARD_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CABIN_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CABIN_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.READING_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.READING_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SUPPORT_CUSTOMIZE_VENDOR_PERMISSION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.DISABLED_OPTIONAL_FEATURES, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.INITIAL_USER_INFO, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SWITCH_USER, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CREATE_USER, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.REMOVE_USER, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.USER_IDENTIFICATION_ASSOCIATION, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EVS_SERVICE_REQUEST, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.POWER_POLICY_REQ, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.POWER_POLICY_GROUP_REQ, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CURRENT_POWER_POLICY, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WATCHDOG_ALIVE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.WATCHDOG_TERMINATED_PROCESS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.VHAL_HEARTBEAT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CLUSTER_SWITCH_UI, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CLUSTER_DISPLAY_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CLUSTER_REPORT_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CLUSTER_REQUEST_DISPLAY, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CLUSTER_NAVIGATION_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.REAR_FOG_LIGHTS_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.REAR_FOG_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_CURRENT_DRAW_LIMIT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_PERCENT_LIMIT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EV_CHARGE_TIME_REMAINING, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.EV_REGENERATIVE_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.TRAILER_PRESENT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.VEHICLE_CURB_WEIGHT, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.BLIND_SPOT_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CRUISE_CONTROL_TYPE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE) + ); + +} diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp index d24a73902b..d2c5145c83 100644 --- a/automotive/vehicle/aidl/impl/Android.bp +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -22,7 +22,6 @@ cc_defaults { name: "VehicleHalDefaults", static_libs: [ "android-automotive-large-parcelable-lib", - "android.hardware.automotive.vehicle-V1-ndk", "libmath", ], shared_libs: [ @@ -37,6 +36,7 @@ cc_defaults { "-Wthread-safety", ], defaults: [ + "VehicleHalInterfaceDefaults", "android-automotive-large-parcelable-defaults", ], } diff --git a/automotive/vehicle/aidl/impl/README.md b/automotive/vehicle/aidl/impl/README.md new file mode 100644 index 0000000000..121ffd15e7 --- /dev/null +++ b/automotive/vehicle/aidl/impl/README.md @@ -0,0 +1,58 @@ +# AIDL VHAL libraries and reference implementation. +--- + +This directory stores the libraries useful for implementing vendor AIDL VHAL. +This directory also stores a reference fake implementation for AIDL VHAL. + +## default_config + +Stores the default vehicle property configurations for reference vehicle HAL. +Vendor implementation could copy this library but must update the configuration +to meet their own requirements, e.g. enable or disable certain properties or +update the initial value for certain properties. + +## fake_impl + +Contains libraries used specifically for the fake reference VHAL implementation. +These libraries are for test only and must not be directly used for vendor +VHAL implementation. + +These libraries contain test-spcific logic and must not run directly on a real +vehicle. + +## grpc + +Stores code for GRPC based VHAL implementation. + +## hardware + +Defines an interface `IVehicleHardware.h` which vendor must implement for +vehicle-specific logic if they want to follow our reference VHAL design. + +## proto + +Stores Some protobuf files translated from AIDL VHAL interface types. These +files are used in GRPC VHAL implementation. + +## utils + +Defines a library `VehicleHalUtils` which provides useful utility functions for +VHAL implementation. Vendor VHAL could use this library. + +## vhal + +Defines a library `DefaultVehicleHal` which provides generic logic for all VHAL +implementations (including reference VHAL). Vendor VHAL implementation could +use this library, along with their own implementation for `IVehicleHardware` +interface. + +Also defines a binary `android.hardware.automotive.vehicle@V1-default-service` +which is the reference VHAL implementation. It implements `IVehicle.aidl` +interface. It uses `DefaultVehicleHal`, along with `FakeVehicleHardware` +(in fake_impl). It simulates the vehicle bus interaction by using an +in-memory map. Meaning that all properties (except for some special ones) are +just written into a hash map and read from a hash map without relying on any +hardware. As a result, the reference implementation can run on emulator or +any host environment. + +Vendor must not directly use the reference implementation for a real vehicle. \ No newline at end of file diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp new file mode 100644 index 0000000000..6984d5e2d5 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library { + name: "VehicleHalJsonConfigLoader", + vendor: true, + srcs: ["src/*.cpp"], + local_include_dirs: ["include"], + export_include_dirs: ["include"], + defaults: ["VehicleHalDefaults"], + static_libs: ["VehicleHalUtils"], + header_libs: [ + "IVehicleGeneratedHeaders", + ], + shared_libs: ["libjsoncpp"], +} + +cc_library { + name: "VehicleHalJsonConfigLoaderEnableTestProperties", + vendor: true, + srcs: ["src/*.cpp"], + local_include_dirs: ["include"], + export_include_dirs: ["include"], + defaults: ["VehicleHalDefaults"], + static_libs: ["VehicleHalUtils"], + header_libs: [ + "VehicleHalTestUtilHeaders", + "IVehicleGeneratedHeaders", + ], + cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"], + shared_libs: ["libjsoncpp"], +} + +cc_library_headers { + name: "VehicleHalJsonConfigLoaderHeaders", + vendor: true, + local_include_dirs: ["include"], + export_include_dirs: ["include"], + defaults: ["VehicleHalDefaults"], + static_libs: ["VehicleHalUtils"], + header_libs: [ + "IVehicleGeneratedHeaders", + ], + shared_libs: ["libjsoncpp"], +} diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/ConfigDeclaration.h b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/ConfigDeclaration.h new file mode 100644 index 0000000000..40ac1293cd --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/ConfigDeclaration.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef android_hardware_automotive_vehicle_aidl_impl_default_config_JsonConfigLoader_include_ConfigDeclaration_H_ +#define android_hardware_automotive_vehicle_aidl_impl_default_config_JsonConfigLoader_include_ConfigDeclaration_H_ + +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// ConfigDeclaration represents one property config, its optional initial value and its optional +// area configs and initial values for each area. +struct ConfigDeclaration { + aidl::android::hardware::automotive::vehicle::VehiclePropConfig config; + + // This value will be used as an initial value for the property. If this field is specified for + // property that supports multiple areas then it will be used for all areas unless particular + // area is overridden in initialAreaValue field. + aidl::android::hardware::automotive::vehicle::RawPropValues initialValue; + // Use initialAreaValues if it is necessary to specify different values per each area. + std::unordered_map + initialAreaValues; + + inline bool operator==(const ConfigDeclaration& other) const { + return (config == other.config && initialValue == other.initialValue && + initialAreaValues == other.initialAreaValues); + } + + friend std::ostream& operator<<(std::ostream& os, const ConfigDeclaration& c) { + return os << "Config Declaration for property: " + << aidl::android::hardware::automotive::vehicle::toString( + static_cast< + aidl::android::hardware::automotive::vehicle::VehicleProperty>( + c.config.prop)); + } +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_default_config_JsonConfigLoader_include_ConfigDeclaration_H_ diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h new file mode 100644 index 0000000000..f3bdbd2343 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef android_hardware_automotive_vehicle_aidl_impl_default_config_JsonConfigLoader_include_JsonConfigLoader_H_ +#define android_hardware_automotive_vehicle_aidl_impl_default_config_JsonConfigLoader_include_JsonConfigLoader_H_ + +#include +#include + +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// private namespace +namespace jsonconfigloader_impl { + +// An abstract interface that represents a ValueParser for any constant value types. +class ConstantParserInterface { + public: + // Parses a constant variable name to its actual value. + virtual android::base::Result parseValue(const std::string& name) const = 0; + virtual ~ConstantParserInterface() = default; +}; + +// A class to parse a value field in JSON config file. +// If the field is a string and the field is in the format of "XX::XX", the value will be parsed +// as a constant value in the format of "TYPE::NAME". Otherwise, the field will be return as is +// converted to the expected type. +class JsonValueParser final { + public: + JsonValueParser(); + + android::base::Result parseStringValue(const std::string& fieldName, + const Json::Value& value) const; + + template + android::base::Result> parseArray(const std::string& fieldName, + const Json::Value& value) const; + + template + android::base::Result parseValue(const std::string& fieldName, + const Json::Value& value) const; + + private: + template + static android::base::Result convertValueToType(const std::string& fieldName, + const Json::Value& value); + + std::optional> maybeGetTypeAndValueName( + const std::string& jsonFieldValue) const; + + android::base::Result parseConstantValue( + const std::pair& typeValueName) const; + + const ConstantParserInterface* getParser(const std::string& type) const { + auto it = mConstantParsersByType.find(type); + if (it == mConstantParsersByType.end()) { + return nullptr; + } + return it->second.get(); + } + + private: + inline static const std::string DELIMITER = "::"; + std::unordered_map> + mConstantParsersByType; +}; + +// The main class to parse a VHAL config file in JSON format. +class JsonConfigParser { + public: + android::base::Result> parseJsonConfig( + std::istream& is); + + private: + JsonValueParser mValueParser; + + // Parses configuration for each property. + std::optional parseEachProperty(const Json::Value& propJsonValue, + std::vector* errors); + // Tries to parse a JSON value to a specific type. + // + // If fieldIsOptional is True, then if the field specified by "fieldName" does not exist, + // this method will return true without doing anything, otherwise, it will return false. + // + // @param parentJsonNode The parent node of the field you are going to parse. + // @param fieldName The name for the field. + // @param fieldIsOptional Whether the field is optional. + // @param outPtr The pointer to output to if the field exists and parsing succeeded. + // @param errors The error array to append error to if errors are found. + // @return true if the field is optional and does not exist or parsed successfully. + template + bool tryParseJsonValueToVariable(const Json::Value& parentJsonNode, + const std::string& fieldName, bool fieldIsOptional, T* outPtr, + std::vector* errors); + // Tries to parse a JSON value to an array of specific type. + // + // If fieldIsOptional is True, then if the field specified by "fieldName" does not exist, + // this method will return true without doing anything, otherwise, it will return false. + // + // @param parentJsonNode The parent node of the field you are going to parse. + // @param fieldName The name for the field. + // @param fieldIsOptional Whether the field is optional. + // @param outPtr The pointer to output to if the field exists and parsing succeeded. + // @param errors The error array to append error to if errors are found. + // @return true if the field is optional and does not exist or parsed successfully. + template + bool tryParseJsonArrayToVariable(const Json::Value& parentJsonNode, + const std::string& fieldName, bool fieldIsOptional, + std::vector* outPtr, std::vector* errors); + // Parses a JSON field to VehiclePropertyAccess or VehiclePropertyChangeMode. + template + void parseAccessChangeMode( + const Json::Value& parentJsonNode, const std::string& fieldName, int propId, + const std::string& propStr, + const std::unordered_map& defaultMap, + T* outPtr, std::vector* errors); + + // Parses a JSON field to RawPropValues. + // + // @return True if the field exist and can be parsed to a RawPropValues. + bool parsePropValues(const Json::Value& parentJsonNode, const std::string& fieldName, + aidl::android::hardware::automotive::vehicle::RawPropValues* outPtr, + std::vector* errors); + + // Prase a JSON field as an array of area configs. + void parseAreas(const Json::Value& parentJsonNode, const std::string& fieldName, + ConfigDeclaration* outPtr, std::vector* errors); +}; + +} // namespace jsonconfigloader_impl + +// A class to load vehicle property configs and initial values in JSON format. +class JsonConfigLoader final { + public: + JsonConfigLoader(); + + // Loads a JSON file stream and parses it to a map from propId to ConfigDeclarations. + android::base::Result> loadPropConfig( + std::istream& is); + + // Loads a JSON config file and parses it to a map from propId to ConfigDeclarations. + android::base::Result> loadPropConfig( + const std::string& configPath); + + private: + std::unique_ptr mParser; +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_default_config_JsonConfigLoader_include_JsonConfigLoader_H_ diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp new file mode 100644 index 0000000000..0a1f90414e --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -0,0 +1,631 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include + +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES +#include +#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace jsonconfigloader_impl { + +using ::aidl::android::hardware::automotive::vehicle::AccessForVehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::AutomaticEmergencyBrakingState; +using ::aidl::android::hardware::automotive::vehicle::BlindSpotWarningState; +using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; +using ::aidl::android::hardware::automotive::vehicle::CruiseControlState; +using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; +using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState; +using ::aidl::android::hardware::automotive::vehicle::ErrorState; +using ::aidl::android::hardware::automotive::vehicle::EvConnectorType; +using ::aidl::android::hardware::automotive::vehicle::EvsServiceState; +using ::aidl::android::hardware::automotive::vehicle::EvsServiceType; +using ::aidl::android::hardware::automotive::vehicle::ForwardCollisionWarningState; +using ::aidl::android::hardware::automotive::vehicle::FuelType; +using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType; +using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionDriverState; +using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionWarning; +using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand; +using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; +using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState; +using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; +using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization; +using ::aidl::android::hardware::automotive::vehicle::RawPropValues; +using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; +using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; +using ::aidl::android::hardware::automotive::vehicle::VehicleGear; +using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection; +using ::aidl::android::hardware::automotive::vehicle::VehicleIgnitionState; +using ::aidl::android::hardware::automotive::vehicle::VehicleOilLevel; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; +using ::aidl::android::hardware::automotive::vehicle::VehicleSeatOccupancyState; +using ::aidl::android::hardware::automotive::vehicle::VehicleTurnSignal; +using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; +using ::aidl::android::hardware::automotive::vehicle::VehicleVendorPermission; +using ::aidl::android::hardware::automotive::vehicle::WindshieldWipersState; +using ::aidl::android::hardware::automotive::vehicle::WindshieldWipersSwitch; + +using ::android::base::Error; +using ::android::base::Result; + +// Defines a map from constant names to constant values, the values defined here corresponds to +// the "Constants::XXXX" used in JSON config file. +const std::unordered_map CONSTANTS_BY_NAME = { + {"DOOR_1_RIGHT", DOOR_1_RIGHT}, + {"DOOR_1_LEFT", DOOR_1_LEFT}, + {"DOOR_2_RIGHT", DOOR_2_RIGHT}, + {"DOOR_2_LEFT", DOOR_2_LEFT}, + {"DOOR_REAR", DOOR_REAR}, + {"HVAC_ALL", HVAC_ALL}, + {"HVAC_LEFT", HVAC_LEFT}, + {"HVAC_RIGHT", HVAC_RIGHT}, + {"VENDOR_EXTENSION_INT_PROPERTY", VENDOR_EXTENSION_INT_PROPERTY}, + {"VENDOR_EXTENSION_BOOLEAN_PROPERTY", VENDOR_EXTENSION_BOOLEAN_PROPERTY}, + {"VENDOR_EXTENSION_STRING_PROPERTY", VENDOR_EXTENSION_STRING_PROPERTY}, + {"VENDOR_EXTENSION_FLOAT_PROPERTY", VENDOR_EXTENSION_FLOAT_PROPERTY}, + {"WINDOW_1_LEFT", WINDOW_1_LEFT}, + {"WINDOW_1_RIGHT", WINDOW_1_RIGHT}, + {"WINDOW_2_LEFT", WINDOW_2_LEFT}, + {"WINDOW_2_RIGHT", WINDOW_2_RIGHT}, + {"WINDOW_ROOF_TOP_1", WINDOW_ROOF_TOP_1}, + {"WINDOW_1_RIGHT_2_LEFT_2_RIGHT", WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT}, + {"SEAT_1_LEFT", SEAT_1_LEFT}, + {"SEAT_1_RIGHT", SEAT_1_RIGHT}, + {"SEAT_2_LEFT", SEAT_2_LEFT}, + {"SEAT_2_RIGHT", SEAT_2_RIGHT}, + {"SEAT_2_CENTER", SEAT_2_CENTER}, + {"SEAT_2_LEFT_2_RIGHT_2_CENTER", SEAT_2_LEFT | SEAT_2_RIGHT | SEAT_2_CENTER}, + {"WHEEL_REAR_RIGHT", WHEEL_REAR_RIGHT}, + {"WHEEL_REAR_LEFT", WHEEL_REAR_LEFT}, + {"WHEEL_FRONT_RIGHT", WHEEL_FRONT_RIGHT}, + {"WHEEL_FRONT_LEFT", WHEEL_FRONT_LEFT}, + {"CHARGE_PORT_FRONT_LEFT", CHARGE_PORT_FRONT_LEFT}, + {"CHARGE_PORT_REAR_LEFT", CHARGE_PORT_REAR_LEFT}, + {"FAN_DIRECTION_UNKNOWN", toInt(VehicleHvacFanDirection::UNKNOWN)}, + {"FAN_DIRECTION_FLOOR", FAN_DIRECTION_FLOOR}, + {"FAN_DIRECTION_FACE", FAN_DIRECTION_FACE}, + {"FAN_DIRECTION_DEFROST", FAN_DIRECTION_DEFROST}, + {"FAN_DIRECTION_FACE_FLOOR", FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR}, + {"FAN_DIRECTION_FACE_DEFROST", FAN_DIRECTION_FACE | FAN_DIRECTION_DEFROST}, + {"FAN_DIRECTION_FLOOR_DEFROST", FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST}, + {"FAN_DIRECTION_FLOOR_DEFROST_FACE", + FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST | FAN_DIRECTION_FACE}, + {"FUEL_DOOR_REAR_LEFT", FUEL_DOOR_REAR_LEFT}, + {"LIGHT_STATE_ON", LIGHT_STATE_ON}, + {"LIGHT_STATE_OFF", LIGHT_STATE_OFF}, + {"LIGHT_SWITCH_OFF", LIGHT_SWITCH_OFF}, + {"LIGHT_SWITCH_ON", LIGHT_SWITCH_ON}, + {"LIGHT_SWITCH_AUTO", LIGHT_SWITCH_AUTO}, + {"EV_STOPPING_MODE_CREEP", EV_STOPPING_MODE_CREEP}, + {"EV_STOPPING_MODE_ROLL", EV_STOPPING_MODE_ROLL}, + {"EV_STOPPING_MODE_HOLD", EV_STOPPING_MODE_HOLD}, + {"MIRROR_DRIVER_LEFT_RIGHT", + toInt(VehicleAreaMirror::DRIVER_LEFT) | toInt(VehicleAreaMirror::DRIVER_RIGHT)}, +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES + // Following are test properties: + {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES}, + {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID}, + {"kMixedTypePropertyForTest", kMixedTypePropertyForTest}, + {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE}, + {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY}, + {"VENDOR_CLUSTER_SWITCH_UI", VENDOR_CLUSTER_SWITCH_UI}, + {"VENDOR_CLUSTER_DISPLAY_STATE", VENDOR_CLUSTER_DISPLAY_STATE}, + {"VENDOR_CLUSTER_REPORT_STATE", VENDOR_CLUSTER_REPORT_STATE}, + {"PLACEHOLDER_PROPERTY_INT", PLACEHOLDER_PROPERTY_INT}, + {"PLACEHOLDER_PROPERTY_FLOAT", PLACEHOLDER_PROPERTY_FLOAT}, + {"PLACEHOLDER_PROPERTY_BOOLEAN", PLACEHOLDER_PROPERTY_BOOLEAN}, + {"PLACEHOLDER_PROPERTY_STRING", PLACEHOLDER_PROPERTY_STRING} +#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES +}; + +// A class to parse constant values for type T. +template +class ConstantParser final : public ConstantParserInterface { + public: + ConstantParser() { + for (const T& v : ndk::enum_range()) { + std::string name = aidl::android::hardware::automotive::vehicle::toString(v); + // We use the same constant for both VehicleUnit::GALLON and VehicleUnit::US_GALLON, + // which caused toString() not work properly for US_GALLON. So we explicitly add the + // map here. + if (name == "GALLON") { + mValueByName["US_GALLON"] = toInt(v); + } + mValueByName[name] = toInt(v); + } + } + + ~ConstantParser() = default; + + Result parseValue(const std::string& name) const override { + auto it = mValueByName.find(name); + if (it == mValueByName.end()) { + return Error() << "Constant name: " << name << " is not defined"; + } + return it->second; + } + + private: + std::unordered_map mValueByName; +}; + +// A class to parse constant values defined in CONSTANTS_BY_NAME map. +class LocalVariableParser final : public ConstantParserInterface { + public: + ~LocalVariableParser() = default; + + Result parseValue(const std::string& name) const override { + auto constantsIt = CONSTANTS_BY_NAME.find(name); + if (constantsIt == CONSTANTS_BY_NAME.end()) { + return Error() << "Constant variable name: " << name << " is not defined"; + } + return constantsIt->second; + } +}; + +JsonValueParser::JsonValueParser() { + mConstantParsersByType["VehiclePropertyAccess"] = + std::make_unique>(); + mConstantParsersByType["VehiclePropertyChangeMode"] = + std::make_unique>(); + mConstantParsersByType["LocationCharacterization"] = + std::make_unique>(); + mConstantParsersByType["VehicleGear"] = std::make_unique>(); + mConstantParsersByType["VehicleAreaWindow"] = + std::make_unique>(); + mConstantParsersByType["VehicleAreaMirror"] = + std::make_unique>(); + mConstantParsersByType["VehicleOilLevel"] = std::make_unique>(); + mConstantParsersByType["VehicleUnit"] = std::make_unique>(); + mConstantParsersByType["VehicleSeatOccupancyState"] = + std::make_unique>(); + mConstantParsersByType["VehicleHvacFanDirection"] = + std::make_unique>(); + mConstantParsersByType["VehicleApPowerStateReport"] = + std::make_unique>(); + mConstantParsersByType["VehicleTurnSignal"] = + std::make_unique>(); + mConstantParsersByType["VehicleVendorPermission"] = + std::make_unique>(); + mConstantParsersByType["EvsServiceType"] = std::make_unique>(); + mConstantParsersByType["EvsServiceState"] = std::make_unique>(); + mConstantParsersByType["EvConnectorType"] = std::make_unique>(); + mConstantParsersByType["VehicleProperty"] = std::make_unique>(); + mConstantParsersByType["GsrComplianceRequirementType"] = + std::make_unique>(); + mConstantParsersByType["VehicleIgnitionState"] = + std::make_unique>(); + mConstantParsersByType["FuelType"] = std::make_unique>(); + mConstantParsersByType["WindshieldWipersState"] = + std::make_unique>(); + mConstantParsersByType["WindshieldWipersSwitch"] = + std::make_unique>(); + mConstantParsersByType["EmergencyLaneKeepAssistState"] = + std::make_unique>(); + mConstantParsersByType["CruiseControlType"] = + std::make_unique>(); + mConstantParsersByType["CruiseControlState"] = + std::make_unique>(); + mConstantParsersByType["CruiseControlCommand"] = + std::make_unique>(); + mConstantParsersByType["HandsOnDetectionDriverState"] = + std::make_unique>(); + mConstantParsersByType["HandsOnDetectionWarning"] = + std::make_unique>(); + mConstantParsersByType["ErrorState"] = std::make_unique>(); + mConstantParsersByType["AutomaticEmergencyBrakingState"] = + std::make_unique>(); + mConstantParsersByType["ForwardCollisionWarningState"] = + std::make_unique>(); + mConstantParsersByType["BlindSpotWarningState"] = + std::make_unique>(); + mConstantParsersByType["LaneDepartureWarningState"] = + std::make_unique>(); + mConstantParsersByType["LaneKeepAssistState"] = + std::make_unique>(); + mConstantParsersByType["LaneCenteringAssistCommand"] = + std::make_unique>(); + mConstantParsersByType["LaneCenteringAssistState"] = + std::make_unique>(); + mConstantParsersByType["Constants"] = std::make_unique(); +} + +template <> +Result JsonValueParser::convertValueToType(const std::string& fieldName, + const Json::Value& value) { + if (!value.isInt()) { + return Error() << "The value: " << value << " for field: " << fieldName + << " is not in correct type, expect int"; + } + return static_cast(value.asInt()); +} + +template <> +Result JsonValueParser::convertValueToType(const std::string& fieldName, + const Json::Value& value) { + // isFloat value does not exist, so we use isDouble here. + if (!value.isDouble()) { + return Error() << "The value: " << value << " for field: " << fieldName + << " is not in correct type, expect float"; + } + return value.asFloat(); +} + +template <> +Result JsonValueParser::convertValueToType(const std::string& fieldName, + const Json::Value& value) { + if (!value.isInt64()) { + return Error() << "The value: " << value << " for field: " << fieldName + << " is not in correct type, expect int64"; + } + return static_cast(value.asInt64()); +} + +template <> +Result JsonValueParser::convertValueToType(const std::string& fieldName, + const Json::Value& value) { + if (!value.isString()) { + return Error() << "The value: " << value << " for field: " << fieldName + << " is not in correct type, expect string"; + } + return value.asString(); +} + +Result JsonValueParser::parseStringValue(const std::string& fieldName, + const Json::Value& value) const { + return convertValueToType(fieldName, value); +} + +template +Result JsonValueParser::parseValue(const std::string& fieldName, + const Json::Value& value) const { + if (!value.isString()) { + return convertValueToType(fieldName, value); + } + auto maybeTypeAndValue = maybeGetTypeAndValueName(value.asString()); + if (!maybeTypeAndValue.has_value()) { + return Error() << "Invalid constant value: " << value << " for field: " << fieldName; + } + auto constantParseResult = parseConstantValue(maybeTypeAndValue.value()); + if (!constantParseResult.ok()) { + return constantParseResult.error(); + } + int constantValue = constantParseResult.value(); + return static_cast(constantValue); +} + +template <> +Result JsonValueParser::parseValue(const std::string& fieldName, + const Json::Value& value) const { + return parseStringValue(fieldName, value); +} + +template +Result> JsonValueParser::parseArray(const std::string& fieldName, + const Json::Value& value) const { + if (!value.isArray()) { + return Error() << "The value: " << value << " for field: " << fieldName + << " is not in correct type, expect array"; + } + std::vector parsedValues; + for (unsigned int i = 0; i < value.size(); i++) { + auto result = parseValue(fieldName, value[i]); + if (!result.ok()) { + return result.error(); + } + parsedValues.push_back(result.value()); + } + return std::move(parsedValues); +} + +std::optional> JsonValueParser::maybeGetTypeAndValueName( + const std::string& jsonFieldValue) const { + size_t pos = jsonFieldValue.find(DELIMITER); + if (pos == std::string::npos) { + return {}; + } + std::string type = jsonFieldValue.substr(0, pos); + std::string valueName = jsonFieldValue.substr(pos + DELIMITER.length(), std::string::npos); + if (type != "Constants" && mConstantParsersByType.find(type) == mConstantParsersByType.end()) { + return {}; + } + return std::make_pair(type, valueName); +} + +Result JsonValueParser::parseConstantValue( + const std::pair& typeValueName) const { + const std::string& type = typeValueName.first; + const std::string& valueName = typeValueName.second; + auto it = mConstantParsersByType.find(type); + if (it == mConstantParsersByType.end()) { + return Error() << "Unrecognized type: " << type; + } + auto result = it->second->parseValue(valueName); + if (!result.ok()) { + return Error() << type << "::" << valueName << " undefined"; + } + return result; +} + +template +bool JsonConfigParser::tryParseJsonValueToVariable(const Json::Value& parentJsonNode, + const std::string& fieldName, + bool fieldIsOptional, T* outPtr, + std::vector* errors) { + if (!parentJsonNode.isObject()) { + errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object"); + return false; + } + if (!parentJsonNode.isMember(fieldName)) { + if (!fieldIsOptional) { + errors->push_back("Missing required field: " + fieldName + + " in node: " + parentJsonNode.toStyledString()); + return false; + } + return true; + } + auto result = mValueParser.parseValue(fieldName, parentJsonNode[fieldName]); + if (!result.ok()) { + errors->push_back(result.error().message()); + return false; + } + *outPtr = std::move(result.value()); + return true; +} + +template +bool JsonConfigParser::tryParseJsonArrayToVariable(const Json::Value& parentJsonNode, + const std::string& fieldName, + bool fieldIsOptional, std::vector* outPtr, + std::vector* errors) { + if (!parentJsonNode.isObject()) { + errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object"); + return false; + } + if (!parentJsonNode.isMember(fieldName)) { + if (!fieldIsOptional) { + errors->push_back("Missing required field: " + fieldName + + " in node: " + parentJsonNode.toStyledString()); + return false; + } + return true; + } + auto result = mValueParser.parseArray(fieldName, parentJsonNode[fieldName]); + if (!result.ok()) { + errors->push_back(result.error().message()); + return false; + } + *outPtr = std::move(result.value()); + return true; +} + +template +void JsonConfigParser::parseAccessChangeMode( + const Json::Value& parentJsonNode, const std::string& fieldName, int propId, + const std::string& propStr, const std::unordered_map& defaultMap, + T* outPtr, std::vector* errors) { + if (!parentJsonNode.isObject()) { + errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object"); + return; + } + if (parentJsonNode.isMember(fieldName)) { + auto result = mValueParser.parseValue(fieldName, parentJsonNode[fieldName]); + if (!result.ok()) { + errors->push_back(result.error().message()); + return; + } + *outPtr = static_cast(result.value()); + return; + } + auto it = defaultMap.find(static_cast(propId)); + if (it == defaultMap.end()) { + errors->push_back("No " + fieldName + " specified for property: " + propStr); + return; + } + *outPtr = it->second; + return; +} + +bool JsonConfigParser::parsePropValues(const Json::Value& parentJsonNode, + const std::string& fieldName, RawPropValues* outPtr, + std::vector* errors) { + if (!parentJsonNode.isObject()) { + errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object"); + return false; + } + if (!parentJsonNode.isMember(fieldName)) { + return false; + } + const Json::Value& jsonValue = parentJsonNode[fieldName]; + bool success = true; + success &= tryParseJsonArrayToVariable(jsonValue, "int32Values", + /*optional=*/true, &(outPtr->int32Values), errors); + success &= tryParseJsonArrayToVariable(jsonValue, "floatValues", + /*optional=*/true, &(outPtr->floatValues), errors); + success &= tryParseJsonArrayToVariable(jsonValue, "int64Values", + /*optional=*/true, &(outPtr->int64Values), errors); + // We don't support "byteValues" yet. + success &= tryParseJsonValueToVariable(jsonValue, "stringValue", + /*optional=*/true, &(outPtr->stringValue), errors); + return success; +} + +void JsonConfigParser::parseAreas(const Json::Value& parentJsonNode, const std::string& fieldName, + ConfigDeclaration* config, std::vector* errors) { + if (!parentJsonNode.isObject()) { + errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object"); + return; + } + if (!parentJsonNode.isMember(fieldName)) { + return; + } + const Json::Value& jsonValue = parentJsonNode[fieldName]; + + if (!jsonValue.isArray()) { + errors->push_back("Field: " + fieldName + " is not an array"); + return; + } + for (unsigned int i = 0; i < jsonValue.size(); i++) { + int32_t areaId; + const Json::Value& jsonAreaConfig = jsonValue[i]; + if (!tryParseJsonValueToVariable(jsonAreaConfig, "areaId", + /*optional=*/false, &areaId, errors)) { + continue; + } + VehicleAreaConfig areaConfig = {}; + areaConfig.areaId = areaId; + tryParseJsonValueToVariable(jsonAreaConfig, "minInt32Value", /*optional=*/true, + &areaConfig.minInt32Value, errors); + tryParseJsonValueToVariable(jsonAreaConfig, "maxInt32Value", /*optional=*/true, + &areaConfig.maxInt32Value, errors); + tryParseJsonValueToVariable(jsonAreaConfig, "minInt64Value", /*optional=*/true, + &areaConfig.minInt64Value, errors); + tryParseJsonValueToVariable(jsonAreaConfig, "maxInt64Value", /*optional=*/true, + &areaConfig.maxInt64Value, errors); + tryParseJsonValueToVariable(jsonAreaConfig, "minFloatValue", /*optional=*/true, + &areaConfig.minFloatValue, errors); + tryParseJsonValueToVariable(jsonAreaConfig, "maxFloatValue", /*optional=*/true, + &areaConfig.maxFloatValue, errors); + + std::vector supportedEnumValues; + tryParseJsonArrayToVariable(jsonAreaConfig, "supportedEnumValues", /*optional=*/true, + &supportedEnumValues, errors); + if (!supportedEnumValues.empty()) { + areaConfig.supportedEnumValues = std::move(supportedEnumValues); + } + config->config.areaConfigs.push_back(std::move(areaConfig)); + + RawPropValues areaValue = {}; + if (parsePropValues(jsonAreaConfig, "defaultValue", &areaValue, errors)) { + config->initialAreaValues[areaId] = std::move(areaValue); + } + } +} + +std::optional JsonConfigParser::parseEachProperty( + const Json::Value& propJsonValue, std::vector* errors) { + size_t initialErrorCount = errors->size(); + ConfigDeclaration configDecl = {}; + int32_t propId; + + if (!tryParseJsonValueToVariable(propJsonValue, "property", /*optional=*/false, &propId, + errors)) { + return std::nullopt; + } + + configDecl.config.prop = propId; + std::string propStr = propJsonValue["property"].toStyledString(); + + parseAccessChangeMode(propJsonValue, "access", propId, propStr, AccessForVehicleProperty, + &configDecl.config.access, errors); + + parseAccessChangeMode(propJsonValue, "changeMode", propId, propStr, + ChangeModeForVehicleProperty, &configDecl.config.changeMode, errors); + + tryParseJsonValueToVariable(propJsonValue, "configString", /*optional=*/true, + &configDecl.config.configString, errors); + + tryParseJsonArrayToVariable(propJsonValue, "configArray", /*optional=*/true, + &configDecl.config.configArray, errors); + + parsePropValues(propJsonValue, "defaultValue", &configDecl.initialValue, errors); + + tryParseJsonValueToVariable(propJsonValue, "minSampleRate", /*optional=*/true, + &configDecl.config.minSampleRate, errors); + + tryParseJsonValueToVariable(propJsonValue, "maxSampleRate", /*optional=*/true, + &configDecl.config.maxSampleRate, errors); + + parseAreas(propJsonValue, "areas", &configDecl, errors); + + if (errors->size() != initialErrorCount) { + return std::nullopt; + } + return configDecl; +} + +Result> JsonConfigParser::parseJsonConfig( + std::istream& is) { + Json::CharReaderBuilder builder; + Json::Value root; + std::unordered_map configsByPropId; + std::string errs; + if (!Json::parseFromStream(builder, is, &root, &errs)) { + return Error() << "Failed to parse property config file as JSON, error: " << errs; + } + if (!root.isObject()) { + return Error() << "root element must be an object"; + } + if (!root.isMember("properties") || !root["properties"].isArray()) { + return Error() << "Missing 'properties' field in root or the field is not an array"; + } + Json::Value properties = root["properties"]; + std::vector errors; + for (unsigned int i = 0; i < properties.size(); i++) { + if (auto maybeConfig = parseEachProperty(properties[i], &errors); maybeConfig.has_value()) { + configsByPropId[maybeConfig.value().config.prop] = std::move(maybeConfig.value()); + } + } + if (!errors.empty()) { + return Error() << android::base::Join(errors, '\n'); + } + return configsByPropId; +} + +} // namespace jsonconfigloader_impl + +JsonConfigLoader::JsonConfigLoader() { + mParser = std::make_unique(); +} + +android::base::Result> +JsonConfigLoader::loadPropConfig(std::istream& is) { + return mParser->parseJsonConfig(is); +} + +android::base::Result> +JsonConfigLoader::loadPropConfig(const std::string& configPath) { + std::ifstream ifs(configPath.c_str()); + if (!ifs) { + return android::base::Error() << "couldn't open " << configPath << " for parsing."; + } + + return loadPropConfig(ifs); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp new file mode 100644 index 0000000000..dae37b9ae0 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/Android.bp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "JsonConfigLoaderUnitTest", + vendor: true, + srcs: ["*.cpp"], + static_libs: [ + "VehicleHalJsonConfigLoader", + "VehicleHalUtils", + "libgtest", + ], + shared_libs: [ + "libjsoncpp", + ], + defaults: ["VehicleHalDefaults"], + test_suites: ["device-tests"], +} + +cc_test { + name: "JsonConfigLoaderUnitTestEnableTestProperties", + vendor: true, + srcs: ["*.cpp"], + static_libs: [ + "VehicleHalJsonConfigLoaderEnableTestProperties", + "VehicleHalUtils", + "libgtest", + ], + shared_libs: [ + "libjsoncpp", + ], + defaults: ["VehicleHalDefaults"], + test_suites: ["device-tests"], +} diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp new file mode 100644 index 0000000000..98826537e7 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp @@ -0,0 +1,705 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::RawPropValues; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; + +class JsonConfigLoaderUnitTest : public ::testing::Test { + protected: + JsonConfigLoader mLoader; +}; + +TEST_F(JsonConfigLoaderUnitTest, testBasic) { + std::istringstream iss(R"( + { + "properties": [{ + "property": 291504388 + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.prop, 291504388); +} + +TEST_F(JsonConfigLoaderUnitTest, testRootNotObject) { + std::istringstream iss(R"( + [] + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) << "root is not an object must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testMissingPropertiesField) { + std::istringstream iss(R"( + { + "abcd": 1234 + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) << "Missing 'properties' field must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testPropertiesFieldNotArray) { + std::istringstream iss(R"( + { + "properties': {'a': 'b'} + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "'properties' field is not an array must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testPropertyIsEnum) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY" + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.prop, toInt(VehicleProperty::INFO_FUEL_CAPACITY)); +} + +TEST_F(JsonConfigLoaderUnitTest, testPropertyEnum_FailInvalidEnum) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::BLAH" + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Invalid VehicleProperty enum must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testPropertyEnum_FailInvalidType) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "test" + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Invalid VehicleProperty type must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testProperty_FailInvalidJson) { + std::istringstream iss(R"( + { + "properties": [{ + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) << "Invalid JSON format must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigArray) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configArray": [1, 2, 3] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.configArray, std::vector({1, 2, 3})); +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigArrayConstants) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configArray": [1, 2, "Constants::FUEL_DOOR_REAR_LEFT"] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.configArray, + std::vector({1, 2, FUEL_DOOR_REAR_LEFT})); +} + +// We have special logic to deal with GALLON and US_GALLON since they share the same value. +TEST_F(JsonConfigLoaderUnitTest, testConfigArrayUnitGallon) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configArray": [1, 2, "VehicleUnit::GALLON"] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigArrayUnitUsGallon) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configArray": [1, 2, "VehicleUnit::US_GALLON"] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigArray_FailInvalidEnum) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configArray": [1, 2, "VehicleUnits::BLAH"] + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Invalid enum in ConfigArray must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigArray_FailNotArray) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configArray": "123" + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "ConfigArray is not an array must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigString) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configString": "test" + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.configString, "test"); +} + +TEST_F(JsonConfigLoaderUnitTest, testConfigString_FailNotString) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "configString": 1234 + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "ConfigString is not a String must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testCheckDefaultAccessChangeMode) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY" + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& propConfig = configs.begin()->second.config; + ASSERT_EQ(propConfig.access, VehiclePropertyAccess::READ); + ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::STATIC); +} + +TEST_F(JsonConfigLoaderUnitTest, testAccessOverride) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "access": "VehiclePropertyAccess::WRITE" + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& propConfig = configs.begin()->second.config; + ASSERT_EQ(propConfig.access, VehiclePropertyAccess::WRITE); + ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::STATIC); +} + +TEST_F(JsonConfigLoaderUnitTest, testChangeModeOverride) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& propConfig = configs.begin()->second.config; + ASSERT_EQ(propConfig.access, VehiclePropertyAccess::READ); + ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::ON_CHANGE); +} + +TEST_F(JsonConfigLoaderUnitTest, testCustomProp) { + std::istringstream iss(R"( + { + "properties": [{ + "property": 1234, + "access": "VehiclePropertyAccess::WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& propConfig = configs.begin()->second.config; + ASSERT_EQ(propConfig.access, VehiclePropertyAccess::WRITE); + ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::ON_CHANGE); +} + +TEST_F(JsonConfigLoaderUnitTest, testCustomProp_FailMissingAccess) { + std::istringstream iss(R"( + { + "properties": [{ + "property": 1234, + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Missing access for custom property must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testCustomProp_FailMissingChangeMode) { + std::istringstream iss(R"( + { + "properties": [{ + "property": 1234, + "access": "VehiclePropertyAccess::WRITE" + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Missing change mode for custom property must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testMinSampleRate) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "minSampleRate": 1, + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.minSampleRate, 1); +} + +TEST_F(JsonConfigLoaderUnitTest, testMinSampleRate_FailInvalidType) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "minSampleRate": "abcd", + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Wrong type for MinSampleRate must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testMaxSampleRate) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "maxSampleRate": 1, + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.config.maxSampleRate, 1); +} + +TEST_F(JsonConfigLoaderUnitTest, testMaxSampleRate_FailInvalidType) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "maxSampleRate": "abcd", + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Wrong type for MaxSampleRate must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testDefaultValue_Simple) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "defaultValue": { + "int32Values": [1, 2] + } + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + ASSERT_EQ(configs.begin()->second.initialValue.int32Values, std::vector({1, 2})); +} + +TEST_F(JsonConfigLoaderUnitTest, testDefaultValue_Mixed) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "defaultValue": { + "int32Values": [1, "Constants::FUEL_DOOR_REAR_LEFT"], + "int64Values": [2, "Constants::FUEL_DOOR_REAR_LEFT"], + "floatValues": [3.0, "Constants::FUEL_DOOR_REAR_LEFT"], + "stringValue": "abcd" + } + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + ASSERT_TRUE(result.ok()) << result.error().message(); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const RawPropValues& initialValue = configs.begin()->second.initialValue; + ASSERT_EQ(initialValue.int32Values, std::vector({1, FUEL_DOOR_REAR_LEFT})); + ASSERT_EQ(initialValue.int64Values, + std::vector({2, static_cast(FUEL_DOOR_REAR_LEFT)})); + ASSERT_EQ(initialValue.floatValues, + std::vector({3.0, static_cast(FUEL_DOOR_REAR_LEFT)})); + ASSERT_EQ(initialValue.stringValue, "abcd"); +} + +TEST_F(JsonConfigLoaderUnitTest, testDefaultValue_FailNotObject) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "defaultValue": [] + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "DefaultValue is not an object must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testDefaultValue_FailInvalidType) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "defaultValue": { + "int32Values": [1.1] + } + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Wrong type for DefaultValue must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testAreas_Simple) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "areas": [{ + "areaId": "Constants::HVAC_ALL", + "minInt32Value": 1, + "maxInt32Value": 7 + }] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& config = configs.begin()->second.config; + ASSERT_EQ(config.areaConfigs.size(), 1u); + const VehicleAreaConfig& areaConfig = config.areaConfigs[0]; + ASSERT_EQ(areaConfig.minInt32Value, 1); + ASSERT_EQ(areaConfig.maxInt32Value, 7); + ASSERT_EQ(areaConfig.areaId, HVAC_ALL); +} + +TEST_F(JsonConfigLoaderUnitTest, testAreas_DefaultValueForEachArea) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "areas": [{ + "areaId": "Constants::HVAC_LEFT", + "defaultValue": { + "int32Values": [1] + } + }, { + "areaId": "Constants::HVAC_RIGHT", + "defaultValue": { + "int32Values": [2] + } + }] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& config = configs.begin()->second.config; + ASSERT_EQ(config.areaConfigs.size(), 2u); + ASSERT_EQ(config.areaConfigs[0].areaId, HVAC_LEFT); + ASSERT_EQ(config.areaConfigs[1].areaId, HVAC_RIGHT); + ASSERT_EQ(configs.begin()->second.initialAreaValues[HVAC_LEFT], + RawPropValues{.int32Values = {1}}); + ASSERT_EQ(configs.begin()->second.initialAreaValues[HVAC_RIGHT], + RawPropValues{.int32Values = {2}}); +} + +TEST_F(JsonConfigLoaderUnitTest, testAreas_FailInvalidTypeForOneAreaValue) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "areas": [{ + "areaId": "Constants::HVAC_LEFT", + "defaultValue": { + "int32Values": [1] + } + }, { + "areaId": "Constants::HVAC_RIGHT", + "defaultValue": { + "int32Values": [2.1] + } + }] + }] + } + )"); + + ASSERT_FALSE(mLoader.loadPropConfig(iss).ok()) + << "Wrong type for DefaultValue for one area must cause error"; +} + +TEST_F(JsonConfigLoaderUnitTest, testAreas_HandlesNoSupportedEnumValuesDeclared) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::CABIN_LIGHTS_STATE", + "areas": [{ + "areaId": 0, + }] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + ASSERT_TRUE(result.ok()); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& config = configs.begin()->second.config; + ASSERT_EQ(config.areaConfigs.size(), 1u); + + const VehicleAreaConfig& areaConfig = config.areaConfigs[0]; + ASSERT_EQ(areaConfig.areaId, 0); + ASSERT_FALSE(areaConfig.supportedEnumValues); +} + +TEST_F(JsonConfigLoaderUnitTest, testAreas_HandlesSupportedEnumValues) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::CABIN_LIGHTS_STATE", + "areas": [{ + "areaId": 0, + "supportedEnumValues": ["Constants::LIGHT_STATE_ON", "Constants::LIGHT_STATE_OFF"] + }] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + ASSERT_TRUE(result.ok()); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& config = configs.begin()->second.config; + ASSERT_EQ(config.areaConfigs.size(), 1u); + + const VehicleAreaConfig& areaConfig = config.areaConfigs[0]; + ASSERT_EQ(areaConfig.areaId, 0); + ASSERT_TRUE(areaConfig.supportedEnumValues); + ASSERT_EQ(areaConfig.supportedEnumValues.value().size(), 2u); + ASSERT_EQ(areaConfig.supportedEnumValues.value(), + std::vector({LIGHT_STATE_ON, LIGHT_STATE_OFF})); +} + +TEST_F(JsonConfigLoaderUnitTest, testAreas_HandlesEmptySupportedEnumValues) { + std::istringstream iss(R"( + { + "properties": [{ + "property": "VehicleProperty::CABIN_LIGHTS_STATE", + "areas": [{ + "areaId": 0, + "supportedEnumValues": [] + }] + }] + } + )"); + + auto result = mLoader.loadPropConfig(iss); + ASSERT_TRUE(result.ok()); + + auto configs = result.value(); + ASSERT_EQ(configs.size(), 1u); + + const VehiclePropConfig& config = configs.begin()->second.config; + ASSERT_EQ(config.areaConfigs.size(), 1u); + + const VehicleAreaConfig& areaConfig = config.areaConfigs[0]; + ASSERT_EQ(areaConfig.areaId, 0); + ASSERT_FALSE(areaConfig.supportedEnumValues); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/default_config/config/Android.bp b/automotive/vehicle/aidl/impl/default_config/config/Android.bp new file mode 100644 index 0000000000..8f1c7d1a8e --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/config/Android.bp @@ -0,0 +1,47 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +filegroup { + name: "VehicleHalDefaultProperties_JSON", + srcs: ["DefaultProperties.json"], +} + +filegroup { + name: "VehicleHalTestProperties_JSON", + srcs: ["TestProperties.json"], +} + +filegroup { + name: "VehicleHalVendorClusterTestProperties_JSON", + srcs: ["VendorClusterTestProperties.json"], +} + +prebuilt_etc { + name: "Prebuilt_VehicleHalDefaultProperties_JSON", + filename_from_src: true, + src: "DefaultProperties.json", + sub_dir: "automotive/vhalconfig/", + vendor: true, +} + +prebuilt_etc { + name: "Prebuilt_VehicleHalTestProperties_JSON", + filename_from_src: true, + src: "TestProperties.json", + sub_dir: "automotive/vhalconfig/", + vendor: true, +} + +prebuilt_etc { + name: "Prebuilt_VehicleHalVendorClusterTestProperties_JSON", + filename_from_src: true, + src: "VendorClusterTestProperties.json", + sub_dir: "automotive/vhalconfig/", + vendor: true, +} diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json new file mode 100644 index 0000000000..5503de22ec --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -0,0 +1,3831 @@ +{ + "apiVersion": 1, + "properties": [ + { + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + "defaultValue": { + "floatValues": [ + 15000.0 + ] + } + }, + { + "property": "VehicleProperty::INFO_FUEL_TYPE", + "defaultValue": { + "int32Values": [ + "FuelType::FUEL_TYPE_UNLEADED" + ] + } + }, + { + "property": "VehicleProperty::INFO_EV_BATTERY_CAPACITY", + "defaultValue": { + "floatValues": [ + 150000.0 + ] + } + }, + { + "property": "VehicleProperty::INFO_EV_CONNECTOR_TYPE", + "defaultValue": { + "int32Values": [ + "EvConnectorType::IEC_TYPE_1_AC" + ] + } + }, + { + "property": "VehicleProperty::INFO_FUEL_DOOR_LOCATION", + "defaultValue": { + "int32Values": [ + "Constants::FUEL_DOOR_REAR_LEFT" + ] + } + }, + { + "property": "VehicleProperty::INFO_EV_PORT_LOCATION", + "defaultValue": { + "int32Values": [ + "Constants::CHARGE_PORT_FRONT_LEFT" + ] + } + }, + { + "property": "VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS", + "defaultValue": { + "int32Values": [ + "Constants::CHARGE_PORT_FRONT_LEFT", + "Constants::CHARGE_PORT_REAR_LEFT" + ] + } + }, + { + "property": "VehicleProperty::INFO_VIN", + "defaultValue": { + "stringValue": "1GCARVIN123456789" + } + }, + { + "property": "VehicleProperty::INFO_MAKE", + "defaultValue": { + "stringValue": "Toy Vehicle" + } + }, + { + "property": "VehicleProperty::INFO_MODEL", + "defaultValue": { + "stringValue": "Speedy Model" + } + }, + { + "property": "VehicleProperty::INFO_MODEL_YEAR", + "defaultValue": { + "int32Values": [ + 2023 + ] + } + }, + { + "property": "VehicleProperty::INFO_EXTERIOR_DIMENSIONS", + "defaultValue": { + "int32Values": [ + 1776, + 4950, + 2008, + 2140, + 2984, + 1665, + 1667, + 11800 + ] + } + }, + { + "property": "VehicleProperty::PERF_VEHICLE_SPEED", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::PERF_VEHICLE_SPEED_DISPLAY", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS", + "defaultValue": { + "int32Values": [ + "VehicleUnit::MILES_PER_HOUR" + ] + }, + "configArray": [ + "VehicleUnit::METER_PER_SEC", + "VehicleUnit::MILES_PER_HOUR", + "VehicleUnit::KILOMETERS_PER_HOUR" + ] + }, + { + "property": "VehicleProperty::EV_BATTERY_DISPLAY_UNITS", + "defaultValue": { + "int32Values": [ + "VehicleUnit::KILOWATT_HOUR" + ] + }, + "configArray": [ + "VehicleUnit::WATT_HOUR", + "VehicleUnit::AMPERE_HOURS", + "VehicleUnit::KILOWATT_HOUR" + ] + }, + { + "property": "VehicleProperty::SEAT_MEMORY_SELECT", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + } + ] + }, + { + "property": "VehicleProperty::SEAT_MEMORY_SET", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + } + ] + }, + { + "property": "VehicleProperty::SEAT_BELT_BUCKLED", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::SEAT_BELT_HEIGHT_POS", + "defaultValue": { + "int32Values": [ + 10 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": 0, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_BELT_HEIGHT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_FORE_AFT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_FORE_AFT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_BACKREST_ANGLE_1_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_BACKREST_ANGLE_2_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEIGHT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEIGHT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_DEPTH_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_DEPTH_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_TILT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_TILT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_LUMBAR_FORE_AFT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_LUMBAR_FORE_AFT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": 0, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEADREST_HEIGHT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEADREST_ANGLE_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEADREST_ANGLE_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEADREST_FORE_AFT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_OFF" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "supportedEnumValues": [ + "Constants::LIGHT_STATE_OFF", + "Constants::LIGHT_STATE_ON" + ] + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "supportedEnumValues": [ + "Constants::LIGHT_STATE_OFF", + "Constants::LIGHT_STATE_ON" + ] + }, + { + "areaId": "Constants::SEAT_2_LEFT_2_RIGHT_2_CENTER", + "supportedEnumValues": [ + "Constants::LIGHT_STATE_OFF", + "Constants::LIGHT_STATE_ON" + ] + } + ] + }, + { + "property": "VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_OFF" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "supportedEnumValues": [ + "Constants::LIGHT_SWITCH_OFF", + "Constants::LIGHT_SWITCH_ON", + "Constants::LIGHT_SWITCH_AUTO" + ] + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "supportedEnumValues": [ + "Constants::LIGHT_SWITCH_OFF", + "Constants::LIGHT_SWITCH_ON", + "Constants::LIGHT_SWITCH_AUTO" + ] + }, + { + "areaId": "Constants::SEAT_2_LEFT_2_RIGHT_2_CENTER", + "supportedEnumValues": [ + "Constants::LIGHT_SWITCH_OFF", + "Constants::LIGHT_SWITCH_ON", + "Constants::LIGHT_SWITCH_AUTO" + ] + } + ] + }, + { + "property": "VehicleProperty::SEAT_EASY_ACCESS_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::SEAT_AIRBAG_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_LUMBAR_VERTICAL_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -10, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::SEAT_WALK_IN_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 5 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 5 + } + ] + }, + { + "property": "VehicleProperty::SEAT_OCCUPANCY", + "defaultValue": { + "int32Values": [ + "VehicleSeatOccupancyState::VACANT" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::INFO_DRIVER_SEAT", + "defaultValue": { + "int32Values": [ + "Constants::SEAT_1_LEFT" + ] + }, + "areas": [ + { + "areaId": 0 + } + ] + }, + { + "property": "VehicleProperty::PERF_ODOMETER", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::PERF_STEERING_ANGLE", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::PERF_REAR_STEERING_ANGLE", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::ENGINE_RPM", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::FUEL_LEVEL", + "defaultValue": { + "floatValues": [ + 15000.0 + ] + }, + "maxSampleRate": 100.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::FUEL_DOOR_OPEN", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::EV_BATTERY_LEVEL", + "defaultValue": { + "floatValues": [ + 150000.0 + ] + }, + "maxSampleRate": 100.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::EV_CURRENT_BATTERY_CAPACITY", + "defaultValue": { + "floatValues": [ + 150000.0 + ] + } + }, + { + "property": "VehicleProperty::EV_CHARGE_PORT_OPEN", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::EV_CHARGE_PORT_CONNECTED", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT", + "defaultValue": { + "floatValues": [ + 12.5 + ] + }, + "comment": "ConfigArray specifies Max current draw allowed by vehicle in amperes", + "configArray": [ + 20 + ] + }, + { + "property": "VehicleProperty::EV_CHARGE_PERCENT_LIMIT", + "defaultValue": { + "floatValues": [ + 40.0 + ] + }, + "configArray": [ + 20, + 40, + 60, + 80, + 100 + ] + }, + { + "property": "VehicleProperty::EV_CHARGE_STATE", + "defaultValue": { + "int32Values": [ + 2 + ] + } + }, + { + "property": "VehicleProperty::EV_CHARGE_SWITCH", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::EV_CHARGE_TIME_REMAINING", + "defaultValue": { + "int32Values": [ + 20 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::EV_REGENERATIVE_BRAKING_STATE", + "defaultValue": { + "int32Values": [ + 2 + ] + } + }, + { + "property": "VehicleProperty::TRAILER_PRESENT", + "defaultValue": { + "int32Values": [ + 2 + ] + } + }, + { + "property": "VehicleProperty::VEHICLE_CURB_WEIGHT", + "defaultValue": { + "int32Values": [ + 2211 + ] + }, + "configArray": [ + 2948 + ], + "comment": "unit is kg" + }, + { + "property": "VehicleProperty::RANGE_REMAINING", + "defaultValue": { + "floatValues": [ + 50000.0 + ] + }, + "comment": "units in meter", + "maxSampleRate": 2.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::TIRE_PRESSURE", + "defaultValue": { + "floatValues": [ + 200.0 + ] + }, + "areas": [ + { + "areaId": "Constants::WHEEL_FRONT_LEFT", + "minFloatValue": 193.0, + "maxFloatValue": 300.0 + }, + { + "areaId": "Constants::WHEEL_FRONT_RIGHT", + "minFloatValue": 193.0, + "maxFloatValue": 300.0 + }, + { + "areaId": "Constants::WHEEL_REAR_LEFT", + "minFloatValue": 193.0, + "maxFloatValue": 300.0 + }, + { + "areaId": "Constants::WHEEL_REAR_RIGHT", + "minFloatValue": 193.0, + "maxFloatValue": 300.0 + } + ], + "comment": "Units in kpa", + "maxSampleRate": 2.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE", + "areas": [ + { + "defaultValue": { + "floatValues": [ + 137.0 + ] + }, + "areaId": "Constants::WHEEL_FRONT_LEFT" + }, + { + "defaultValue": { + "floatValues": [ + 137.0 + ] + }, + "areaId": "Constants::WHEEL_FRONT_RIGHT" + }, + { + "defaultValue": { + "floatValues": [ + 137.0 + ] + }, + "areaId": "Constants::WHEEL_REAR_RIGHT" + }, + { + "defaultValue": { + "floatValues": [ + 137.0 + ] + }, + "areaId": "Constants::WHEEL_REAR_LEFT" + } + ] + }, + { + "property": "VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS", + "defaultValue": { + "int32Values": [ + "VehicleUnit::PSI" + ] + }, + "configArray": [ + "VehicleUnit::KILOPASCAL", + "VehicleUnit::PSI", + "VehicleUnit::BAR" + ] + }, + { + "property": "VehicleProperty::CURRENT_GEAR", + "defaultValue": { + "int32Values": [ + "VehicleGear::GEAR_PARK" + ] + }, + "configArray": [ + "VehicleGear::GEAR_PARK", + "VehicleGear::GEAR_NEUTRAL", + "VehicleGear::GEAR_REVERSE", + "VehicleGear::GEAR_1", + "VehicleGear::GEAR_2", + "VehicleGear::GEAR_3", + "VehicleGear::GEAR_4", + "VehicleGear::GEAR_5" + ] + }, + { + "property": "VehicleProperty::PARKING_BRAKE_ON", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::PARKING_BRAKE_AUTO_APPLY", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::EV_BRAKE_REGENERATION_LEVEL", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": 0, + "maxInt32Value": 3 + } + ] + }, + { + "property": "VehicleProperty::EV_STOPPING_MODE", + "defaultValue": { + "int32Values": [ + "Constants::EV_STOPPING_MODE_CREEP" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "Constants::EV_STOPPING_MODE_CREEP", + "Constants::EV_STOPPING_MODE_ROLL", + "Constants::EV_STOPPING_MODE_HOLD" + ] + } + ] + }, + { + "property": "VehicleProperty::FUEL_LEVEL_LOW", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS", + "defaultValue": { + "int32Values": [ + "VehicleUnit::US_GALLON" + ] + }, + "configArray": [ + "VehicleUnit::LITER", + "VehicleUnit::US_GALLON" + ] + }, + { + "property": "VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::HW_KEY_INPUT", + "defaultValue": { + "int32Values": [ + 0, + 0, + 0 + ] + } + }, + { + "property": "VehicleProperty::HW_KEY_INPUT_V2", + "defaultValue": { + "int32Values": [ + 0, + 0, + 0, + 0 + ], + "int64Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HW_MOTION_INPUT", + "defaultValue": { + "int32Values": [ + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ], + "floatValues": [ + 0, + 0, + 0, + 0 + ], + "int64Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HW_ROTARY_INPUT", + "defaultValue": { + "int32Values": [ + 0, + 0, + 0 + ] + } + }, + { + "property": "VehicleProperty::HW_CUSTOM_INPUT", + "defaultValue": { + "int32Values": [ + 0, + 0, + 0 + ] + }, + "configArray": [ + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0, + 0 + ] + }, + { + "property": "VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM", + "defaultValue": { + "int32Values": [ + 50 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_POWER_ON", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ], + "configArray": [ + "VehicleProperty::HVAC_FAN_SPEED", + "VehicleProperty::HVAC_FAN_DIRECTION" + ] + }, + { + "property": "VehicleProperty::HVAC_DEFROSTER", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD" + }, + { + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD" + } + ], + "comment": "0 means using for all areas" + }, + { + "property": "VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD" + }, + { + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD" + } + ], + "comment": "0 means using for all areas" + }, + { + "property": "VehicleProperty::HVAC_MAX_DEFROST_ON", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_RECIRC_ON", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_AUTO_RECIRC_ON", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_AC_ON", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_MAX_AC_ON", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_AUTO_ON", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_DUAL_ON", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::HVAC_ALL" + } + ] + }, + { + "property": "VehicleProperty::HVAC_FAN_SPEED", + "defaultValue": { + "int32Values": [ + 3 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": 1, + "maxInt32Value": 7 + } + ] + }, + { + "property": "VehicleProperty::HVAC_FAN_DIRECTION", + "defaultValue": { + "int32Values": [ + "VehicleHvacFanDirection::FACE" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE", + "defaultValue": { + "int32Values": [ + "Constants::FAN_DIRECTION_UNKNOWN", + "Constants::FAN_DIRECTION_FACE", + "Constants::FAN_DIRECTION_FLOOR", + "Constants::FAN_DIRECTION_FACE_FLOOR", + "Constants::FAN_DIRECTION_DEFROST", + "Constants::FAN_DIRECTION_FACE_DEFROST", + "Constants::FAN_DIRECTION_FLOOR_DEFROST", + "Constants::FAN_DIRECTION_FLOOR_DEFROST_FACE" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_SEAT_VENTILATION", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": 0, + "maxInt32Value": 3 + } + ], + "comment": "0 is off and +ve values indicate ventilation level." + }, + { + "property": "VehicleProperty::HVAC_STEERING_WHEEL_HEAT", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": -2, + "maxInt32Value": 2 + } + ], + "comment": "+ve values for heating and -ve for cooling" + }, + { + "property": "VehicleProperty::HVAC_SEAT_TEMPERATURE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": -2, + "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": -2, + "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -2, + "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -2, + "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -2, + "maxInt32Value": 2 + } + ], + "comment": "+ve values for heating and -ve for cooling" + }, + { + "property": "VehicleProperty::HVAC_SIDE_MIRROR_HEAT", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 2 + } + ] + }, + { + "property": "VehicleProperty::HVAC_TEMPERATURE_CURRENT", + "defaultValue": { + "floatValues": [ + 19.1 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::HVAC_TEMPERATURE_SET", + "defaultValue": { + "floatValues": [ + 17.0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + } + ], + "comment": + "minFloatValue and maxFloatValue in area config should match corresponding values in configArray", + "configArray": [ + 160, + 280, + 5, + 600, + 840, + 10 + ] + }, + { + "property": "VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION", + "defaultValue": { + "floatValues": [ + 66.19999694824219, + "VehicleUnit::FAHRENHEIT", + 19.0, + 66.0 + ] + } + }, + { + "property": "VehicleProperty::ENV_OUTSIDE_TEMPERATURE", + "defaultValue": { + "floatValues": [ + 25.0 + ] + }, + "maxSampleRate": 2.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS", + "defaultValue": { + "int32Values": [ + "VehicleUnit::FAHRENHEIT" + ] + }, + "configArray": [ + "VehicleUnit::FAHRENHEIT", + "VehicleUnit::CELSIUS" + ] + }, + { + "property": "VehicleProperty::DISTANCE_DISPLAY_UNITS", + "defaultValue": { + "int32Values": [ + "VehicleUnit::MILE" + ] + }, + "areas": [ + { + "areaId": 0 + } + ], + "configArray": [ + "VehicleUnit::KILOMETER", + "VehicleUnit::MILE" + ] + }, + { + "property": "VehicleProperty::NIGHT_MODE", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::GEAR_SELECTION", + "defaultValue": { + "int32Values": [ + "VehicleGear::GEAR_PARK" + ] + }, + "configArray": [ + "VehicleGear::GEAR_PARK", + "VehicleGear::GEAR_NEUTRAL", + "VehicleGear::GEAR_REVERSE", + "VehicleGear::GEAR_DRIVE", + "VehicleGear::GEAR_1", + "VehicleGear::GEAR_2", + "VehicleGear::GEAR_3", + "VehicleGear::GEAR_4", + "VehicleGear::GEAR_5" + ] + }, + { + "property": "VehicleProperty::TURN_SIGNAL_STATE", + "defaultValue": { + "int32Values": [ + "VehicleTurnSignal::NONE" + ] + } + }, + { + "property": "VehicleProperty::IGNITION_STATE", + "defaultValue": { + "int32Values": [ + "VehicleIgnitionState::ON" + ] + } + }, + { + "property": "VehicleProperty::ENGINE_COOLANT_TEMP", + "defaultValue": { + "floatValues": [ + 75.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::ENGINE_OIL_LEVEL", + "defaultValue": { + "int32Values": [ + "VehicleOilLevel::NORMAL" + ] + } + }, + { + "property": "VehicleProperty::ENGINE_OIL_TEMP", + "defaultValue": { + "floatValues": [ + 101.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 0.10000000149011612 + }, + { + "property": "VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::DOOR_LOCK", + "areas": [ + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "Constants::DOOR_1_LEFT" + }, + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "Constants::DOOR_1_RIGHT" + }, + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "Constants::DOOR_2_LEFT" + }, + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "Constants::DOOR_2_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::DOOR_CHILD_LOCK_ENABLED", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::DOOR_2_LEFT" + }, + { + "areaId": "Constants::DOOR_2_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::DOOR_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::DOOR_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_REAR", + "minInt32Value": 0, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::DOOR_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::DOOR_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::DOOR_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::MIRROR_Z_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaMirror::DRIVER_LEFT", + "minInt32Value": -3, + "maxInt32Value": 3 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_RIGHT", + "minInt32Value": -3, + "maxInt32Value": 3 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_CENTER", + "minInt32Value": -3, + "maxInt32Value": 3 + } + ] + }, + { + "property": "VehicleProperty::MIRROR_Z_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaMirror::DRIVER_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::MIRROR_Y_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaMirror::DRIVER_LEFT", + "minInt32Value": -3, + "maxInt32Value": 3 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_RIGHT", + "minInt32Value": -3, + "maxInt32Value": 3 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_CENTER", + "minInt32Value": -3, + "maxInt32Value": 3 + } + ] + }, + { + "property": "VehicleProperty::MIRROR_Y_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaMirror::DRIVER_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "VehicleAreaMirror::DRIVER_CENTER", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::MIRROR_LOCK", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::MIRROR_FOLD", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::MIRROR_AUTO_FOLD_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::MIRROR_AUTO_TILT_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areas": [ + { + "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::WINDOW_LOCK", + "areas": [ + { + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areaId": "Constants::WINDOW_1_RIGHT_2_LEFT_2_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::WINDOW_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::WINDOW_1_LEFT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::WINDOW_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::WINDOW_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::WINDOW_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + }, + { + "areaId": "Constants::WINDOW_ROOF_TOP_1", + "minInt32Value": -10, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::WINDOW_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::WINDOW_1_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::WINDOW_1_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::WINDOW_2_LEFT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::WINDOW_2_RIGHT", + "minInt32Value": -1, + "maxInt32Value": 1 + }, + { + "areaId": "Constants::WINDOW_ROOF_TOP_1", + "minInt32Value": -1, + "maxInt32Value": 1 + } + ] + }, + { + "property": "VehicleProperty::WINDSHIELD_WIPERS_PERIOD", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD", + "minInt32Value": 0, + "maxInt32Value": 3000 + }, + { + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD", + "minInt32Value": 0, + "maxInt32Value": 3000 + } + ] + }, + { + "property": "VehicleProperty::WINDSHIELD_WIPERS_STATE", + "defaultValue": { + "int32Values": [ + "WindshieldWipersState::OFF" + ] + }, + "areas": [ + { + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD", + "supportedEnumValues": [ + "WindshieldWipersState::OFF", + "WindshieldWipersState::ON", + "WindshieldWipersState::SERVICE" + ] + }, + { + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD", + "supportedEnumValues": [ + "WindshieldWipersState::OFF", + "WindshieldWipersState::ON" + ] + } + ] + }, + { + "property": "VehicleProperty::WINDSHIELD_WIPERS_SWITCH", + "defaultValue": { + "int32Values": [ + "WindshieldWipersSwitch::OFF" + ] + }, + "areas": [ + { + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD", + "supportedEnumValues": [ + "WindshieldWipersSwitch::OFF", + "WindshieldWipersSwitch::MIST", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_1", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_2", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_3", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_4", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_5", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_1", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_2", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_3", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_4", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_5", + "WindshieldWipersSwitch::AUTO", + "WindshieldWipersSwitch::SERVICE" + ] + }, + { + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD", + "supportedEnumValues": [ + "WindshieldWipersSwitch::OFF", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_1", + "WindshieldWipersSwitch::INTERMITTENT_LEVEL_2", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_1", + "WindshieldWipersSwitch::CONTINUOUS_LEVEL_2", + "WindshieldWipersSwitch::AUTO", + "WindshieldWipersSwitch::SERVICE" + ] + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_DEPTH_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": 0, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_DEPTH_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": -2, + "maxInt32Value": 2 + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_HEIGHT_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": 0, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": -2, + "maxInt32Value": 2 + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::STEERING_WHEEL_LOCKED", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::GLOVE_BOX_DOOR_POS", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 10 + } + ] + }, + { + "property": "VehicleProperty::GLOVE_BOX_LOCKED", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_RIGHT" + } + ] + }, + { + "property": "VehicleProperty::WHEEL_TICK", + "defaultValue": { + "int64Values": [ + 0, + 100000, + 200000, + 300000, + 400000 + ] + }, + "configArray": [ + 15, + 50000, + 50000, + 50000, + 50000 + ], + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::ABS_ACTIVE", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::TRACTION_CONTROL_ACTIVE", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::AP_POWER_STATE_REQ", + "configArray": [ + 0 + ] + }, + { + "property": "VehicleProperty::AP_POWER_STATE_REPORT", + "defaultValue": { + "int32Values": [ + "VehicleApPowerStateReport::WAIT_FOR_VHAL", + 0 + ] + } + }, + { + "property": "VehicleProperty::DISPLAY_BRIGHTNESS", + "defaultValue": { + "int32Values": [ + 100 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": 0, + "maxInt32Value": 100 + } + ] + }, + { + "property": "VehicleProperty::OBD2_LIVE_FRAME", + "configArray": [ + 0, + 0 + ] + }, + { + "property": "VehicleProperty::OBD2_FREEZE_FRAME", + "configArray": [ + 0, + 0 + ] + }, + { + "property": "VehicleProperty::OBD2_FREEZE_FRAME_INFO" + }, + { + "property": "VehicleProperty::OBD2_FREEZE_FRAME_CLEAR", + "configArray": [ + 1 + ] + }, + { + "property": "VehicleProperty::HEADLIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + } + }, + { + "property": "VehicleProperty::HIGH_BEAM_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + } + }, + { + "property": "VehicleProperty::FRONT_FOG_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + } + }, + { + "property": "VehicleProperty::REAR_FOG_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + } + }, + { + "property": "VehicleProperty::HAZARD_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + } + }, + { + "property": "VehicleProperty::CABIN_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + } + }, + { + "property": "VehicleProperty::READING_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_LIGHTS_STATE", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_STATE_ON" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "Constants::LIGHT_STATE_OFF", + "Constants::LIGHT_STATE_ON" + ] + } + ] + }, + { + "property": "VehicleProperty::HEADLIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_AUTO" + ] + } + }, + { + "property": "VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_AUTO" + ] + } + }, + { + "property": "VehicleProperty::FRONT_FOG_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_AUTO" + ] + } + }, + { + "property": "VehicleProperty::REAR_FOG_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_AUTO" + ] + } + }, + { + "property": "VehicleProperty::HAZARD_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_AUTO" + ] + } + }, + { + "property": "VehicleProperty::CABIN_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_OFF" + ] + } + }, + { + "property": "VehicleProperty::READING_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_OFF" + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, + { + "property": "VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH", + "defaultValue": { + "int32Values": [ + "Constants::LIGHT_SWITCH_AUTO" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "Constants::LIGHT_SWITCH_OFF", + "Constants::LIGHT_SWITCH_ON", + "Constants::LIGHT_SWITCH_AUTO" + ] + } + ] + }, + { + "property": "VehicleProperty::EVS_SERVICE_REQUEST", + "defaultValue": { + "int32Values": [ + "EvsServiceType::REARVIEW", + "EvsServiceState::OFF" + ] + } + }, + { + "property": "VehicleProperty::VEHICLE_MAP_SERVICE" + }, + { + "property": "VehicleProperty::LOCATION_CHARACTERIZATION", + "defaultValue": { + "int32Values": [ + "LocationCharacterization::RAW_GNSS_ONLY" + ] + } + }, + { + "property": "VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE", + "defaultValue": { + "int32Values": [ + "EmergencyLaneKeepAssistState::ENABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "EmergencyLaneKeepAssistState::ENABLED", + "EmergencyLaneKeepAssistState::WARNING_LEFT", + "EmergencyLaneKeepAssistState::WARNING_RIGHT", + "EmergencyLaneKeepAssistState::ACTIVATED_STEER_LEFT", + "EmergencyLaneKeepAssistState::ACTIVATED_STEER_RIGHT", + "EmergencyLaneKeepAssistState::USER_OVERRIDE" + ] + } + ] + }, + { + "property": "VehicleProperty::CRUISE_CONTROL_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::CRUISE_CONTROL_TYPE", + "defaultValue": { + "int32Values": [ + "CruiseControlType::STANDARD" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "CruiseControlType::STANDARD", + "CruiseControlType::ADAPTIVE", + "CruiseControlType::PREDICTIVE" + ] + } + ] + }, + { + "property": "VehicleProperty::CRUISE_CONTROL_STATE", + "defaultValue": { + "int32Values": [ + "CruiseControlState::ENABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "CruiseControlState::ENABLED", + "CruiseControlState::ACTIVATED", + "CruiseControlState::USER_OVERRIDE", + "CruiseControlState::SUSPENDED", + "CruiseControlState::FORCED_DEACTIVATION_WARNING" + ] + } + ] + }, + { + "property": "VehicleProperty::CRUISE_CONTROL_COMMAND", + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "CruiseControlCommand::ACTIVATE", + "CruiseControlCommand::SUSPEND", + "CruiseControlCommand::INCREASE_TARGET_SPEED", + "CruiseControlCommand::DECREASE_TARGET_SPEED", + "CruiseControlCommand::INCREASE_TARGET_TIME_GAP", + "CruiseControlCommand::DECREASE_TARGET_TIME_GAP" + ] + } + ] + }, + { + "property": "VehicleProperty::CRUISE_CONTROL_TARGET_SPEED", + "defaultValue": { + "floatValues": [ + 25.0 + ] + }, + "areas": [ + { + "areaId": 0, + "minFloatValue": 20.0, + "maxFloatValue": 35.0 + } + ] + }, + { + "property": "VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP", + "defaultValue": { + "int32Values": [ + 1200 + ] + }, + "configArray": [ + 1200, + 1400, + 1600, + 1800, + 2000, + 2200 + ] + }, + { + "property": "VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE", + "defaultValue": { + "int32Values": [ + 100000 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": 0, + "maxInt32Value": 200000 + } + ], + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::HANDS_ON_DETECTION_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE", + "defaultValue": { + "int32Values": [ + "HandsOnDetectionDriverState::HANDS_ON" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_DISABLED", + "HandsOnDetectionDriverState::HANDS_ON", + "HandsOnDetectionDriverState::HANDS_OFF" + ] + } + ] + }, + { + "property": "VehicleProperty::HANDS_ON_DETECTION_WARNING", + "defaultValue": { + "int32Values": [ + "HandsOnDetectionWarning::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_DISABLED", + "HandsOnDetectionWarning::NO_WARNING", + "HandsOnDetectionWarning::WARNING" + ] + } + ] + }, + { + "property": "VehicleProperty::INITIAL_USER_INFO" + }, + { + "property": "VehicleProperty::SWITCH_USER" + }, + { + "property": "VehicleProperty::CREATE_USER" + }, + { + "property": "VehicleProperty::REMOVE_USER" + }, + { + "property": "VehicleProperty::USER_IDENTIFICATION_ASSOCIATION" + }, + { + "property": "VehicleProperty::POWER_POLICY_REQ" + }, + { + "property": "VehicleProperty::POWER_POLICY_GROUP_REQ" + }, + { + "property": "VehicleProperty::CURRENT_POWER_POLICY" + }, + { + "property": "VehicleProperty::ANDROID_EPOCH_TIME" + }, + { + "property": "VehicleProperty::WATCHDOG_ALIVE" + }, + { + "property": "VehicleProperty::WATCHDOG_TERMINATED_PROCESS" + }, + { + "property": "VehicleProperty::VHAL_HEARTBEAT" + }, + { + "property": "VehicleProperty::CLUSTER_SWITCH_UI", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "comment": "0 means ClusterHome" + }, + { + "property": "VehicleProperty::CLUSTER_DISPLAY_STATE", + "defaultValue": { + "int32Values": [ + 0, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + ] + }, + "comment": + "Value means: 0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */" + }, + { + "property": "VehicleProperty::CLUSTER_REPORT_STATE", + "configArray": [ + 0, + 0, + 0, + 11, + 0, + 0, + 0, + 0, + 16 + ] + }, + { + "property": "VehicleProperty::CLUSTER_REQUEST_DISPLAY" + }, + { + "property": "VehicleProperty::CLUSTER_NAVIGATION_STATE" + }, + { + "property": "VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT", + "defaultValue": { + "int32Values": [ + "GsrComplianceRequirementType::GSR_COMPLIANCE_REQUIRED_V1" + ] + } + }, + { + "property": "VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, + { + "property": "VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE", + "defaultValue": { + "int32Values": [ + "ErrorState::NOT_AVAILABLE_DISABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "AutomaticEmergencyBrakingState::ENABLED", + "AutomaticEmergencyBrakingState::ACTIVATED", + "AutomaticEmergencyBrakingState::USER_OVERRIDE" + ] + } + ] + }, + { + "property": "VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::FORWARD_COLLISION_WARNING_STATE", + "defaultValue": { + "int32Values": [ + "ForwardCollisionWarningState::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "ForwardCollisionWarningState::NO_WARNING", + "ForwardCollisionWarningState::WARNING" + ] + } + ] + }, + { + "property": "VehicleProperty::BLIND_SPOT_WARNING_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::BLIND_SPOT_WARNING_STATE", + "defaultValue": { + "int32Values": [ + "BlindSpotWarningState::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": "VehicleAreaMirror::DRIVER_LEFT", + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "BlindSpotWarningState::NO_WARNING", + "BlindSpotWarningState::WARNING" + ] + }, + { + "areaId": "VehicleAreaMirror::DRIVER_RIGHT", + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "BlindSpotWarningState::NO_WARNING", + "BlindSpotWarningState::WARNING" + ] + } + ] + }, + { + "property": "VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::LANE_DEPARTURE_WARNING_STATE", + "defaultValue": { + "int32Values": [ + "LaneDepartureWarningState::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "LaneDepartureWarningState::NO_WARNING", + "LaneDepartureWarningState::WARNING_LEFT", + "LaneDepartureWarningState::WARNING_RIGHT" + ] + } + ] + }, + { + "property": "VehicleProperty::LANE_KEEP_ASSIST_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::LANE_KEEP_ASSIST_STATE", + "defaultValue": { + "int32Values": [ + "LaneKeepAssistState::ENABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "LaneKeepAssistState::ENABLED", + "LaneKeepAssistState::ACTIVATED_STEER_LEFT", + "LaneKeepAssistState::ACTIVATED_STEER_RIGHT", + "LaneKeepAssistState::USER_OVERRIDE" + ] + } + ] + }, + { + "property": "VehicleProperty::LANE_CENTERING_ASSIST_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, + { + "property": "VehicleProperty::LANE_CENTERING_ASSIST_COMMAND" + }, + { + "property": "VehicleProperty::LANE_CENTERING_ASSIST_STATE", + "defaultValue": { + "int32Values": [ + "LaneCenteringAssistState::ENABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "LaneCenteringAssistState::ENABLED", + "LaneCenteringAssistState::ACTIVATION_REQUESTED", + "LaneCenteringAssistState::ACTIVATED", + "LaneCenteringAssistState::USER_OVERRIDE", + "LaneCenteringAssistState::FORCED_DEACTIVATION_WARNING" + ] + } + ] + } + ] +} diff --git a/automotive/vehicle/aidl/impl/default_config/config/README.md b/automotive/vehicle/aidl/impl/default_config/config/README.md new file mode 100644 index 0000000000..6e82de5773 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/config/README.md @@ -0,0 +1,171 @@ +# Property Configuration Files + +Each JSON file in this folder is a property configuration file for reference +Vehicle HAL. They contain VehiclePropConfig information along with initial +value information. + +## JSON schema + +Each JSON file must be in a schema like the following example: +(The comment starting with "//" is for documentation only and must be removed +from the actual JSON file. The "comment" field is used for comment in the +actual JSON file and will be ignored by the parser) + +``` +{ + // (number) The version for the JSON schema. + "apiVersion": 1, + // (non-empty array of objects) The property configuration list. + // + // Each object is a configuration for one property. + "properties": [ + { + // (number/string) The ID for the property. + // This value is defined in a string value + // which represents a constant value, see the "JSON Number-type + // Field Values" section for detail. + "property": "VehicleProperty::INFO_FUEL_CAPACITY", + // (optional, number/string) The access mode for the property. + // If specified, this overwrite the default access mode specified in + // VehicleProperty.aidl. Must be specified for vendor properties. + "access": "VehiclePropertyAccess::READ", + // (optional, number/string) The change mode for the property. + // If specified, this overwrite the default change mode specified in + // VehicleProperty.aidl. Must be specified for vendor properties. + "changeMode": "VehiclePropertyChangeMode::STATIC", + // (optional, string) The config string. + "configString": "blahblah", + // (optional, array of number/string) The config array. + "configArray": [1, 2, "Constants::HVAC_ALL"], + // (optional, object) The default value for the property. + // If not specified, the property will be shown as unavailable + // until its value is set. + "defaultValue": { + // (optional, array of int number/string) Int values. + "int32Values": [1, 2, "Constants::HVAC_ALL"], + // (optional, array of int number/string) Long values. + "int64Values": [1, 2], + // (optional, array of float number/string) Float values. + "floatValues": [1.1, 2.2], + // (optional, string) String value. + "stringValue": "test" + }, + // (optional, number/string) The minimum sample rate in HZ. + // Only work for VehiclePropertyChangeMode::CONTINUOUS property. + // Must be specified for continuous property. + "minSampleRate": 1, + // (optional, number/string) The maximum sample rate in HZ. + // Only work for VehiclePropertyChangeMode::CONTINUOUS property. + // Must be specified for continuous property. + "maxSampleRate": 10, + // (optional, array of objects) The area configs. + "areas:" [ + { + // (number/string) The area ID. + "areaId": "Constants::DOOR_1_LEFT", + // (optional number/string) The minimum int value. + "minInt32Value": 1, + // (optional number/string) The maximum int value. + "maxInt32Value": 10, + // (optional number/string) The minimum long value. + "minInt64Value": 1, + // (optional number/string) The maximum long value. + "maxInt64Value": 10, + // (optional number/string) The minimum float value. + "minFloatValue": 1, + // (optional number/string) The maximum float value. + "maxFloatValue": 10, + // (optional object) The default value for this area. + // Uses the same format as the "defaultValue" field for + // property object. If specified, this overwrite the global + // defaultValue. + "defaultValue": { + "int32Values": [1, 2, "Constants::HVAC_ALL"], + "int64Values": [1, 2], + "floatValues": [1.1, 2.2], + "stringValue": "test" + } + } + ] + } + ] +} +``` + +## JSON Number-type Field Values + +For number type field values, they can either be defined as a numeric number, +e.g., `{"minInt32Value": 1}` or be defined as a string which represents a +defined constant value, e.g., +`{"property": "VehicleProperty::INFO_FUEL_CAPACITY"}`. + +For constant values, they must be a string in the format of `XXX::XXX`, where +the field before `::` is the constant type, and the field after `::` is the +variable name. + +We support the following constant types: + +* VehiclePropertyAccess + +* VehiclePropertyChangeMode + +* VehicleGear + +* VehicleAreaWindow + +* VehicleOilLevel + +* VehicleUnit + +* VehicleSeatOccupancyState + +* VehicleHvacFanDirection + +* VehicleApPowerStateReport + +* VehicleTurnSignal + +* VehicleVendorPermission + +* EvsServiceType + +* EvsServiceState + +* EvConnectorType + +* VehicleProperty + +* GsrComplianceRequirementType + +* VehicleIgnitionState + +* FuelType + +* AutomaticEmergencyBrakingState + +* ForwardCollisionWarningState + +* BlindSpotWarningState + +* LaneDepartureWarningState + +* LaneKeepAssistState + +* LaneCenteringAssistCommand + +* LaneCenteringAssistState + +* ErrorState + +* WindshieldWipersState + +* WindshieldWipersSwitch + +* Constants + +Every constant type except "Constants" corresponds to a enum defined in Vehicle +HAL interfac. E.g. "VehicleProperty" corresponds to the enums defined in +"VehicleProperty.aidl". + +"Constants" type refers to the constant variables defined in the paresr. +Specifically, the "CONSTANTS_BY_NAME" map defined in "JsonConfigLoader.cpp". diff --git a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json new file mode 100644 index 0000000000..fd4b0026bd --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json @@ -0,0 +1,209 @@ +{ + "properties": [ + { + "property": "Constants::kMixedTypePropertyForTest", + "defaultValue": { + "floatValues": [ + 4.5 + ], + "int32Values": [ + 1, + 2, + 3 + ], + "stringValue": "MIXED property" + }, + "configArray": [ + 1, + 1, + 0, + 2, + 0, + 0, + 1, + 0, + 0 + ], + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_EXTENSION_BOOLEAN_PROPERTY", + "areas": [ + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "Constants::DOOR_1_LEFT" + }, + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "Constants::DOOR_1_RIGHT" + }, + { + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areaId": "Constants::DOOR_2_LEFT" + }, + { + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areaId": "Constants::DOOR_2_RIGHT" + } + ], + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY", + "areas": [ + { + "defaultValue": { + "floatValues": [ + 1.0 + ] + }, + "areaId": "Constants::HVAC_LEFT", + "minFloatValue": -10.0, + "maxFloatValue": 10.0 + }, + { + "defaultValue": { + "floatValues": [ + 2.0 + ] + }, + "areaId": "Constants::HVAC_RIGHT", + "minFloatValue": -10.0, + "maxFloatValue": 10.0 + } + ], + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_EXTENSION_INT_PROPERTY", + "areas": [ + { + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD", + "minInt32Value": -100, + "maxInt32Value": 100 + }, + { + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areaId": "VehicleAreaWindow::REAR_WINDSHIELD", + "minInt32Value": -100, + "maxInt32Value": 100 + }, + { + "defaultValue": { + "int32Values": [ + -1 + ] + }, + "areaId": "VehicleAreaWindow::ROOF_TOP_1", + "minInt32Value": -100, + "maxInt32Value": 100 + } + ], + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_EXTENSION_STRING_PROPERTY", + "defaultValue": { + "stringValue": "Vendor String Property" + }, + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::PLACEHOLDER_PROPERTY_INT", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::PLACEHOLDER_PROPERTY_FLOAT", + "defaultValue": { + "floatValues": [ + 0.0 + ] + }, + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::PLACEHOLDER_PROPERTY_BOOLEAN", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::PLACEHOLDER_PROPERTY_STRING", + "defaultValue": { + "stringValue": "Test" + }, + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::ECHO_REVERSE_BYTES", + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_PROPERTY_ID", + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION", + "defaultValue": { + "int32Values": [ + 1 + ] + }, + "configArray": [ + "Constants::kMixedTypePropertyForTest", + "VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO", + "VehicleVendorPermission::PERMISSION_SET_VENDOR_CATEGORY_INFO", + "Constants::VENDOR_EXTENSION_INT_PROPERTY", + "VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_SEAT", + "VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE", + "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY", + "VehicleVendorPermission::PERMISSION_DEFAULT", + "VehicleVendorPermission::PERMISSION_DEFAULT" + ] + } + ] +} \ No newline at end of file diff --git a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json new file mode 100644 index 0000000000..3a1a783b84 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json @@ -0,0 +1,63 @@ +{ + "properties": [ + { + "property": "Constants::VENDOR_CLUSTER_SWITCH_UI", + "access": "VehiclePropertyAccess::WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_CLUSTER_DISPLAY_STATE", + "access": "VehiclePropertyAccess::WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, + { + "property": "Constants::VENDOR_CLUSTER_REPORT_STATE", + "defaultValue": { + "int32Values": [ + 0, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + -1 + ] + }, + "configArray": [ + 0, + 0, + 0, + 11, + 0, + 0, + 0, + 0, + 16 + ], + "access": "VehiclePropertyAccess::READ", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE", + "comment": + "Value means 0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */, 0 /* ClusterHome */, -1 /* ClusterNone */" + }, + { + "property": "Constants::VENDOR_CLUSTER_REQUEST_DISPLAY", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "access": "VehiclePropertyAccess::READ", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE", + "comment": "0 means ClusterHome" + }, + { + "property": "Constants::VENDOR_CLUSTER_NAVIGATION_STATE", + "access": "VehiclePropertyAccess::READ", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + } + ] +} \ No newline at end of file diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h deleted file mode 100644 index f023fd2063..0000000000 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ /dev/null @@ -1,2040 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ - -#ifndef android_hardware_automotive_vehicle_aidl_impl_default_config_include_DefaultConfig_H_ -#define android_hardware_automotive_vehicle_aidl_impl_default_config_include_DefaultConfig_H_ - -#include -#include -#include - -#include -#include - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { - -// Types used in configs, not to be exposed as public API. -namespace defaultconfig_impl { - -using ::aidl::android::hardware::automotive::vehicle::EvConnectorType; -using ::aidl::android::hardware::automotive::vehicle::EvsServiceState; -using ::aidl::android::hardware::automotive::vehicle::EvsServiceType; -using ::aidl::android::hardware::automotive::vehicle::FuelType; -using ::aidl::android::hardware::automotive::vehicle::RawPropValues; -using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; -using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; -using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; -using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror; -using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; -using ::aidl::android::hardware::automotive::vehicle::VehicleGear; -using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection; -using ::aidl::android::hardware::automotive::vehicle::VehicleIgnitionState; -using ::aidl::android::hardware::automotive::vehicle::VehicleOilLevel; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; -using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; -using ::aidl::android::hardware::automotive::vehicle::VehicleSeatOccupancyState; -using ::aidl::android::hardware::automotive::vehicle::VehicleTurnSignal; -using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; -using ::aidl::android::hardware::automotive::vehicle::VehicleVendorPermission; - -struct ConfigDeclaration { - VehiclePropConfig config; - - // This value will be used as an initial value for the property. If this field is specified for - // property that supports multiple areas then it will be used for all areas unless particular - // area is overridden in initialAreaValue field. - RawPropValues initialValue; - // Use initialAreaValues if it is necessary to specify different values per each area. - std::map initialAreaValues; -}; - -const std::vector kVehicleProperties = { - {.config = - { - .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.floatValues = {15000.0f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_FUEL_TYPE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {toInt(FuelType::FUEL_TYPE_UNLEADED)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.floatValues = {150000.0f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_EV_CONNECTOR_TYPE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {toInt(EvConnectorType::IEC_TYPE_1_AC)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_FUEL_DOOR_LOCATION), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {FUEL_DOOR_REAR_LEFT}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_EV_PORT_LOCATION), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT, CHARGE_PORT_REAR_LEFT}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_VIN), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.stringValue = "1GCARVIN123456789"}}, - {.config = - { - .prop = toInt(VehicleProperty::INFO_MAKE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.stringValue = "Toy Vehicle"}}, - {.config = - { - .prop = toInt(VehicleProperty::INFO_MODEL), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.stringValue = "Speedy Model"}}, - {.config = - { - .prop = toInt(VehicleProperty::INFO_MODEL_YEAR), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {2020}}}, - {.config = - { - .prop = toInt(VehicleProperty::INFO_EXTERIOR_DIMENSIONS), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}}, - {.config = - { - .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}}, - {.config = - { - .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED_DISPLAY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}}, - {.config = - { - .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(VehicleUnit::METER_PER_SEC), - toInt(VehicleUnit::MILES_PER_HOUR), - toInt(VehicleUnit::KILOMETERS_PER_HOUR)}, - }, - .initialValue = {.int32Values = {toInt(VehicleUnit::MILES_PER_HOUR)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_BATTERY_DISPLAY_UNITS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(VehicleUnit::WATT_HOUR), - toInt(VehicleUnit::AMPERE_HOURS), - toInt(VehicleUnit::KILOWATT_HOUR)}, - }, - .initialValue = {.int32Values = {toInt(VehicleUnit::KILOWATT_HOUR)}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_MEMORY_SELECT), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 3}}}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_MEMORY_SET), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 3}}}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_BUCKLED), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_HEIGHT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = 0, - .maxInt32Value = 10}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {10}}}, - {SEAT_1_RIGHT, {.int32Values = {10}}}, - {SEAT_2_LEFT, {.int32Values = {10}}}, - {SEAT_2_RIGHT, {.int32Values = {10}}}, - {SEAT_2_CENTER, {.int32Values = {10}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_HEIGHT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_FORE_AFT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_FORE_AFT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_1_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_2_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}}, - {SEAT_1_RIGHT, {.int32Values = {0}}}, - {SEAT_2_LEFT, {.int32Values = {0}}}, - {SEAT_2_RIGHT, {.int32Values = {0}}}, - {SEAT_2_CENTER, {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEIGHT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEIGHT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_DEPTH_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_DEPTH_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_TILT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_TILT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_LUMBAR_FORE_AFT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -10, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_LUMBAR_FORE_AFT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = 0, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEADREST_HEIGHT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEADREST_ANGLE_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = 0, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEADREST_ANGLE_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEADREST_FORE_AFT_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = 0, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::SEAT_OCCUPANCY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = (SEAT_1_LEFT)}, - VehicleAreaConfig{.areaId = (SEAT_1_RIGHT)}}, - }, - .initialAreaValues = {{SEAT_1_LEFT, - {.int32Values = {toInt(VehicleSeatOccupancyState::VACANT)}}}, - {SEAT_1_RIGHT, - {.int32Values = {toInt(VehicleSeatOccupancyState::VACANT)}}}}}, - - {.config = - { - .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - // this was a zoned property on an old vhal, but it is meant to be global - .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, - }, - .initialValue = {.int32Values = {SEAT_1_LEFT}}}, - - {.config = - { - .prop = toInt(VehicleProperty::PERF_ODOMETER), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}}, - {.config = - { - .prop = toInt(VehicleProperty::PERF_STEERING_ANGLE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}}, - {.config = - { - .prop = toInt(VehicleProperty::PERF_REAR_STEERING_ANGLE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}}, - { - .config = - { - .prop = toInt(VehicleProperty::ENGINE_RPM), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}, - }, - - {.config = - { - .prop = toInt(VehicleProperty::FUEL_LEVEL), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 100.0f, - }, - .initialValue = {.floatValues = {15000.0f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::FUEL_DOOR_OPEN), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_BATTERY_LEVEL), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 100.0f, - }, - .initialValue = {.floatValues = {150000.0f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_PORT_OPEN), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_PORT_CONNECTED), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {0.0f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {/*max current draw allowed by vehicle in amperes=*/20}, - }, - .initialValue = {.floatValues = {(float)12.5}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_PERCENT_LIMIT), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {20, 40, 60, 80, 100}, - }, - .initialValue = {.floatValues = {40}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {2}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0 /* false */}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.int32Values = {20}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EV_REGENERATIVE_BRAKING_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {2}}}, - - {.config = - { - .prop = toInt(VehicleProperty::TRAILER_PRESENT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {2}}}, - - {.config = - { - .prop = toInt(VehicleProperty::VEHICLE_CURB_WEIGHT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - .configArray = {/*gross weight kg=*/2948}, - }, - .initialValue = {.int32Values = {2211 /*kg*/}}}, - - {.config = - { - .prop = toInt(VehicleProperty::RANGE_REMAINING), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 2.0f, - }, - .initialValue = {.floatValues = {50000.0f}}}, // units in meters - - {.config = - { - .prop = toInt(VehicleProperty::TIRE_PRESSURE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .areaConfigs = {VehicleAreaConfig{ - .areaId = WHEEL_FRONT_LEFT, - .minFloatValue = 193.0f, - .maxFloatValue = 300.0f, - }, - VehicleAreaConfig{ - .areaId = WHEEL_FRONT_RIGHT, - .minFloatValue = 193.0f, - .maxFloatValue = 300.0f, - }, - VehicleAreaConfig{ - .areaId = WHEEL_REAR_LEFT, - .minFloatValue = 193.0f, - .maxFloatValue = 300.0f, - }, - VehicleAreaConfig{ - .areaId = WHEEL_REAR_RIGHT, - .minFloatValue = 193.0f, - .maxFloatValue = 300.0f, - }}, - .minSampleRate = 1.0f, - .maxSampleRate = 2.0f, - }, - .initialValue = {.floatValues = {200.0f}}}, // units in kPa - - {.config = - { - .prop = toInt(VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - .areaConfigs = {VehicleAreaConfig{.areaId = WHEEL_FRONT_LEFT}, - VehicleAreaConfig{.areaId = WHEEL_FRONT_RIGHT}, - VehicleAreaConfig{.areaId = WHEEL_REAR_RIGHT}, - VehicleAreaConfig{.areaId = WHEEL_REAR_LEFT}}, - }, - .initialAreaValues = {{WHEEL_FRONT_LEFT, {.floatValues = {137.0f}}}, - {WHEEL_FRONT_RIGHT, {.floatValues = {137.0f}}}, - {WHEEL_REAR_RIGHT, {.floatValues = {137.0f}}}, - {WHEEL_REAR_LEFT, {.floatValues = {137.0f}}}}}, - - {.config = - { - .prop = toInt(VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(VehicleUnit::KILOPASCAL), toInt(VehicleUnit::PSI), - toInt(VehicleUnit::BAR)}, - }, - .initialValue = {.int32Values = {toInt(VehicleUnit::PSI)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::CURRENT_GEAR), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(VehicleGear::GEAR_PARK), - toInt(VehicleGear::GEAR_NEUTRAL), - toInt(VehicleGear::GEAR_REVERSE), - toInt(VehicleGear::GEAR_1), toInt(VehicleGear::GEAR_2), - toInt(VehicleGear::GEAR_3), toInt(VehicleGear::GEAR_4), - toInt(VehicleGear::GEAR_5)}, - }, - .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::PARKING_BRAKE_ON), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {1}}}, - - {.config = - { - .prop = toInt(VehicleProperty::PARKING_BRAKE_AUTO_APPLY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {1}}}, - - {.config = - { - .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {(int)VehicleUnit::LITER, (int)VehicleUnit::US_GALLON}, - }, - .initialValue = {.int32Values = {(int)VehicleUnit::US_GALLON}}}, - - {.config = - { - .prop = toInt( - VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {1}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HW_KEY_INPUT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0, 0, 0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HW_ROTARY_INPUT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0, 0, 0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HW_CUSTOM_INPUT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0, 0, 3, 0, 0, 0, 0, 0}, - }, - .initialValue = - { - .int32Values = {0, 0, 0}, - }}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {50}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}, - // TODO(bryaneyler): Ideally, this is generated dynamically from - // kHvacPowerProperties. - .configArray = {toInt(VehicleProperty::HVAC_FAN_SPEED), - toInt(VehicleProperty::HVAC_FAN_DIRECTION)}}, - .initialValue = {.int32Values = {1}}}, - - { - .config = {.prop = toInt(VehicleProperty::HVAC_DEFROSTER), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{ - .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)}, - VehicleAreaConfig{ - .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}}, - .initialValue = {.int32Values = {0}} // Will be used for all areas. - }, - { - .config = {.prop = toInt(VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{ - .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)}, - VehicleAreaConfig{ - .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}}, - .initialValue = {.int32Values = {0}} // Will be used for all areas. - }, - - {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{ - .areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}}, - .initialValue = {.int32Values = {3}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {FAN_DIRECTION_FACE, FAN_DIRECTION_FLOOR, - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR, - FAN_DIRECTION_DEFROST, - FAN_DIRECTION_FACE | FAN_DIRECTION_DEFROST, - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST, - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST | - FAN_DIRECTION_FACE}}}, - {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_VENTILATION), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{ - .areaId = SEAT_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 3, - }, - VehicleAreaConfig{ - .areaId = SEAT_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 3, - }}}, - .initialValue = - {.int32Values = {0}}}, // 0 is off and +ve values indicate ventilation level. - - {.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{ - .areaId = (0), .minInt32Value = -2, .maxInt32Value = 2}}}, - .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling - - {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{ - .areaId = SEAT_1_LEFT, - .minInt32Value = -2, - .maxInt32Value = 2, - }, - VehicleAreaConfig{ - .areaId = SEAT_1_RIGHT, - .minInt32Value = -2, - .maxInt32Value = 2, - }}}, - .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling - - {.config = {.prop = toInt(VehicleProperty::HVAC_SIDE_MIRROR_HEAT), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{ - .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT) | - toInt(VehicleAreaMirror::DRIVER_RIGHT), - .minInt32Value = 0, - .maxInt32Value = 2, - }}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_LEFT}, - VehicleAreaConfig{.areaId = HVAC_RIGHT}}}, - .initialAreaValues = {{HVAC_LEFT, {.floatValues = {17.3f}}}, - {HVAC_RIGHT, {.floatValues = {19.1f}}}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {160, 280, 5, 605, 825, 10}, - .areaConfigs = {VehicleAreaConfig{ - .areaId = HVAC_LEFT, - .minFloatValue = 16, - .maxFloatValue = 32, - }, - VehicleAreaConfig{ - .areaId = HVAC_RIGHT, - .minFloatValue = 16, - .maxFloatValue = 32, - }}}, - .initialAreaValues = {{HVAC_LEFT, {.floatValues = {16}}}, - {HVAC_RIGHT, {.floatValues = {20}}}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.floatValues = {66.2f, (float)VehicleUnit::FAHRENHEIT, 19.0f, 66.5f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE), - .access = VehiclePropertyAccess::READ, - // TODO(bryaneyler): Support ON_CHANGE as well. - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 2.0f, - }, - .initialValue = {.floatValues = {25.0f}}}, - - {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(VehicleUnit::FAHRENHEIT), toInt(VehicleUnit::CELSIUS)}}, - .initialValue = {.int32Values = {toInt(VehicleUnit::FAHRENHEIT)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, - .configArray = {toInt(VehicleUnit::KILOMETER), toInt(VehicleUnit::MILE)}, - }, - .initialValue = {.int32Values = {toInt(VehicleUnit::MILE)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::NIGHT_MODE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::GEAR_SELECTION), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(VehicleGear::GEAR_PARK), - toInt(VehicleGear::GEAR_NEUTRAL), - toInt(VehicleGear::GEAR_REVERSE), - toInt(VehicleGear::GEAR_DRIVE), toInt(VehicleGear::GEAR_1), - toInt(VehicleGear::GEAR_2), toInt(VehicleGear::GEAR_3), - toInt(VehicleGear::GEAR_4), toInt(VehicleGear::GEAR_5)}, - }, - .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::TURN_SIGNAL_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {toInt(VehicleTurnSignal::NONE)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::IGNITION_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::ENGINE_COOLANT_TEMP), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.floatValues = {75.0f}}}, - - {.config = - { - .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {toInt(VehicleOilLevel::NORMAL)}}}, - - {.config = - { - .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 0.1, // 0.1 Hz, every 10 seconds - .maxSampleRate = 10, // 10 Hz, every 100 ms - }, - .initialValue = {.floatValues = {101.0f}}}, - - { - .config = {.prop = kMixedTypePropertyForTest, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}}, - .initialValue = - { - .int32Values = {1 /* indicate TRUE boolean value */, 2, 3}, - .floatValues = {4.5f}, - .stringValue = "MIXED property", - }, - }, - - {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT}, - VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, - VehicleAreaConfig{.areaId = DOOR_2_LEFT}, - VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, - .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, - {DOOR_1_RIGHT, {.int32Values = {1}}}, - {DOOR_2_LEFT, {.int32Values = {1}}}, - {DOOR_2_RIGHT, {.int32Values = {1}}}}}, - - {.config = {.prop = toInt(VehicleProperty::DOOR_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{ - .areaId = DOOR_1_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = DOOR_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 1}, - VehicleAreaConfig{ - .areaId = DOOR_2_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = DOOR_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 1}, - VehicleAreaConfig{ - .areaId = DOOR_REAR, .minInt32Value = 0, .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::MIRROR_Z_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_LEFT), - .minInt32Value = -3, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT), - .minInt32Value = -3, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_CENTER), - .minInt32Value = -3, - .maxInt32Value = 3}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::MIRROR_Z_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_LEFT), - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT), - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_CENTER), - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::MIRROR_Y_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_LEFT), - .minInt32Value = -3, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT), - .minInt32Value = -3, - .maxInt32Value = 3}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_CENTER), - .minInt32Value = -3, - .maxInt32Value = 3}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::MIRROR_Y_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_LEFT), - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT), - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaMirror::DRIVER_CENTER), - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::MIRROR_LOCK), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::MIRROR_FOLD), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {1}}}, - - {.config = {.prop = toInt(VehicleProperty::WINDOW_LOCK), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT | - WINDOW_2_RIGHT}}}, - .initialAreaValues = {{WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT, - {.int32Values = {0}}}}}, - - {.config = {.prop = toInt(VehicleProperty::WINDOW_POS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = WINDOW_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = WINDOW_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = WINDOW_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - VehicleAreaConfig{.areaId = WINDOW_ROOF_TOP_1, - .minInt32Value = -10, - .maxInt32Value = 10}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::WINDOW_MOVE), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = WINDOW_1_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = WINDOW_2_LEFT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = WINDOW_2_RIGHT, - .minInt32Value = -1, - .maxInt32Value = 1}, - VehicleAreaConfig{.areaId = WINDOW_ROOF_TOP_1, - .minInt32Value = -1, - .maxInt32Value = 1}}}, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = WHEEL_TICK, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000}, - .minSampleRate = 1.0f, - .maxSampleRate = 10.0f, - }, - .initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}}, - - {.config = {.prop = ABS_ACTIVE, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = TRACTION_CONTROL_ACTIVE, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {3}}}, - - {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL), 0}}}, - - {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 100}}}, - .initialValue = {.int32Values = {100}}}, - - { - .config = {.prop = OBD2_LIVE_FRAME, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0}}, - }, - - { - .config = {.prop = OBD2_FREEZE_FRAME, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0}}, - }, - - { - .config = {.prop = OBD2_FREEZE_FRAME_INFO, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - }, - - { - .config = {.prop = OBD2_FREEZE_FRAME_CLEAR, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {1}}, - }, - - {.config = - { - .prop = toInt(VehicleProperty::HEADLIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::FRONT_FOG_LIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::REAR_FOG_LIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HAZARD_LIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::CABIN_LIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = {.prop = toInt(VehicleProperty::READING_LIGHTS_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER}}}, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HEADLIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, - - // FOG_LIGHTS_SWITCH must not be implemented when FRONT_FOG_LIGHTS_SWITCH is implemented - {.config = - { - .prop = toInt(VehicleProperty::FRONT_FOG_LIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, - - // FOG_LIGHTS_SWITCH must not be implemented when REAR_FOG_LIGHTS_SWITCH is implemented - {.config = - { - .prop = toInt(VehicleProperty::REAR_FOG_LIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, - - {.config = - { - .prop = toInt(VehicleProperty::HAZARD_LIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, - - {.config = - { - .prop = toInt(VehicleProperty::CABIN_LIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = {.prop = toInt(VehicleProperty::READING_LIGHTS_SWITCH), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = SEAT_1_LEFT}, - VehicleAreaConfig{.areaId = SEAT_1_RIGHT}, - VehicleAreaConfig{.areaId = SEAT_2_LEFT}, - VehicleAreaConfig{.areaId = SEAT_2_RIGHT}, - VehicleAreaConfig{.areaId = SEAT_2_CENTER}}}, - .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, - - {.config = - { - .prop = toInt(VehicleProperty::EVS_SERVICE_REQUEST), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {toInt(EvsServiceType::REARVIEW), - toInt(EvsServiceState::OFF)}}}, - - {.config = {.prop = VEHICLE_MAP_SERVICE, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}}, - - // Example Vendor Extension properties for testing - {.config = {.prop = VENDOR_EXTENSION_BOOLEAN_PROPERTY, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT}, - VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, - VehicleAreaConfig{.areaId = DOOR_2_LEFT}, - VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, - .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, - {DOOR_1_RIGHT, {.int32Values = {1}}}, - {DOOR_2_LEFT, {.int32Values = {0}}}, - {DOOR_2_RIGHT, {.int32Values = {0}}}}}, - - {.config = {.prop = VENDOR_EXTENSION_FLOAT_PROPERTY, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_LEFT, - .minFloatValue = -10, - .maxFloatValue = 10}, - VehicleAreaConfig{.areaId = HVAC_RIGHT, - .minFloatValue = -10, - .maxFloatValue = 10}}}, - .initialAreaValues = {{HVAC_LEFT, {.floatValues = {1}}}, - {HVAC_RIGHT, {.floatValues = {2}}}}}, - - {.config = {.prop = VENDOR_EXTENSION_INT_PROPERTY, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD), - .minInt32Value = -100, - .maxInt32Value = 100}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD), - .minInt32Value = -100, - .maxInt32Value = 100}, - VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::ROOF_TOP_1), - .minInt32Value = -100, - .maxInt32Value = 100}}}, - .initialAreaValues = {{toInt(VehicleAreaWindow::FRONT_WINDSHIELD), {.int32Values = {1}}}, - {toInt(VehicleAreaWindow::REAR_WINDSHIELD), {.int32Values = {0}}}, - {toInt(VehicleAreaWindow::ROOF_TOP_1), {.int32Values = {-1}}}}}, - - {.config = {.prop = VENDOR_EXTENSION_STRING_PROPERTY, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.stringValue = "Vendor String Property"}}, - - {.config = {.prop = toInt(VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {0}}}, - - {.config = {.prop = toInt(VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = {.int32Values = {0}}}, - - {.config = - { - .prop = toInt(VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {kMixedTypePropertyForTest, - toInt(VehicleVendorPermission:: - PERMISSION_GET_VENDOR_CATEGORY_INFO), - toInt(VehicleVendorPermission:: - PERMISSION_SET_VENDOR_CATEGORY_INFO), - VENDOR_EXTENSION_INT_PROPERTY, - toInt(VehicleVendorPermission:: - PERMISSION_GET_VENDOR_CATEGORY_SEAT), - toInt(VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE), - VENDOR_EXTENSION_FLOAT_PROPERTY, - toInt(VehicleVendorPermission::PERMISSION_DEFAULT), - toInt(VehicleVendorPermission::PERMISSION_DEFAULT)}, - }, - .initialValue = {.int32Values = {1}}}, - - { - .config = - { - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::SWITCH_USER), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CREATE_USER), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::REMOVE_USER), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::POWER_POLICY_REQ), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::POWER_POLICY_GROUP_REQ), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CURRENT_POWER_POLICY), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::ANDROID_EPOCH_TIME), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::WATCHDOG_ALIVE), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::WATCHDOG_TERMINATED_PROCESS), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::VHAL_HEARTBEAT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CLUSTER_SWITCH_UI), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0 /* ClusterHome */}}, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CLUSTER_DISPLAY_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, - -1, -1 /* Insets */}}, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CLUSTER_REPORT_STATE), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CLUSTER_REQUEST_DISPLAY), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = toInt(VehicleProperty::CLUSTER_NAVIGATION_STATE), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = PLACEHOLDER_PROPERTY_INT, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}, - }, - { - .config = - { - .prop = PLACEHOLDER_PROPERTY_FLOAT, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.floatValues = {0.0f}}, - }, - { - .config = - { - .prop = PLACEHOLDER_PROPERTY_BOOLEAN, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0 /* false */}}, - }, - { - .config = - { - .prop = PLACEHOLDER_PROPERTY_STRING, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.stringValue = {"Test"}}, - }, - { - .config = - { - .prop = ECHO_REVERSE_BYTES, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, -#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING - // Vendor propetry for E2E ClusterHomeService testing. - { - .config = - { - .prop = VENDOR_CLUSTER_SWITCH_UI, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = VENDOR_CLUSTER_DISPLAY_STATE, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, - { - .config = - { - .prop = VENDOR_CLUSTER_REPORT_STATE, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, - }, - .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, - -1, -1 /* Insets */, 0 /* ClusterHome */, - -1 /* ClusterNone */}}, - }, - { - .config = - { - .prop = VENDOR_CLUSTER_REQUEST_DISPLAY, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0 /* ClusterHome */}}, - }, - { - .config = - { - .prop = VENDOR_CLUSTER_NAVIGATION_STATE, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, -#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING -}; - -} // namespace defaultconfig_impl - -// public namespace -namespace defaultconfig { - -typedef defaultconfig_impl::ConfigDeclaration ConfigDeclaration; - -inline constexpr const std::vector& getDefaultConfigs() { - return defaultconfig_impl::kVehicleProperties; -} - -} // namespace defaultconfig - -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - -#endif // android_hardware_automotive_vehicle_aidl_impl_default_config_include_DefaultConfig_H_ diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp index 771472c8c1..8702eae053 100644 --- a/automotive/vehicle/aidl/impl/default_config/test/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp @@ -24,11 +24,47 @@ cc_test { defaults: ["VehicleHalDefaults"], srcs: ["*.cpp"], static_libs: [ + "VehicleHalJsonConfigLoader", "VehicleHalUtils", + "libgmock", "libgtest", ], header_libs: [ - "VehicleHalDefaultConfig", + "IVehicleGeneratedHeaders", + ], + shared_libs: [ + "libjsoncpp", + ], + data: [ + ":VehicleHalDefaultProperties_JSON", + ], + test_suites: ["device-tests"], +} + +cc_test { + name: "VehicleHalDefaultConfigTestEnableTestProperties", + vendor: true, + defaults: ["VehicleHalDefaults"], + srcs: ["*.cpp"], + static_libs: [ + "VehicleHalJsonConfigLoaderEnableTestProperties", + "VehicleHalUtils", + "libgmock", + "libgtest", + ], + cflags: [ + "-DENABLE_VEHICLE_HAL_TEST_PROPERTIES", + ], + header_libs: [ + "IVehicleGeneratedHeaders", + ], + shared_libs: [ + "libjsoncpp", + ], + data: [ + ":VehicleHalDefaultProperties_JSON", + ":VehicleHalTestProperties_JSON", + ":VehicleHalVendorClusterTestProperties_JSON", ], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp index baaae75108..95fecfe2d9 100644 --- a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp +++ b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp @@ -14,27 +14,75 @@ * limitations under the License. */ -#include +#include #include +#include +#include #include +#include +#include namespace android { namespace hardware { namespace automotive { namespace vehicle { -namespace defaultconfig { namespace test { -TEST(DefaultConfigTest, loadDefaultConfigs) { - for (ConfigDeclaration config : getDefaultConfigs()) { - ASSERT_NE(0, config.config.prop); - } +using ::android::base::Error; +using ::android::base::Result; +using ::testing::UnorderedElementsAreArray; + +constexpr char kDefaultPropertiesConfigFile[] = "DefaultProperties.json"; + +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES +constexpr char kTestPropertiesConfigFile[] = "TestProperties.json"; +constexpr char kVendorClusterTestPropertiesConfigFile[] = "VendorClusterTestProperties.json"; +#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES + +std::string getTestFilePath(const char* filename) { + static std::string baseDir = android::base::GetExecutableDirectory(); + return baseDir + "/" + filename; } +Result> loadConfig(JsonConfigLoader& loader, + const char* path) { + std::string configPath = getTestFilePath(path); + std::ifstream ifs(configPath.c_str()); + if (!ifs) { + return Error() << "couldn't open %s for parsing." << configPath; + } + + return loader.loadPropConfig(ifs); +} + +TEST(DefaultConfigTest, TestloadDefaultProperties) { + JsonConfigLoader loader; + auto result = loadConfig(loader, kDefaultPropertiesConfigFile); + + ASSERT_TRUE(result.ok()) << result.error().message(); +} + +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES + +TEST(DefaultConfigTest, TestloadTestProperties) { + JsonConfigLoader loader; + auto result = loadConfig(loader, kTestPropertiesConfigFile); + + ASSERT_TRUE(result.ok()) << result.error().message(); +} + +TEST(DefaultConfigTest, TestloadVendorClusterTestProperties) { + JsonConfigLoader loader; + auto result = loadConfig(loader, kVendorClusterTestPropertiesConfigFile); + + ASSERT_TRUE(result.ok()) << result.error().message(); +} + +#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES + } // namespace test -} // namespace defaultconfig } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h index 9f112ae794..f96b6ecbd4 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h @@ -54,8 +54,8 @@ class GeneratorHub { void registerGenerator(int32_t generatorId, std::unique_ptr generator); // Unregister a generator with the generatorId. If no registered generator is found, this - // function does nothing. - void unregisterGenerator(int32_t generatorId); + // function does nothing. Returns true if the generator is unregistered. + bool unregisterGenerator(int32_t generatorId); private: struct VhalEvent { diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h index d421ac525d..42b1bd3c6c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h @@ -45,6 +45,9 @@ class JsonFakeValueGenerator : public FakeValueGenerator { // Create a new JSON fake value generator using the specified JSON file path. All the events // in the JSON file would be generated once. explicit JsonFakeValueGenerator(const std::string& path); + // Create a new JSON fake value generator using the JSON content. The first argument is just + // used to differentiate this function with the one that takes path as input. + explicit JsonFakeValueGenerator(bool unused, const std::string& content, int32_t iteration); ~JsonFakeValueGenerator() = default; @@ -53,6 +56,9 @@ class JsonFakeValueGenerator : public FakeValueGenerator { const std::vector& getAllEvents(); + // Whether there are events left to replay for this generator. + bool hasNext(); + private: size_t mEventIndex = 0; std::vector mEvents; @@ -60,7 +66,8 @@ class JsonFakeValueGenerator : public FakeValueGenerator { int32_t mNumOfIterations = 0; void setBit(std::vector& bytes, size_t idx); - void init(const std::string& path, int32_t iteration); + void initWithPath(const std::string& path, int32_t iteration); + void initWithStream(std::istream& is, int32_t iteration); }; } // namespace fake diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/GeneratorHub.cpp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/GeneratorHub.cpp index 0c182d9c2b..d815456a56 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/GeneratorHub.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/GeneratorHub.cpp @@ -29,11 +29,18 @@ namespace fake { using ::android::base::ScopedLockAssertion; -GeneratorHub::GeneratorHub(OnHalEvent&& onHalEvent) - : mOnHalEvent(onHalEvent), mThread(&GeneratorHub::run, this) {} +GeneratorHub::GeneratorHub(OnHalEvent&& onHalEvent) : mOnHalEvent(onHalEvent) { + mThread = std::thread(&GeneratorHub::run, this); +} GeneratorHub::~GeneratorHub() { - mShuttingDownFlag.store(true); + { + // Even if the shared variable is atomic, it must be modified under the + // mutex in order to correctly publish the modification to the waiting + // thread. + std::unique_lock lock(mGeneratorsLock); + mShuttingDownFlag.store(true); + } mCond.notify_all(); if (mThread.joinable()) { mThread.join(); @@ -58,13 +65,15 @@ void GeneratorHub::registerGenerator(int32_t id, std::unique_ptr lockGuard(mGeneratorsLock); - mGenerators.erase(id); + removed = mGenerators.erase(id); } mCond.notify_one(); ALOGI("%s: Unregistered generator, id: %d", __func__, id); + return removed; } void GeneratorHub::run() { diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp index d4d52a5849..cb42317195 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp @@ -173,12 +173,11 @@ std::vector parseFakeValueJson(std::istream& is) { } // namespace -JsonFakeValueGenerator::JsonFakeValueGenerator(const std::string& path) { - init(path, 1); -} +JsonFakeValueGenerator::JsonFakeValueGenerator(const std::string& path) + : JsonFakeValueGenerator(path, /*iteration=*/1) {} JsonFakeValueGenerator::JsonFakeValueGenerator(const std::string& path, int32_t iteration) { - init(path, iteration); + initWithPath(path, iteration); } JsonFakeValueGenerator::JsonFakeValueGenerator(const VehiclePropValue& request) { @@ -186,16 +185,26 @@ JsonFakeValueGenerator::JsonFakeValueGenerator(const VehiclePropValue& request) // Iterate infinitely if iteration number is not provided int32_t numOfIterations = v.int32Values.size() < 2 ? -1 : v.int32Values[1]; - init(v.stringValue, numOfIterations); + initWithPath(v.stringValue, numOfIterations); } -void JsonFakeValueGenerator::init(const std::string& path, int32_t iteration) { +JsonFakeValueGenerator::JsonFakeValueGenerator([[maybe_unused]] bool unused, + const std::string& content, int32_t iteration) { + std::istringstream iss(content); + initWithStream(iss, iteration); +} + +void JsonFakeValueGenerator::initWithPath(const std::string& path, int32_t iteration) { std::ifstream ifs(path); if (!ifs) { ALOGE("%s: couldn't open %s for parsing.", __func__, path.c_str()); return; } - mEvents = parseFakeValueJson(ifs); + initWithStream(ifs, iteration); +} + +void JsonFakeValueGenerator::initWithStream(std::istream& is, int32_t iteration) { + mEvents = parseFakeValueJson(is); mNumOfIterations = iteration; } @@ -235,12 +244,15 @@ std::optional JsonFakeValueGenerator::nextEvent() { mNumOfIterations--; } } - generatedValue.timestamp = mLastEventTimestamp; return generatedValue; } +bool JsonFakeValueGenerator::hasNext() { + return mNumOfIterations != 0 && mEvents.size() > 0; +} + } // namespace fake } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/fake_impl/README.md b/automotive/vehicle/aidl/impl/fake_impl/README.md new file mode 100644 index 0000000000..e86dceeb9a --- /dev/null +++ b/automotive/vehicle/aidl/impl/fake_impl/README.md @@ -0,0 +1,28 @@ +# Fake reference AIDL VHAL implementation libraries +--- + +This directory stores libraries for implementing a fake reference AIDL VHAL. + +WARNING: All the libraries here are for TEST ONLY. + +## GeneratorHub + +Defines a library `FakeVehicleHalValueGenerators` that could generate fake +vehicle property values for testing. + +## hardware + +Defines a fake implementation for device-specifc interface `IVehicleHardware`: +`FakeVehicleHardware`. This implementation uses a in-memory map for storing +property values and does not communicate with or depending on any specific +vehicle bus. + +## obd2frame + +Defines a library `FakeObd2Frame` that generates fake OBD2 frame for OBD2 +properties. + +## userhal + +Defines a library `FakeUserHal` that emulates a real User HAL behavior by +parsing debug commands. diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp index dcd9208cab..4c17cded42 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp @@ -24,6 +24,7 @@ cc_library { srcs: ["src/*.cpp"], local_include_dirs: ["include"], export_include_dirs: ["include"], + cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"], defaults: [ "VehicleHalDefaults", "FakeVehicleHardwareDefaults", @@ -32,18 +33,23 @@ cc_library { cc_defaults { name: "FakeVehicleHardwareDefaults", - cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"], header_libs: [ "IVehicleHardware", - "VehicleHalDefaultConfig", + "VehicleHalTestUtilHeaders", ], export_header_lib_headers: ["IVehicleHardware"], static_libs: [ + "VehicleHalJsonConfigLoaderEnableTestProperties", "VehicleHalUtils", "FakeVehicleHalValueGenerators", "FakeObd2Frame", "FakeUserHal", ], + required: [ + "Prebuilt_VehicleHalDefaultProperties_JSON", + "Prebuilt_VehicleHalTestProperties_JSON", + "Prebuilt_VehicleHalVendorClusterTestProperties_JSON", + ], shared_libs: [ "libjsoncpp", ], diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 34b2b2454f..c3ebd3b3bc 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -18,21 +18,24 @@ #define android_hardware_automotive_vehicle_aidl_impl_fake_impl_hardware_include_FakeVehicleHardware_H_ #include -#include +#include #include #include +#include #include +#include #include #include #include +#include #include #include #include #include -#include #include #include +#include #include namespace android { @@ -47,7 +50,8 @@ class FakeVehicleHardware : public IVehicleHardware { FakeVehicleHardware(); - explicit FakeVehicleHardware(std::unique_ptr valuePool); + FakeVehicleHardware(std::string defaultConfigDir, std::string overrideConfigDir, + bool forceOverride); ~FakeVehicleHardware(); @@ -132,11 +136,18 @@ class FakeVehicleHardware : public IVehicleHardware { const std::unique_ptr mFakeUserHal; // RecurrentTimer is thread-safe. std::unique_ptr mRecurrentTimer; + // GeneratorHub is thread-safe. + std::unique_ptr mGeneratorHub; + + // Only allowed to set once. + std::unique_ptr mOnPropertyChangeCallback; + std::unique_ptr mOnPropertySetErrorCallback; + std::mutex mLock; - std::unique_ptr mOnPropertyChangeCallback GUARDED_BY(mLock); - std::unique_ptr mOnPropertySetErrorCallback GUARDED_BY(mLock); std::unordered_map, PropIdAreaIdHash> mRecurrentActions GUARDED_BY(mLock); + std::unordered_map + mSavedProps GUARDED_BY(mLock); // PendingRequestHandler is thread-safe. mutable PendingRequestHandler @@ -145,18 +156,36 @@ class FakeVehicleHardware : public IVehicleHardware { aidl::android::hardware::automotive::vehicle::SetValueRequest> mPendingSetValueRequests; + const std::string mDefaultConfigDir; + const std::string mOverrideConfigDir; + const bool mForceOverride; + bool mAddExtraTestVendorConfigs; + + // Only used during initialization. + JsonConfigLoader mLoader; + void init(); // Stores the initial value to property store. - void storePropInitialValue(const defaultconfig::ConfigDeclaration& config); + void storePropInitialValue(const ConfigDeclaration& config); // The callback that would be called when a vehicle property value change happens. void onValueChangeCallback( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); - // If property "persist.vendor.vhal_init_value_override" is set to true, override the properties - // using config files in 'overrideDir'. - void maybeOverrideProperties(const char* overrideDir); - // Override the properties using config files in 'overrideDir'. - void overrideProperties(const char* overrideDir); + // Load the config files in format '*.json' from the directory and parse the config files + // into a map from property ID to ConfigDeclarations. + void loadPropConfigsFromDir(const std::string& dirPath, + std::unordered_map* configs); + // Function to be called when a value change event comes from vehicle bus. In our fake + // implementation, this function is only called during "--inject-event" dump command. + void eventFromVehicleBus( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + int getHvacTempNumIncrements(int requestedTemp, int minTemp, int maxTemp, int increment); + void updateHvacTemperatureValueSuggestionInput( + const std::vector& hvacTemperatureSetConfigArray, + std::vector* hvacTemperatureValueSuggestionInput); + VhalResult setHvacTemperatureValueSuggestion( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& + hvacTemperatureValueSuggestion); VhalResult maybeSetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue); @@ -167,13 +196,18 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); VehiclePropValuePool::RecyclableType createApPowerStateReq( aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state); + VehiclePropValuePool::RecyclableType createAdasStateReq(int32_t propertyId, int32_t areaId, + int32_t state); VhalResult setUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); ValueResultType getUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; ValueResultType getEchoReverseBytes( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - bool isHvacPropAndHvacNotAvailable(int32_t propId); + bool isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const; + VhalResult isAdasPropertyAvailable(int32_t adasStatePropertyId) const; + + std::unordered_map loadConfigDeclarations(); std::string dumpAllProperties(); std::string dumpOnePropertyByConfig( @@ -184,6 +218,10 @@ class FakeVehicleHardware : public IVehicleHardware { std::string dumpListProperties(); std::string dumpSpecificProperty(const std::vector& options); std::string dumpSetProperties(const std::vector& options); + std::string dumpGetPropertyWithArg(const std::vector& options); + std::string dumpSaveProperty(const std::vector& options); + std::string dumpRestoreProperty(const std::vector& options); + std::string dumpInjectEvent(const std::vector& options); template android::base::Result safelyParseInt(int index, const std::string& s) { @@ -198,7 +236,7 @@ class FakeVehicleHardware : public IVehicleHardware { std::vector getOptionValues(const std::vector& options, size_t* index); android::base::Result - parseSetPropOptions(const std::vector& options); + parsePropOptions(const std::vector& options); android::base::Result> parseHexString(const std::string& s); android::base::Result checkArgumentsSize(const std::vector& options, @@ -207,6 +245,26 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::GetValueRequest& request); aidl::android::hardware::automotive::vehicle::SetValueResult handleSetValueRequest( const aidl::android::hardware::automotive::vehicle::SetValueRequest& request); + + std::string genFakeDataCommand(const std::vector& options); + void sendHvacPropertiesCurrentValues(int32_t areaId); + void sendAdasPropertiesState(int32_t propertyId, int32_t state); + void generateVendorConfigs( + std::vector&) const; + + static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp( + aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action, + int32_t keyCode, int32_t targetDisplay); + static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwKeyInputV2Prop( + int32_t area, int32_t targetDisplay, int32_t keyCode, int32_t action, + int32_t repeatCount); + static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwMotionInputProp( + int32_t area, int32_t display, int32_t inputType, int32_t action, int32_t buttonState, + int32_t pointerCount, int32_t pointerId[], int32_t toolType[], float xData[], + float yData[], float pressure[], float size[]); + + static std::string genFakeDataHelp(); + static std::string parseErrMsg(std::string fieldName, std::string value, std::string type); }; } // namespace fake diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 20c34aa12e..3f5e4c4273 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -15,24 +15,29 @@ */ #define LOG_TAG "FakeVehicleHardware" +#define ATRACE_TAG ATRACE_TAG_HAL #define FAKE_VEHICLEHARDWARE_DEBUG false // STOPSHIP if true. #include "FakeVehicleHardware.h" -#include #include #include +#include #include #include #include #include + +#include #include #include #include #include #include +#include #include +#include #include #include #include @@ -47,6 +52,7 @@ namespace fake { namespace { +using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; @@ -55,24 +61,50 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; +using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; using ::android::base::EqualsIgnoreCase; using ::android::base::Error; +using ::android::base::GetIntProperty; using ::android::base::ParseFloat; using ::android::base::Result; using ::android::base::ScopedLockAssertion; using ::android::base::StartsWith; using ::android::base::StringPrintf; -const char* VENDOR_OVERRIDE_DIR = "/vendor/etc/automotive/vhaloverride/"; -const char* OVERRIDE_PROPERTY = "persist.vendor.vhal_init_value_override"; - +// In order to test large number of vehicle property configs, we might generate additional fake +// property config start from this ID. These fake properties are for getPropertyList, +// getPropertiesAsync, and setPropertiesAsync. +// 0x21403000 +constexpr int32_t STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST = + 0x3000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | + toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | + toInt(testpropertyutils_impl::VehiclePropertyType::INT32); +// 0x21405000 +constexpr int32_t ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST = + 0x5000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | + toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | + toInt(testpropertyutils_impl::VehiclePropertyType::INT32); +// The directory for default property configuration file. +// For config file format, see impl/default_config/config/README.md. +constexpr char DEFAULT_CONFIG_DIR[] = "/vendor/etc/automotive/vhalconfig/"; +// The directory for property configuration file that overrides the default configuration file. +// For config file format, see impl/default_config/config/README.md. +constexpr char OVERRIDE_CONFIG_DIR[] = "/vendor/etc/automotive/vhaloverride/"; +// If OVERRIDE_PROPERTY is set, we will use the configuration files from OVERRIDE_CONFIG_DIR to +// overwrite the default configs. +constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override"; +constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config"; +// The value to be returned if VENDOR_PROPERTY_ID is set as the property +constexpr int VENDOR_ERROR_CODE = 0x00ab0005; // A list of supported options for "--set" command. const std::unordered_set SET_PROP_OPTIONS = { // integer. @@ -86,11 +118,81 @@ const std::unordered_set SET_PROP_OPTIONS = { // bytes in hex format, e.g. 0xDEADBEEF. "-b", // Area id in integer. - "-a"}; + "-a", + // Timestamp in int64. + "-t"}; +// ADAS _ENABLED property to list of ADAS state properties using ErrorState enum. +const std::unordered_map> mAdasEnabledPropToAdasPropWithErrorState = { + // AEB + { + toInt(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED), + { + toInt(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE), + }, + }, + // FCW + { + toInt(VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED), + { + toInt(VehicleProperty::FORWARD_COLLISION_WARNING_STATE), + }, + }, + // BSW + { + toInt(VehicleProperty::BLIND_SPOT_WARNING_ENABLED), + { + toInt(VehicleProperty::BLIND_SPOT_WARNING_STATE), + }, + }, + // LDW + { + toInt(VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED), + { + toInt(VehicleProperty::LANE_DEPARTURE_WARNING_STATE), + }, + }, + // LKA + { + toInt(VehicleProperty::LANE_KEEP_ASSIST_ENABLED), + { + toInt(VehicleProperty::LANE_KEEP_ASSIST_STATE), + }, + }, + // LCA + { + toInt(VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + { + toInt(VehicleProperty::LANE_CENTERING_ASSIST_STATE), + }, + }, + // ELKA + { + toInt(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED), + { + toInt(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE), + }, + }, + // CC + { + toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + { + toInt(VehicleProperty::CRUISE_CONTROL_TYPE), + toInt(VehicleProperty::CRUISE_CONTROL_STATE), + }, + }, + // HOD + { + toInt(VehicleProperty::HANDS_ON_DETECTION_ENABLED), + { + toInt(VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE), + toInt(VehicleProperty::HANDS_ON_DETECTION_WARNING), + }, + }, +}; } // namespace -void FakeVehicleHardware::storePropInitialValue(const defaultconfig::ConfigDeclaration& config) { +void FakeVehicleHardware::storePropInitialValue(const ConfigDeclaration& config) { const VehiclePropConfig& vehiclePropConfig = config.config; int propId = vehiclePropConfig.prop; @@ -132,30 +234,50 @@ void FakeVehicleHardware::storePropInitialValue(const defaultconfig::ConfigDecla } FakeVehicleHardware::FakeVehicleHardware() - : FakeVehicleHardware(std::make_unique()) {} + : FakeVehicleHardware(DEFAULT_CONFIG_DIR, OVERRIDE_CONFIG_DIR, false) {} -FakeVehicleHardware::FakeVehicleHardware(std::unique_ptr valuePool) - : mValuePool(std::move(valuePool)), +FakeVehicleHardware::FakeVehicleHardware(std::string defaultConfigDir, + std::string overrideConfigDir, bool forceOverride) + : mValuePool(std::make_unique()), mServerSidePropStore(new VehiclePropertyStore(mValuePool)), mFakeObd2Frame(new obd2frame::FakeObd2Frame(mServerSidePropStore)), mFakeUserHal(new FakeUserHal(mValuePool)), mRecurrentTimer(new RecurrentTimer()), + mGeneratorHub(new GeneratorHub( + [this](const VehiclePropValue& value) { eventFromVehicleBus(value); })), mPendingGetValueRequests(this), - mPendingSetValueRequests(this) { + mPendingSetValueRequests(this), + mDefaultConfigDir(defaultConfigDir), + mOverrideConfigDir(overrideConfigDir), + mForceOverride(forceOverride) { init(); } FakeVehicleHardware::~FakeVehicleHardware() { mPendingGetValueRequests.stop(); mPendingSetValueRequests.stop(); + mGeneratorHub.reset(); +} + +std::unordered_map FakeVehicleHardware::loadConfigDeclarations() { + std::unordered_map configsByPropId; + loadPropConfigsFromDir(mDefaultConfigDir, &configsByPropId); + if (mForceOverride || + android::base::GetBoolProperty(OVERRIDE_PROPERTY, /*default_value=*/false)) { + loadPropConfigsFromDir(mOverrideConfigDir, &configsByPropId); + } + return configsByPropId; } void FakeVehicleHardware::init() { - for (auto& it : defaultconfig::getDefaultConfigs()) { - VehiclePropConfig cfg = it.config; + for (auto& [_, configDeclaration] : loadConfigDeclarations()) { + VehiclePropConfig cfg = configDeclaration.config; VehiclePropertyStore::TokenFunction tokenFunction = nullptr; - if (cfg.prop == OBD2_FREEZE_FRAME) { + if (cfg.prop == toInt(VehicleProperty::AP_POWER_STATE_REQ)) { + int config = GetIntProperty(POWER_STATE_REQ_CONFIG_PROPERTY, /*default_value=*/0); + cfg.configArray[0] = config; + } else if (cfg.prop == OBD2_FREEZE_FRAME) { tokenFunction = [](const VehiclePropValue& propValue) { return propValue.timestamp; }; } @@ -165,22 +287,29 @@ void FakeVehicleHardware::init() { // logic. continue; } - storePropInitialValue(it); + storePropInitialValue(configDeclaration); } - maybeOverrideProperties(VENDOR_OVERRIDE_DIR); - // OBD2_LIVE_FRAME and OBD2_FREEZE_FRAME must be configured in default configs. - mFakeObd2Frame->initObd2LiveFrame(*mServerSidePropStore->getConfig(OBD2_LIVE_FRAME).value()); - mFakeObd2Frame->initObd2FreezeFrame( - *mServerSidePropStore->getConfig(OBD2_FREEZE_FRAME).value()); + auto maybeObd2LiveFrame = mServerSidePropStore->getConfig(OBD2_LIVE_FRAME); + if (maybeObd2LiveFrame.has_value()) { + mFakeObd2Frame->initObd2LiveFrame(*maybeObd2LiveFrame.value()); + } + auto maybeObd2FreezeFrame = mServerSidePropStore->getConfig(OBD2_FREEZE_FRAME); + if (maybeObd2FreezeFrame.has_value()) { + mFakeObd2Frame->initObd2FreezeFrame(*maybeObd2FreezeFrame.value()); + } mServerSidePropStore->setOnValueChangeCallback( [this](const VehiclePropValue& value) { return onValueChangeCallback(value); }); } std::vector FakeVehicleHardware::getAllPropertyConfigs() const { - return mServerSidePropStore->getAllConfigs(); + std::vector allConfigs = mServerSidePropStore->getAllConfigs(); + if (mAddExtraTestVendorConfigs) { + generateVendorConfigs(/* outAllConfigs= */ allConfigs); + } + return allConfigs; } VehiclePropValuePool::RecyclableType FakeVehicleHardware::createApPowerStateReq( @@ -196,6 +325,18 @@ VehiclePropValuePool::RecyclableType FakeVehicleHardware::createApPowerStateReq( return req; } +VehiclePropValuePool::RecyclableType FakeVehicleHardware::createAdasStateReq(int32_t propertyId, + int32_t areaId, + int32_t state) { + auto req = mValuePool->obtain(VehiclePropertyType::INT32); + req->prop = propertyId; + req->areaId = areaId; + req->timestamp = elapsedRealtimeNano(); + req->status = VehiclePropertyStatus::AVAILABLE; + req->value.int32Values[0] = state; + return req; +} + VhalResult FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) { auto updatedValue = mValuePool->obtain(value); updatedValue->timestamp = elapsedRealtimeNano(); @@ -257,21 +398,155 @@ VhalResult FakeVehicleHardware::setApPowerStateReport(const VehiclePropVal return {}; } -bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId) { +int FakeVehicleHardware::getHvacTempNumIncrements(int requestedTemp, int minTemp, int maxTemp, + int increment) { + requestedTemp = std::max(requestedTemp, minTemp); + requestedTemp = std::min(requestedTemp, maxTemp); + int numIncrements = (requestedTemp - minTemp) / increment; + return numIncrements; +} + +void FakeVehicleHardware::updateHvacTemperatureValueSuggestionInput( + const std::vector& hvacTemperatureSetConfigArray, + std::vector* hvacTemperatureValueSuggestionInput) { + int minTempInCelsius = hvacTemperatureSetConfigArray[0]; + int maxTempInCelsius = hvacTemperatureSetConfigArray[1]; + int incrementInCelsius = hvacTemperatureSetConfigArray[2]; + + int minTempInFahrenheit = hvacTemperatureSetConfigArray[3]; + int maxTempInFahrenheit = hvacTemperatureSetConfigArray[4]; + int incrementInFahrenheit = hvacTemperatureSetConfigArray[5]; + + // The HVAC_TEMPERATURE_SET config array values are temperature values that have been multiplied + // by 10 and converted to integers. Therefore, requestedTemp must also be multiplied by 10 and + // converted to an integer in order for them to be the same units. + int requestedTemp = static_cast((*hvacTemperatureValueSuggestionInput)[0] * 10.0f); + int numIncrements = + (*hvacTemperatureValueSuggestionInput)[1] == toInt(VehicleUnit::CELSIUS) + ? getHvacTempNumIncrements(requestedTemp, minTempInCelsius, maxTempInCelsius, + incrementInCelsius) + : getHvacTempNumIncrements(requestedTemp, minTempInFahrenheit, + maxTempInFahrenheit, incrementInFahrenheit); + + int suggestedTempInCelsius = minTempInCelsius + incrementInCelsius * numIncrements; + int suggestedTempInFahrenheit = minTempInFahrenheit + incrementInFahrenheit * numIncrements; + // HVAC_TEMPERATURE_VALUE_SUGGESTION specifies the temperature values to be in the original + // floating point form so we divide by 10 and convert to float. + (*hvacTemperatureValueSuggestionInput)[2] = static_cast(suggestedTempInCelsius) / 10.0f; + (*hvacTemperatureValueSuggestionInput)[3] = + static_cast(suggestedTempInFahrenheit) / 10.0f; +} + +VhalResult FakeVehicleHardware::setHvacTemperatureValueSuggestion( + const VehiclePropValue& hvacTemperatureValueSuggestion) { + auto hvacTemperatureSetConfigResult = + mServerSidePropStore->getConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)); + + if (!hvacTemperatureSetConfigResult.ok()) { + return StatusError(getErrorCode(hvacTemperatureSetConfigResult)) << StringPrintf( + "Failed to set HVAC_TEMPERATURE_VALUE_SUGGESTION because" + " HVAC_TEMPERATURE_SET could not be retrieved. Error: %s", + getErrorMsg(hvacTemperatureSetConfigResult).c_str()); + } + + const auto& originalInput = hvacTemperatureValueSuggestion.value.floatValues; + if (originalInput.size() != 4) { + return StatusError(StatusCode::INVALID_ARG) << StringPrintf( + "Failed to set HVAC_TEMPERATURE_VALUE_SUGGESTION because float" + " array value is not size 4."); + } + + bool isTemperatureUnitSpecified = originalInput[1] == toInt(VehicleUnit::CELSIUS) || + originalInput[1] == toInt(VehicleUnit::FAHRENHEIT); + if (!isTemperatureUnitSpecified) { + return StatusError(StatusCode::INVALID_ARG) << StringPrintf( + "Failed to set HVAC_TEMPERATURE_VALUE_SUGGESTION because float" + " value at index 1 is not any of %d or %d, which corresponds to" + " VehicleUnit#CELSIUS and VehicleUnit#FAHRENHEIT respectively.", + toInt(VehicleUnit::CELSIUS), toInt(VehicleUnit::FAHRENHEIT)); + } + + auto updatedValue = mValuePool->obtain(hvacTemperatureValueSuggestion); + const auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfigResult.value()->configArray; + auto& hvacTemperatureValueSuggestionInput = updatedValue->value.floatValues; + + updateHvacTemperatureValueSuggestionInput(hvacTemperatureSetConfigArray, + &hvacTemperatureValueSuggestionInput); + + updatedValue->timestamp = elapsedRealtimeNano(); + auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue), + /* updateStatus = */ true, + VehiclePropertyStore::EventMode::ALWAYS); + if (!writeResult.ok()) { + return StatusError(getErrorCode(writeResult)) + << StringPrintf("failed to write value into property store, error: %s", + getErrorMsg(writeResult).c_str()); + } + + return {}; +} + +bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const { std::unordered_set powerProps(std::begin(HVAC_POWER_PROPERTIES), std::end(HVAC_POWER_PROPERTIES)); if (powerProps.count(propId)) { - auto hvacPowerOnResult = - mServerSidePropStore->readValue(toInt(VehicleProperty::HVAC_POWER_ON), HVAC_ALL); - - if (hvacPowerOnResult.ok() && hvacPowerOnResult.value()->value.int32Values.size() == 1 && - hvacPowerOnResult.value()->value.int32Values[0] == 0) { - return true; + auto hvacPowerOnResults = + mServerSidePropStore->readValuesForProperty(toInt(VehicleProperty::HVAC_POWER_ON)); + if (!hvacPowerOnResults.ok()) { + ALOGW("failed to get HVAC_POWER_ON 0x%x, error: %s", + toInt(VehicleProperty::HVAC_POWER_ON), getErrorMsg(hvacPowerOnResults).c_str()); + return false; + } + auto& hvacPowerOnValues = hvacPowerOnResults.value(); + for (size_t j = 0; j < hvacPowerOnValues.size(); j++) { + auto hvacPowerOnValue = std::move(hvacPowerOnValues[j]); + if ((hvacPowerOnValue->areaId & areaId) == areaId) { + if (hvacPowerOnValue->value.int32Values.size() == 1 && + hvacPowerOnValue->value.int32Values[0] == 0) { + return true; + } + break; + } } } return false; } +VhalResult FakeVehicleHardware::isAdasPropertyAvailable(int32_t adasStatePropertyId) const { + auto adasStateResult = mServerSidePropStore->readValue(adasStatePropertyId); + if (!adasStateResult.ok()) { + ALOGW("Failed to get ADAS ENABLED property 0x%x, error: %s", adasStatePropertyId, + getErrorMsg(adasStateResult).c_str()); + return {}; + } + + if (adasStateResult.value()->value.int32Values.size() == 1 && + adasStateResult.value()->value.int32Values[0] < 0) { + auto errorState = adasStateResult.value()->value.int32Values[0]; + switch (errorState) { + case toInt(ErrorState::NOT_AVAILABLE_DISABLED): + return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) + << "ADAS feature is disabled."; + case toInt(ErrorState::NOT_AVAILABLE_SPEED_LOW): + return StatusError(StatusCode::NOT_AVAILABLE_SPEED_LOW) + << "ADAS feature is disabled because the vehicle speed is too low."; + case toInt(ErrorState::NOT_AVAILABLE_SPEED_HIGH): + return StatusError(StatusCode::NOT_AVAILABLE_SPEED_HIGH) + << "ADAS feature is disabled because the vehicle speed is too high."; + case toInt(ErrorState::NOT_AVAILABLE_POOR_VISIBILITY): + return StatusError(StatusCode::NOT_AVAILABLE_POOR_VISIBILITY) + << "ADAS feature is disabled because the visibility is too poor."; + case toInt(ErrorState::NOT_AVAILABLE_SAFETY): + return StatusError(StatusCode::NOT_AVAILABLE_SAFETY) + << "ADAS feature is disabled because of safety reasons."; + default: + return StatusError(StatusCode::NOT_AVAILABLE) << "ADAS feature is not available."; + } + } + + return {}; +} + VhalResult FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) { auto result = mFakeUserHal->onSetProperty(value); if (!result.ok()) { @@ -282,7 +557,11 @@ VhalResult FakeVehicleHardware::setUserHalProp(const VehiclePropValue& val if (updatedValue != nullptr) { ALOGI("onSetProperty(): updating property returned by HAL: %s", updatedValue->toString().c_str()); - if (auto writeResult = mServerSidePropStore->writeValue(std::move(result.value())); + // Update timestamp otherwise writeValue might fail because the timestamp is outdated. + updatedValue->timestamp = elapsedRealtimeNano(); + if (auto writeResult = mServerSidePropStore->writeValue( + std::move(result.value()), + /*updateStatus=*/true, VehiclePropertyStore::EventMode::ALWAYS); !writeResult.ok()) { return StatusError(getErrorCode(writeResult)) << "failed to write value into property store, error: " @@ -319,11 +598,27 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( int32_t propId = value.prop; ValueResultType result; + if (propId >= STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST && + propId < ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST) { + *isSpecialValue = true; + result = mValuePool->obtainInt32(/* value= */ 5); + + result.value()->prop = propId; + result.value()->areaId = 0; + result.value()->timestamp = elapsedRealtimeNano(); + return result; + } + if (mFakeUserHal->isSupported(propId)) { *isSpecialValue = true; return getUserHalProp(value); } + if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) { + *isSpecialValue = true; + return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available"; + } + switch (propId) { case OBD2_FREEZE_FRAME: *isSpecialValue = true; @@ -342,6 +637,22 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( case ECHO_REVERSE_BYTES: *isSpecialValue = true; return getEchoReverseBytes(value); + case VENDOR_PROPERTY_ID: + *isSpecialValue = true; + return StatusError((StatusCode)VENDOR_ERROR_CODE); + case toInt(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED): + [[fallthrough]]; + case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): + [[fallthrough]]; + case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE): { + auto isAdasPropertyAvailableResult = + isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE)); + if (!isAdasPropertyAvailableResult.ok()) { + *isSpecialValue = true; + return isAdasPropertyAvailableResult.error(); + } + return nullptr; + } default: // Do nothing. break; @@ -366,20 +677,85 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getEchoReverseBytes( return std::move(gotValue); } +void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId) { + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + int powerPropId = HVAC_POWER_PROPERTIES[i]; + auto powerPropResults = mServerSidePropStore->readValuesForProperty(powerPropId); + if (!powerPropResults.ok()) { + ALOGW("failed to get power prop 0x%x, error: %s", powerPropId, + getErrorMsg(powerPropResults).c_str()); + continue; + } + auto& powerPropValues = powerPropResults.value(); + for (size_t j = 0; j < powerPropValues.size(); j++) { + auto powerPropValue = std::move(powerPropValues[j]); + if ((powerPropValue->areaId & areaId) == powerPropValue->areaId) { + powerPropValue->status = VehiclePropertyStatus::AVAILABLE; + powerPropValue->timestamp = elapsedRealtimeNano(); + // This will trigger a property change event for the current hvac property value. + mServerSidePropStore->writeValue(std::move(powerPropValue), /*updateStatus=*/true, + VehiclePropertyStore::EventMode::ALWAYS); + } + } + } +} + +void FakeVehicleHardware::sendAdasPropertiesState(int32_t propertyId, int32_t state) { + auto& adasDependentPropIds = mAdasEnabledPropToAdasPropWithErrorState.find(propertyId)->second; + for (auto dependentPropId : adasDependentPropIds) { + auto dependentPropConfigResult = mServerSidePropStore->getConfig(dependentPropId); + if (!dependentPropConfigResult.ok()) { + ALOGW("Failed to get config for ADAS property 0x%x, error: %s", dependentPropId, + getErrorMsg(dependentPropConfigResult).c_str()); + continue; + } + auto& dependentPropConfig = dependentPropConfigResult.value(); + for (auto& areaConfig : dependentPropConfig->areaConfigs) { + auto propValue = createAdasStateReq(dependentPropId, areaConfig.areaId, state); + // This will trigger a property change event for the current ADAS property value. + mServerSidePropStore->writeValue(std::move(propValue), /*updateStatus=*/true, + VehiclePropertyStore::EventMode::ALWAYS); + } + } +} + VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& value, bool* isSpecialValue) { *isSpecialValue = false; VehiclePropValuePool::RecyclableType updatedValue; int32_t propId = value.prop; + if (propId >= STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST && + propId < ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST) { + *isSpecialValue = true; + return {}; + } + if (mFakeUserHal->isSupported(propId)) { *isSpecialValue = true; return setUserHalProp(value); } - if (isHvacPropAndHvacNotAvailable(propId)) { + if (propId == toInt(VehicleProperty::HVAC_POWER_ON) && value.value.int32Values.size() == 1 && + value.value.int32Values[0] == 1) { + // If we are turning HVAC power on, send current hvac property values through on change + // event. + sendHvacPropertiesCurrentValues(value.areaId); + } + + if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) { *isSpecialValue = true; - return StatusError(StatusCode::NOT_AVAILABLE) << "hvac not available"; + return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available"; + } + + if (mAdasEnabledPropToAdasPropWithErrorState.count(propId) && + value.value.int32Values.size() == 1) { + if (value.value.int32Values[0] == 1) { + // Set default state to 1 when ADAS feature is enabled. + sendAdasPropertiesState(propId, /* state = */ 1); + } else { + sendAdasPropertiesState(propId, toInt(ErrorState::NOT_AVAILABLE_DISABLED)); + } } switch (propId) { @@ -394,8 +770,32 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case OBD2_FREEZE_FRAME_CLEAR: *isSpecialValue = true; return mFakeObd2Frame->clearObd2FreezeFrames(value); + case VENDOR_PROPERTY_ID: + *isSpecialValue = true; + return StatusError((StatusCode)VENDOR_ERROR_CODE); + case toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION): + *isSpecialValue = true; + return setHvacTemperatureValueSuggestion(value); + case toInt(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND): { + auto isAdasPropertyAvailableResult = + isAdasPropertyAvailable(toInt(VehicleProperty::LANE_CENTERING_ASSIST_STATE)); + if (!isAdasPropertyAvailableResult.ok()) { + *isSpecialValue = true; + } + return isAdasPropertyAvailableResult; + } + case toInt(VehicleProperty::CRUISE_CONTROL_COMMAND): + [[fallthrough]]; + case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): { + auto isAdasPropertyAvailableResult = + isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE)); + if (!isAdasPropertyAvailableResult.ok()) { + *isSpecialValue = true; + } + return isAdasPropertyAvailableResult; + } -#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES case toInt(VehicleProperty::CLUSTER_REPORT_STATE): [[fallthrough]]; case toInt(VehicleProperty::CLUSTER_REQUEST_DISPLAY): @@ -423,7 +823,7 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu << getErrorMsg(writeResult); } return {}; -#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING +#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES default: break; @@ -454,7 +854,6 @@ VhalResult FakeVehicleHardware::setValue(const VehiclePropValue& value) { // Here we are just updating mValuePool. bool isSpecialValue = false; auto setSpecialValueResult = maybeSetSpecialValue(value, &isSpecialValue); - if (isSpecialValue) { if (!setSpecialValueResult.ok()) { return StatusError(getErrorCode(setSpecialValueResult)) @@ -574,34 +973,447 @@ DumpResult FakeVehicleHardware::dump(const std::vector& options) { result.buffer = dumpListProperties(); } else if (EqualsIgnoreCase(option, "--get")) { result.buffer = dumpSpecificProperty(options); + } else if (EqualsIgnoreCase(option, "--getWithArg")) { + result.buffer = dumpGetPropertyWithArg(options); } else if (EqualsIgnoreCase(option, "--set")) { result.buffer = dumpSetProperties(options); + } else if (EqualsIgnoreCase(option, "--save-prop")) { + result.buffer = dumpSaveProperty(options); + } else if (EqualsIgnoreCase(option, "--restore-prop")) { + result.buffer = dumpRestoreProperty(options); + } else if (EqualsIgnoreCase(option, "--inject-event")) { + result.buffer = dumpInjectEvent(options); } else if (EqualsIgnoreCase(option, kUserHalDumpOption)) { - if (options.size() == 1) { - result.buffer = mFakeUserHal->showDumpHelp(); - } else { - result.buffer = mFakeUserHal->dump(options[1]); - } + result.buffer = mFakeUserHal->dump(); + } else if (EqualsIgnoreCase(option, "--genfakedata")) { + result.buffer = genFakeDataCommand(options); + } else if (EqualsIgnoreCase(option, "--genTestVendorConfigs")) { + mAddExtraTestVendorConfigs = true; + result.refreshPropertyConfigs = true; + } else if (EqualsIgnoreCase(option, "--restoreVendorConfigs")) { + mAddExtraTestVendorConfigs = false; + result.refreshPropertyConfigs = true; } else { result.buffer = StringPrintf("Invalid option: %s\n", option.c_str()); } return result; } +std::string FakeVehicleHardware::genFakeDataHelp() { + return R"( +Generate Fake Data Usage: +--genfakedata --startlinear [propID] [mValue] [cValue] [dispersion] [increment] [interval]: " +Start a linear generator that generates event with floatValue within range: +[mValue - disperson, mValue + dispersion]. +propID(int32): ID for the property to generate event for. +mValue(float): The middle of the possible values for the property. +cValue(float): The start value for the property, must be within the range. +dispersion(float): The range the value can change. +increment(float): The step the value would increase by for each generated event, +if exceed the range, the value would loop back. +interval(int64): The interval in nanoseconds the event would generate by. + +--genfakedata --stoplinear [propID(int32)]: Stop a linear generator + +--genfakedata --startjson --path [jsonFilePath] [repetition]: +Start a JSON generator that would generate events according to a JSON file. +jsonFilePath(string): The path to a JSON file. The JSON content must be in the format of +[{ + "timestamp": 1000000, + "areaId": 0, + "value": 8, + "prop": 289408000 +}, {...}] +Each event in the JSON file would be generated by the same interval their timestamp is relative to +the first event's timestamp. +repetition(int32, optional): how many iterations the events would be generated. If it is not +provided, it would iterate indefinitely. + +--genfakedata --startjson --content [jsonContent]: Start a JSON generator using the content. + +--genfakedata --stopjson [generatorID(string)]: Stop a JSON generator. + +--genfakedata --keypress [keyCode(int32)] [display[int32]]: Generate key press. + +--genfakedata --keyinputv2 [area(int32)] [display(int32)] [keyCode[int32]] [action[int32]] + [repeatCount(int32)] + +--genfakedata --motioninput [area(int32)] [display(int32)] [inputType[int32]] [action[int32]] + [buttonState(int32)] --pointer [pointerId(int32)] [toolType(int32)] [xData(float)] [yData(float)] + [pressure(float)] [size(float)] + Generate a motion input event. --pointer option can be specified multiple times. + +--genTestVendorConfigs: Generates fake VehiclePropConfig ranging from 0x5000 to 0x8000 all with + vendor property group, global vehicle area, and int32 vehicle property type. This is mainly used + for testing + +--restoreVendorConfigs: Restores to to the default state if genTestVendorConfigs was used. + Otherwise this will do nothing. + +)"; +} + +std::string FakeVehicleHardware::parseErrMsg(std::string fieldName, std::string value, + std::string type) { + return StringPrintf("failed to parse %s as %s: \"%s\"\n%s", fieldName.c_str(), type.c_str(), + value.c_str(), genFakeDataHelp().c_str()); +} + +void FakeVehicleHardware::generateVendorConfigs( + std::vector& outAllConfigs) const { + for (int i = STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST; + i < ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST; i++) { + VehiclePropConfig config; + config.prop = i; + config.access = VehiclePropertyAccess::READ_WRITE; + outAllConfigs.push_back(config); + } +} + +std::string FakeVehicleHardware::genFakeDataCommand(const std::vector& options) { + if (options.size() < 2) { + return "No subcommand specified for genfakedata\n" + genFakeDataHelp(); + } + + std::string command = options[1]; + if (command == "--startlinear") { + // --genfakedata --startlinear [propID(int32)] [middleValue(float)] + // [currentValue(float)] [dispersion(float)] [increment(float)] [interval(int64)] + if (options.size() != 8) { + return "incorrect argument count, need 8 arguments for --genfakedata --startlinear\n" + + genFakeDataHelp(); + } + int32_t propId; + float middleValue; + float currentValue; + float dispersion; + float increment; + int64_t interval; + if (!android::base::ParseInt(options[2], &propId)) { + return parseErrMsg("propId", options[2], "int"); + } + if (!android::base::ParseFloat(options[3], &middleValue)) { + return parseErrMsg("middleValue", options[3], "float"); + } + if (!android::base::ParseFloat(options[4], ¤tValue)) { + return parseErrMsg("currentValue", options[4], "float"); + } + if (!android::base::ParseFloat(options[5], &dispersion)) { + return parseErrMsg("dispersion", options[5], "float"); + } + if (!android::base::ParseFloat(options[6], &increment)) { + return parseErrMsg("increment", options[6], "float"); + } + if (!android::base::ParseInt(options[7], &interval)) { + return parseErrMsg("interval", options[7], "int"); + } + auto generator = std::make_unique( + propId, middleValue, currentValue, dispersion, increment, interval); + mGeneratorHub->registerGenerator(propId, std::move(generator)); + return "Linear event generator started successfully"; + } else if (command == "--stoplinear") { + // --genfakedata --stoplinear [propID(int32)] + if (options.size() != 3) { + return "incorrect argument count, need 3 arguments for --genfakedata --stoplinear\n" + + genFakeDataHelp(); + } + int32_t propId; + if (!android::base::ParseInt(options[2], &propId)) { + return parseErrMsg("propId", options[2], "int"); + } + if (mGeneratorHub->unregisterGenerator(propId)) { + return "Linear event generator stopped successfully"; + } + return StringPrintf("No linear event generator found for property: %d", propId); + } else if (command == "--startjson") { + // --genfakedata --startjson --path path repetition + // or + // --genfakedata --startjson --content content repetition. + if (options.size() != 4 && options.size() != 5) { + return "incorrect argument count, need 4 or 5 arguments for --genfakedata " + "--startjson\n"; + } + // Iterate infinitely if repetition number is not provided + int32_t repetition = -1; + if (options.size() == 5) { + if (!android::base::ParseInt(options[4], &repetition)) { + return parseErrMsg("repetition", options[4], "int"); + } + } + std::unique_ptr generator; + if (options[2] == "--path") { + const std::string& fileName = options[3]; + generator = std::make_unique(fileName, repetition); + if (!generator->hasNext()) { + return "invalid JSON file, no events"; + } + } else if (options[2] == "--content") { + const std::string& content = options[3]; + generator = + std::make_unique(/*unused=*/true, content, repetition); + if (!generator->hasNext()) { + return "invalid JSON content, no events"; + } + } + int32_t cookie = std::hash()(options[3]); + mGeneratorHub->registerGenerator(cookie, std::move(generator)); + return StringPrintf("JSON event generator started successfully, ID: %" PRId32, cookie); + } else if (command == "--stopjson") { + // --genfakedata --stopjson [generatorID(string)] + if (options.size() != 3) { + return "incorrect argument count, need 3 arguments for --genfakedata --stopjson\n"; + } + int32_t cookie; + if (!android::base::ParseInt(options[2], &cookie)) { + return parseErrMsg("cookie", options[2], "int"); + } + if (mGeneratorHub->unregisterGenerator(cookie)) { + return "JSON event generator stopped successfully"; + } else { + return StringPrintf("No JSON event generator found for ID: %s", options[2].c_str()); + } + } else if (command == "--keypress") { + int32_t keyCode; + int32_t display; + // --genfakedata --keypress [keyCode(int32)] [display[int32]] + if (options.size() != 4) { + return "incorrect argument count, need 4 arguments for --genfakedata --keypress\n"; + } + if (!android::base::ParseInt(options[2], &keyCode)) { + return parseErrMsg("keyCode", options[2], "int"); + } + if (!android::base::ParseInt(options[3], &display)) { + return parseErrMsg("display", options[3], "int"); + } + // Send back to HAL + onValueChangeCallback( + createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_DOWN, keyCode, display)); + onValueChangeCallback( + createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_UP, keyCode, display)); + return "keypress event generated successfully"; + } else if (command == "--keyinputv2") { + int32_t area; + int32_t display; + int32_t keyCode; + int32_t action; + int32_t repeatCount; + // --genfakedata --keyinputv2 [area(int32)] [display(int32)] [keyCode[int32]] + // [action[int32]] [repeatCount(int32)] + if (options.size() != 7) { + return "incorrect argument count, need 7 arguments for --genfakedata --keyinputv2\n"; + } + if (!android::base::ParseInt(options[2], &area)) { + return parseErrMsg("area", options[2], "int"); + } + if (!android::base::ParseInt(options[3], &display)) { + return parseErrMsg("display", options[3], "int"); + } + if (!android::base::ParseInt(options[4], &keyCode)) { + return parseErrMsg("keyCode", options[4], "int"); + } + if (!android::base::ParseInt(options[5], &action)) { + return parseErrMsg("action", options[5], "int"); + } + if (!android::base::ParseInt(options[6], &repeatCount)) { + return parseErrMsg("repeatCount", options[6], "int"); + } + // Send back to HAL + onValueChangeCallback(createHwKeyInputV2Prop(area, display, keyCode, action, repeatCount)); + return StringPrintf( + "keyinputv2 event generated successfully with area:%d, display:%d," + " keyCode:%d, action:%d, repeatCount:%d", + area, display, keyCode, action, repeatCount); + + } else if (command == "--motioninput") { + int32_t area; + int32_t display; + int32_t inputType; + int32_t action; + int32_t buttonState; + int32_t pointerCount; + + // --genfakedata --motioninput [area(int32)] [display(int32)] [inputType[int32]] + // [action[int32]] [buttonState(int32)] [pointerCount(int32)] + // --pointer [pointerId(int32)] [toolType(int32)] [xData(float)] [yData(float)] + // [pressure(float)] [size(float)] + int optionsSize = (int)options.size(); + if (optionsSize / 7 < 2) { + return "incorrect argument count, need at least 14 arguments for --genfakedata " + "--motioninput including at least 1 --pointer\n"; + } + + if (optionsSize % 7 != 0) { + return "incorrect argument count, need 6 arguments for every --pointer\n"; + } + pointerCount = (int)optionsSize / 7 - 1; + + if (!android::base::ParseInt(options[2], &area)) { + return parseErrMsg("area", options[2], "int"); + } + if (!android::base::ParseInt(options[3], &display)) { + return parseErrMsg("display", options[3], "int"); + } + if (!android::base::ParseInt(options[4], &inputType)) { + return parseErrMsg("inputType", options[4], "int"); + } + if (!android::base::ParseInt(options[5], &action)) { + return parseErrMsg("action", options[5], "int"); + } + if (!android::base::ParseInt(options[6], &buttonState)) { + return parseErrMsg("buttonState", options[6], "int"); + } + + int32_t pointerId[pointerCount]; + int32_t toolType[pointerCount]; + float xData[pointerCount]; + float yData[pointerCount]; + float pressure[pointerCount]; + float size[pointerCount]; + + for (int i = 7, pc = 0; i < optionsSize; i += 7, pc += 1) { + int offset = i; + if (options[offset] != "--pointer") { + return "--pointer is needed for the motion input\n"; + } + offset += 1; + if (!android::base::ParseInt(options[offset], &pointerId[pc])) { + return parseErrMsg("pointerId", options[offset], "int"); + } + offset += 1; + if (!android::base::ParseInt(options[offset], &toolType[pc])) { + return parseErrMsg("toolType", options[offset], "int"); + } + offset += 1; + if (!android::base::ParseFloat(options[offset], &xData[pc])) { + return parseErrMsg("xData", options[offset], "float"); + } + offset += 1; + if (!android::base::ParseFloat(options[offset], &yData[pc])) { + return parseErrMsg("yData", options[offset], "float"); + } + offset += 1; + if (!android::base::ParseFloat(options[offset], &pressure[pc])) { + return parseErrMsg("pressure", options[offset], "float"); + } + offset += 1; + if (!android::base::ParseFloat(options[offset], &size[pc])) { + return parseErrMsg("size", options[offset], "float"); + } + } + + // Send back to HAL + onValueChangeCallback(createHwMotionInputProp(area, display, inputType, action, buttonState, + pointerCount, pointerId, toolType, xData, + yData, pressure, size)); + + std::string successMessage = StringPrintf( + "motion event generated successfully with area:%d, display:%d," + " inputType:%d, action:%d, buttonState:%d, pointerCount:%d\n", + area, display, inputType, action, buttonState, pointerCount); + for (int i = 0; i < pointerCount; i++) { + successMessage += StringPrintf( + "Pointer #%d {\n" + " id:%d , tooltype:%d \n" + " x:%f , y:%f\n" + " pressure: %f, data: %f\n" + "}\n", + i, pointerId[i], toolType[i], xData[i], yData[i], pressure[i], size[i]); + } + return successMessage; + } + + return StringPrintf("Unknown command: \"%s\"\n%s", command.c_str(), genFakeDataHelp().c_str()); +} + +VehiclePropValue FakeVehicleHardware::createHwInputKeyProp(VehicleHwKeyInputAction action, + int32_t keyCode, int32_t targetDisplay) { + VehiclePropValue value = { + .prop = toInt(VehicleProperty::HW_KEY_INPUT), + .areaId = 0, + .timestamp = elapsedRealtimeNano(), + .status = VehiclePropertyStatus::AVAILABLE, + .value.int32Values = {toInt(action), keyCode, targetDisplay}, + }; + return value; +} + +VehiclePropValue FakeVehicleHardware::createHwKeyInputV2Prop(int32_t area, int32_t targetDisplay, + int32_t keyCode, int32_t action, + int32_t repeatCount) { + VehiclePropValue value = {.prop = toInt(VehicleProperty::HW_KEY_INPUT_V2), + .areaId = area, + .timestamp = elapsedRealtimeNano(), + .status = VehiclePropertyStatus::AVAILABLE, + .value.int32Values = {targetDisplay, keyCode, action, repeatCount}, + .value.int64Values = {elapsedRealtimeNano()}}; + return value; +} + +VehiclePropValue FakeVehicleHardware::createHwMotionInputProp( + int32_t area, int32_t display, int32_t inputType, int32_t action, int32_t buttonState, + int32_t pointerCount, int32_t pointerId[], int32_t toolType[], float xData[], float yData[], + float pressure[], float size[]) { + std::vector intValues; + intValues.push_back(display); + intValues.push_back(inputType); + intValues.push_back(action); + intValues.push_back(buttonState); + intValues.push_back(pointerCount); + for (int i = 0; i < pointerCount; i++) { + intValues.push_back(pointerId[i]); + } + for (int i = 0; i < pointerCount; i++) { + intValues.push_back(toolType[i]); + } + + std::vector floatValues; + for (int i = 0; i < pointerCount; i++) { + floatValues.push_back(xData[i]); + } + for (int i = 0; i < pointerCount; i++) { + floatValues.push_back(yData[i]); + } + for (int i = 0; i < pointerCount; i++) { + floatValues.push_back(pressure[i]); + } + for (int i = 0; i < pointerCount; i++) { + floatValues.push_back(size[i]); + } + + VehiclePropValue value = {.prop = toInt(VehicleProperty::HW_MOTION_INPUT), + .areaId = area, + .timestamp = elapsedRealtimeNano(), + .status = VehiclePropertyStatus::AVAILABLE, + .value.int32Values = intValues, + .value.floatValues = floatValues, + .value.int64Values = {elapsedRealtimeNano()}}; + return value; +} + +void FakeVehicleHardware::eventFromVehicleBus(const VehiclePropValue& value) { + mServerSidePropStore->writeValue(mValuePool->obtain(value)); +} + std::string FakeVehicleHardware::dumpHelp() { return "Usage: \n\n" "[no args]: dumps (id and value) all supported properties \n" "--help: shows this help\n" "--list: lists the ids of all supported properties\n" - "--get [PROP2] [PROPN]: dumps the value of specific properties \n" - "--set [-i INT_VALUE [INT_VALUE ...]] [-i64 INT64_VALUE [INT64_VALUE ...]] " - "[-f FLOAT_VALUE [FLOAT_VALUE ...]] [-s STR_VALUE] " - "[-b BYTES_VALUE] [-a AREA_ID] : sets the value of property PROP. " + "--get [PROP2] [PROPN]: dumps the value of specific properties. \n" + "--getWithArg [ValueArguments]: gets the value for a specific property with " + "arguments. \n" + "--set [ValueArguments]: sets the value of property PROP. \n" + "--save-prop [-a AREA_ID]: saves the current value for PROP, integration test" + " that modifies prop value must call this before test and restore-prop after test. \n" + "--restore-prop [-a AREA_ID]: restores a previously saved property value. \n" + "--inject-event [ValueArguments]: inject a property update event from car\n\n" + "ValueArguments are in the format of [-i INT_VALUE [INT_VALUE ...]] " + "[-i64 INT64_VALUE [INT64_VALUE ...]] [-f FLOAT_VALUE [FLOAT_VALUE ...]] [-s STR_VALUE] " + "[-b BYTES_VALUE] [-a AREA_ID].\n" "Notice that the string, bytes and area value can be set just once, while the other can" " have multiple values (so they're used in the respective array), " - "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n\n" - "Fake user HAL usage: \n" + - mFakeUserHal->showDumpHelp(); + "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n" + + genFakeDataHelp() + "Fake user HAL usage: \n" + mFakeUserHal->showDumpHelp(); } std::string FakeVehicleHardware::dumpAllProperties() { @@ -719,10 +1531,11 @@ std::vector FakeVehicleHardware::getOptionValues( return std::move(values); } -Result FakeVehicleHardware::parseSetPropOptions( +Result FakeVehicleHardware::parsePropOptions( const std::vector& options) { // Options format: - // --set PROP [-f f1 f2...] [-i i1 i2...] [-i64 i1 i2...] [-s s1 s2...] [-b b1 b2...] [-a a] + // --set/get/inject-event PROP [-f f1 f2...] [-i i1 i2...] [-i64 i1 i2...] [-s s1 s2...] + // [-b b1 b2...] [-a a] [-t timestamp] size_t optionIndex = 1; auto result = safelyParseInt(optionIndex, options[optionIndex]); if (!result.ok()) { @@ -736,83 +1549,98 @@ Result FakeVehicleHardware::parseSetPropOptions( std::unordered_set parsedOptions; while (optionIndex < options.size()) { - std::string type = options[optionIndex]; + std::string argType = options[optionIndex]; optionIndex++; + size_t currentIndex = optionIndex; - std::vector values = getOptionValues(options, &optionIndex); - if (parsedOptions.find(type) != parsedOptions.end()) { - return Error() << StringPrintf("Duplicate \"%s\" options\n", type.c_str()); + std::vector argValues = getOptionValues(options, &optionIndex); + if (parsedOptions.find(argType) != parsedOptions.end()) { + return Error() << StringPrintf("Duplicate \"%s\" options\n", argType.c_str()); } - parsedOptions.insert(type); - if (EqualsIgnoreCase(type, "-i")) { - if (values.size() == 0) { + parsedOptions.insert(argType); + size_t argValuesSize = argValues.size(); + if (EqualsIgnoreCase(argType, "-i")) { + if (argValuesSize == 0) { return Error() << "No values specified when using \"-i\"\n"; } - prop.value.int32Values.resize(values.size()); - for (size_t i = 0; i < values.size(); i++) { - auto int32Result = safelyParseInt(currentIndex + i, values[i]); + prop.value.int32Values.resize(argValuesSize); + for (size_t i = 0; i < argValuesSize; i++) { + auto int32Result = safelyParseInt(currentIndex + i, argValues[i]); if (!int32Result.ok()) { return Error() << StringPrintf("Value: \"%s\" is not a valid int: %s\n", - values[i].c_str(), getErrorMsg(int32Result).c_str()); + argValues[i].c_str(), getErrorMsg(int32Result).c_str()); } prop.value.int32Values[i] = int32Result.value(); } - } else if (EqualsIgnoreCase(type, "-i64")) { - if (values.size() == 0) { + } else if (EqualsIgnoreCase(argType, "-i64")) { + if (argValuesSize == 0) { return Error() << "No values specified when using \"-i64\"\n"; } - prop.value.int64Values.resize(values.size()); - for (size_t i = 0; i < values.size(); i++) { - auto int64Result = safelyParseInt(currentIndex + i, values[i]); + prop.value.int64Values.resize(argValuesSize); + for (size_t i = 0; i < argValuesSize; i++) { + auto int64Result = safelyParseInt(currentIndex + i, argValues[i]); if (!int64Result.ok()) { return Error() << StringPrintf("Value: \"%s\" is not a valid int64: %s\n", - values[i].c_str(), getErrorMsg(int64Result).c_str()); + argValues[i].c_str(), getErrorMsg(int64Result).c_str()); } prop.value.int64Values[i] = int64Result.value(); } - } else if (EqualsIgnoreCase(type, "-f")) { - if (values.size() == 0) { + } else if (EqualsIgnoreCase(argType, "-f")) { + if (argValuesSize == 0) { return Error() << "No values specified when using \"-f\"\n"; } - prop.value.floatValues.resize(values.size()); - for (size_t i = 0; i < values.size(); i++) { - auto floatResult = safelyParseFloat(currentIndex + i, values[i]); + prop.value.floatValues.resize(argValuesSize); + for (size_t i = 0; i < argValuesSize; i++) { + auto floatResult = safelyParseFloat(currentIndex + i, argValues[i]); if (!floatResult.ok()) { return Error() << StringPrintf("Value: \"%s\" is not a valid float: %s\n", - values[i].c_str(), getErrorMsg(floatResult).c_str()); + argValues[i].c_str(), getErrorMsg(floatResult).c_str()); } prop.value.floatValues[i] = floatResult.value(); } - } else if (EqualsIgnoreCase(type, "-s")) { - if (values.size() != 1) { + } else if (EqualsIgnoreCase(argType, "-s")) { + if (argValuesSize != 1) { return Error() << "Expect exact one value when using \"-s\"\n"; } - prop.value.stringValue = values[0]; - } else if (EqualsIgnoreCase(type, "-b")) { - if (values.size() != 1) { + prop.value.stringValue = argValues[0]; + } else if (EqualsIgnoreCase(argType, "-b")) { + if (argValuesSize != 1) { return Error() << "Expect exact one value when using \"-b\"\n"; } - auto bytesResult = parseHexString(values[0]); + auto bytesResult = parseHexString(argValues[0]); if (!bytesResult.ok()) { return Error() << StringPrintf("value: \"%s\" is not a valid hex string: %s\n", - values[0].c_str(), getErrorMsg(bytesResult).c_str()); + argValues[0].c_str(), + getErrorMsg(bytesResult).c_str()); } prop.value.byteValues = std::move(bytesResult.value()); - } else if (EqualsIgnoreCase(type, "-a")) { - if (values.size() != 1) { + } else if (EqualsIgnoreCase(argType, "-a")) { + if (argValuesSize != 1) { return Error() << "Expect exact one value when using \"-a\"\n"; } - auto int32Result = safelyParseInt(currentIndex, values[0]); + auto int32Result = safelyParseInt(currentIndex, argValues[0]); if (!int32Result.ok()) { return Error() << StringPrintf("Area ID: \"%s\" is not a valid int: %s\n", - values[0].c_str(), getErrorMsg(int32Result).c_str()); + argValues[0].c_str(), + getErrorMsg(int32Result).c_str()); } prop.areaId = int32Result.value(); + } else if (EqualsIgnoreCase(argType, "-t")) { + if (argValuesSize != 1) { + return Error() << "Expect exact one value when using \"-t\"\n"; + } + auto int64Result = safelyParseInt(currentIndex, argValues[0]); + if (!int64Result.ok()) { + return Error() << StringPrintf("Timestamp: \"%s\" is not a valid int64: %s\n", + argValues[0].c_str(), + getErrorMsg(int64Result).c_str()); + } + prop.timestamp = int64Result.value(); } else { - return Error() << StringPrintf("Unknown option: %s\n", type.c_str()); + return Error() << StringPrintf("Unknown option: %s\n", argType.c_str()); } } @@ -824,7 +1652,7 @@ std::string FakeVehicleHardware::dumpSetProperties(const std::vector& options) { + if (auto result = checkArgumentsSize(options, 3); !result.ok()) { + return getErrorMsg(result); + } + + auto parseResult = parsePropOptions(options); + if (!parseResult.ok()) { + return getErrorMsg(parseResult); + } + VehiclePropValue prop = std::move(parseResult.value()); + ALOGD("Dump: Getting property: %s", prop.toString().c_str()); + + bool isSpecialValue = false; + auto result = maybeGetSpecialValue(prop, &isSpecialValue); + + if (!isSpecialValue) { + result = mServerSidePropStore->readValue(prop); + } + + if (!result.ok()) { + return StringPrintf("failed to read property value: %d, error: %s, code: %d\n", prop.prop, + getErrorMsg(result).c_str(), getIntErrorCode(result)); + } + return StringPrintf("Get property result: %s\n", result.value()->toString().c_str()); +} + +std::string FakeVehicleHardware::dumpSaveProperty(const std::vector& options) { + // Format: --save-prop PROP [-a areaID] + if (auto result = checkArgumentsSize(options, 2); !result.ok()) { + return getErrorMsg(result); + } + + auto parseResult = parsePropOptions(options); + if (!parseResult.ok()) { + return getErrorMsg(parseResult); + } + // We are only using the prop and areaId option. + VehiclePropValue value = std::move(parseResult.value()); + int32_t propId = value.prop; + int32_t areaId = value.areaId; + + auto readResult = mServerSidePropStore->readValue(value); + if (!readResult.ok()) { + return StringPrintf("Failed to save current property value, error: %s", + getErrorMsg(readResult).c_str()); + } + + std::scoped_lock lockGuard(mLock); + mSavedProps[PropIdAreaId{ + .propId = propId, + .areaId = areaId, + }] = std::move(readResult.value()); + + return StringPrintf("Property: %" PRId32 ", areaID: %" PRId32 " saved", propId, areaId); +} + +std::string FakeVehicleHardware::dumpRestoreProperty(const std::vector& options) { + // Format: --restore-prop PROP [-a areaID] + if (auto result = checkArgumentsSize(options, 2); !result.ok()) { + return getErrorMsg(result); + } + + auto parseResult = parsePropOptions(options); + if (!parseResult.ok()) { + return getErrorMsg(parseResult); + } + // We are only using the prop and areaId option. + VehiclePropValue value = std::move(parseResult.value()); + int32_t propId = value.prop; + int32_t areaId = value.areaId; + VehiclePropValuePool::RecyclableType savedValue; + + { + std::scoped_lock lockGuard(mLock); + auto it = mSavedProps.find(PropIdAreaId{ + .propId = propId, + .areaId = areaId, + }); + if (it == mSavedProps.end()) { + return StringPrintf("No saved property for property: %" PRId32 ", areaID: %" PRId32, + propId, areaId); + } + + savedValue = std::move(it->second); + // Remove the saved property after restoring it. + mSavedProps.erase(it); + } + + // Update timestamp. + savedValue->timestamp = elapsedRealtimeNano(); + + auto writeResult = mServerSidePropStore->writeValue(std::move(savedValue)); + if (!writeResult.ok()) { + return StringPrintf("Failed to restore property value, error: %s", + getErrorMsg(writeResult).c_str()); + } + + return StringPrintf("Property: %" PRId32 ", areaID: %" PRId32 " restored", propId, areaId); +} + +std::string FakeVehicleHardware::dumpInjectEvent(const std::vector& options) { + if (auto result = checkArgumentsSize(options, 3); !result.ok()) { + return getErrorMsg(result); + } + + auto parseResult = parsePropOptions(options); + if (!parseResult.ok()) { + return getErrorMsg(parseResult); + } + VehiclePropValue prop = std::move(parseResult.value()); + ALOGD("Dump: Injecting event from vehicle bus: %s", prop.toString().c_str()); + + eventFromVehicleBus(prop); + + return StringPrintf("Event for property: %d injected", prop.prop); +} + StatusCode FakeVehicleHardware::checkHealth() { // Always return OK for checkHealth. return StatusCode::OK; @@ -854,13 +1799,19 @@ StatusCode FakeVehicleHardware::checkHealth() { void FakeVehicleHardware::registerOnPropertyChangeEvent( std::unique_ptr callback) { - std::scoped_lock lockGuard(mLock); + if (mOnPropertyChangeCallback != nullptr) { + ALOGE("registerOnPropertyChangeEvent must only be called once"); + return; + } mOnPropertyChangeCallback = std::move(callback); } void FakeVehicleHardware::registerOnPropertySetErrorEvent( std::unique_ptr callback) { - std::scoped_lock lockGuard(mLock); + if (mOnPropertySetErrorCallback != nullptr) { + ALOGE("registerOnPropertySetErrorEvent must only be called once"); + return; + } mOnPropertySetErrorCallback = std::move(callback); } @@ -904,8 +1855,6 @@ StatusCode FakeVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, } void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) { - std::scoped_lock lockGuard(mLock); - if (mOnPropertyChangeCallback == nullptr) { return; } @@ -915,33 +1864,26 @@ void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) { (*mOnPropertyChangeCallback)(std::move(updatedValues)); } -void FakeVehicleHardware::maybeOverrideProperties(const char* overrideDir) { - if (android::base::GetBoolProperty(OVERRIDE_PROPERTY, false)) { - overrideProperties(overrideDir); - } -} - -void FakeVehicleHardware::overrideProperties(const char* overrideDir) { - ALOGI("loading vendor override properties from %s", overrideDir); - if (auto dir = opendir(overrideDir); dir != NULL) { +void FakeVehicleHardware::loadPropConfigsFromDir( + const std::string& dirPath, + std::unordered_map* configsByPropId) { + ALOGI("loading properties from %s", dirPath.c_str()); + if (auto dir = opendir(dirPath.c_str()); dir != NULL) { std::regex regJson(".*[.]json", std::regex::icase); while (auto f = readdir(dir)) { if (!std::regex_match(f->d_name, regJson)) { continue; } - std::string file = overrideDir + std::string(f->d_name); - JsonFakeValueGenerator tmpGenerator(file); - - std::vector propValues = tmpGenerator.getAllEvents(); - for (const VehiclePropValue& prop : propValues) { - auto propToStore = mValuePool->obtain(prop); - propToStore->timestamp = elapsedRealtimeNano(); - if (auto result = mServerSidePropStore->writeValue(std::move(propToStore), - /*updateStatus=*/true); - !result.ok()) { - ALOGW("failed to write vendor override properties: %d, error: %s, code: %d", - prop.prop, getErrorMsg(result).c_str(), getIntErrorCode(result)); - } + std::string filePath = dirPath + "/" + std::string(f->d_name); + ALOGI("loading properties from %s", filePath.c_str()); + auto result = mLoader.loadPropConfig(filePath); + if (!result.ok()) { + ALOGE("failed to load config file: %s, error: %s", filePath.c_str(), + result.error().message().c_str()); + continue; + } + for (auto& [propId, configDeclaration] : result.value()) { + (*configsByPropId)[propId] = std::move(configDeclaration); } } closedir(dir); @@ -1027,11 +1969,15 @@ void FakeVehicleHardware::PendingRequestHandler, std::vector> callbackToResults; for (const auto& rwc : mRequests.flush()) { + ATRACE_BEGIN("FakeVehicleHardware:handleGetValueRequest"); auto result = mHardware->handleGetValueRequest(rwc.request); + ATRACE_END(); callbackToResults[rwc.callback].push_back(std::move(result)); } for (const auto& [callback, results] : callbackToResults) { + ATRACE_BEGIN("FakeVehicleHardware:call get value result callback"); (*callback)(std::move(results)); + ATRACE_END(); } } @@ -1041,11 +1987,15 @@ void FakeVehicleHardware::PendingRequestHandler, std::vector> callbackToResults; for (const auto& rwc : mRequests.flush()) { + ATRACE_BEGIN("FakeVehicleHardware:handleSetValueRequest"); auto result = mHardware->handleSetValueRequest(rwc.request); + ATRACE_END(); callbackToResults[rwc.callback].push_back(std::move(result)); } for (const auto& [callback, results] : callbackToResults) { + ATRACE_BEGIN("FakeVehicleHardware:call set value result callback"); (*callback)(std::move(results)); + ATRACE_END(); } } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp index 90d1516a21..8d8fcf5908 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp @@ -22,13 +22,13 @@ cc_test { name: "FakeVehicleHardwareTest", vendor: true, srcs: ["*.cpp"], - cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"], + cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"], header_libs: [ "IVehicleHardware", - "VehicleHalDefaultConfig", "VehicleHalTestUtilHeaders", ], static_libs: [ + "VehicleHalJsonConfigLoaderEnableTestProperties", "VehicleHalUtils", "FakeVehicleHardware", "FakeVehicleHalValueGenerators", @@ -41,7 +41,11 @@ cc_test { "libjsoncpp", ], data: [ + ":VehicleHalDefaultProperties_JSON", + ":VehicleHalTestProperties_JSON", + ":VehicleHalVendorClusterTestProperties_JSON", ":FakeVehicleHardwareTestOverrideJson", + ":FakeVehicleHardwareTestPropJson", ], defaults: ["VehicleHalDefaults"], test_suites: ["device-tests"], @@ -51,3 +55,8 @@ filegroup { name: "FakeVehicleHardwareTestOverrideJson", srcs: ["override/*"], } + +filegroup { + name: "FakeVehicleHardwareTestPropJson", + srcs: ["fakedata/prop.json"], +} diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 3e8f634ab7..8d385ddcfe 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -16,7 +16,6 @@ #include -#include #include #include #include @@ -38,6 +37,22 @@ #include #include +namespace aidl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +void PrintTo(const VehiclePropValue& value, std::ostream* os) { + *os << "\n( " << value.toString() << " )\n"; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android +} // namespace aidl + namespace android { namespace hardware { namespace automotive { @@ -45,6 +60,7 @@ namespace vehicle { namespace fake { namespace { +using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; @@ -53,17 +69,23 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror; +using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; using ::android::base::expected; using ::android::base::ScopedLockAssertion; using ::android::base::StringPrintf; using ::android::base::unexpected; +using ::testing::AnyOfArray; using ::testing::ContainerEq; using ::testing::ContainsRegex; using ::testing::Eq; +using ::testing::HasSubstr; +using ::testing::IsSubsetOf; using ::testing::WhenSortedBy; using std::chrono::milliseconds; @@ -78,7 +100,9 @@ class FakeVehicleHardwareTestHelper { public: FakeVehicleHardwareTestHelper(FakeVehicleHardware* hardware) { mHardware = hardware; } - void overrideProperties(const char* overrideDir) { mHardware->overrideProperties(overrideDir); } + std::unordered_map loadConfigDeclarations() { + return mHardware->loadConfigDeclarations(); + } private: FakeVehicleHardware* mHardware; @@ -87,6 +111,9 @@ class FakeVehicleHardwareTestHelper { class FakeVehicleHardwareTest : public ::testing::Test { protected: void SetUp() override { + mHardware = std::make_unique(android::base::GetExecutableDirectory(), + /*overrideConfigDir=*/"", + /*forceOverride=*/false); auto callback = std::make_unique( [this](const std::vector& values) { onPropertyChangeEvent(values); @@ -98,7 +125,17 @@ class FakeVehicleHardwareTest : public ::testing::Test { [this](std::vector results) { onGetValues(results); }); } - FakeVehicleHardware* getHardware() { return &mHardware; } + void TearDown() override { + // mHardware uses callback which contains reference to 'this', so it has to be destroyed + // before 'this'. + mHardware.reset(); + } + + FakeVehicleHardware* getHardware() { return mHardware.get(); } + + void setHardware(std::unique_ptr hardware) { + mHardware = std::move(hardware); + } StatusCode setValues(const std::vector& requests) { { @@ -251,6 +288,14 @@ class FakeVehicleHardwareTest : public ::testing::Test { return mChangedProperties; } + bool waitForChangedProperties(size_t count, milliseconds timeout) { + std::unique_lock lk(mLock); + return mCv.wait_for(lk, timeout, [this, count] { + ScopedLockAssertion lockAssertion(mLock); + return mChangedProperties.size() >= count; + }); + } + bool waitForChangedProperties(int32_t propId, int32_t areaId, size_t count, milliseconds timeout) { PropIdAreaId propIdAreaId{ @@ -270,6 +315,15 @@ class FakeVehicleHardwareTest : public ::testing::Test { mChangedProperties.clear(); } + size_t getEventCount(int32_t propId, int32_t areaId) { + PropIdAreaId propIdAreaId{ + .propId = propId, + .areaId = areaId, + }; + std::scoped_lock lockGuard(mLock); + return mEventCount[propIdAreaId]; + } + static void addSetValueRequest(std::vector& requests, std::vector& expectedResults, int64_t requestId, const VehiclePropValue& value, StatusCode expectedStatus) { @@ -332,7 +386,7 @@ class FakeVehicleHardwareTest : public ::testing::Test { } mPropValueCmp; private: - FakeVehicleHardware mHardware; + std::unique_ptr mHardware; std::shared_ptr mSetValuesCallback; std::shared_ptr mGetValuesCallback; std::condition_variable mCv; @@ -348,7 +402,8 @@ class FakeVehicleHardwareTest : public ::testing::Test { TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs) { std::vector configs = getHardware()->getAllPropertyConfigs(); - ASSERT_EQ(configs.size(), defaultconfig::getDefaultConfigs().size()); + FakeVehicleHardwareTestHelper helper(getHardware()); + ASSERT_EQ(configs.size(), helper.loadConfigDeclarations().size()); } TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { @@ -356,7 +411,8 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { std::vector expectedGetValueResults; int64_t requestId = 1; - for (auto& config : defaultconfig::getDefaultConfigs()) { + FakeVehicleHardwareTestHelper helper(getHardware()); + for (auto& [propId, config] : helper.loadConfigDeclarations()) { if (obd2frame::FakeObd2Frame::isDiagnosticProperty(config.config)) { // Ignore storing default value for diagnostic property. They have special get/set // logic. @@ -368,12 +424,16 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { continue; } - if (config.config.prop == ECHO_REVERSE_BYTES) { + if (propId == ECHO_REVERSE_BYTES) { // Ignore ECHO_REVERSE_BYTES, it has special logic. continue; } - int propId = config.config.prop; + if (propId == VENDOR_PROPERTY_ID) { + // Ignore VENDOR_PROPERTY_ID, it has special logic. + continue; + } + if (isGlobalProp(propId)) { if (config.initialValue == RawPropValues{}) { addGetValueRequest(getValueRequests, expectedGetValueResults, requestId++, @@ -631,10 +691,12 @@ TEST_F(FakeVehicleHardwareTest, testSetStatusMustIgnore) { } TEST_F(FakeVehicleHardwareTest, testVendorOverrideProperties) { - std::string overrideDir = android::base::GetExecutableDirectory() + "/override/"; + std::string currentDir = android::base::GetExecutableDirectory(); + std::string overrideDir = currentDir + "/override/"; // Set vendor override directory. - FakeVehicleHardwareTestHelper helper(getHardware()); - helper.overrideProperties(overrideDir.c_str()); + std::unique_ptr hardware = + std::make_unique(currentDir, overrideDir, /*forceOverride=*/true); + setHardware(std::move(hardware)); // This is the same as the prop in 'gear_selection.json'. int gearProp = toInt(VehicleProperty::GEAR_SELECTION); @@ -669,10 +731,12 @@ TEST_F(FakeVehicleHardwareTest, testVendorOverrideProperties) { } TEST_F(FakeVehicleHardwareTest, testVendorOverridePropertiesMultipleAreas) { - std::string overrideDir = android::base::GetExecutableDirectory() + "/override/"; + std::string currentDir = android::base::GetExecutableDirectory(); + std::string overrideDir = currentDir + "/override/"; // Set vendor override directory. - FakeVehicleHardwareTestHelper helper(getHardware()); - helper.overrideProperties(overrideDir.c_str()); + std::unique_ptr hardware = + std::make_unique(currentDir, overrideDir, /*forceOverride=*/true); + setHardware(std::move(hardware)); // This is the same as the prop in 'hvac_temperature_set.json'. int hvacProp = toInt(VehicleProperty::HVAC_TEMPERATURE_SET); @@ -685,22 +749,16 @@ TEST_F(FakeVehicleHardwareTest, testVendorOverridePropertiesMultipleAreas) { ASSERT_TRUE(result.ok()) << "expect to get the overridden property ok: " << getStatus(result); ASSERT_EQ(static_cast(1), result.value().value.floatValues.size()); ASSERT_EQ(30.0f, result.value().value.floatValues[0]); - - // HVAC_RIGHT should not be affected and return the default value. - result = getValue(VehiclePropValue{ - .prop = hvacProp, - .areaId = HVAC_RIGHT, - }); - - ASSERT_TRUE(result.ok()) << "expect to get the default property ok: " << getStatus(result); - ASSERT_EQ(static_cast(1), result.value().value.floatValues.size()); - ASSERT_EQ(20.0f, result.value().value.floatValues[0]); } TEST_F(FakeVehicleHardwareTest, testVendorOverridePropertiesDirDoesNotExist) { - // Set vendor override directory to a non-existing dir - FakeVehicleHardwareTestHelper helper(getHardware()); - helper.overrideProperties("123"); + std::string currentDir = android::base::GetExecutableDirectory(); + std::string overrideDir = currentDir + "/override/"; + // Set vendor override directory to a non-existing dir. + std::unique_ptr hardware = + std::make_unique(currentDir, "1234", /*forceOverride=*/true); + setHardware(std::move(hardware)); + auto result = getValue(VehiclePropValue{ .prop = toInt(VehicleProperty::GEAR_SELECTION), }); @@ -979,6 +1037,488 @@ std::vector setSpecialValueTestCases() { }, }, }, + SetSpecialValueTestCase{ + .name = "set_automatic_emergency_braking_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + AUTOMATIC_EMERGENCY_BRAKING_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + AUTOMATIC_EMERGENCY_BRAKING_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + AUTOMATIC_EMERGENCY_BRAKING_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_automatic_emergency_braking_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + AUTOMATIC_EMERGENCY_BRAKING_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + AUTOMATIC_EMERGENCY_BRAKING_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + AUTOMATIC_EMERGENCY_BRAKING_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_forward_collision_warning_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + FORWARD_COLLISION_WARNING_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + FORWARD_COLLISION_WARNING_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + FORWARD_COLLISION_WARNING_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_forward_collision_warning_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + FORWARD_COLLISION_WARNING_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + FORWARD_COLLISION_WARNING_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + FORWARD_COLLISION_WARNING_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_blind_spot_warning_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_STATE), + .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_STATE), + .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_blind_spot_warning_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_STATE), + .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::BLIND_SPOT_WARNING_STATE), + .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_lane_departure_warning_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + LANE_DEPARTURE_WARNING_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + LANE_DEPARTURE_WARNING_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_DEPARTURE_WARNING_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_lane_departure_warning_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + LANE_DEPARTURE_WARNING_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + LANE_DEPARTURE_WARNING_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_DEPARTURE_WARNING_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_lane_keep_assist_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::LANE_KEEP_ASSIST_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_lane_keep_assist_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::LANE_KEEP_ASSIST_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_lane_centering_assist_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_CENTERING_ASSIST_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_lane_centering_assist_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::LANE_CENTERING_ASSIST_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_emergency_lane_keep_assist_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + EMERGENCY_LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + EMERGENCY_LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + EMERGENCY_LANE_KEEP_ASSIST_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_emergency_lane_keep_assist_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + EMERGENCY_LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + EMERGENCY_LANE_KEEP_ASSIST_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + EMERGENCY_LANE_KEEP_ASSIST_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_cruise_control_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_cruise_control_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_STATE), + .value.int32Values = {1}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_hands_on_detection_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::HANDS_ON_DETECTION_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::HANDS_ON_DETECTION_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + HANDS_ON_DETECTION_DRIVER_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::HANDS_ON_DETECTION_WARNING), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_hands_on_detection_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::HANDS_ON_DETECTION_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty::HANDS_ON_DETECTION_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt(VehicleProperty:: + HANDS_ON_DETECTION_DRIVER_STATE), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty::HANDS_ON_DETECTION_WARNING), + .value.int32Values = {1}, + }, + }, + }, }; } @@ -996,7 +1536,7 @@ TEST_P(FakeVehicleHardwareSpecialValuesTest, testSetSpecialProperties) { std::vector gotValues; for (const auto& value : tc.expectedValuesToGet) { - auto result = getValue(VehiclePropValue{.prop = value.prop}); + auto result = getValue(VehiclePropValue{.prop = value.prop, .areaId = value.areaId}); ASSERT_TRUE(result.ok()) << "failed to get property " << value.prop << " status:" << getStatus(result); @@ -1011,7 +1551,7 @@ TEST_P(FakeVehicleHardwareSpecialValuesTest, testSetSpecialProperties) { // Some of the updated properties might be the same as default config, thus not causing // a property change event. So the changed properties should be a subset of all the updated // properties. - ASSERT_THAT(getChangedProperties(), WhenSortedBy(mPropValueCmp, Eq(gotValues))); + ASSERT_THAT(getChangedProperties(), IsSubsetOf(gotValues)); } INSTANTIATE_TEST_SUITE_P( @@ -1040,11 +1580,12 @@ TEST_F(FakeVehicleHardwareTest, testSetWaitForVhalAfterCarServiceCrash) { ASSERT_EQ(events.size(), 1u); // Erase the timestamp for comparison. events[0].timestamp = 0; - ASSERT_EQ(events[0], (VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), - .status = VehiclePropertyStatus::AVAILABLE, - .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, - })); + auto expectedValue = VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), + .status = VehiclePropertyStatus::AVAILABLE, + .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, + }; + ASSERT_EQ(events[0], expectedValue); } TEST_F(FakeVehicleHardwareTest, testGetObd2FreezeFrame) { @@ -1108,6 +1649,255 @@ TEST_F(FakeVehicleHardwareTest, testSetVehicleMapService) { EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE); } +TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) { + int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; + for (int areaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {0}}); + + ASSERT_EQ(status, StatusCode::OK); + + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + int powerPropId = HVAC_POWER_PROPERTIES[i]; + for (int powerDependentAreaId : seatAreaIds) { + auto getValueResult = getValue(VehiclePropValue{ + .prop = powerPropId, + .areaId = powerDependentAreaId, + }); + + if (areaId == powerDependentAreaId) { + EXPECT_FALSE(getValueResult.ok()); + EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED); + } else { + EXPECT_TRUE(getValueResult.ok()); + } + } + } + + // Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence + // on this value from any power dependent property values other than those with the same + // areaId. + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {1}}); + } +} + +TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) { + int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; + for (int areaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {0}}); + + ASSERT_EQ(status, StatusCode::OK); + + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + int powerPropId = HVAC_POWER_PROPERTIES[i]; + for (int powerDependentAreaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = powerPropId, + .areaId = powerDependentAreaId, + .value.int32Values = {1}}); + + if (areaId == powerDependentAreaId) { + EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED); + } else { + EXPECT_EQ(status, StatusCode::OK); + } + } + } + + // Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence + // on this value from any power dependent property values other than those with the same + // areaId. + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {1}}); + } +} + +TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) { + int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; + for (int areaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {0}}); + + ASSERT_EQ(status, StatusCode::OK); + + clearChangedProperties(); + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {1}}); + + auto events = getChangedProperties(); + // If we turn HVAC power on, we expect to receive one property event for every HVAC prop + // areas plus one event for HVAC_POWER_ON. + std::vector changedPropIds; + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + changedPropIds.push_back(HVAC_POWER_PROPERTIES[i]); + } + changedPropIds.push_back(toInt(VehicleProperty::HVAC_POWER_ON)); + + for (const auto& event : events) { + EXPECT_EQ(event.areaId, areaId); + EXPECT_THAT(event.prop, AnyOfArray(changedPropIds)); + } + } +} + +TEST_F(FakeVehicleHardwareTest, testGetAdasPropNotAvailable) { + std::unordered_map> adasEnabledPropToDependentProps = { + { + toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + { + toInt(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED), + toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP), + toInt(VehicleProperty:: + ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE), + }, + }, + }; + for (auto& enabledToDependents : adasEnabledPropToDependentProps) { + int32_t adasEnabledPropertyId = enabledToDependents.first; + StatusCode status = + setValue(VehiclePropValue{.prop = adasEnabledPropertyId, .value.int32Values = {0}}); + EXPECT_EQ(status, StatusCode::OK); + + auto& dependentProps = enabledToDependents.second; + for (auto dependentProp : dependentProps) { + auto getValueResult = getValue(VehiclePropValue{.prop = dependentProp}); + EXPECT_FALSE(getValueResult.ok()); + EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED); + } + } +} + +TEST_F(FakeVehicleHardwareTest, testSetAdasPropNotAvailable) { + std::unordered_map> adasEnabledPropToDependentProps = { + { + toInt(VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + { + toInt(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND), + }, + }, + { + toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + { + toInt(VehicleProperty::CRUISE_CONTROL_COMMAND), + toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP), + }, + }, + }; + for (auto& enabledToDependents : adasEnabledPropToDependentProps) { + int32_t adasEnabledPropertyId = enabledToDependents.first; + StatusCode status = + setValue(VehiclePropValue{.prop = adasEnabledPropertyId, .value.int32Values = {0}}); + EXPECT_EQ(status, StatusCode::OK); + + auto& dependentProps = enabledToDependents.second; + for (auto dependentProp : dependentProps) { + StatusCode status = setValue(VehiclePropValue{.prop = dependentProp}); + EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED); + } + } +} + +TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) { + std::unordered_map> adasEnabledPropToAdasPropWithErrorState = { + // AEB + { + toInt(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED), + { + toInt(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE), + }, + }, + // FCW + { + toInt(VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED), + { + toInt(VehicleProperty::FORWARD_COLLISION_WARNING_STATE), + }, + }, + // BSW + { + toInt(VehicleProperty::BLIND_SPOT_WARNING_ENABLED), + { + toInt(VehicleProperty::BLIND_SPOT_WARNING_STATE), + }, + }, + // LDW + { + toInt(VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED), + { + toInt(VehicleProperty::LANE_DEPARTURE_WARNING_STATE), + }, + }, + // LKA + { + toInt(VehicleProperty::LANE_KEEP_ASSIST_ENABLED), + { + toInt(VehicleProperty::LANE_KEEP_ASSIST_STATE), + }, + }, + // LCA + { + toInt(VehicleProperty::LANE_CENTERING_ASSIST_ENABLED), + { + toInt(VehicleProperty::LANE_CENTERING_ASSIST_STATE), + }, + }, + // ELKA + { + toInt(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED), + { + toInt(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE), + }, + }, + // CC + { + toInt(VehicleProperty::CRUISE_CONTROL_ENABLED), + { + toInt(VehicleProperty::CRUISE_CONTROL_TYPE), + toInt(VehicleProperty::CRUISE_CONTROL_STATE), + }, + }, + // HOD + { + toInt(VehicleProperty::HANDS_ON_DETECTION_ENABLED), + { + toInt(VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE), + toInt(VehicleProperty::HANDS_ON_DETECTION_WARNING), + }, + }, + }; + for (auto& enabledToErrorStateProps : adasEnabledPropToAdasPropWithErrorState) { + int32_t adasEnabledPropertyId = enabledToErrorStateProps.first; + StatusCode status = + setValue(VehiclePropValue{.prop = adasEnabledPropertyId, .value.int32Values = {0}}); + EXPECT_EQ(status, StatusCode::OK); + + clearChangedProperties(); + status = + setValue(VehiclePropValue{.prop = adasEnabledPropertyId, .value.int32Values = {1}}); + EXPECT_EQ(status, StatusCode::OK); + + // If we enable the ADAS feature, we expect to receive one property event for every ADAS + // state property plus one event for enabling the feature. + std::unordered_set expectedChangedPropIds(enabledToErrorStateProps.second.begin(), + enabledToErrorStateProps.second.end()); + expectedChangedPropIds.insert(adasEnabledPropertyId); + + std::unordered_set changedPropIds; + auto events = getChangedProperties(); + for (const auto& event : events) { + changedPropIds.insert(event.prop); + } + EXPECT_EQ(changedPropIds, expectedChangedPropIds); + } +} + TEST_F(FakeVehicleHardwareTest, testGetUserPropertySetOnly) { for (VehicleProperty prop : std::vector({ VehicleProperty::INITIAL_USER_INFO, @@ -1191,6 +1981,8 @@ TEST_F(FakeVehicleHardwareTest, testSwitchUser) { ASSERT_EQ(events.size(), static_cast(1)); events[0].timestamp = 0; + // The returned event will have area ID 0. + valueToSet.areaId = 0; ASSERT_EQ(events[0], valueToSet); // Try to get switch_user again, should return default value. @@ -1201,19 +1993,20 @@ TEST_F(FakeVehicleHardwareTest, testSwitchUser) { events = getChangedProperties(); ASSERT_EQ(events.size(), static_cast(1)); events[0].timestamp = 0; - ASSERT_EQ(events[0], (VehiclePropValue{ - .areaId = 0, - .prop = toInt(VehicleProperty::SWITCH_USER), - .value.int32Values = - { - // Request ID - 666, - // VEHICLE_RESPONSE - 3, - // SUCCESS - 1, - }, - })); + auto expectedValue = VehiclePropValue{ + .areaId = 0, + .prop = toInt(VehicleProperty::SWITCH_USER), + .value.int32Values = + { + // Request ID + 666, + // VEHICLE_RESPONSE + 3, + // SUCCESS + 1, + }, + }; + ASSERT_EQ(events[0], expectedValue); } TEST_F(FakeVehicleHardwareTest, testCreateUser) { @@ -1245,6 +2038,8 @@ TEST_F(FakeVehicleHardwareTest, testCreateUser) { auto events = getChangedProperties(); ASSERT_EQ(events.size(), static_cast(1)); events[0].timestamp = 0; + // The returned event will have area ID 0. + valueToSet.areaId = 0; EXPECT_EQ(events[0], valueToSet); // Try to get create_user again, should return default value. @@ -1255,17 +2050,18 @@ TEST_F(FakeVehicleHardwareTest, testCreateUser) { events = getChangedProperties(); ASSERT_EQ(events.size(), static_cast(1)); events[0].timestamp = 0; - ASSERT_EQ(events[0], (VehiclePropValue{ - .areaId = 0, - .prop = toInt(VehicleProperty::CREATE_USER), - .value.int32Values = - { - // Request ID - 666, - // SUCCESS - 1, - }, - })); + auto expectedValue = VehiclePropValue{ + .areaId = 0, + .prop = toInt(VehicleProperty::CREATE_USER), + .value.int32Values = + { + // Request ID + 666, + // SUCCESS + 1, + }, + }; + ASSERT_EQ(events[0], expectedValue); } TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { @@ -1297,11 +2093,12 @@ TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { auto events = getChangedProperties(); ASSERT_EQ(events.size(), static_cast(1)); events[0].timestamp = 0; - EXPECT_EQ(events[0], (VehiclePropValue{ - .areaId = 1, - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), - .value.int32Values = {3, 1, 11}, - })); + auto expectedValue = VehiclePropValue{ + .areaId = 0, + .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .value.int32Values = {3, 1, 11}, + }; + EXPECT_EQ(events[0], expectedValue); // Try to get create_user again, should return default value. clearChangedProperties(); @@ -1311,22 +2108,23 @@ TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { events = getChangedProperties(); ASSERT_EQ(events.size(), static_cast(1)); events[0].timestamp = 0; - EXPECT_EQ(events[0], (VehiclePropValue{ - .areaId = 0, - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), - .value.int32Values = - { - // Request ID - 3, - // ACTION: DEFAULT - 0, - // User id: 0 - 0, - // Flags: 0 - 0, - }, - .value.stringValue = "||", - })); + expectedValue = VehiclePropValue{ + .areaId = 0, + .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .value.int32Values = + { + // Request ID + 3, + // ACTION: DEFAULT + 0, + // User id: 0 + 0, + // Flags: 0 + 0, + }, + .value.stringValue = "||", + }; + EXPECT_EQ(events[0], expectedValue); } TEST_F(FakeVehicleHardwareTest, testDumpAllProperties) { @@ -1395,6 +2193,85 @@ TEST_F(FakeVehicleHardwareTest, testDumpSpecificPropertiesNoArg) { ASSERT_THAT(result.buffer, ContainsRegex("Invalid number of arguments")); } +TEST_F(FakeVehicleHardwareTest, testDumpSpecificPropertyWithArg) { + auto getValueResult = getValue(VehiclePropValue{.prop = OBD2_FREEZE_FRAME_INFO}); + ASSERT_TRUE(getValueResult.ok()); + auto propValue = getValueResult.value(); + ASSERT_EQ(propValue.value.int64Values.size(), static_cast(3)) + << "expect 3 obd2 freeze frames stored"; + + std::string propIdStr = StringPrintf("%d", OBD2_FREEZE_FRAME); + DumpResult result; + for (int64_t timestamp : propValue.value.int64Values) { + result = getHardware()->dump( + {"--getWithArg", propIdStr, "-i64", StringPrintf("%" PRId64, timestamp)}); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("Get property result:")); + } + + // Set the timestamp argument to 0. + result = getHardware()->dump({"--getWithArg", propIdStr, "-i64", "0"}); + + ASSERT_FALSE(result.callerShouldDumpState); + // There is no freeze obd2 frame at timestamp 0. + ASSERT_THAT(result.buffer, ContainsRegex("failed to read property value")); +} + +TEST_F(FakeVehicleHardwareTest, testSaveRestoreProp) { + int32_t prop = toInt(VehicleProperty::TIRE_PRESSURE); + std::string propIdStr = std::to_string(prop); + std::string areaIdStr = std::to_string(WHEEL_FRONT_LEFT); + + DumpResult result = getHardware()->dump({"--save-prop", propIdStr, "-a", areaIdStr}); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, ContainsRegex("saved")); + + ASSERT_EQ(setValue(VehiclePropValue{ + .prop = prop, + .areaId = WHEEL_FRONT_LEFT, + .value = + { + .floatValues = {210.0}, + }, + }), + StatusCode::OK); + + result = getHardware()->dump({"--restore-prop", propIdStr, "-a", areaIdStr}); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, ContainsRegex("restored")); + + auto getResult = getValue(VehiclePropValue{.prop = prop, .areaId = WHEEL_FRONT_LEFT}); + + ASSERT_TRUE(getResult.ok()); + // The default value is 200.0. + ASSERT_EQ(getResult.value().value.floatValues, std::vector{200.0}); +} + +TEST_F(FakeVehicleHardwareTest, testDumpInjectEvent) { + int32_t prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + std::string propIdStr = std::to_string(prop); + + int64_t timestamp = elapsedRealtimeNano(); + // Inject an event with float value 123.4 and timestamp. + DumpResult result = getHardware()->dump( + {"--inject-event", propIdStr, "-f", "123.4", "-t", std::to_string(timestamp)}); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, + ContainsRegex(StringPrintf("Event for property: %d injected", prop))); + ASSERT_TRUE(waitForChangedProperties(prop, 0, /*count=*/1, milliseconds(1000))) + << "No changed event received for injected event from vehicle bus"; + auto events = getChangedProperties(); + ASSERT_EQ(events.size(), 1u); + auto event = events[0]; + ASSERT_EQ(event.timestamp, timestamp); + ASSERT_EQ(event.value.floatValues, std::vector({123.4})); +} + TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) { std::vector options; options.push_back("--invalid"); @@ -1405,26 +2282,16 @@ TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) { ASSERT_THAT(result.buffer, ContainsRegex("Invalid option: --invalid")); } -TEST_F(FakeVehicleHardwareTest, testDumpFakeUserHalHelp) { - std::vector options; - options.push_back("--user-hal"); - - DumpResult result = getHardware()->dump(options); - ASSERT_FALSE(result.callerShouldDumpState); - ASSERT_NE(result.buffer, ""); - ASSERT_THAT(result.buffer, ContainsRegex("dumps state used for user management")); -} - TEST_F(FakeVehicleHardwareTest, testDumpFakeUserHal) { std::vector options; options.push_back("--user-hal"); - // Indent: " ". - options.push_back(" "); DumpResult result = getHardware()->dump(options); ASSERT_FALSE(result.callerShouldDumpState); ASSERT_NE(result.buffer, ""); - ASSERT_THAT(result.buffer, ContainsRegex(" No InitialUserInfo response\n")); + ASSERT_THAT(result.buffer, + ContainsRegex("No InitialUserInfo response\nNo SwitchUser response\nNo CreateUser " + "response\nNo SetUserIdentificationAssociation response\n")); } struct SetPropTestCase { @@ -1606,6 +2473,386 @@ TEST_F(FakeVehicleHardwareTest, SetComplexPropTest) { ASSERT_EQ(3.402823466E+38f, value.value.floatValues[2]); } +struct OptionsTestCase { + std::string name; + std::vector options; + std::string expectMsg; +}; + +class FakeVehicleHardwareOptionsTest : public FakeVehicleHardwareTest, + public testing::WithParamInterface {}; + +std::vector GenInvalidOptions() { + return {{"unknown_command", {"--unknown"}, "Invalid option: --unknown"}, + {"help", {"--help"}, "Usage:"}, + {"genfakedata_no_subcommand", + {"--genfakedata"}, + "No subcommand specified for genfakedata"}, + {"genfakedata_unknown_subcommand", + {"--genfakedata", "--unknown"}, + "Unknown command: \"--unknown\""}, + {"genfakedata_start_linear_no_args", + {"--genfakedata", "--startlinear"}, + "incorrect argument count"}, + {"genfakedata_start_linear_invalid_propId", + {"--genfakedata", "--startlinear", "abcd", "0.1", "0.1", "0.1", "0.1", "100000000"}, + "failed to parse propId as int: \"abcd\""}, + {"genfakedata_start_linear_invalid_middleValue", + {"--genfakedata", "--startlinear", "1", "abcd", "0.1", "0.1", "0.1", "100000000"}, + "failed to parse middleValue as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_currentValue", + {"--genfakedata", "--startlinear", "1", "0.1", "abcd", "0.1", "0.1", "100000000"}, + "failed to parse currentValue as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_dispersion", + {"--genfakedata", "--startlinear", "1", "0.1", "0.1", "abcd", "0.1", "100000000"}, + "failed to parse dispersion as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_increment", + {"--genfakedata", "--startlinear", "1", "0.1", "0.1", "0.1", "abcd", "100000000"}, + "failed to parse increment as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_interval", + {"--genfakedata", "--startlinear", "1", "0.1", "0.1", "0.1", "0.1", "0.1"}, + "failed to parse interval as int: \"0.1\""}, + {"genfakedata_stop_linear_no_args", + {"--genfakedata", "--stoplinear"}, + "incorrect argument count"}, + {"genfakedata_stop_linear_invalid_propId", + {"--genfakedata", "--stoplinear", "abcd"}, + "failed to parse propId as int: \"abcd\""}, + {"genfakedata_startjson_no_args", + {"--genfakedata", "--startjson"}, + "incorrect argument count"}, + {"genfakedata_startjson_invalid_repetition", + {"--genfakedata", "--startjson", "--path", "file", "0.1"}, + "failed to parse repetition as int: \"0.1\""}, + {"genfakedata_startjson_invalid_json_file", + {"--genfakedata", "--startjson", "--path", "file", "1"}, + "invalid JSON file"}, + {"genfakedata_stopjson_no_args", + {"--genfakedata", "--stopjson"}, + "incorrect argument count"}, + {"genfakedata_keypress_no_args", + {"--genfakedata", "--keypress"}, + "incorrect argument count"}, + {"genfakedata_keypress_invalid_keyCode", + {"--genfakedata", "--keypress", "0.1", "1"}, + "failed to parse keyCode as int: \"0.1\""}, + {"genfakedata_keypress_invalid_display", + {"--genfakedata", "--keypress", "1", "0.1"}, + "failed to parse display as int: \"0.1\""}, + {"genfakedata_keyinputv2_incorrect_arguments", + {"--genfakedata", "--keyinputv2", "1", "1"}, + "incorrect argument count, need 7 arguments for --genfakedata --keyinputv2\n"}, + {"genfakedata_keyinputv2_invalid_area", + {"--genfakedata", "--keyinputv2", "0.1", "1", "1", "1", "1"}, + "failed to parse area as int: \"0.1\""}, + {"genfakedata_keyinputv2_invalid_display", + {"--genfakedata", "--keyinputv2", "1", "0.1", "1", "1", "1"}, + "failed to parse display as int: \"0.1\""}, + {"genfakedata_keyinputv2_invalid_keycode", + {"--genfakedata", "--keyinputv2", "1", "1", "0.1", "1", "1"}, + "failed to parse keyCode as int: \"0.1\""}, + {"genfakedata_keyinputv2_invalid_action", + {"--genfakedata", "--keyinputv2", "1", "1", "1", "0.1", "1"}, + "failed to parse action as int: \"0.1\""}, + {"genfakedata_keyinputv2_invalid_repeatcount", + {"--genfakedata", "--keyinputv2", "1", "1", "1", "1", "0.1"}, + "failed to parse repeatCount as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_argument_count", + {"--genfakedata", "--motioninput", "1", "1", "1", "1", "1"}, + "incorrect argument count, need at least 14 arguments for --genfakedata " + "--motioninput including at least 1 --pointer\n"}, + {"genfakedata_motioninput_pointer_invalid_argument_count", + {"--genfakedata", "--motioninput", "1", "1", "1", "1", "1", "--pointer", "1", "1", "1", + "1", "1", "1", "--pointer"}, + "incorrect argument count, need 6 arguments for every --pointer\n"}, + {"genfakedata_motioninput_invalid_area", + {"--genfakedata", "--motioninput", "0.1", "1", "1", "1", "1", "--pointer", "1", "1", + "1", "1", "1", "1"}, + "failed to parse area as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_display", + {"--genfakedata", "--motioninput", "1", "0.1", "1", "1", "1", "--pointer", "1", "1", + "1", "1", "1", "1"}, + "failed to parse display as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_inputtype", + {"--genfakedata", "--motioninput", "1", "1", "0.1", "1", "1", "--pointer", "1", "1", + "1", "1", "1", "1"}, + "failed to parse inputType as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_action", + {"--genfakedata", "--motioninput", "1", "1", "1", "0.1", "1", "--pointer", "1", "1", + "1", "1", "1", "1"}, + "failed to parse action as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_buttonstate", + {"--genfakedata", "--motioninput", "1", "1", "1", "1", "0.1", "--pointer", "1", "1", + "1.2", "1.2", "1.2", "1.2"}, + "failed to parse buttonState as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_pointerid", + {"--genfakedata", "--motioninput", "1", "1", "1", "1", "1", "--pointer", "0.1", "1", + "1.2", "1", "1", "1"}, + "failed to parse pointerId as int: \"0.1\""}, + {"genfakedata_motioninput_invalid_tooltype", + {"--genfakedata", "--motioninput", "1", "1", "1", "1", "1", "--pointer", "1", "0.1", + "1.2", "1", "1", "1"}, + "failed to parse toolType as int: \"0.1\""}}; +} + +TEST_P(FakeVehicleHardwareOptionsTest, testInvalidOptions) { + auto tc = GetParam(); + + DumpResult result = getHardware()->dump(tc.options); + + EXPECT_FALSE(result.callerShouldDumpState); + EXPECT_THAT(result.buffer, HasSubstr(tc.expectMsg)); +} + +INSTANTIATE_TEST_SUITE_P( + FakeVehicleHardwareOptionsTests, FakeVehicleHardwareOptionsTest, + testing::ValuesIn(GenInvalidOptions()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataLinear) { + // Start a fake linear data generator for vehicle speed at 0.1s interval. + // range: 0 - 100, current value: 30, step: 20. + std::string propIdString = StringPrintf("%d", toInt(VehicleProperty::PERF_VEHICLE_SPEED)); + std::vector options = {"--genfakedata", "--startlinear", propIdString, + /*middleValue=*/"50", + /*currentValue=*/"30", + /*dispersion=*/"50", + /*increment=*/"20", + /*interval=*/"100000000"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + ASSERT_TRUE(waitForChangedProperties(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0, /*count=*/5, + milliseconds(1000))) + << "not enough events generated for linear data generator"; + + int32_t value = 30; + auto events = getChangedProperties(); + for (size_t i = 0; i < 5; i++) { + ASSERT_EQ(1u, events[i].value.floatValues.size()); + EXPECT_EQ(static_cast(value), events[i].value.floatValues[0]); + value = (value + 20) % 100; + } + + // Stop the linear generator. + options = {"--genfakedata", "--stoplinear", propIdString}; + + result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + clearChangedProperties(); + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + // There should be no new events generated. + EXPECT_EQ(0u, getEventCount(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0)); +} + +std::string getTestFilePath(const char* filename) { + static std::string baseDir = android::base::GetExecutableDirectory(); + return baseDir + "/fakedata/" + filename; +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJson) { + std::vector options = {"--genfakedata", "--startjson", "--path", + getTestFilePath("prop.json"), "2"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + ASSERT_TRUE(waitForChangedProperties(/*count=*/8, milliseconds(1000))) + << "not enough events generated for JSON data generator"; + + auto events = getChangedProperties(); + ASSERT_EQ(8u, events.size()); + // First set of events, we test 1st and the last. + EXPECT_EQ(1u, events[0].value.int32Values.size()); + EXPECT_EQ(8, events[0].value.int32Values[0]); + EXPECT_EQ(1u, events[3].value.int32Values.size()); + EXPECT_EQ(10, events[3].value.int32Values[0]); + // Second set of the same events. + EXPECT_EQ(1u, events[4].value.int32Values.size()); + EXPECT_EQ(8, events[4].value.int32Values[0]); + EXPECT_EQ(1u, events[7].value.int32Values.size()); + EXPECT_EQ(10, events[7].value.int32Values[0]); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonByContent) { + std::vector options = { + "--genfakedata", "--startjson", "--content", + "[{\"timestamp\":1000000,\"areaId\":0,\"value\":8,\"prop\":289408000}]", "1"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + ASSERT_TRUE(waitForChangedProperties(/*count=*/1, milliseconds(1000))) + << "not enough events generated for JSON data generator"; + + auto events = getChangedProperties(); + ASSERT_EQ(1u, events.size()); + EXPECT_EQ(1u, events[0].value.int32Values.size()); + EXPECT_EQ(8, events[0].value.int32Values[0]); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonInvalidContent) { + std::vector options = {"--genfakedata", "--startjson", "--content", "[{", "2"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("invalid JSON content")); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonInvalidFile) { + std::vector options = {"--genfakedata", "--startjson", "--path", + getTestFilePath("blahblah.json"), "2"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("invalid JSON file")); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonStop) { + // No iteration number provided, would loop indefinitely. + std::vector options = {"--genfakedata", "--startjson", "--path", + getTestFilePath("prop.json")}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + std::string id = result.buffer.substr(result.buffer.find("ID: ") + 4); + + result = getHardware()->dump({"--genfakedata", "--stopjson", id}); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonStopInvalidFile) { + // No iteration number provided, would loop indefinitely. + std::vector options = {"--genfakedata", "--startjson", "--path", + getTestFilePath("prop.json")}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + result = getHardware()->dump({"--genfakedata", "--stopjson", "1234"}); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("No JSON event generator found")); + + // TearDown function should destroy the generator which stops the iteration. +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyPress) { + std::vector options = {"--genfakedata", "--keypress", "1", "2"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + auto events = getChangedProperties(); + ASSERT_EQ(2u, events.size()); + EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[0].prop); + EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[1].prop); + ASSERT_EQ(3u, events[0].value.int32Values.size()); + ASSERT_EQ(3u, events[1].value.int32Values.size()); + EXPECT_EQ(toInt(VehicleHwKeyInputAction::ACTION_DOWN), events[0].value.int32Values[0]); + EXPECT_EQ(1, events[0].value.int32Values[1]); + EXPECT_EQ(2, events[0].value.int32Values[2]); + EXPECT_EQ(toInt(VehicleHwKeyInputAction::ACTION_UP), events[1].value.int32Values[0]); + EXPECT_EQ(1, events[1].value.int32Values[1]); + EXPECT_EQ(2, events[1].value.int32Values[2]); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyInputV2) { + std::vector options = {"--genfakedata", "--keyinputv2", "1", "2", "3", "4", "5"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + auto events = getChangedProperties(); + ASSERT_EQ(1u, events.size()); + EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT_V2), events[0].prop); + ASSERT_EQ(4u, events[0].value.int32Values.size()); + EXPECT_EQ(2, events[0].value.int32Values[0]); + EXPECT_EQ(3, events[0].value.int32Values[1]); + EXPECT_EQ(4, events[0].value.int32Values[2]); + EXPECT_EQ(5, events[0].value.int32Values[3]); + ASSERT_EQ(1u, events[0].value.int64Values.size()); +} + +TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataMotionInput) { + std::vector options = {"--genfakedata", + "--motioninput", + "1", + "2", + "3", + "4", + "5", + "--pointer", + "11", + "22", + "33.3", + "44.4", + "55.5", + "66.6", + "--pointer", + "21", + "32", + "43.3", + "54.4", + "65.5", + "76.6"}; + + DumpResult result = getHardware()->dump(options); + + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_THAT(result.buffer, HasSubstr("successfully")); + + auto events = getChangedProperties(); + ASSERT_EQ(1u, events.size()); + EXPECT_EQ(toInt(VehicleProperty::HW_MOTION_INPUT), events[0].prop); + ASSERT_EQ(9u, events[0].value.int32Values.size()); + EXPECT_EQ(2, events[0].value.int32Values[0]); + EXPECT_EQ(3, events[0].value.int32Values[1]); + EXPECT_EQ(4, events[0].value.int32Values[2]); + EXPECT_EQ(5, events[0].value.int32Values[3]); + EXPECT_EQ(2, events[0].value.int32Values[4]); + EXPECT_EQ(11, events[0].value.int32Values[5]); + EXPECT_EQ(21, events[0].value.int32Values[6]); + EXPECT_EQ(22, events[0].value.int32Values[7]); + EXPECT_EQ(32, events[0].value.int32Values[8]); + ASSERT_EQ(8u, events[0].value.floatValues.size()); + EXPECT_FLOAT_EQ(33.3, events[0].value.floatValues[0]); + EXPECT_FLOAT_EQ(43.3, events[0].value.floatValues[1]); + EXPECT_FLOAT_EQ(44.4, events[0].value.floatValues[2]); + EXPECT_FLOAT_EQ(54.4, events[0].value.floatValues[3]); + EXPECT_FLOAT_EQ(55.5, events[0].value.floatValues[4]); + EXPECT_FLOAT_EQ(65.5, events[0].value.floatValues[5]); + EXPECT_FLOAT_EQ(66.6, events[0].value.floatValues[6]); + EXPECT_FLOAT_EQ(76.6, events[0].value.floatValues[7]); + ASSERT_EQ(1u, events[0].value.int64Values.size()); +} + TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) { ASSERT_EQ(setValue(VehiclePropValue{ .prop = ECHO_REVERSE_BYTES, @@ -1653,6 +2900,348 @@ TEST_F(FakeVehicleHardwareTest, testUpdateSampleRate) { } } +TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { + float CELSIUS = static_cast(toInt(VehicleUnit::CELSIUS)); + float FAHRENHEIT = static_cast(toInt(VehicleUnit::FAHRENHEIT)); + + VehiclePropValue floatArraySizeFour = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {0, CELSIUS, 0, 0}, + }; + StatusCode status = setValue(floatArraySizeFour); + EXPECT_EQ(status, StatusCode::OK); + + VehiclePropValue floatArraySizeZero = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + }; + status = setValue(floatArraySizeZero); + EXPECT_EQ(status, StatusCode::INVALID_ARG); + + VehiclePropValue floatArraySizeFive = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {0, CELSIUS, 0, 0, 0}, + }; + status = setValue(floatArraySizeFive); + EXPECT_EQ(status, StatusCode::INVALID_ARG); + + VehiclePropValue invalidUnit = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {0, 0, 0, 0}, + }; + status = setValue(floatArraySizeFive); + EXPECT_EQ(status, StatusCode::INVALID_ARG); + clearChangedProperties(); + + // Config array values from HVAC_TEMPERATURE_SET in DefaultProperties.json + auto configs = getHardware()->getAllPropertyConfigs(); + VehiclePropConfig* hvacTemperatureSetConfig = nullptr; + for (auto& config : configs) { + if (config.prop == toInt(VehicleProperty::HVAC_TEMPERATURE_SET)) { + hvacTemperatureSetConfig = &config; + break; + } + } + EXPECT_NE(hvacTemperatureSetConfig, nullptr); + + auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfig->configArray; + // The HVAC_TEMPERATURE_SET config array values are temperature values that have been multiplied + // by 10 and converted to integers. HVAC_TEMPERATURE_VALUE_SUGGESTION specifies the temperature + // values to be in the original floating point form so we divide by 10 and convert to float. + float minTempInCelsius = hvacTemperatureSetConfigArray[0] / 10.0f; + float maxTempInCelsius = hvacTemperatureSetConfigArray[1] / 10.0f; + float incrementInCelsius = hvacTemperatureSetConfigArray[2] / 10.0f; + float minTempInFahrenheit = hvacTemperatureSetConfigArray[3] / 10.0f; + float maxTempInFahrenheit = hvacTemperatureSetConfigArray[4] / 10.0f; + float incrementInFahrenheit = hvacTemperatureSetConfigArray[5] / 10.0f; + + auto testCases = { + SetSpecialValueTestCase{ + .name = "min_celsius_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInCelsius, CELSIUS, 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInCelsius, CELSIUS, + minTempInCelsius, + minTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "min_fahrenheit_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInFahrenheit, FAHRENHEIT, + 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInFahrenheit, FAHRENHEIT, + minTempInCelsius, + minTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "max_celsius_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInCelsius, CELSIUS, 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInCelsius, CELSIUS, + maxTempInCelsius, + maxTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "max_fahrenheit_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInFahrenheit, FAHRENHEIT, + 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInFahrenheit, FAHRENHEIT, + maxTempInCelsius, + maxTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "below_min_celsius_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInCelsius - 1, CELSIUS, 0, + 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInCelsius - 1, CELSIUS, + minTempInCelsius, + minTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "below_min_fahrenheit_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInFahrenheit - 1, + FAHRENHEIT, 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInFahrenheit - 1, + FAHRENHEIT, minTempInCelsius, + minTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "above_max_celsius_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInCelsius + 1, CELSIUS, 0, + 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInCelsius + 1, CELSIUS, + maxTempInCelsius, + maxTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "above_max_fahrenheit_temperature", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInFahrenheit + 1, + FAHRENHEIT, 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {maxTempInFahrenheit + 1, + FAHRENHEIT, maxTempInCelsius, + maxTempInFahrenheit}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "inbetween_value_celsius", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInCelsius + + incrementInCelsius * 2.5f, + CELSIUS, 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = + {minTempInCelsius + incrementInCelsius * 2.5f, + CELSIUS, + minTempInCelsius + incrementInCelsius * 2, + minTempInFahrenheit + + incrementInFahrenheit * 2}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "inbetween_value_fahrenheit", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = {minTempInFahrenheit + + incrementInFahrenheit * + 2.5f, + FAHRENHEIT, 0, 0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = HVAC_ALL, + .value.floatValues = + {minTempInFahrenheit + + incrementInFahrenheit * 2.5f, + FAHRENHEIT, + minTempInCelsius + incrementInCelsius * 2, + minTempInFahrenheit + + incrementInFahrenheit * 2}, + }, + }, + }, + }; + + for (auto& tc : testCases) { + StatusCode status = setValue(tc.valuesToSet[0]); + EXPECT_EQ(status, StatusCode::OK); + + auto events = getChangedProperties(); + EXPECT_EQ(events.size(), static_cast(1)); + events[0].timestamp = 0; + + EXPECT_EQ(events[0], tc.expectedValuesToGet[0]); + clearChangedProperties(); + } +} + } // namespace fake } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/fakedata/prop.json b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/fakedata/prop.json new file mode 100644 index 0000000000..7123a002cc --- /dev/null +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/fakedata/prop.json @@ -0,0 +1,26 @@ +[ + { + "timestamp": 1000000, + "areaId": 0, + "value": 8, + "prop": 289408000 + }, + { + "timestamp": 2000000, + "areaId": 0, + "value": 4, + "prop": 289408000 + }, + { + "timestamp": 3000000, + "areaId": 0, + "value": 16, + "prop": 289408000 + }, + { + "timestamp": 4000000, + "areaId": 0, + "value": 10, + "prop": 289408000 + } +] diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/gear_selection.json b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/gear_selection.json index 59666b8046..693f1e2ae5 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/gear_selection.json +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/gear_selection.json @@ -1,9 +1,13 @@ -[ - { - "timestamp": 1000000, - "areaId": 0, - "value": 8, - // GEAR_SELECTION - "prop": 289408000 - } -] +{ + "apiVersion": 1, + "properties": [ + { + "property": "VehicleProperty::GEAR_SELECTION", + "defaultValue": { + "int32Values": [ + 8 + ] + } + } + ] +} diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/hvac_temperature_set.json b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/hvac_temperature_set.json index 93a97ed095..07cfebba10 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/hvac_temperature_set.json +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/override/hvac_temperature_set.json @@ -1,10 +1,20 @@ -[ - { - "timestamp": 1000000, - // HVAC_LEFT - "areaId": 49, - "value": 30, - // HVAC_TEMPERATURE_SET - "prop": 358614275 - } -] +{ + "apiVersion": 1, + "properties": [ + { + "property": "VehicleProperty::HVAC_TEMPERATURE_SET", + "areas": [ + { + "defaultValue": { + "floatValues": [ + 30.0 + ] + }, + "areaId": 49, + "minFloatValue": 16.0, + "maxFloatValue": 32.0 + } + ] + } + ] +} diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h index 4ae9c8c1cb..fcbe8fddea 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h @@ -64,7 +64,7 @@ class FakeUserHal final { std::string showDumpHelp() const; // Dump its contents. - std::string dump(std::string indent) const; + std::string dump() const; private: const std::shared_ptr mValuePool; diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp b/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp index 7748fb6618..878c2e7da0 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp @@ -328,6 +328,9 @@ FakeUserHal::ValueResultType FakeUserHal::sendUserHalResponse( << "invalid action on lshal response: " << response->toString(); } + // Update area ID to 0 since this is a global property (and the area ID was only set to emulate + // the request id behavior). + response->areaId = 0; ALOGD("updating property to: %s", response->toString().c_str()); return response; } @@ -336,33 +339,31 @@ std::string FakeUserHal::showDumpHelp() const { return fmt::format("{}: dumps state used for user management\n", kUserHalDumpOption); } -std::string FakeUserHal::dump(std::string indent) const { +std::string FakeUserHal::dump() const { std::scoped_lock lockGuard(mLock); std::string info; if (mInitialUserResponseFromCmd != nullptr) { - info += fmt::format("{}InitialUserInfo response: {}\n", indent, + info += fmt::format("InitialUserInfo response: {}\n", mInitialUserResponseFromCmd->toString()); } else { - info += fmt::format("{}No InitialUserInfo response\n", indent); + info += "No InitialUserInfo response\n"; } if (mSwitchUserResponseFromCmd != nullptr) { - info += fmt::format("{}SwitchUser response: {}\n", indent, - mSwitchUserResponseFromCmd->toString()); + info += fmt::format("SwitchUser response: {}\n", mSwitchUserResponseFromCmd->toString()); } else { - info += fmt::format("{}No SwitchUser response\n", indent); + info += "No SwitchUser response\n"; } if (mCreateUserResponseFromCmd != nullptr) { - info += fmt::format("{}CreateUser response: {}\n", indent, - mCreateUserResponseFromCmd->toString()); + info += fmt::format("CreateUser response: {}\n", mCreateUserResponseFromCmd->toString()); } else { - info += fmt::format("{}No CreateUser response\n", indent); + info += "No CreateUser response\n"; } if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { - info += fmt::format("{}SetUserIdentificationAssociation response: {}\n", indent, + info += fmt::format("SetUserIdentificationAssociation response: {}\n", mSetUserIdentificationAssociationResponseFromCmd->toString()); } else { - info += fmt::format("{}No SetUserIdentificationAssociation response\n", indent); + info += "No SetUserIdentificationAssociation response\n"; } return info; } diff --git a/automotive/vehicle/aidl/impl/grpc/Android.bp b/automotive/vehicle/aidl/impl/grpc/Android.bp new file mode 100644 index 0000000000..06c9600100 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/Android.bp @@ -0,0 +1,126 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +genrule { + name: "VehicleServerProtoStub_h@default-grpc", + tools: [ + "aprotoc", + "protoc-gen-grpc-cpp-plugin", + ], + cmd: "$(location aprotoc) -I$$(dirname $(in)) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", + srcs: [ + "proto/VehicleServer.proto", + ], + out: [ + "VehicleServer.pb.h", + "VehicleServer.grpc.pb.h", + ], + visibility: ["//visibility:private"], +} + +genrule { + name: "VehicleServerProtoStub_cc@default-grpc", + tools: [ + "aprotoc", + "protoc-gen-grpc-cpp-plugin", + ], + cmd: "$(location aprotoc) -I$$(dirname $(in)) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", + srcs: [ + "proto/VehicleServer.proto", + ], + out: [ + "VehicleServer.pb.cc", + "VehicleServer.grpc.pb.cc", + ], + visibility: ["//visibility:private"], +} + +cc_library_static { + name: "android.hardware.automotive.vehicle@default-grpc-libgrpc", + vendor: true, + host_supported: true, + include_dirs: [ + "external/protobuf/src", + ], + generated_headers: [ + "VehicleServerProtoStub_h@default-grpc", + ], + export_generated_headers: [ + "VehicleServerProtoStub_h@default-grpc", + ], + generated_sources: [ + "VehicleServerProtoStub_cc@default-grpc", + ], + whole_static_libs: [ + "VehicleHalProtos", + ], + shared_libs: [ + "libgrpc++", + ], + cflags: [ + "-Wno-unused-parameter", + ], +} + +cc_library_static { + name: "android.hardware.automotive.vehicle@default-grpc-hardware-lib", + defaults: ["VehicleHalDefaults"], + vendor: true, + srcs: [ + "GRPCVehicleHardware.cpp", + ], + whole_static_libs: [ + "android.hardware.automotive.vehicle@default-grpc-libgrpc", + "VehicleHalProtoMessageConverter", + ], + header_libs: [ + "IVehicleHardware", + ], + shared_libs: [ + "libgrpc++", + "libprotobuf-cpp-full", + ], + export_include_dirs: ["."], + cflags: [ + "-Wno-unused-parameter", + ], +} + +cc_library_static { + name: "android.hardware.automotive.vehicle@default-grpc-server-lib", + defaults: ["VehicleHalDefaults"], + vendor: true, + srcs: [ + "GRPCVehicleProxyServer.cpp", + ], + whole_static_libs: [ + "android.hardware.automotive.vehicle@default-grpc-libgrpc", + "VehicleHalProtoMessageConverter", + ], + header_libs: [ + "IVehicleHardware", + ], + shared_libs: [ + "libgrpc++", + "libprotobuf-cpp-full", + ], + export_include_dirs: ["."], + cflags: [ + "-Wno-unused-parameter", + ], +} diff --git a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.cpp b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.cpp new file mode 100644 index 0000000000..07422835d2 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.cpp @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "ProtoMessageConverter.h" + +#include +#include + +#include +#include +#include +#include + +namespace android::hardware::automotive::vehicle::virtualization { + +static std::shared_ptr<::grpc::ChannelCredentials> getChannelCredentials() { + // TODO(chenhaosjtuacm): get secured credentials here + return ::grpc::InsecureChannelCredentials(); +} + +GRPCVehicleHardware::GRPCVehicleHardware(std::string service_addr) + : mServiceAddr(std::move(service_addr)), + mGrpcChannel(::grpc::CreateChannel(mServiceAddr, getChannelCredentials())), + mGrpcStub(proto::VehicleServer::NewStub(mGrpcChannel)), + mValuePollingThread([this] { ValuePollingLoop(); }) {} + +GRPCVehicleHardware::~GRPCVehicleHardware() { + { + std::lock_guard lck(mShutdownMutex); + mShuttingDownFlag.store(true); + } + mShutdownCV.notify_all(); + mValuePollingThread.join(); +} + +std::vector GRPCVehicleHardware::getAllPropertyConfigs() const { + std::vector configs; + ::grpc::ClientContext context; + auto config_stream = mGrpcStub->GetAllPropertyConfig(&context, ::google::protobuf::Empty()); + proto::VehiclePropConfig protoConfig; + while (config_stream->Read(&protoConfig)) { + aidlvhal::VehiclePropConfig config; + proto_msg_converter::protoToAidl(protoConfig, &config); + configs.push_back(std::move(config)); + } + auto grpc_status = config_stream->Finish(); + if (!grpc_status.ok()) { + LOG(ERROR) << __func__ + << ": GRPC GetAllPropertyConfig Failed: " << grpc_status.error_message(); + } + return configs; +} + +aidlvhal::StatusCode GRPCVehicleHardware::setValues( + std::shared_ptr callback, + const std::vector& requests) { + ::grpc::ClientContext context; + proto::VehiclePropValueRequests protoRequests; + proto::SetValueResults protoResults; + for (const auto& request : requests) { + auto& protoRequest = *protoRequests.add_requests(); + protoRequest.set_request_id(request.requestId); + proto_msg_converter::aidlToProto(request.value, protoRequest.mutable_value()); + } + // TODO(chenhaosjtuacm): Make it Async. + auto grpc_status = mGrpcStub->SetValues(&context, protoRequests, &protoResults); + if (!grpc_status.ok()) { + LOG(ERROR) << __func__ << ": GRPC SetValues Failed: " << grpc_status.error_message(); + { + std::shared_lock lck(mCallbackMutex); + // TODO(chenhaosjtuacm): call on-set-error callback. + } + return aidlvhal::StatusCode::INTERNAL_ERROR; + } + std::vector results; + for (const auto& protoResult : protoResults.results()) { + auto& result = results.emplace_back(); + result.requestId = protoResult.request_id(); + result.status = static_cast(protoResult.status()); + // TODO(chenhaosjtuacm): call on-set-error callback. + } + (*callback)(std::move(results)); + + return aidlvhal::StatusCode::OK; +} + +aidlvhal::StatusCode GRPCVehicleHardware::getValues( + std::shared_ptr callback, + const std::vector& requests) const { + ::grpc::ClientContext context; + proto::VehiclePropValueRequests protoRequests; + proto::GetValueResults protoResults; + for (const auto& request : requests) { + auto& protoRequest = *protoRequests.add_requests(); + protoRequest.set_request_id(request.requestId); + proto_msg_converter::aidlToProto(request.prop, protoRequest.mutable_value()); + } + // TODO(chenhaosjtuacm): Make it Async. + auto grpc_status = mGrpcStub->GetValues(&context, protoRequests, &protoResults); + if (!grpc_status.ok()) { + LOG(ERROR) << __func__ << ": GRPC GetValues Failed: " << grpc_status.error_message(); + return aidlvhal::StatusCode::INTERNAL_ERROR; + } + std::vector results; + for (const auto& protoResult : protoResults.results()) { + auto& result = results.emplace_back(); + result.requestId = protoResult.request_id(); + result.status = static_cast(protoResult.status()); + if (protoResult.has_value()) { + aidlvhal::VehiclePropValue value; + proto_msg_converter::protoToAidl(protoResult.value(), &value); + result.prop = std::move(value); + } + } + (*callback)(std::move(results)); + + return aidlvhal::StatusCode::OK; +} + +void GRPCVehicleHardware::registerOnPropertyChangeEvent( + std::unique_ptr callback) { + std::lock_guard lck(mCallbackMutex); + if (mOnPropChange) { + LOG(ERROR) << __func__ << " must only be called once."; + return; + } + mOnPropChange = std::move(callback); +} + +void GRPCVehicleHardware::registerOnPropertySetErrorEvent( + std::unique_ptr callback) { + std::lock_guard lck(mCallbackMutex); + if (mOnSetErr) { + LOG(ERROR) << __func__ << " must only be called once."; + return; + } + mOnSetErr = std::move(callback); +} + +DumpResult GRPCVehicleHardware::dump(const std::vector& options) { + ::grpc::ClientContext context; + proto::DumpOptions protoDumpOptions; + proto::DumpResult protoDumpResult; + for (const auto& option : options) { + protoDumpOptions.add_options(option); + } + auto grpc_status = mGrpcStub->Dump(&context, protoDumpOptions, &protoDumpResult); + if (!grpc_status.ok()) { + LOG(ERROR) << __func__ << ": GRPC Dump Failed: " << grpc_status.error_message(); + return {}; + } + return { + .callerShouldDumpState = protoDumpResult.caller_should_dump_state(), + .buffer = protoDumpResult.buffer(), + }; +} + +aidlvhal::StatusCode GRPCVehicleHardware::checkHealth() { + ::grpc::ClientContext context; + proto::VehicleHalCallStatus protoStatus; + auto grpc_status = mGrpcStub->CheckHealth(&context, ::google::protobuf::Empty(), &protoStatus); + if (!grpc_status.ok()) { + LOG(ERROR) << __func__ << ": GRPC CheckHealth Failed: " << grpc_status.error_message(); + return aidlvhal::StatusCode::INTERNAL_ERROR; + } + return static_cast(protoStatus.status_code()); +} + +aidlvhal::StatusCode GRPCVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, + float sampleRate) { + ::grpc::ClientContext context; + proto::UpdateSampleRateRequest request; + proto::VehicleHalCallStatus protoStatus; + request.set_prop(propId); + request.set_area_id(areaId); + request.set_sample_rate(sampleRate); + auto grpc_status = mGrpcStub->UpdateSampleRate(&context, request, &protoStatus); + if (!grpc_status.ok()) { + LOG(ERROR) << __func__ << ": GRPC UpdateSampleRate Failed: " << grpc_status.error_message(); + return aidlvhal::StatusCode::INTERNAL_ERROR; + } + return static_cast(protoStatus.status_code()); +} + +bool GRPCVehicleHardware::waitForConnected(std::chrono::milliseconds waitTime) { + return mGrpcChannel->WaitForConnected(gpr_time_add( + gpr_now(GPR_CLOCK_MONOTONIC), gpr_time_from_millis(waitTime.count(), GPR_TIMESPAN))); +} + +void GRPCVehicleHardware::ValuePollingLoop() { + while (!mShuttingDownFlag.load()) { + ::grpc::ClientContext context; + + bool rpc_stopped{false}; + std::thread shuttingdown_watcher([this, &rpc_stopped, &context]() { + std::unique_lock lck(mShutdownMutex); + mShutdownCV.wait(lck, [this, &rpc_stopped]() { + return rpc_stopped || mShuttingDownFlag.load(); + }); + context.TryCancel(); + }); + + auto value_stream = + mGrpcStub->StartPropertyValuesStream(&context, ::google::protobuf::Empty()); + LOG(INFO) << __func__ << ": GRPC Value Streaming Started"; + proto::VehiclePropValues protoValues; + while (!mShuttingDownFlag.load() && value_stream->Read(&protoValues)) { + std::vector values; + for (const auto protoValue : protoValues.values()) { + values.push_back(aidlvhal::VehiclePropValue()); + proto_msg_converter::protoToAidl(protoValue, &values.back()); + } + std::shared_lock lck(mCallbackMutex); + if (mOnPropChange) { + (*mOnPropChange)(values); + } + } + + { + std::lock_guard lck(mShutdownMutex); + rpc_stopped = true; + } + mShutdownCV.notify_all(); + shuttingdown_watcher.join(); + + auto grpc_status = value_stream->Finish(); + // never reach here until connection lost + LOG(ERROR) << __func__ << ": GRPC Value Streaming Failed: " << grpc_status.error_message(); + + // try to reconnect + } +} + +} // namespace android::hardware::automotive::vehicle::virtualization diff --git a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h new file mode 100644 index 0000000000..e740da7e5c --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include "VehicleServer.grpc.pb.h" +#include "VehicleServer.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::automotive::vehicle::virtualization { + +namespace aidlvhal = ::aidl::android::hardware::automotive::vehicle; + +class GRPCVehicleHardware : public IVehicleHardware { + public: + explicit GRPCVehicleHardware(std::string service_addr); + + ~GRPCVehicleHardware(); + + // Get all the property configs. + std::vector getAllPropertyConfigs() const override; + + // Set property values asynchronously. Server could return before the property set requests + // are sent to vehicle bus or before property set confirmation is received. The callback is + // safe to be called after the function returns and is safe to be called in a different thread. + aidlvhal::StatusCode setValues(std::shared_ptr callback, + const std::vector& requests) override; + + // Get property values asynchronously. Server could return before the property values are ready. + // The callback is safe to be called after the function returns and is safe to be called in a + // different thread. + aidlvhal::StatusCode getValues( + std::shared_ptr callback, + const std::vector& requests) const override; + + // Dump debug information in the server. + DumpResult dump(const std::vector& options) override; + + // Check whether the system is healthy, return {@code StatusCode::OK} for healthy. + aidlvhal::StatusCode checkHealth() override; + + // Register a callback that would be called when there is a property change event from vehicle. + void registerOnPropertyChangeEvent( + std::unique_ptr callback) override; + + // Register a callback that would be called when there is a property set error event from + // vehicle. + void registerOnPropertySetErrorEvent( + std::unique_ptr callback) override; + + // Update the sample rate for the [propId, areaId] pair. + aidlvhal::StatusCode updateSampleRate(int32_t propId, int32_t areaId, + float sampleRate) override; + + bool waitForConnected(std::chrono::milliseconds waitTime); + + private: + void ValuePollingLoop(); + + std::string mServiceAddr; + std::shared_ptr<::grpc::Channel> mGrpcChannel; + std::unique_ptr mGrpcStub; + std::thread mValuePollingThread; + + std::shared_mutex mCallbackMutex; + std::unique_ptr mOnPropChange; + std::unique_ptr mOnSetErr; + + std::mutex mShutdownMutex; + std::condition_variable mShutdownCV; + std::atomic mShuttingDownFlag{false}; +}; + +} // namespace android::hardware::automotive::vehicle::virtualization diff --git a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleProxyServer.cpp b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleProxyServer.cpp new file mode 100644 index 0000000000..af3dd595a1 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleProxyServer.cpp @@ -0,0 +1,296 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "GRPCVehicleProxyServer.h" + +#include "ProtoMessageConverter.h" + +#include + +#include + +#include +#include +#include +#include +#include +#include + +namespace android::hardware::automotive::vehicle::virtualization { + +std::atomic GrpcVehicleProxyServer::ConnectionDescriptor::connection_id_counter_{0}; + +static std::shared_ptr<::grpc::ServerCredentials> getServerCredentials() { + // TODO(chenhaosjtuacm): get secured credentials here + return ::grpc::InsecureServerCredentials(); +} + +GrpcVehicleProxyServer::GrpcVehicleProxyServer(std::string serverAddr, + std::unique_ptr&& hardware) + : mServiceAddr(std::move(serverAddr)), mHardware(std::move(hardware)) { + mHardware->registerOnPropertyChangeEvent( + std::make_unique( + [this](std::vector values) { + OnVehiclePropChange(values); + })); +} + +::grpc::Status GrpcVehicleProxyServer::GetAllPropertyConfig( + ::grpc::ServerContext* context, const ::google::protobuf::Empty* request, + ::grpc::ServerWriter* stream) { + for (const auto& config : mHardware->getAllPropertyConfigs()) { + proto::VehiclePropConfig protoConfig; + proto_msg_converter::aidlToProto(config, &protoConfig); + if (!stream->Write(protoConfig)) { + return ::grpc::Status(::grpc::StatusCode::ABORTED, "Connection lost."); + } + } + return ::grpc::Status::OK; +} + +::grpc::Status GrpcVehicleProxyServer::SetValues(::grpc::ServerContext* context, + const proto::VehiclePropValueRequests* requests, + proto::SetValueResults* results) { + std::vector aidlRequests; + for (const auto& protoRequest : requests->requests()) { + auto& aidlRequest = aidlRequests.emplace_back(); + aidlRequest.requestId = protoRequest.request_id(); + proto_msg_converter::protoToAidl(protoRequest.value(), &aidlRequest.value); + } + auto waitMtx = std::make_shared(); + auto waitCV = std::make_shared(); + auto complete = std::make_shared(false); + auto tmpResults = std::make_shared(); + auto aidlStatus = mHardware->setValues( + std::make_shared( + [waitMtx, waitCV, complete, + tmpResults](std::vector setValueResults) { + for (const auto& aidlResult : setValueResults) { + auto& protoResult = *tmpResults->add_results(); + protoResult.set_request_id(aidlResult.requestId); + protoResult.set_status( + static_cast(aidlResult.status)); + } + { + std::lock_guard lck(*waitMtx); + *complete = true; + } + waitCV->notify_all(); + }), + aidlRequests); + if (aidlStatus != aidlvhal::StatusCode::OK) { + return ::grpc::Status(::grpc::StatusCode::INTERNAL, + "The underlying hardware fails to set values, VHAL status: " + + toString(aidlStatus)); + } + std::unique_lock lck(*waitMtx); + bool success = waitCV->wait_for(lck, kHardwareOpTimeout, [complete] { return *complete; }); + if (!success) { + return ::grpc::Status(::grpc::StatusCode::INTERNAL, + "The underlying hardware set values timeout."); + } + *results = std::move(*tmpResults); + return ::grpc::Status::OK; +} + +::grpc::Status GrpcVehicleProxyServer::GetValues(::grpc::ServerContext* context, + const proto::VehiclePropValueRequests* requests, + proto::GetValueResults* results) { + std::vector aidlRequests; + for (const auto& protoRequest : requests->requests()) { + auto& aidlRequest = aidlRequests.emplace_back(); + aidlRequest.requestId = protoRequest.request_id(); + proto_msg_converter::protoToAidl(protoRequest.value(), &aidlRequest.prop); + } + auto waitMtx = std::make_shared(); + auto waitCV = std::make_shared(); + auto complete = std::make_shared(false); + auto tmpResults = std::make_shared(); + auto aidlStatus = mHardware->getValues( + std::make_shared( + [waitMtx, waitCV, complete, + tmpResults](std::vector getValueResults) { + for (const auto& aidlResult : getValueResults) { + auto& protoResult = *tmpResults->add_results(); + protoResult.set_request_id(aidlResult.requestId); + protoResult.set_status( + static_cast(aidlResult.status)); + if (aidlResult.prop) { + auto* valuePtr = protoResult.mutable_value(); + proto_msg_converter::aidlToProto(*aidlResult.prop, valuePtr); + } + } + { + std::lock_guard lck(*waitMtx); + *complete = true; + } + waitCV->notify_all(); + }), + aidlRequests); + if (aidlStatus != aidlvhal::StatusCode::OK) { + return ::grpc::Status(::grpc::StatusCode::INTERNAL, + "The underlying hardware fails to get values, VHAL status: " + + toString(aidlStatus)); + } + std::unique_lock lck(*waitMtx); + bool success = waitCV->wait_for(lck, kHardwareOpTimeout, [complete] { return *complete; }); + if (!success) { + return ::grpc::Status(::grpc::StatusCode::INTERNAL, + "The underlying hardware get values timeout."); + } + *results = std::move(*tmpResults); + return ::grpc::Status::OK; +} + +::grpc::Status GrpcVehicleProxyServer::UpdateSampleRate( + ::grpc::ServerContext* context, const proto::UpdateSampleRateRequest* request, + proto::VehicleHalCallStatus* status) { + const auto status_code = mHardware->updateSampleRate(request->prop(), request->area_id(), + request->sample_rate()); + status->set_status_code(static_cast(status_code)); + return ::grpc::Status::OK; +} + +::grpc::Status GrpcVehicleProxyServer::CheckHealth(::grpc::ServerContext* context, + const ::google::protobuf::Empty*, + proto::VehicleHalCallStatus* status) { + status->set_status_code(static_cast(mHardware->checkHealth())); + return ::grpc::Status::OK; +} + +::grpc::Status GrpcVehicleProxyServer::Dump(::grpc::ServerContext* context, + const proto::DumpOptions* options, + proto::DumpResult* result) { + std::vector dumpOptionStrings(options->options().begin(), + options->options().end()); + auto dumpResult = mHardware->dump(dumpOptionStrings); + result->set_caller_should_dump_state(dumpResult.callerShouldDumpState); + result->set_buffer(dumpResult.buffer); + return ::grpc::Status::OK; +} + +::grpc::Status GrpcVehicleProxyServer::StartPropertyValuesStream( + ::grpc::ServerContext* context, const ::google::protobuf::Empty* request, + ::grpc::ServerWriter* stream) { + auto conn = std::make_shared(stream); + { + std::lock_guard lck(mConnectionMutex); + mValueStreamingConnections.push_back(conn); + } + conn->Wait(); + LOG(ERROR) << __func__ << ": Stream lost, ID : " << conn->ID(); + return ::grpc::Status(::grpc::StatusCode::ABORTED, "Connection lost."); +} + +void GrpcVehicleProxyServer::OnVehiclePropChange( + const std::vector& values) { + std::unordered_set brokenConn; + proto::VehiclePropValues protoValues; + for (const auto& value : values) { + auto* protoValuePtr = protoValues.add_values(); + proto_msg_converter::aidlToProto(value, protoValuePtr); + } + { + std::shared_lock read_lock(mConnectionMutex); + for (auto& connection : mValueStreamingConnections) { + auto writeOK = connection->Write(protoValues); + if (!writeOK) { + LOG(ERROR) << __func__ + << ": Server Write failed, connection lost. ID: " << connection->ID(); + brokenConn.insert(connection->ID()); + } + } + } + if (brokenConn.empty()) { + return; + } + std::unique_lock write_lock(mConnectionMutex); + mValueStreamingConnections.erase( + std::remove_if(mValueStreamingConnections.begin(), mValueStreamingConnections.end(), + [&brokenConn](const auto& conn) { + return brokenConn.find(conn->ID()) != brokenConn.end(); + }), + mValueStreamingConnections.end()); +} + +GrpcVehicleProxyServer& GrpcVehicleProxyServer::Start() { + if (mServer) { + LOG(WARNING) << __func__ << ": GrpcVehicleProxyServer has already started."; + return *this; + } + ::grpc::ServerBuilder builder; + builder.RegisterService(this); + builder.AddListeningPort(mServiceAddr, getServerCredentials()); + mServer = builder.BuildAndStart(); + CHECK(mServer) << __func__ << ": failed to create the GRPC server, " + << "please make sure the configuration and permissions are correct"; + return *this; +} + +GrpcVehicleProxyServer& GrpcVehicleProxyServer::Shutdown() { + std::shared_lock read_lock(mConnectionMutex); + for (auto& conn : mValueStreamingConnections) { + conn->Shutdown(); + } + if (mServer) { + mServer->Shutdown(); + } + return *this; +} + +void GrpcVehicleProxyServer::Wait() { + if (mServer) { + mServer->Wait(); + } + mServer.reset(); +} + +GrpcVehicleProxyServer::ConnectionDescriptor::~ConnectionDescriptor() { + Shutdown(); +} + +bool GrpcVehicleProxyServer::ConnectionDescriptor::Write(const proto::VehiclePropValues& values) { + if (!mStream) { + LOG(ERROR) << __func__ << ": Empty stream. ID: " << ID(); + Shutdown(); + return false; + } + { + std::lock_guard lck(*mMtx); + if (!mShutdownFlag && mStream->Write(values)) { + return true; + } else { + LOG(ERROR) << __func__ << ": Server Write failed, connection lost. ID: " << ID(); + } + } + Shutdown(); + return false; +} + +void GrpcVehicleProxyServer::ConnectionDescriptor::Wait() { + std::unique_lock lck(*mMtx); + mCV->wait(lck, [this] { return mShutdownFlag; }); +} + +void GrpcVehicleProxyServer::ConnectionDescriptor::Shutdown() { + { + std::lock_guard lck(*mMtx); + mShutdownFlag = true; + } + mCV->notify_all(); +} + +} // namespace android::hardware::automotive::vehicle::virtualization diff --git a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleProxyServer.h b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleProxyServer.h new file mode 100644 index 0000000000..3596354539 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleProxyServer.h @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IVehicleHardware.h" + +#include "VehicleServer.grpc.pb.h" +#include "VehicleServer.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::automotive::vehicle::virtualization { + +namespace aidlvhal = ::aidl::android::hardware::automotive::vehicle; + +// Connect other GRPC vehicle hardware(s) to the underlying vehicle hardware. +class GrpcVehicleProxyServer : public proto::VehicleServer::Service { + public: + GrpcVehicleProxyServer(std::string serverAddr, std::unique_ptr&& hardware); + + ::grpc::Status GetAllPropertyConfig( + ::grpc::ServerContext* context, const ::google::protobuf::Empty* request, + ::grpc::ServerWriter* stream) override; + + ::grpc::Status SetValues(::grpc::ServerContext* context, + const proto::VehiclePropValueRequests* requests, + proto::SetValueResults* results) override; + + ::grpc::Status GetValues(::grpc::ServerContext* context, + const proto::VehiclePropValueRequests* requests, + proto::GetValueResults* results) override; + + ::grpc::Status UpdateSampleRate(::grpc::ServerContext* context, + const proto::UpdateSampleRateRequest* request, + proto::VehicleHalCallStatus* status) override; + + ::grpc::Status CheckHealth(::grpc::ServerContext* context, const ::google::protobuf::Empty*, + proto::VehicleHalCallStatus* status) override; + + ::grpc::Status Dump(::grpc::ServerContext* context, const proto::DumpOptions* options, + proto::DumpResult* result) override; + + ::grpc::Status StartPropertyValuesStream( + ::grpc::ServerContext* context, const ::google::protobuf::Empty* request, + ::grpc::ServerWriter* stream) override; + + GrpcVehicleProxyServer& Start(); + + GrpcVehicleProxyServer& Shutdown(); + + void Wait(); + + private: + void OnVehiclePropChange(const std::vector& values); + + // We keep long-lasting connection for streaming the prop values. + struct ConnectionDescriptor { + explicit ConnectionDescriptor(::grpc::ServerWriter* stream) + : mStream(stream), + mConnectionID(connection_id_counter_.fetch_add(1) + 1), + mMtx(std::make_unique()), + mCV(std::make_unique()) {} + + ConnectionDescriptor(const ConnectionDescriptor&) = delete; + ConnectionDescriptor(ConnectionDescriptor&& cd) = default; + ConnectionDescriptor& operator=(const ConnectionDescriptor&) = delete; + ConnectionDescriptor& operator=(ConnectionDescriptor&& cd) = default; + + ~ConnectionDescriptor(); + + uint64_t ID() const { return mConnectionID; } + + bool Write(const proto::VehiclePropValues& values); + + void Wait(); + + void Shutdown(); + + private: + ::grpc::ServerWriter* mStream; + uint64_t mConnectionID{0}; + std::unique_ptr mMtx; + std::unique_ptr mCV; + bool mShutdownFlag{false}; + + static std::atomic connection_id_counter_; + }; + + std::string mServiceAddr; + std::unique_ptr<::grpc::Server> mServer{nullptr}; + std::unique_ptr mHardware; + + std::shared_mutex mConnectionMutex; + std::vector> mValueStreamingConnections; + + static constexpr auto kHardwareOpTimeout = std::chrono::seconds(1); +}; + +} // namespace android::hardware::automotive::vehicle::virtualization diff --git a/automotive/vehicle/aidl/impl/grpc/OWNERS b/automotive/vehicle/aidl/impl/grpc/OWNERS new file mode 100644 index 0000000000..7a96f236d1 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/OWNERS @@ -0,0 +1,3 @@ +shanyu@google.com +chenhaosjtuacm@google.com +egranata@google.com diff --git a/automotive/vehicle/aidl/impl/grpc/proto/VehicleServer.proto b/automotive/vehicle/aidl/impl/grpc/proto/VehicleServer.proto new file mode 100644 index 0000000000..22b11d8c87 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/proto/VehicleServer.proto @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +import "android/hardware/automotive/vehicle/DumpOptions.proto"; +import "android/hardware/automotive/vehicle/DumpResult.proto"; +import "android/hardware/automotive/vehicle/StatusCode.proto"; +import "android/hardware/automotive/vehicle/VehiclePropConfig.proto"; +import "android/hardware/automotive/vehicle/VehiclePropValue.proto"; +import "android/hardware/automotive/vehicle/VehiclePropValueRequest.proto"; +import "google/protobuf/empty.proto"; + +service VehicleServer { + rpc GetAllPropertyConfig(google.protobuf.Empty) returns (stream VehiclePropConfig) {} + + rpc SetValues(VehiclePropValueRequests) returns (SetValueResults) {} + + rpc GetValues(VehiclePropValueRequests) returns (GetValueResults) {} + + rpc UpdateSampleRate(UpdateSampleRateRequest) returns (VehicleHalCallStatus) {} + + rpc CheckHealth(google.protobuf.Empty) returns (VehicleHalCallStatus) {} + + rpc Dump(DumpOptions) returns (DumpResult) {} + + rpc StartPropertyValuesStream(google.protobuf.Empty) returns (stream VehiclePropValues) {} +} diff --git a/automotive/vehicle/aidl/impl/grpc/test/Android.bp b/automotive/vehicle/aidl/impl/grpc/test/Android.bp new file mode 100644 index 0000000000..e53826f7f3 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/test/Android.bp @@ -0,0 +1,74 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "GRPCVehicleHardwareUnitTest", + vendor: true, + srcs: ["GRPCVehicleHardwareUnitTest.cpp"], + whole_static_libs: [ + "android.hardware.automotive.vehicle@default-grpc-hardware-lib", + ], + header_libs: [ + "IVehicleHardware", + ], + static_libs: [ + "libgtest", + "libgmock", + ], + shared_libs: [ + "libgrpc++", + "libprotobuf-cpp-full", + ], + // libgrpc++.so is installed as root, require root to access it. + require_root: true, + defaults: [ + "VehicleHalDefaults", + ], + cflags: [ + "-Wno-unused-parameter", + ], + test_suites: ["device-tests"], +} + +cc_test { + name: "GRPCVehicleProxyServerUnitTest", + vendor: true, + srcs: ["GRPCVehicleProxyServerUnitTest.cpp"], + header_libs: [ + "IVehicleHardware", + ], + static_libs: [ + "android.hardware.automotive.vehicle@default-grpc-hardware-lib", + "android.hardware.automotive.vehicle@default-grpc-server-lib", + "libgtest", + "libgmock", + ], + shared_libs: [ + "libgrpc++", + "libprotobuf-cpp-full", + ], + // libgrpc++.so is installed as root, require root to access it. + require_root: true, + defaults: [ + "VehicleHalDefaults", + ], + cflags: [ + "-Wno-unused-parameter", + ], + test_suites: ["device-tests"], +} diff --git a/automotive/vehicle/aidl/impl/grpc/test/GRPCVehicleHardwareUnitTest.cpp b/automotive/vehicle/aidl/impl/grpc/test/GRPCVehicleHardwareUnitTest.cpp new file mode 100644 index 0000000000..f578021f1b --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/test/GRPCVehicleHardwareUnitTest.cpp @@ -0,0 +1,94 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "GRPCVehicleHardware.h" +#include "VehicleServer.grpc.pb.h" +#include "VehicleServer.pb.h" + +#include +#include +#include + +#include +#include +#include + +namespace android::hardware::automotive::vehicle::virtualization { + +const std::string kFakeServerAddr = "0.0.0.0:54321"; + +class FakeVehicleServer : public proto::VehicleServer::Service { + public: + ::grpc::Status StartPropertyValuesStream( + ::grpc::ServerContext* context, const ::google::protobuf::Empty* request, + ::grpc::ServerWriter* stream) override { + stream->Write(proto::VehiclePropValues()); + // A fake disconnection. + return ::grpc::Status(::grpc::StatusCode::ABORTED, "Connection lost."); + } + + // Functions that we do not care. + ::grpc::Status GetAllPropertyConfig( + ::grpc::ServerContext* context, const ::google::protobuf::Empty* request, + ::grpc::ServerWriter* stream) override { + return ::grpc::Status::OK; + } + + ::grpc::Status SetValues(::grpc::ServerContext* context, + const proto::VehiclePropValueRequests* requests, + proto::SetValueResults* results) override { + return ::grpc::Status::OK; + } + + ::grpc::Status GetValues(::grpc::ServerContext* context, + const proto::VehiclePropValueRequests* requests, + proto::GetValueResults* results) override { + return ::grpc::Status::OK; + } +}; + +TEST(GRPCVehicleHardwareUnitTest, Reconnect) { + auto receivedUpdate = std::make_shared>(0); + auto vehicleHardware = std::make_unique(kFakeServerAddr); + vehicleHardware->registerOnPropertyChangeEvent( + std::make_unique( + [receivedUpdate](const auto&) { receivedUpdate->fetch_add(1); })); + + constexpr size_t kServerRestartTimes = 5; + for (size_t serverStart = 0; serverStart < kServerRestartTimes; ++serverStart) { + EXPECT_EQ(receivedUpdate->load(), 0); + auto fakeServer = std::make_unique(); + ::grpc::ServerBuilder builder; + builder.RegisterService(fakeServer.get()); + builder.AddListeningPort(kFakeServerAddr, ::grpc::InsecureServerCredentials()); + auto grpcServer = builder.BuildAndStart(); + + // Wait until the vehicle hardware received the second update (after one fake + // disconnection). + constexpr auto kMaxWaitTime = std::chrono::seconds(5); + auto startTime = std::chrono::steady_clock::now(); + while (receivedUpdate->load() <= 1 && + std::chrono::steady_clock::now() - startTime < kMaxWaitTime) + ; + + grpcServer->Shutdown(); + grpcServer->Wait(); + EXPECT_GT(receivedUpdate->load(), 1); + + // Reset for the next round. + receivedUpdate->store(0); + } +} + +} // namespace android::hardware::automotive::vehicle::virtualization diff --git a/automotive/vehicle/aidl/impl/grpc/test/GRPCVehicleProxyServerUnitTest.cpp b/automotive/vehicle/aidl/impl/grpc/test/GRPCVehicleProxyServerUnitTest.cpp new file mode 100644 index 0000000000..49e6fc9d21 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/test/GRPCVehicleProxyServerUnitTest.cpp @@ -0,0 +1,147 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "GRPCVehicleHardware.h" +#include "GRPCVehicleProxyServer.h" +#include "IVehicleHardware.h" +#include "VehicleServer.grpc.pb.h" +#include "VehicleServer.pb.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace android::hardware::automotive::vehicle::virtualization { + +const std::string kFakeServerAddr = "0.0.0.0:54321"; + +class VehicleHardwareForTest : public IVehicleHardware { + public: + void registerOnPropertyChangeEvent( + std::unique_ptr callback) override { + mOnProp = std::move(callback); + } + + void onPropertyEvent( + std::vector values) { + if (mOnProp) { + (*mOnProp)(std::move(values)); + } + } + + // Functions that we do not care. + std::vector + getAllPropertyConfigs() const override { + return {}; + } + + aidl::android::hardware::automotive::vehicle::StatusCode setValues( + std::shared_ptr callback, + const std::vector& + requests) override { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } + + aidl::android::hardware::automotive::vehicle::StatusCode getValues( + std::shared_ptr callback, + const std::vector& + requests) const override { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } + + DumpResult dump(const std::vector& options) override { return {}; } + + aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } + + void registerOnPropertySetErrorEvent( + std::unique_ptr callback) override {} + + private: + std::unique_ptr mOnProp; +}; + +TEST(GRPCVehicleProxyServerUnitTest, ClientConnectDisconnect) { + auto testHardware = std::make_unique(); + // HACK: manipulate the underlying hardware via raw pointer for testing. + auto* testHardwareRaw = testHardware.get(); + auto vehicleServer = + std::make_unique(kFakeServerAddr, std::move(testHardware)); + vehicleServer->Start(); + + constexpr auto kWaitForConnectionMaxTime = std::chrono::seconds(5); + constexpr auto kWaitForStreamStartTime = std::chrono::seconds(1); + constexpr auto kWaitForUpdateDeliveryTime = std::chrono::milliseconds(100); + + auto updateReceived1 = std::make_shared(false); + auto vehicleHardware1 = std::make_unique(kFakeServerAddr); + vehicleHardware1->registerOnPropertyChangeEvent( + std::make_unique( + [updateReceived1](const auto&) { *updateReceived1 = true; })); + EXPECT_TRUE(vehicleHardware1->waitForConnected(kWaitForConnectionMaxTime)); + std::this_thread::sleep_for(kWaitForStreamStartTime); + + // Client hardware 1 received update from the server. + EXPECT_FALSE(*updateReceived1); + testHardwareRaw->onPropertyEvent({}); + // Wait for the update delivery. + std::this_thread::sleep_for(kWaitForUpdateDeliveryTime); + EXPECT_TRUE(*updateReceived1); + + // Reset. + *updateReceived1 = false; + + auto updateReceived2 = std::make_shared(false); + auto vehicleHardware2 = std::make_unique(kFakeServerAddr); + vehicleHardware2->registerOnPropertyChangeEvent( + std::make_unique( + [updateReceived2](const auto&) { *updateReceived2 = true; })); + EXPECT_TRUE(vehicleHardware2->waitForConnected(kWaitForConnectionMaxTime)); + std::this_thread::sleep_for(kWaitForStreamStartTime); + + // Both client hardware 1 and 2 received update from the server. + EXPECT_FALSE(*updateReceived1); + EXPECT_FALSE(*updateReceived2); + testHardwareRaw->onPropertyEvent({}); + // Wait for the update delivery. + std::this_thread::sleep_for(kWaitForUpdateDeliveryTime); + EXPECT_TRUE(*updateReceived1); + EXPECT_TRUE(*updateReceived2); + + // Reset. + *updateReceived1 = false; + *updateReceived2 = false; + + vehicleHardware1.reset(); + + // Client 1 exited, only client hardware 2 received update from the server. + EXPECT_FALSE(*updateReceived1); + EXPECT_FALSE(*updateReceived2); + testHardwareRaw->onPropertyEvent({}); + // Wait for the update delivery. + std::this_thread::sleep_for(kWaitForUpdateDeliveryTime); + EXPECT_FALSE(*updateReceived1); + EXPECT_TRUE(*updateReceived2); + + vehicleServer->Shutdown().Wait(); +} + +} // namespace android::hardware::automotive::vehicle::virtualization diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp index 7670c25418..2b4059c912 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp @@ -47,13 +47,19 @@ cc_test { ], vendor: true, defaults: ["VehicleHalDefaults"], - shared_libs: ["libprotobuf-cpp-full"], + shared_libs: [ + "libprotobuf-cpp-full", + "libjsoncpp", + ], static_libs: [ + "VehicleHalJsonConfigLoaderEnableTestProperties", "VehicleHalProtoMessageConverter", "VehicleHalProtos", "VehicleHalUtils", "libgtest", ], - header_libs: ["VehicleHalDefaultConfig"], + data: [ + ":VehicleHalDefaultProperties_JSON", + ], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp index c742db51f5..308be4601a 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp @@ -16,9 +16,11 @@ #include -#include +#include #include #include + +#include #include #include #include @@ -35,23 +37,39 @@ namespace { namespace proto = ::android::hardware::automotive::vehicle::proto; namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle; +constexpr char DEFAULT_PROPERTIES_CONFIG[] = "DefaultProperties.json"; + +inline std::string getConfigPath(const std::string& name) { + return android::base::GetExecutableDirectory() + "/" + name; +} + std::vector prepareTestConfigs() { + JsonConfigLoader loader; + auto result = loader.loadPropConfig(getConfigPath(DEFAULT_PROPERTIES_CONFIG)); + if (!result.ok()) { + return {}; + } std::vector configs; - for (auto& property : defaultconfig::getDefaultConfigs()) { - configs.push_back(property.config); + for (auto& [_, configDeclaration] : result.value()) { + configs.push_back(configDeclaration.config); } return configs; } std::vector prepareTestValues() { + JsonConfigLoader loader; + auto result = loader.loadPropConfig(getConfigPath(DEFAULT_PROPERTIES_CONFIG)); + if (!result.ok()) { + return {}; + } std::vector values; int64_t timestamp = 1; - for (auto& property : defaultconfig::getDefaultConfigs()) { + for (auto& [_, configDeclaration] : result.value()) { values.push_back({ .timestamp = timestamp, .areaId = 123, - .prop = property.config.prop, - .value = property.initialValue, + .prop = configDeclaration.config.prop, + .value = configDeclaration.initialValue, .status = aidl_vehicle::VehiclePropertyStatus::ERROR, }); } diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index 759db4153d..e53947ee33 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -35,6 +35,8 @@ struct DumpResult { bool callerShouldDumpState; // The dumped information for the caller to print. std::string buffer; + // To pass if DefaultVehicleHal should refresh the property configs + bool refreshPropertyConfigs = false; }; // A structure to represent a set value error event reported from vehicle. @@ -116,11 +118,12 @@ class IVehicleHardware { virtual aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0; // Register a callback that would be called when there is a property change event from vehicle. + // Must only be called once during initialization. virtual void registerOnPropertyChangeEvent( std::unique_ptr callback) = 0; // Register a callback that would be called when there is a property set error event from - // vehicle. + // vehicle. Must only be called once during initialization. virtual void registerOnPropertySetErrorEvent( std::unique_ptr callback) = 0; }; diff --git a/automotive/vehicle/aidl/impl/proto/Android.bp b/automotive/vehicle/aidl/impl/proto/Android.bp index 709307d3e1..56fad7ed91 100644 --- a/automotive/vehicle/aidl/impl/proto/Android.bp +++ b/automotive/vehicle/aidl/impl/proto/Android.bp @@ -40,6 +40,7 @@ genrule { ":VehicleHalProtoFiles", ], out: [ + "android/hardware/automotive/vehicle/DumpOptions.pb.h", "android/hardware/automotive/vehicle/DumpResult.pb.h", "android/hardware/automotive/vehicle/StatusCode.pb.h", "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h", @@ -63,6 +64,7 @@ genrule { ":VehicleHalProtoFiles", ], out: [ + "android/hardware/automotive/vehicle/DumpOptions.pb.cc", "android/hardware/automotive/vehicle/DumpResult.pb.cc", "android/hardware/automotive/vehicle/StatusCode.pb.cc", "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc", diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpOptions.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpOptions.proto new file mode 100644 index 0000000000..4bed927288 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpOptions.proto @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +message DumpOptions { + repeated string options = 1; +} diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto index 97cb0f88b2..63d7933e7d 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto @@ -39,3 +39,7 @@ enum StatusCode { /* Something unexpected has happened in Vehicle HAL */ INTERNAL_ERROR = 5; }; + +message VehicleHalCallStatus { + StatusCode status_code = 1; +} diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto index 80c73cbb77..dda9ff5119 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto @@ -52,3 +52,7 @@ message VehiclePropValue { /* This is used for properties of type VehiclePropertyType#STRING */ string string_value = 9; }; + +message VehiclePropValues { + repeated VehiclePropValue values = 1; +} diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto index b16daa8bd3..c347a800c3 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto @@ -18,9 +18,44 @@ syntax = "proto3"; package android.hardware.automotive.vehicle.proto; +import "android/hardware/automotive/vehicle/StatusCode.proto"; import "android/hardware/automotive/vehicle/VehiclePropValue.proto"; message VehiclePropValueRequest { - int32 request_id = 1; + int64 request_id = 1; VehiclePropValue value = 2; }; + +message UpdateSampleRateRequest { + /* Property identifier */ + int32 prop = 1; + + /* Area type(s) for non-global property it must be one of the value from + * VehicleArea* enums or 0 for global properties. */ + int32 area_id = 2; + + float sample_rate = 3; +}; + +message SetValueResult { + int64 request_id = 1; + StatusCode status = 2; +}; + +message GetValueResult { + int64 request_id = 1; + StatusCode status = 2; + VehiclePropValue value = 3; +}; + +message VehiclePropValueRequests { + repeated VehiclePropValueRequest requests = 1; +}; + +message SetValueResults { + repeated SetValueResult results = 1; +}; + +message GetValueResults { + repeated GetValueResult results = 1; +}; diff --git a/automotive/vehicle/aidl/impl/utils/README.md b/automotive/vehicle/aidl/impl/utils/README.md new file mode 100644 index 0000000000..87bb7e3034 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/README.md @@ -0,0 +1,62 @@ +# Utility classes for VHAL implementation +--- + +This directory stores utility classes for VHAL implementation. Vendor +implementation could use utility classes from `common` folder in their +VHAL implementation. + +## common + +Defines common utility libraries. + +### ConcurrentQueue + +Provides a thread-safe concurrent queue object. Useful for adding object to +a queue in one thread (usually binder thread) and handle the objects in a +separate handler thread. + +### ParcelableUtils + +Provides functions to convert between a regular parcelable and a +`LargeParcelabe`. + +A `LargeParcelable` is a parcelable that marshals the payload +into a shared memory file if the payload is too large to pass across binder. +It is used to pass large data across binder. Before sending the data, VHAL +impl should convert a regular parcelabe to a `LargeParcelable`. After receving +data, VHAL impl should convert a `LargeParcelable` back to regular parcelabe. + +### PendingRequestPool + +Defines A class for managing pending requests and automatically call timeout +callback if the request timed-out. + +### PropertyUtils + +Defines some useful constants. + +### RecurrentTimer + +Defines a thread-safe recurrent timer that can call a function periodically. + +### VehicleHalTypes + +Provides a header file that includes many commonly used header files. Useful +when you are using multiple types defined in VHAL interface. + +### VehicleObjectPool + +Defines a reusable in-memory pool for `VehiclePropValue`. + +### VehiclePropertyStore + +Defines an in-memory map for storing vehicle properties. Allows easier insert, +delete and lookup. + +### VehicleUtils + +Defines many useful utility functions. + +## test + +Defines utility libraries for test only. diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h index 3f8db93ba3..28cf08e93b 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -85,7 +84,7 @@ class PendingRequestPool final { std::unordered_map> mPendingRequestsByClient GUARDED_BY(mLock); std::thread mThread; - std::atomic mThreadStop = false; + bool mThreadStop = false; std::condition_variable mCv; std::mutex mCvLock; diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h index 2743578df1..7275ba30f9 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h @@ -28,6 +28,7 @@ namespace vehicle { namespace propertyutils_impl { // These names are not part of the API since we only expose ints. +using ::aidl::android::hardware::automotive::vehicle::EvStoppingMode; using ::aidl::android::hardware::automotive::vehicle::PortLocationType; using ::aidl::android::hardware::automotive::vehicle::VehicleArea; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaDoor; @@ -96,7 +97,13 @@ constexpr int FUEL_DOOR_REAR_LEFT = toInt(propertyutils_impl::PortLocationType:: constexpr int CHARGE_PORT_FRONT_LEFT = toInt(propertyutils_impl::PortLocationType::FRONT_LEFT); constexpr int CHARGE_PORT_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT); constexpr int LIGHT_STATE_ON = toInt(propertyutils_impl::VehicleLightState::ON); +constexpr int LIGHT_STATE_OFF = toInt(propertyutils_impl::VehicleLightState::OFF); +constexpr int LIGHT_SWITCH_OFF = toInt(propertyutils_impl::VehicleLightSwitch::OFF); +constexpr int LIGHT_SWITCH_ON = toInt(propertyutils_impl::VehicleLightSwitch::ON); constexpr int LIGHT_SWITCH_AUTO = toInt(propertyutils_impl::VehicleLightSwitch::AUTOMATIC); +constexpr int EV_STOPPING_MODE_CREEP = toInt(propertyutils_impl::EvStoppingMode::CREEP); +constexpr int EV_STOPPING_MODE_ROLL = toInt(propertyutils_impl::EvStoppingMode::ROLL); +constexpr int EV_STOPPING_MODE_HOLD = toInt(propertyutils_impl::EvStoppingMode::HOLD); constexpr int WHEEL_FRONT_LEFT = toInt(propertyutils_impl::VehicleAreaWheel::LEFT_FRONT); constexpr int WHEEL_FRONT_RIGHT = toInt(propertyutils_impl::VehicleAreaWheel::RIGHT_FRONT); constexpr int WHEEL_REAR_LEFT = toInt(propertyutils_impl::VehicleAreaWheel::LEFT_REAR); diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 8bc3c20ad8..e6d657d675 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -17,15 +17,32 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_ #define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_ +#include +#include +#include +#include +#include #include #include +#include +#include #include +#include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -66,5 +83,7 @@ #include #include #include +#include +#include #endif // android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_ diff --git a/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp index 0196edd2ca..ab504992e4 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp @@ -39,20 +39,27 @@ constexpr int64_t CHECK_TIME_IN_NANO = 1'000'000'000; } // namespace -PendingRequestPool::PendingRequestPool(int64_t timeoutInNano) - : mTimeoutInNano(timeoutInNano), mThread([this] { - // [this] must be alive within this thread because destructor would wait for this thread - // to exit. - int64_t sleepTime = std::min(mTimeoutInNano, static_cast(CHECK_TIME_IN_NANO)); - std::unique_lock lk(mCvLock); - while (!mCv.wait_for(lk, std::chrono::nanoseconds(sleepTime), - [this] { return mThreadStop.load(); })) { - checkTimeout(); - } - }) {} +PendingRequestPool::PendingRequestPool(int64_t timeoutInNano) : mTimeoutInNano(timeoutInNano) { + mThread = std::thread([this] { + // [this] must be alive within this thread because destructor would wait for this thread + // to exit. + int64_t sleepTime = std::min(mTimeoutInNano, static_cast(CHECK_TIME_IN_NANO)); + std::unique_lock lk(mCvLock); + while (!mCv.wait_for(lk, std::chrono::nanoseconds(sleepTime), + [this] { return mThreadStop; })) { + checkTimeout(); + } + }); +} PendingRequestPool::~PendingRequestPool() { - mThreadStop = true; + { + // Even if the shared variable is atomic, it must be modified under the + // mutex in order to correctly publish the modification to the waiting + // thread. + std::unique_lock lk(mCvLock); + mThreadStop = true; + } mCv.notify_all(); if (mThread.joinable()) { mThread.join(); diff --git a/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp index 908564c2ff..c6d3687553 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp @@ -29,7 +29,9 @@ namespace vehicle { using ::android::base::ScopedLockAssertion; -RecurrentTimer::RecurrentTimer() : mThread(&RecurrentTimer::loop, this) {} +RecurrentTimer::RecurrentTimer() { + mThread = std::thread(&RecurrentTimer::loop, this); +} RecurrentTimer::~RecurrentTimer() { { diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h index d512713cc9..14002884f5 100644 --- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h @@ -35,7 +35,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; } // namespace testpropertyutils_impl -#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING // Converts the system property to the vendor property. // WARNING: This is only for the end-to-end testing, Should NOT include in the user build. inline constexpr int32_t toVendor( @@ -55,7 +54,6 @@ constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY = toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REQUEST_DISPLAY); constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_NAVIGATION_STATE); -#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING // These properties are placeholder properties for developers to test new features without // implementing a real property. @@ -86,6 +84,13 @@ constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 | toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | toInt(testpropertyutils_impl::VehiclePropertyType::BYTES); +// This property is used for testing vendor error codes end to end. +// 0x21402a13 +constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 | + toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | + toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | + toInt(testpropertyutils_impl::VehiclePropertyType::INT32); + // This property is used for test purpose. End to end tests use this property to test set and get // method for MIXED type properties. constexpr int32_t kMixedTypePropertyForTest = diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 5abcaf6980..4feea79490 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -66,3 +66,25 @@ cc_library { "libbinder_ndk", ], } + +cc_fuzz { + name: "android.hardware.automotive.vehicle@V1-default-service_fuzzer", + vendor: true, + defaults: [ + "FakeVehicleHardwareDefaults", + "VehicleHalDefaults", + "android-automotive-large-parcelable-defaults", + "service_fuzzer_defaults", + ], + static_libs: [ + "DefaultVehicleHal", + "FakeVehicleHardware", + "VehicleHalUtils", + ], + srcs: ["src/fuzzer.cpp"], + fuzz_config: { + cc: [ + "keithmok@google.com", + ], + }, +} diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index b3f4a0f722..2e7298ff0b 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -107,18 +107,12 @@ class SubscriptionClient final : public ConnectedClient { // Gets the callback to be called when the request for this client has finished. std::shared_ptr getResultCallback(); - // Marshals the updated values into largeParcelable and sends it through {@code onPropertyEvent} + // Marshals the updated values into largeParcelable and sents it through {@code onPropertyEvent} // callback. static void sendUpdatedValues( CallbackType callback, std::vector&& updatedValues); - // Marshals the set property error events into largeParcelable and sends it through - // {@code onPropertySetError} callback. - static void sendPropertySetErrors( - CallbackType callback, - std::vector&& - vehiclePropErrors); protected: // Gets the callback to be called when the request for this client has timeout. diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index b6dbbc136c..2c2cf1a5bd 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -123,10 +123,10 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi std::shared_ptr mPendingRequestPool; }; - // A wrapper for binder operations to enable stubbing for test. - class IBinder { + // A wrapper for binder lifecycle operations to enable stubbing for test. + class BinderLifecycleInterface { public: - virtual ~IBinder() = default; + virtual ~BinderLifecycleInterface() = default; virtual binder_status_t linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) = 0; @@ -134,8 +134,8 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi virtual bool isAlive(const AIBinder* binder) = 0; }; - // A real implementation for IBinder. - class AIBinderImpl final : public IBinder { + // A real implementation for BinderLifecycleInterface. + class BinderLifecycleHandler final : public BinderLifecycleInterface { public: binder_status_t linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) override; @@ -154,7 +154,7 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi // BinderDiedUnlinkedEvent represents either an onBinderDied or an onBinderUnlinked event. struct BinderDiedUnlinkedEvent { // true for onBinderDied, false for onBinderUnlinked. - bool onBinderDied; + bool forOnBinderDied; const AIBinder* clientId; }; @@ -164,6 +164,7 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi static constexpr int64_t TIMEOUT_IN_NANO = 30'000'000'000; // heart beat event interval: 3s static constexpr int64_t HEART_BEAT_INTERVAL_IN_NANO = 3'000'000'000; + bool mShouldRefreshPropertyConfigs; std::unique_ptr mVehicleHardware; // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to @@ -186,8 +187,8 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi GUARDED_BY(mLock); // SubscriptionClients is thread-safe. std::shared_ptr mSubscriptionClients; - // mBinderImpl is only going to be changed in test. - std::unique_ptr mBinderImpl; + // mBinderLifecycleHandler is only going to be changed in test. + std::unique_ptr mBinderLifecycleHandler; // Only initialized once. std::shared_ptr> mRecurrentAction; @@ -212,7 +213,6 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi android::base::Result> checkDuplicateRequests( const std::vector& requests); - VhalResult checkSubscribeOptions( const std::vector& options); @@ -236,6 +236,8 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi bool checkDumpPermission(); + bool getAllPropConfigsFromHardware(); + // The looping handler function to process all onBinderDied or onBinderUnlinked events in // mBinderEvents. void onBinderDiedUnlinkedHandler(); @@ -247,14 +249,10 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi const CallbackType& callback, std::shared_ptr pendingRequestPool); static void onPropertyChangeEvent( - const std::weak_ptr& subscriptionManager, + std::weak_ptr subscriptionManager, const std::vector& updatedValues); - static void onPropertySetErrorEvent( - const std::weak_ptr& subscriptionManager, - const std::vector& errorEvents); - static void checkHealth(IVehicleHardware* hardware, std::weak_ptr subscriptionManager); @@ -267,7 +265,7 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi void setTimeout(int64_t timeoutInNano); // Test-only - void setBinderImpl(std::unique_ptr impl); + void setBinderLifecycleHandler(std::unique_ptr impl); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index 4912093849..14799d9f84 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -41,15 +41,15 @@ class ContSubConfigs final { public: using ClientIdType = const AIBinder*; - void addClient(const ClientIdType& clientId, float sampleRate); + void addClient(const ClientIdType& clientId, float sampleRateHz); void removeClient(const ClientIdType& clientId); - float getMaxSampleRate(); + float getMaxSampleRateHz() const; private: - float mMaxSampleRate = 0.; - std::unordered_map mSampleRates; + float mMaxSampleRateHz = 0.; + std::unordered_map mSampleRateHzByClient; - void refreshMaxSampleRate(); + void refreshMaxSampleRateHz(); }; // A thread-safe subscription manager that manages all VHAL subscriptions. @@ -59,7 +59,7 @@ class SubscriptionManager final { using CallbackType = std::shared_ptr; - explicit SubscriptionManager(IVehicleHardware* hardware); + explicit SubscriptionManager(IVehicleHardware* vehicleHardware); ~SubscriptionManager(); // Subscribes to properties according to {@code SubscribeOptions}. Note that all option must @@ -99,18 +99,8 @@ class SubscriptionManager final { const std::vector& updatedValues); - // Gets the sample rate for the continuous property. Returns {@code std::nullopt} if the - // property has not been subscribed before or is not a continuous property. - std::optional getSampleRate(const ClientIdType& clientId, int32_t propId, - int32_t areaId); - // For a list of set property error events, returns a map that maps clients subscribing to the - // properties to a list of errors for each client. - std::unordered_map> - getSubscribedClientsForErrorEvents(const std::vector& errorEvents); - // Checks whether the sample rate is valid. - static bool checkSampleRate(float sampleRate); + static bool checkSampleRateHz(float sampleRateHz); private: // Friend class for testing. @@ -127,17 +117,21 @@ class SubscriptionManager final { std::unordered_map mContSubConfigsByPropIdArea GUARDED_BY(mLock); - VhalResult updateSampleRateLocked(const ClientIdType& clientId, - const PropIdAreaId& propIdAreaId, float sampleRate) + VhalResult addContinuousSubscriberLocked(const ClientIdType& clientId, + const PropIdAreaId& propIdAreaId, + float sampleRateHz) REQUIRES(mLock); + VhalResult removeContinuousSubscriberLocked(const ClientIdType& clientId, + const PropIdAreaId& propIdAreaId) REQUIRES(mLock); - VhalResult removeSampleRateLocked(const ClientIdType& clientId, - const PropIdAreaId& propIdAreaId) REQUIRES(mLock); + + VhalResult updateContSubConfigs(const PropIdAreaId& PropIdAreaId, + const ContSubConfigs& newConfig) REQUIRES(mLock); // Checks whether the manager is empty. For testing purpose. bool isEmpty(); // Get the interval in nanoseconds accroding to sample rate. - static android::base::Result getInterval(float sampleRate); + static android::base::Result getIntervalNanos(float sampleRateHz); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index fb23a25047..81d231c87f 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -38,8 +38,6 @@ using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::StatusCode; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropError; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; using ::android::base::Result; @@ -302,34 +300,7 @@ void SubscriptionClient::sendUpdatedValues(std::shared_ptr cal if (ScopedAStatus callbackStatus = callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); !callbackStatus.isOk()) { - ALOGE("subscribe: failed to call onPropertyEvent callback, client ID: %p, error: %s, " - "exception: %d, service specific error: %d", - callback->asBinder().get(), callbackStatus.getMessage(), - callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); - } -} - -void SubscriptionClient::sendPropertySetErrors(std::shared_ptr callback, - std::vector&& vehiclePropErrors) { - if (vehiclePropErrors.empty()) { - return; - } - - VehiclePropErrors vehiclePropErrorsLargeParcelable; - ScopedAStatus status = vectorToStableLargeParcelable(std::move(vehiclePropErrors), - &vehiclePropErrorsLargeParcelable); - if (!status.isOk()) { - int statusCode = status.getServiceSpecificError(); - ALOGE("subscribe: failed to marshal result into large parcelable, error: " - "%s, code: %d", - status.getMessage(), statusCode); - return; - } - - if (ScopedAStatus callbackStatus = - callback->onPropertySetError(vehiclePropErrorsLargeParcelable); - !callbackStatus.isOk()) { - ALOGE("subscribe: failed to call onPropertySetError callback, client ID: %p, error: %s, " + ALOGE("subscribe: failed to call UpdateValues callback, client ID: %p, error: %s, " "exception: %d, service specific error: %d", callback->asBinder().get(), callbackStatus.getMessage(), callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 2e9a4b6702..98cfc398af 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -15,6 +15,7 @@ */ #define LOG_TAG "DefaultVehicleHal" +#define ATRACE_TAG ATRACE_TAG_HAL #include @@ -28,6 +29,7 @@ #include #include #include +#include #include #include @@ -78,14 +80,14 @@ std::string toString(const std::unordered_set& values) { return str; } -float getDefaultSampleRate(float sampleRate, float minSampleRate, float maxSampleRate) { - if (sampleRate < minSampleRate) { - return minSampleRate; +float getDefaultSampleRateHz(float sampleRateHz, float minSampleRateHz, float maxSampleRateHz) { + if (sampleRateHz < minSampleRateHz) { + return minSampleRateHz; } - if (sampleRate > maxSampleRate) { - return maxSampleRate; + if (sampleRateHz > maxSampleRateHz) { + return maxSampleRateHz; } - return sampleRate; + return sampleRateHz; } } // namespace @@ -123,32 +125,18 @@ size_t DefaultVehicleHal::SubscriptionClients::countClients() { return mClients.size(); } -DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) - : mVehicleHardware(std::move(hardware)), +DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr vehicleHardware) + : mVehicleHardware(std::move(vehicleHardware)), mPendingRequestPool(std::make_shared(TIMEOUT_IN_NANO)) { - auto configs = mVehicleHardware->getAllPropertyConfigs(); - for (auto& config : configs) { - mConfigsByPropId[config.prop] = config; - } - VehiclePropConfigs vehiclePropConfigs; - vehiclePropConfigs.payloads = std::move(configs); - auto result = LargeParcelableBase::parcelableToStableLargeParcelable(vehiclePropConfigs); - if (!result.ok()) { - ALOGE("failed to convert configs to shared memory file, error: %s, code: %d", - result.error().message().c_str(), static_cast(result.error().code())); + if (!getAllPropConfigsFromHardware()) { return; } - if (result.value() != nullptr) { - mConfigFile = std::move(result.value()); - } - - mSubscriptionClients = std::make_shared(mPendingRequestPool); mSubscriptionClients = std::make_shared(mPendingRequestPool); auto subscribeIdByClient = std::make_shared(); - IVehicleHardware* hardwarePtr = mVehicleHardware.get(); - mSubscriptionManager = std::make_shared(hardwarePtr); + IVehicleHardware* vehicleHardwarePtr = mVehicleHardware.get(); + mSubscriptionManager = std::make_shared(vehicleHardwarePtr); std::weak_ptr subscriptionManagerCopy = mSubscriptionManager; mVehicleHardware->registerOnPropertyChangeEvent( @@ -156,20 +144,15 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) [subscriptionManagerCopy](std::vector updatedValues) { onPropertyChangeEvent(subscriptionManagerCopy, updatedValues); })); - mVehicleHardware->registerOnPropertySetErrorEvent( - std::make_unique( - [subscriptionManagerCopy](std::vector errorEvents) { - onPropertySetErrorEvent(subscriptionManagerCopy, errorEvents); - })); // Register heartbeat event. - mRecurrentAction = - std::make_shared>([hardwarePtr, subscriptionManagerCopy]() { - checkHealth(hardwarePtr, subscriptionManagerCopy); + mRecurrentAction = std::make_shared>( + [vehicleHardwarePtr, subscriptionManagerCopy]() { + checkHealth(vehicleHardwarePtr, subscriptionManagerCopy); }); mRecurrentTimer.registerTimerCallback(HEART_BEAT_INTERVAL_IN_NANO, mRecurrentAction); - mBinderImpl = std::make_unique(); + mBinderLifecycleHandler = std::make_unique(); mOnBinderDiedUnlinkedHandlerThread = std::thread([this] { onBinderDiedUnlinkedHandler(); }); mDeathRecipient = ScopedAIBinder_DeathRecipient( AIBinder_DeathRecipient_new(&DefaultVehicleHal::onBinderDied)); @@ -194,7 +177,7 @@ DefaultVehicleHal::~DefaultVehicleHal() { } void DefaultVehicleHal::onPropertyChangeEvent( - const std::weak_ptr& subscriptionManager, + std::weak_ptr subscriptionManager, const std::vector& updatedValues) { auto manager = subscriptionManager.lock(); if (manager == nullptr) { @@ -211,20 +194,6 @@ void DefaultVehicleHal::onPropertyChangeEvent( } } -void DefaultVehicleHal::onPropertySetErrorEvent( - const std::weak_ptr& subscriptionManager, - const std::vector& errorEvents) { - auto manager = subscriptionManager.lock(); - if (manager == nullptr) { - ALOGW("the SubscriptionManager is destroyed, DefaultVehicleHal is ending"); - return; - } - auto vehiclePropErrorsByClient = manager->getSubscribedClientsForErrorEvents(errorEvents); - for (auto& [callback, vehiclePropErrors] : vehiclePropErrorsByClient) { - SubscriptionClient::sendPropertySetErrors(callback, std::move(vehiclePropErrors)); - } -} - template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, @@ -239,7 +208,7 @@ std::shared_ptr DefaultVehicleHal::getOrCreateClient( bool DefaultVehicleHal::monitorBinderLifeCycleLocked(const AIBinder* clientId) { OnBinderDiedContext* contextPtr = nullptr; if (mOnBinderDiedContexts.find(clientId) != mOnBinderDiedContexts.end()) { - return mBinderImpl->isAlive(clientId); + return mBinderLifecycleHandler->isAlive(clientId); } else { std::unique_ptr context = std::make_unique( OnBinderDiedContext{.vhal = this, .clientId = clientId}); @@ -251,7 +220,7 @@ bool DefaultVehicleHal::monitorBinderLifeCycleLocked(const AIBinder* clientId) { } // If this function fails, onBinderUnlinked would be called to remove the added context. - binder_status_t status = mBinderImpl->linkToDeath( + binder_status_t status = mBinderLifecycleHandler->linkToDeath( const_cast(clientId), mDeathRecipient.get(), static_cast(contextPtr)); if (status == STATUS_OK) { return true; @@ -265,7 +234,8 @@ void DefaultVehicleHal::onBinderDied(void* cookie) { OnBinderDiedContext* context = reinterpret_cast(cookie); // To be handled in mOnBinderDiedUnlinkedHandlerThread. We cannot handle the event in the same // thread because we might be holding the mLock the handler requires. - context->vhal->mBinderEvents.push(BinderDiedUnlinkedEvent{true, context->clientId}); + context->vhal->mBinderEvents.push( + BinderDiedUnlinkedEvent{/*forOnBinderDied=*/true, context->clientId}); } void DefaultVehicleHal::onBinderDiedWithContext(const AIBinder* clientId) { @@ -281,7 +251,8 @@ void DefaultVehicleHal::onBinderUnlinked(void* cookie) { OnBinderDiedContext* context = reinterpret_cast(cookie); // To be handled in mOnBinderDiedUnlinkedHandlerThread. We cannot handle the event in the same // thread because we might be holding the mLock the handler requires. - context->vhal->mBinderEvents.push(BinderDiedUnlinkedEvent{false, context->clientId}); + context->vhal->mBinderEvents.push( + BinderDiedUnlinkedEvent{/*forOnBinderDied=*/false, context->clientId}); } void DefaultVehicleHal::onBinderUnlinkedWithContext(const AIBinder* clientId) { @@ -294,7 +265,7 @@ void DefaultVehicleHal::onBinderUnlinkedWithContext(const AIBinder* clientId) { void DefaultVehicleHal::onBinderDiedUnlinkedHandler() { while (mBinderEvents.waitForItems()) { for (BinderDiedUnlinkedEvent& event : mBinderEvents.flush()) { - if (event.onBinderDied) { + if (event.forOnBinderDied) { onBinderDiedWithContext(event.clientId); } else { onBinderUnlinkedWithContext(event.clientId); @@ -320,6 +291,27 @@ void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) { mPendingRequestPool = std::make_unique(timeoutInNano); } +bool DefaultVehicleHal::getAllPropConfigsFromHardware() { + auto configs = mVehicleHardware->getAllPropertyConfigs(); + for (auto& config : configs) { + mConfigsByPropId[config.prop] = config; + } + VehiclePropConfigs vehiclePropConfigs; + vehiclePropConfigs.payloads = std::move(configs); + auto result = LargeParcelableBase::parcelableToStableLargeParcelable(vehiclePropConfigs); + if (!result.ok()) { + ALOGE("failed to convert configs to shared memory file, error: %s, code: %d", + result.error().message().c_str(), static_cast(result.error().code())); + mConfigFile = nullptr; + return false; + } + + if (result.value() != nullptr) { + mConfigFile = std::move(result.value()); + } + return true; +} + ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { if (mConfigFile != nullptr) { output->payloads.clear(); @@ -368,6 +360,10 @@ Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const GetValueRequests& requests) { + ATRACE_CALL(); + if (callback == nullptr) { + return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER); + } expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -451,6 +447,10 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, const SetValueRequests& requests) { + ATRACE_CALL(); + if (callback == nullptr) { + return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER); + } expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -608,18 +608,20 @@ VhalResult DefaultVehicleHal::checkSubscribeOptions( } if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { - float sampleRate = option.sampleRate; - float minSampleRate = config.minSampleRate; - float maxSampleRate = config.maxSampleRate; - if (sampleRate < minSampleRate || sampleRate > maxSampleRate) { - float defaultRate = getDefaultSampleRate(sampleRate, minSampleRate, maxSampleRate); - ALOGW("sample rate: %f out of range, must be within %f and %f, set to %f", - sampleRate, minSampleRate, maxSampleRate, defaultRate); - sampleRate = defaultRate; + float sampleRateHz = option.sampleRate; + float minSampleRateHz = config.minSampleRate; + float maxSampleRateHz = config.maxSampleRate; + float defaultRateHz = + getDefaultSampleRateHz(sampleRateHz, minSampleRateHz, maxSampleRateHz); + if (sampleRateHz != defaultRateHz) { + ALOGW("sample rate: %f HZ out of range, must be within %f HZ and %f HZ , set to %f " + "HZ", + sampleRateHz, minSampleRateHz, maxSampleRateHz, defaultRateHz); + sampleRateHz = defaultRateHz; } - if (!SubscriptionManager::checkSampleRate(sampleRate)) { + if (!SubscriptionManager::checkSampleRateHz(sampleRateHz)) { return StatusError(StatusCode::INVALID_ARG) - << "invalid sample rate: " << sampleRate; + << "invalid sample rate: " << sampleRateHz << " HZ"; } } @@ -644,11 +646,13 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, const std::vector& options, [[maybe_unused]] int32_t maxSharedMemoryFileCount) { // TODO(b/205189110): Use shared memory file count. + if (callback == nullptr) { + return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER); + } if (auto result = checkSubscribeOptions(options); !result.ok()) { ALOGE("subscribe: invalid subscribe options: %s", getErrorMsg(result).c_str()); return toScopedAStatus(result); } - std::vector onChangeSubscriptions; std::vector continuousSubscriptions; for (const auto& option : options) { @@ -669,7 +673,7 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, } if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { - optionCopy.sampleRate = getDefaultSampleRate( + optionCopy.sampleRate = getDefaultSampleRateHz( optionCopy.sampleRate, config.minSampleRate, config.maxSampleRate); continuousSubscriptions.push_back(std::move(optionCopy)); } else { @@ -688,19 +692,15 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, // Create a new SubscriptionClient if there isn't an existing one. mSubscriptionClients->maybeAddClient(callback); + // Since we have already check the sample rates, the following functions must succeed. if (!onChangeSubscriptions.empty()) { - auto result = mSubscriptionManager->subscribe(callback, onChangeSubscriptions, - /*isContinuousProperty=*/false); - if (!result.ok()) { - return toScopedAStatus(result); - } + return toScopedAStatus(mSubscriptionManager->subscribe(callback, onChangeSubscriptions, + /*isContinuousProperty=*/false)); } if (!continuousSubscriptions.empty()) { - auto result = mSubscriptionManager->subscribe(callback, continuousSubscriptions, - /*isContinuousProperty=*/true); - if (!result.ok()) { - return toScopedAStatus(result); - } + return toScopedAStatus(mSubscriptionManager->subscribe(callback, + continuousSubscriptions, + /*isContinuousProperty=*/true)); } } return ScopedAStatus::ok(); @@ -708,6 +708,9 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType& callback, const std::vector& propIds) { + if (callback == nullptr) { + return ScopedAStatus::fromExceptionCode(EX_NULL_POINTER); + } return toScopedAStatus(mSubscriptionManager->unsubscribe(callback->asBinder().get(), propIds)); } @@ -752,9 +755,9 @@ VhalResult DefaultVehicleHal::checkReadPermission(const VehiclePropValue& return {}; } -void DefaultVehicleHal::checkHealth(IVehicleHardware* hardware, +void DefaultVehicleHal::checkHealth(IVehicleHardware* vehicleHardware, std::weak_ptr subscriptionManager) { - StatusCode status = hardware->checkHealth(); + StatusCode status = vehicleHardware->checkHealth(); if (status != StatusCode::OK) { ALOGE("VHAL check health returns non-okay status"); return; @@ -769,18 +772,18 @@ void DefaultVehicleHal::checkHealth(IVehicleHardware* hardware, return; } -binder_status_t DefaultVehicleHal::AIBinderImpl::linkToDeath(AIBinder* binder, - AIBinder_DeathRecipient* recipient, - void* cookie) { +binder_status_t DefaultVehicleHal::BinderLifecycleHandler::linkToDeath( + AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) { return AIBinder_linkToDeath(binder, recipient, cookie); } -bool DefaultVehicleHal::AIBinderImpl::isAlive(const AIBinder* binder) { +bool DefaultVehicleHal::BinderLifecycleHandler::isAlive(const AIBinder* binder) { return AIBinder_isAlive(binder); } -void DefaultVehicleHal::setBinderImpl(std::unique_ptr impl) { - mBinderImpl = std::move(impl); +void DefaultVehicleHal::setBinderLifecycleHandler( + std::unique_ptr handler) { + mBinderLifecycleHandler = std::move(handler); } bool DefaultVehicleHal::checkDumpPermission() { @@ -798,10 +801,16 @@ binder_status_t DefaultVehicleHal::dump(int fd, const char** args, uint32_t numA for (uint32_t i = 0; i < numArgs; i++) { options.push_back(args[i]); } + if (options.size() == 1 && options[0] == "-a") { + // Ignore "-a" option. Bugreport will call with this option. + options.clear(); + } DumpResult result = mVehicleHardware->dump(options); + if (result.refreshPropertyConfigs) { + getAllPropConfigsFromHardware(); + } dprintf(fd, "%s", (result.buffer + "\n").c_str()); if (!result.callerShouldDumpState) { - dprintf(fd, "Skip dumping Vehicle HAL State.\n"); return STATUS_OK; } dprintf(fd, "Vehicle HAL State: \n"); diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index 566c303992..bba730f6f4 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -36,14 +36,14 @@ constexpr float ONE_SECOND_IN_NANO = 1'000'000'000.; using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropError; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Error; using ::android::base::Result; using ::android::base::StringPrintf; using ::ndk::ScopedAStatus; -SubscriptionManager::SubscriptionManager(IVehicleHardware* hardware) : mVehicleHardware(hardware) {} +SubscriptionManager::SubscriptionManager(IVehicleHardware* vehicleHardware) + : mVehicleHardware(vehicleHardware) {} SubscriptionManager::~SubscriptionManager() { std::scoped_lock lockGuard(mLock); @@ -52,94 +52,82 @@ SubscriptionManager::~SubscriptionManager() { mSubscribedPropsByClient.clear(); } -bool SubscriptionManager::checkSampleRate(float sampleRate) { - return getInterval(sampleRate).ok(); +bool SubscriptionManager::checkSampleRateHz(float sampleRateHz) { + return getIntervalNanos(sampleRateHz).ok(); } -Result SubscriptionManager::getInterval(float sampleRate) { - int64_t interval = 0; - if (sampleRate <= 0) { +Result SubscriptionManager::getIntervalNanos(float sampleRateHz) { + int64_t intervalNanos = 0; + if (sampleRateHz <= 0) { return Error() << "invalid sample rate, must be a positive number"; } - if (sampleRate <= (ONE_SECOND_IN_NANO / static_cast(INT64_MAX))) { - return Error() << "invalid sample rate: " << sampleRate << ", too small"; + if (sampleRateHz <= (ONE_SECOND_IN_NANO / static_cast(INT64_MAX))) { + return Error() << "invalid sample rate: " << sampleRateHz << ", too small"; } - interval = static_cast(ONE_SECOND_IN_NANO / sampleRate); - return interval; + intervalNanos = static_cast(ONE_SECOND_IN_NANO / sampleRateHz); + return intervalNanos; } -void ContSubConfigs::refreshMaxSampleRate() { - float maxSampleRate = 0.; +void ContSubConfigs::refreshMaxSampleRateHz() { + float maxSampleRateHz = 0.; // This is not called frequently so a brute-focre is okay. More efficient way exists but this // is simpler. - for (const auto& [_, sampleRate] : mSampleRates) { - if (sampleRate > maxSampleRate) { - maxSampleRate = sampleRate; + for (const auto& [_, sampleRateHz] : mSampleRateHzByClient) { + if (sampleRateHz > maxSampleRateHz) { + maxSampleRateHz = sampleRateHz; } } - mMaxSampleRate = maxSampleRate; + mMaxSampleRateHz = maxSampleRateHz; } -void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRate) { - mSampleRates[clientId] = sampleRate; - refreshMaxSampleRate(); +void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRateHz) { + mSampleRateHzByClient[clientId] = sampleRateHz; + refreshMaxSampleRateHz(); } void ContSubConfigs::removeClient(const ClientIdType& clientId) { - mSampleRates.erase(clientId); - refreshMaxSampleRate(); + mSampleRateHzByClient.erase(clientId); + refreshMaxSampleRateHz(); } -float ContSubConfigs::getMaxSampleRate() { - return mMaxSampleRate; +float ContSubConfigs::getMaxSampleRateHz() const { + return mMaxSampleRateHz; } -VhalResult SubscriptionManager::updateSampleRateLocked(const ClientIdType& clientId, - const PropIdAreaId& propIdAreaId, - float sampleRate) { +VhalResult SubscriptionManager::addContinuousSubscriberLocked( + const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz) { // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. - ContSubConfigs infoCopy = mContSubConfigsByPropIdArea[propIdAreaId]; - infoCopy.addClient(clientId, sampleRate); - if (infoCopy.getMaxSampleRate() == - mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRate()) { - mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; + ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId]; + newConfig.addClient(clientId, sampleRateHz); + return updateContSubConfigs(propIdAreaId, newConfig); +} + +VhalResult SubscriptionManager::removeContinuousSubscriberLocked( + const ClientIdType& clientId, const PropIdAreaId& propIdAreaId) { + // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. + ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId]; + newConfig.removeClient(clientId); + return updateContSubConfigs(propIdAreaId, newConfig); +} + +VhalResult SubscriptionManager::updateContSubConfigs(const PropIdAreaId& propIdAreaId, + const ContSubConfigs& newConfig) { + if (newConfig.getMaxSampleRateHz() == + mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRateHz()) { + mContSubConfigsByPropIdArea[propIdAreaId] = newConfig; return {}; } - float newRate = infoCopy.getMaxSampleRate(); + float newRateHz = newConfig.getMaxSampleRateHz(); int32_t propId = propIdAreaId.propId; int32_t areaId = propIdAreaId.areaId; - if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRate); + if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRateHz); status != StatusCode::OK) { return StatusError(status) << StringPrintf("failed to update sample rate for prop: %" PRId32 ", area" - ": %" PRId32 ", sample rate: %f", - propId, areaId, newRate); + ": %" PRId32 ", sample rate: %f HZ", + propId, areaId, newRateHz); } - mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; - return {}; -} - -VhalResult SubscriptionManager::removeSampleRateLocked(const ClientIdType& clientId, - const PropIdAreaId& propIdAreaId) { - // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. - ContSubConfigs infoCopy = mContSubConfigsByPropIdArea[propIdAreaId]; - infoCopy.removeClient(clientId); - if (infoCopy.getMaxSampleRate() == - mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRate()) { - mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; - return {}; - } - float newRate = infoCopy.getMaxSampleRate(); - int32_t propId = propIdAreaId.propId; - int32_t areaId = propIdAreaId.areaId; - if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRate); - status != StatusCode::OK) { - return StatusError(status) << StringPrintf("failed to update sample rate for prop: %" PRId32 - ", area" - ": %" PRId32 ", sample rate: %f", - propId, areaId, newRate); - } - mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; + mContSubConfigsByPropIdArea[propIdAreaId] = newConfig; return {}; } @@ -148,14 +136,12 @@ VhalResult SubscriptionManager::subscribe(const std::shared_ptr lockGuard(mLock); - std::vector intervals; for (const auto& option : options) { - float sampleRate = option.sampleRate; + float sampleRateHz = option.sampleRate; if (isContinuousProperty) { - auto intervalResult = getInterval(sampleRate); - if (!intervalResult.ok()) { - return StatusError(StatusCode::INVALID_ARG) << intervalResult.error().message(); + if (auto result = getIntervalNanos(sampleRateHz); !result.ok()) { + return StatusError(StatusCode::INVALID_ARG) << result.error().message(); } } @@ -177,7 +163,8 @@ VhalResult SubscriptionManager::subscribe(const std::shared_ptr SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdT while (it != propIdAreaIds.end()) { int32_t propId = it->propId; if (std::find(propIds.begin(), propIds.end(), propId) != propIds.end()) { - if (auto result = removeSampleRateLocked(clientId, *it); !result.ok()) { + if (auto result = removeContinuousSubscriberLocked(clientId, *it); !result.ok()) { return result; } @@ -245,7 +232,7 @@ VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdT auto& subscriptions = mSubscribedPropsByClient[clientId]; for (auto const& propIdAreaId : subscriptions) { - if (auto result = removeSampleRateLocked(clientId, propIdAreaId); !result.ok()) { + if (auto result = removeContinuousSubscriberLocked(clientId, propIdAreaId); !result.ok()) { return result; } @@ -282,32 +269,6 @@ SubscriptionManager::getSubscribedClients(const std::vector& u return clients; } -std::unordered_map, std::vector> -SubscriptionManager::getSubscribedClientsForErrorEvents( - const std::vector& errorEvents) { - std::scoped_lock lockGuard(mLock); - std::unordered_map, std::vector> clients; - - for (const auto& errorEvent : errorEvents) { - PropIdAreaId propIdAreaId{ - .propId = errorEvent.propId, - .areaId = errorEvent.areaId, - }; - if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { - continue; - } - - for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) { - clients[client].push_back({ - .propId = errorEvent.propId, - .areaId = errorEvent.areaId, - .errorCode = errorEvent.errorCode, - }); - } - } - return clients; -} - bool SubscriptionManager::isEmpty() { std::scoped_lock lockGuard(mLock); return mSubscribedPropsByClient.empty() && mClientsByPropIdArea.empty(); diff --git a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp index c8b5c658dd..f8a4e7d14d 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp @@ -27,6 +27,13 @@ using ::android::hardware::automotive::vehicle::DefaultVehicleHal; using ::android::hardware::automotive::vehicle::fake::FakeVehicleHardware; int main(int /* argc */, char* /* argv */[]) { + ALOGI("Starting thread pool..."); + if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) { + ALOGE("%s", "failed to set thread pool max thread count"); + return 1; + } + ABinderProcess_startThreadPool(); + std::unique_ptr hardware = std::make_unique(); std::shared_ptr vhal = ::ndk::SharedRefBase::make(std::move(hardware)); @@ -39,12 +46,6 @@ int main(int /* argc */, char* /* argv */[]) { return 1; } - if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) { - ALOGE("%s", "failed to set thread pool max thread count"); - return 1; - } - ABinderProcess_startThreadPool(); - ALOGI("Vehicle Service Ready"); ABinderProcess_joinThreadPool(); diff --git a/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp b/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp new file mode 100644 index 0000000000..ac1e3b1a56 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +using ::android::fuzzService; +using ::android::hardware::automotive::vehicle::DefaultVehicleHal; +using ::android::hardware::automotive::vehicle::fake::FakeVehicleHardware; +using ::ndk::SharedRefBase; + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::unique_ptr hardware = std::make_unique(); + std::shared_ptr vhal = + ::ndk::SharedRefBase::make(std::move(hardware)); + + fuzzService(vhal->asBinder().get(), FuzzedDataProvider(data, size)); + + return 0; +} diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 76b57c71f9..05e569ab8a 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -62,7 +62,6 @@ using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropError; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; @@ -325,9 +324,9 @@ class DefaultVehicleHalTest : public testing::Test { mCallbackClient = IVehicleCallback::fromBinder(mBinder); // Set the linkToDeath to a fake implementation that always returns OK. - auto binderImpl = std::make_unique(); - mBinderImpl = binderImpl.get(); - mVhal->setBinderImpl(std::move(binderImpl)); + auto handler = std::make_unique(); + mBinderLifecycleHandler = handler.get(); + mVhal->setBinderLifecycleHandler(std::move(handler)); } void TearDown() override { @@ -371,7 +370,7 @@ class DefaultVehicleHalTest : public testing::Test { bool hasNoSubscriptions() { return mVhal->mSubscriptionManager->isEmpty(); } - void setBinderAlive(bool isAlive) { mBinderImpl->setAlive(isAlive); }; + void setBinderAlive(bool isAlive) { mBinderLifecycleHandler->setAlive(isAlive); }; static Result getValuesTestCases(size_t size, GetValueRequests& requests, std::vector& expectedResults, @@ -445,7 +444,7 @@ class DefaultVehicleHalTest : public testing::Test { } private: - class TestBinderImpl final : public DefaultVehicleHal::IBinder { + class TestBinderLifecycleHandler final : public DefaultVehicleHal::BinderLifecycleInterface { public: binder_status_t linkToDeath(AIBinder*, AIBinder_DeathRecipient*, void*) override { if (mIsAlive) { @@ -469,7 +468,7 @@ class DefaultVehicleHalTest : public testing::Test { std::shared_ptr mCallback; std::shared_ptr mCallbackClient; SpAIBinder mBinder; - TestBinderImpl* mBinderImpl; + TestBinderLifecycleHandler* mBinderLifecycleHandler; }; TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { @@ -672,8 +671,8 @@ TEST_F(DefaultVehicleHalTest, testGetValuesNoReadPermission) { } TEST_F(DefaultVehicleHalTest, testGetValuesFinishBeforeTimeout) { - // timeout: 0.1s - int64_t timeout = 100000000; + // timeout: 1s + int64_t timeout = 1000000000; setTimeout(timeout); GetValueRequests requests; @@ -682,17 +681,15 @@ TEST_F(DefaultVehicleHalTest, testGetValuesFinishBeforeTimeout) { ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); - // The response would be returned after 0.05s. - getHardware()->setSleepTime(timeout / 2); + // The response would be returned after 0.01s. + getHardware()->setSleepTime(timeout / 100); getHardware()->addGetValueResponses(expectedResults); auto status = getClient()->getValues(getCallbackClient(), requests); ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); - // Wait for the response. - std::this_thread::sleep_for(std::chrono::nanoseconds(timeout)); - + ASSERT_TRUE(getCallback()->waitForGetValueResults(1, timeout)) << "no results in callback"; auto maybeGetValueResults = getCallback()->nextGetValueResults(); ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback"; EXPECT_EQ(maybeGetValueResults.value().payloads, expectedResults) << "results mismatch"; @@ -700,8 +697,8 @@ TEST_F(DefaultVehicleHalTest, testGetValuesFinishBeforeTimeout) { } TEST_F(DefaultVehicleHalTest, testGetValuesFinishAfterTimeout) { - // timeout: 0.1s - int64_t timeout = 100000000; + // timeout: 0.01s + int64_t timeout = 10000000; setTimeout(timeout); GetValueRequests requests; @@ -710,17 +707,14 @@ TEST_F(DefaultVehicleHalTest, testGetValuesFinishAfterTimeout) { ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); - // The response would be returned after 0.2s. - getHardware()->setSleepTime(timeout * 2); + // The response would be returned after 0.1s. + getHardware()->setSleepTime(timeout * 10); getHardware()->addGetValueResponses(expectedResults); auto status = getClient()->getValues(getCallbackClient(), requests); ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); - // Wait for the response. - std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5)); - for (size_t i = 0; i < expectedResults.size(); i++) { expectedResults[i] = { .requestId = expectedResults[i].requestId, @@ -729,6 +723,8 @@ TEST_F(DefaultVehicleHalTest, testGetValuesFinishAfterTimeout) { }; } + ASSERT_TRUE(getCallback()->waitForGetValueResults(1, timeout * 100)) + << "no results in callback"; auto maybeGetValueResults = getCallback()->nextGetValueResults(); ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback"; ASSERT_THAT(maybeGetValueResults.value().payloads, UnorderedElementsAreArray(expectedResults)) @@ -961,8 +957,8 @@ TEST_P(SetValuesInvalidRequestTest, testSetValuesInvalidRequest) { } TEST_F(DefaultVehicleHalTest, testSetValuesFinishBeforeTimeout) { - // timeout: 0.1s - int64_t timeout = 100000000; + // timeout: 1s + int64_t timeout = 1000000000; setTimeout(timeout); SetValueRequests requests; @@ -971,17 +967,15 @@ TEST_F(DefaultVehicleHalTest, testSetValuesFinishBeforeTimeout) { ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); - // The response would be returned after 0.05s. - getHardware()->setSleepTime(timeout / 2); + // The response would be returned after 0.01s. + getHardware()->setSleepTime(timeout / 100); getHardware()->addSetValueResponses(expectedResults); auto status = getClient()->setValues(getCallbackClient(), requests); ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); - // Wait for the response. - std::this_thread::sleep_for(std::chrono::nanoseconds(timeout)); - + ASSERT_TRUE(getCallback()->waitForSetValueResults(1, timeout)) << "no set value results"; auto maybeSetValueResults = getCallback()->nextSetValueResults(); ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; EXPECT_EQ(maybeSetValueResults.value().payloads, expectedResults) << "results mismatch"; @@ -989,8 +983,8 @@ TEST_F(DefaultVehicleHalTest, testSetValuesFinishBeforeTimeout) { } TEST_F(DefaultVehicleHalTest, testSetValuesFinishAfterTimeout) { - // timeout: 0.1s - int64_t timeout = 100000000; + // timeout: 0.01s + int64_t timeout = 10000000; setTimeout(timeout); SetValueRequests requests; @@ -999,17 +993,14 @@ TEST_F(DefaultVehicleHalTest, testSetValuesFinishAfterTimeout) { ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); - // The response would be returned after 0.2s. - getHardware()->setSleepTime(timeout * 2); + // The response would be returned after 0.1s. + getHardware()->setSleepTime(timeout * 10); getHardware()->addSetValueResponses(expectedResults); auto status = getClient()->setValues(getCallbackClient(), requests); ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); - // Wait for the response. - std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5)); - for (size_t i = 0; i < expectedResults.size(); i++) { expectedResults[i] = { .requestId = expectedResults[i].requestId, @@ -1017,6 +1008,7 @@ TEST_F(DefaultVehicleHalTest, testSetValuesFinishAfterTimeout) { }; } + ASSERT_TRUE(getCallback()->waitForSetValueResults(1, timeout * 100)) << "no set value results"; auto maybeSetValueResults = getCallback()->nextSetValueResults(); ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; ASSERT_THAT(maybeSetValueResults.value().payloads, UnorderedElementsAreArray(expectedResults)) @@ -1457,7 +1449,7 @@ TEST_F(DefaultVehicleHalTest, testUnsubscribeContinuous) { std::vector options = { { .propId = GLOBAL_CONTINUOUS_PROP, - .sampleRate = 20.0, + .sampleRate = 100.0, }, }; @@ -1470,16 +1462,20 @@ TEST_F(DefaultVehicleHalTest, testUnsubscribeContinuous) { ASSERT_TRUE(status.isOk()) << "unsubscribe failed: " << status.getMessage(); + // Wait for the last events to come. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + // Clear existing events. while (getCallback()->nextOnPropertyEventResults().has_value()) { // Do nothing. } - // Wait for a while, make sure no new events are generated. + // Wait for a while, make sure no new events are generated. If still subscribed, this should + // generate around 10 events. std::this_thread::sleep_for(std::chrono::milliseconds(100)); - ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) - << "No property event should be generated after unsubscription"; + ASSERT_EQ(getCallback()->countOnPropertyEventResults(), 0u) + << "Property event generation must stop after unsubscription"; } class SubscribeInvalidOptionsTest @@ -1657,63 +1653,6 @@ TEST_F(DefaultVehicleHalTest, testDumpCallerShouldNotDump) { ASSERT_EQ(msg.find("Vehicle HAL State: "), std::string::npos); } -TEST_F(DefaultVehicleHalTest, testOnPropertySetErrorEvent) { - std::vector options = { - { - .propId = GLOBAL_ON_CHANGE_PROP, - .areaIds = {0}, - }, - { - .propId = GLOBAL_CONTINUOUS_PROP, - .areaIds = {0}, - .sampleRate = 1, - }, - }; - auto status = getClient()->subscribe(getCallbackClient(), options, 0); - ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); - std::vector errorEvents = { - { - .propId = GLOBAL_ON_CHANGE_PROP, - .areaId = 0, - .errorCode = StatusCode::INTERNAL_ERROR, - }, - { - .propId = GLOBAL_ON_CHANGE_PROP, - .areaId = 0, - .errorCode = StatusCode::ACCESS_DENIED, - }, - { - .propId = GLOBAL_CONTINUOUS_PROP, - .areaId = 0, - .errorCode = StatusCode::INVALID_ARG, - }, - }; - std::vector expectedResults = { - { - .propId = GLOBAL_ON_CHANGE_PROP, - .areaId = 0, - .errorCode = StatusCode::INTERNAL_ERROR, - }, - { - .propId = GLOBAL_ON_CHANGE_PROP, - .areaId = 0, - .errorCode = StatusCode::ACCESS_DENIED, - }, - { - .propId = GLOBAL_CONTINUOUS_PROP, - .areaId = 0, - .errorCode = StatusCode::INVALID_ARG, - }, - }; - getHardware()->sendOnPropertySetErrorEvent(errorEvents); - - ASSERT_EQ(getCallback()->countOnPropertySetErrorResults(), 1u); - auto maybeVehiclePropErrors = getCallback()->nextOnPropertySetErrorResults(); - ASSERT_TRUE(maybeVehiclePropErrors.has_value()); - const auto& vehiclePropErrors = maybeVehiclePropErrors.value(); - ASSERT_THAT(vehiclePropErrors.payloads, UnorderedElementsAreArray(expectedResults)); -} - } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp index 75b82571a1..f51ce5cb39 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp @@ -16,6 +16,9 @@ #include "MockVehicleCallback.h" +#include +#include + namespace android { namespace hardware { namespace automotive { @@ -27,6 +30,7 @@ using ::aidl::android::hardware::automotive::vehicle::GetValueResults; using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; +using ::android::base::ScopedLockAssertion; using ::ndk::ScopedAStatus; using ::ndk::ScopedFileDescriptor; @@ -46,26 +50,39 @@ static ScopedAStatus storeResults(const T& results, std::list* storedResults) } // namespace ScopedAStatus MockVehicleCallback::onGetValues(const GetValueResults& results) { - std::scoped_lock lockGuard(mLock); - return storeResults(results, &mGetValueResults); + ScopedAStatus result; + { + std::scoped_lock lockGuard(mLock); + result = storeResults(results, &mGetValueResults); + } + mCond.notify_all(); + return result; } ScopedAStatus MockVehicleCallback::onSetValues(const SetValueResults& results) { - std::scoped_lock lockGuard(mLock); - return storeResults(results, &mSetValueResults); + ScopedAStatus result; + { + std::scoped_lock lockGuard(mLock); + result = storeResults(results, &mSetValueResults); + } + mCond.notify_all(); + return result; } ScopedAStatus MockVehicleCallback::onPropertyEvent(const VehiclePropValues& results, int32_t sharedMemoryFileCount) { - std::scoped_lock lockGuard(mLock); - - mSharedMemoryFileCount = sharedMemoryFileCount; - return storeResults(results, &mOnPropertyEventResults); + ScopedAStatus result; + { + std::scoped_lock lockGuard(mLock); + mSharedMemoryFileCount = sharedMemoryFileCount; + result = storeResults(results, &mOnPropertyEventResults); + } + mCond.notify_all(); + return result; } -ScopedAStatus MockVehicleCallback::onPropertySetError(const VehiclePropErrors& results) { - std::scoped_lock lockGuard(mLock); - return storeResults(results, &mOnPropertySetErrorResults); +ScopedAStatus MockVehicleCallback::onPropertySetError(const VehiclePropErrors&) { + return ScopedAStatus::ok(); } std::optional MockVehicleCallback::nextGetValueResults() { @@ -88,14 +105,20 @@ size_t MockVehicleCallback::countOnPropertyEventResults() { return mOnPropertyEventResults.size(); } -std::optional MockVehicleCallback::nextOnPropertySetErrorResults() { - std::scoped_lock lockGuard(mLock); - return pop(mOnPropertySetErrorResults); +bool MockVehicleCallback::waitForSetValueResults(size_t size, size_t timeoutInNano) { + std::unique_lock lk(mLock); + return mCond.wait_for(lk, std::chrono::nanoseconds(timeoutInNano), [this, size] { + ScopedLockAssertion lockAssertion(mLock); + return mSetValueResults.size() >= size; + }); } -size_t MockVehicleCallback::countOnPropertySetErrorResults() { - std::scoped_lock lockGuard(mLock); - return mOnPropertySetErrorResults.size(); +bool MockVehicleCallback::waitForGetValueResults(size_t size, size_t timeoutInNano) { + std::unique_lock lk(mLock); + return mCond.wait_for(lk, std::chrono::nanoseconds(timeoutInNano), [this, size] { + ScopedLockAssertion lockAssertion(mLock); + return mGetValueResults.size() >= size; + }); } } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h index 91dbb7e98b..f17b273b18 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -62,13 +63,13 @@ class MockVehicleCallback final nextSetValueResults(); std::optional nextOnPropertyEventResults(); - size_t countOnPropertySetErrorResults(); - std::optional - nextOnPropertySetErrorResults(); size_t countOnPropertyEventResults(); + bool waitForSetValueResults(size_t size, size_t timeoutInNano); + bool waitForGetValueResults(size_t size, size_t timeoutInNano); private: std::mutex mLock; + std::condition_variable mCond; std::list mGetValueResults GUARDED_BY(mLock); std::list mSetValueResults @@ -76,8 +77,6 @@ class MockVehicleCallback final std::list mOnPropertyEventResults GUARDED_BY(mLock); int32_t mSharedMemoryFileCount GUARDED_BY(mLock); - std::list - mOnPropertySetErrorResults GUARDED_BY(mLock); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index ba0d33dfde..4df4e1aea5 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -131,9 +131,8 @@ void MockVehicleHardware::registerOnPropertyChangeEvent( } void MockVehicleHardware::registerOnPropertySetErrorEvent( - std::unique_ptr callback) { - std::scoped_lock lockGuard(mLock); - mPropertySetErrorCallback = std::move(callback); + std::unique_ptr) { + // TODO(b/200737967): mock this. } void MockVehicleHardware::setPropertyConfigs(const std::vector& configs) { @@ -255,12 +254,6 @@ template StatusCode MockVehicleHardware::handleRequestsLocked>* storedRequests, std::list>* storedResponses) const; -void MockVehicleHardware::sendOnPropertySetErrorEvent( - const std::vector& errorEvents) { - std::scoped_lock lockGuard(mLock); - (*mPropertySetErrorCallback)(errorEvents); -} - } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index 46b30b9405..743841c216 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -85,7 +85,6 @@ class MockVehicleHardware final : public IVehicleHardware { aidl::android::hardware::automotive::vehicle::StatusCode status); void setSleepTime(int64_t timeInNano); void setDumpResult(DumpResult result); - void sendOnPropertySetErrorEvent(const std::vector& errorEvents); private: mutable std::mutex mLock; @@ -105,7 +104,6 @@ class MockVehicleHardware final : public IVehicleHardware { mStatusByFunctions GUARDED_BY(mLock); int64_t mSleepTime GUARDED_BY(mLock) = 0; std::unique_ptr mPropertyChangeCallback GUARDED_BY(mLock); - std::unique_ptr mPropertySetErrorCallback GUARDED_BY(mLock); std::function, const std::vector&)> diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index 3f593633f9..cb8c8d1514 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -231,7 +231,7 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeGlobalContinuous) { std::vector options = {{ .propId = 0, .areaIds = {0}, - .sampleRate = 10.0, + .sampleRate = 100.0, }}; auto result = getManager()->subscribe(getCallbackClient(), options, true); @@ -240,11 +240,13 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeGlobalContinuous) { result = getManager()->unsubscribe(getCallbackClient()->asBinder().get()); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + // Wait for the last events to come. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + clearEvents(); - std::this_thread::sleep_for(std::chrono::milliseconds(200)); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); - // Theoretically trigger 10 times, but check for at least 9 times to be stable. ASSERT_TRUE(getEvents().empty()); } @@ -269,6 +271,9 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeMultipleAreas) { std::vector({0})); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + // Wait for the last events to come. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + clearEvents(); std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -301,6 +306,9 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeByCallback) { result = getManager()->unsubscribe(getCallbackClient()->asBinder().get()); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + // Wait for the last events to come. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + clearEvents(); std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -477,16 +485,16 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeOnchange) { ASSERT_THAT(clients[getCallbackClient()], ElementsAre(&updatedValues[1])); } -TEST_F(SubscriptionManagerTest, testCheckSampleRateValid) { - ASSERT_TRUE(SubscriptionManager::checkSampleRate(1.0)); +TEST_F(SubscriptionManagerTest, testCheckSampleRateHzValid) { + ASSERT_TRUE(SubscriptionManager::checkSampleRateHz(1.0)); } -TEST_F(SubscriptionManagerTest, testCheckSampleRateInvalidTooSmall) { - ASSERT_FALSE(SubscriptionManager::checkSampleRate(FLT_MIN)); +TEST_F(SubscriptionManagerTest, testCheckSampleRateHzInvalidTooSmall) { + ASSERT_FALSE(SubscriptionManager::checkSampleRateHz(FLT_MIN)); } -TEST_F(SubscriptionManagerTest, testCheckSampleRateInvalidZero) { - ASSERT_FALSE(SubscriptionManager::checkSampleRate(0)); +TEST_F(SubscriptionManagerTest, testCheckSampleRateHzInvalidZero) { + ASSERT_FALSE(SubscriptionManager::checkSampleRateHz(0)); } } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml index 4d587eeba8..9834cdbc67 100644 --- a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml +++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml @@ -1,7 +1,7 @@ android.hardware.automotive.vehicle - 1 + 2 IVehicle/default diff --git a/automotive/vehicle/aidl_property/Android.bp b/automotive/vehicle/aidl_property/Android.bp new file mode 100644 index 0000000000..19fa4a38db --- /dev/null +++ b/automotive/vehicle/aidl_property/Android.bp @@ -0,0 +1,58 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +aidl_interface { + name: "android.hardware.automotive.vehicle.property", + vendor_available: true, + srcs: [ + // This HAL was originally part of android.hardware.automotive.vehicle + "android/hardware/automotive/vehicle/*.aidl", + ], + frozen: true, + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], + }, + }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + { + version: "2", + imports: [], + }, + + ], + +} diff --git a/automotive/vehicle/aidl_property/OWNERS b/automotive/vehicle/aidl_property/OWNERS new file mode 100644 index 0000000000..73e45cab13 --- /dev/null +++ b/automotive/vehicle/aidl_property/OWNERS @@ -0,0 +1 @@ +tylertrephan@google.com diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/.hash b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/.hash new file mode 100644 index 0000000000..02d7352c60 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/.hash @@ -0,0 +1,2 @@ +8610b651e162c614a97542d6f4ed039c969823e5 +d80c4423311162bf7e4fdda8c7be2bad2371cc00 diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CustomInputType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/CustomInputType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvChargeState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvChargeState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvConnectorType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvConnectorType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/EvsServiceType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/FuelType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/FuelType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/PortLocationType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/PortLocationType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RotaryInputType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/RotaryInputType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/TrailerState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/TrailerState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserInfo.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UserInfo.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UsersInfo.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/UsersInfo.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleArea.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleArea.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleGear.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleGear.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleProperty.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleProperty.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleUnit.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleUnit.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/.hash b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/.hash new file mode 100644 index 0000000000..46c03c396d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/.hash @@ -0,0 +1 @@ +666fd8f93217775f55c3eb6ef9897cdde7e43da9 diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl new file mode 100644 index 0000000000..b316df7454 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum AutomaticEmergencyBrakingState { + OTHER = 0, + ENABLED = 1, + ACTIVATED = 2, + USER_OVERRIDE = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl new file mode 100644 index 0000000000..535b0b1e2f --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum BlindSpotWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CreateUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CreateUserRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CreateUserResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CreateUserResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CreateUserStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CreateUserStatus.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlCommand.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlCommand.aidl new file mode 100644 index 0000000000..d6a104d25b --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlCommand.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CruiseControlCommand { + ACTIVATE = 1, + SUSPEND = 2, + INCREASE_TARGET_SPEED = 3, + DECREASE_TARGET_SPEED = 4, + INCREASE_TARGET_TIME_GAP = 5, + DECREASE_TARGET_TIME_GAP = 6, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlState.aidl new file mode 100644 index 0000000000..ddaffa30c2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CruiseControlState { + OTHER = 0, + ENABLED = 1, + ACTIVATED = 2, + USER_OVERRIDE = 3, + SUSPENDED = 4, + FORCED_DEACTIVATION_WARNING = 5, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlType.aidl new file mode 100644 index 0000000000..aab9dfe966 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CruiseControlType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CruiseControlType { + OTHER = 0, + STANDARD = 1, + ADAPTIVE = 2, + PREDICTIVE = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CustomInputType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/CustomInputType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl new file mode 100644 index 0000000000..078acde168 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EmergencyLaneKeepAssistState { + OTHER = 0, + ENABLED = 1, + WARNING_LEFT = 2, + WARNING_RIGHT = 3, + ACTIVATED_STEER_LEFT = 4, + ACTIVATED_STEER_RIGHT = 5, + USER_OVERRIDE = 6, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ErrorState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ErrorState.aidl new file mode 100644 index 0000000000..dd950ce88c --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ErrorState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ErrorState { + OTHER_ERROR_STATE = (-1) /* -1 */, + NOT_AVAILABLE_DISABLED = (-2) /* -2 */, + NOT_AVAILABLE_SPEED_LOW = (-3) /* -3 */, + NOT_AVAILABLE_SPEED_HIGH = (-4) /* -4 */, + NOT_AVAILABLE_POOR_VISIBILITY = (-5) /* -5 */, + NOT_AVAILABLE_SAFETY = (-6) /* -6 */, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvChargeState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvChargeState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvConnectorType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvConnectorType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvStoppingMode.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvStoppingMode.aidl new file mode 100644 index 0000000000..3be8d1263f --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvStoppingMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvStoppingMode { + OTHER = 0, + CREEP = 1, + ROLL = 2, + HOLD = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceState.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceType.aidl new file mode 100644 index 0000000000..285732cc39 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/EvsServiceType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvsServiceType { + REARVIEW = 0, + SURROUNDVIEW = 1, + FRONTVIEW = 2, + LEFTVIEW = 3, + RIGHTVIEW = 4, + DRIVERVIEW = 5, + FRONTPASSENGERSVIEW = 6, + REARPASSENGERSVIEW = 7, + USER_DEFINED = 1000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl new file mode 100644 index 0000000000..371885d3b5 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ForwardCollisionWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/FuelType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/FuelType.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl new file mode 100644 index 0000000000..9c565ee818 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum GsrComplianceRequirementType { + GSR_COMPLIANCE_NOT_REQUIRED = 0, + GSR_COMPLIANCE_REQUIRED_V1 = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl new file mode 100644 index 0000000000..bb390f2224 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum HandsOnDetectionDriverState { + OTHER = 0, + HANDS_ON = 1, + HANDS_OFF = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl new file mode 100644 index 0000000000..4ea4d1d450 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum HandsOnDetectionWarning { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl new file mode 100644 index 0000000000..9e726052e8 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneCenteringAssistCommand { + ACTIVATE = 1, + DEACTIVATE = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl new file mode 100644 index 0000000000..c5afe2be1a --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneCenteringAssistState { + OTHER = 0, + ENABLED = 1, + ACTIVATION_REQUESTED = 2, + ACTIVATED = 3, + USER_OVERRIDE = 4, + FORCED_DEACTIVATION_WARNING = 5, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl new file mode 100644 index 0000000000..cdddb6f2d2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneDepartureWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING_LEFT = 2, + WARNING_RIGHT = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl new file mode 100644 index 0000000000..9c92ff69c5 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneKeepAssistState { + OTHER = 0, + ENABLED = 1, + ACTIVATED_STEER_LEFT = 2, + ACTIVATED_STEER_RIGHT = 3, + USER_OVERRIDE = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LocationCharacterization.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LocationCharacterization.aidl new file mode 100644 index 0000000000..27abe417dc --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/LocationCharacterization.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LocationCharacterization { + PRIOR_LOCATIONS = 0x1, + GYROSCOPE_FUSION = 0x2, + ACCELEROMETER_FUSION = 0x4, + COMPASS_FUSION = 0x8, + WHEEL_SPEED_FUSION = 0x10, + STEERING_ANGLE_FUSION = 0x20, + CAR_SPEED_FUSION = 0x40, + DEAD_RECKONED = 0x80, + RAW_GNSS_ONLY = 0x100, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl new file mode 100644 index 0000000000..7d122241eb --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2CommonIgnitionMonitors { + COMPONENTS_AVAILABLE = (0x1 << 0) /* 1 */, + COMPONENTS_INCOMPLETE = (0x1 << 1) /* 2 */, + FUEL_SYSTEM_AVAILABLE = (0x1 << 2) /* 4 */, + FUEL_SYSTEM_INCOMPLETE = (0x1 << 3) /* 8 */, + MISFIRE_AVAILABLE = (0x1 << 4) /* 16 */, + MISFIRE_INCOMPLETE = (0x1 << 5) /* 32 */, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl new file mode 100644 index 0000000000..90240bf4bf --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2CompressionIgnitionMonitors { + COMPONENTS_AVAILABLE = (0x1 << 0) /* 1 */, + COMPONENTS_INCOMPLETE = (0x1 << 1) /* 2 */, + FUEL_SYSTEM_AVAILABLE = (0x1 << 2) /* 4 */, + FUEL_SYSTEM_INCOMPLETE = (0x1 << 3) /* 8 */, + MISFIRE_AVAILABLE = (0x1 << 4) /* 16 */, + MISFIRE_INCOMPLETE = (0x1 << 5) /* 32 */, + EGR_OR_VVT_AVAILABLE = (0x1 << 6) /* 64 */, + EGR_OR_VVT_INCOMPLETE = (0x1 << 7) /* 128 */, + PM_FILTER_AVAILABLE = (0x1 << 8) /* 256 */, + PM_FILTER_INCOMPLETE = (0x1 << 9) /* 512 */, + EXHAUST_GAS_SENSOR_AVAILABLE = (0x1 << 10) /* 1024 */, + EXHAUST_GAS_SENSOR_INCOMPLETE = (0x1 << 11) /* 2048 */, + BOOST_PRESSURE_AVAILABLE = (0x1 << 12) /* 4096 */, + BOOST_PRESSURE_INCOMPLETE = (0x1 << 13) /* 8192 */, + NOx_SCR_AVAILABLE = (0x1 << 14) /* 16384 */, + NOx_SCR_INCOMPLETE = (0x1 << 15) /* 32768 */, + NMHC_CATALYST_AVAILABLE = (0x1 << 16) /* 65536 */, + NMHC_CATALYST_INCOMPLETE = (0x1 << 17) /* 131072 */, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2FuelType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2FuelType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl new file mode 100644 index 0000000000..51e321b828 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2SparkIgnitionMonitors { + COMPONENTS_AVAILABLE = (0x1 << 0) /* 1 */, + COMPONENTS_INCOMPLETE = (0x1 << 1) /* 2 */, + FUEL_SYSTEM_AVAILABLE = (0x1 << 2) /* 4 */, + FUEL_SYSTEM_INCOMPLETE = (0x1 << 3) /* 8 */, + MISFIRE_AVAILABLE = (0x1 << 4) /* 16 */, + MISFIRE_INCOMPLETE = (0x1 << 5) /* 32 */, + EGR_AVAILABLE = (0x1 << 6) /* 64 */, + EGR_INCOMPLETE = (0x1 << 7) /* 128 */, + OXYGEN_SENSOR_HEATER_AVAILABLE = (0x1 << 8) /* 256 */, + OXYGEN_SENSOR_HEATER_INCOMPLETE = (0x1 << 9) /* 512 */, + OXYGEN_SENSOR_AVAILABLE = (0x1 << 10) /* 1024 */, + OXYGEN_SENSOR_INCOMPLETE = (0x1 << 11) /* 2048 */, + AC_REFRIGERANT_AVAILABLE = (0x1 << 12) /* 4096 */, + AC_REFRIGERANT_INCOMPLETE = (0x1 << 13) /* 8192 */, + SECONDARY_AIR_SYSTEM_AVAILABLE = (0x1 << 14) /* 16384 */, + SECONDARY_AIR_SYSTEM_INCOMPLETE = (0x1 << 15) /* 32768 */, + EVAPORATIVE_SYSTEM_AVAILABLE = (0x1 << 16) /* 65536 */, + EVAPORATIVE_SYSTEM_INCOMPLETE = (0x1 << 17) /* 131072 */, + HEATED_CATALYST_AVAILABLE = (0x1 << 18) /* 262144 */, + HEATED_CATALYST_INCOMPLETE = (0x1 << 19) /* 524288 */, + CATALYST_AVAILABLE = (0x1 << 20) /* 1048576 */, + CATALYST_INCOMPLETE = (0x1 << 21) /* 2097152 */, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/PortLocationType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/PortLocationType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/RemoveUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/RemoveUserRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/RotaryInputType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/RotaryInputType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/SwitchUserStatus.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/TrailerState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/TrailerState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserInfo.aidl similarity index 89% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserInfo.aidl index f47d5e74bb..feb5a73ed4 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UserInfo.aidl @@ -36,10 +36,10 @@ package android.hardware.automotive.vehicle; parcelable UserInfo { int userId = 0; int flags; - const int USER_FLAG_SYSTEM = 1; - const int USER_FLAG_GUEST = 2; - const int USER_FLAG_EPHEMERAL = 4; - const int USER_FLAG_ADMIN = 8; - const int USER_FLAG_DISABLED = 16; - const int USER_FLAG_PROFILE = 32; + const int USER_FLAG_SYSTEM = 0x01; + const int USER_FLAG_GUEST = 0x02; + const int USER_FLAG_EPHEMERAL = 0x04; + const int USER_FLAG_ADMIN = 0x08; + const int USER_FLAG_DISABLED = 0x10; + const int USER_FLAG_PROFILE = 0x20; } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UsersInfo.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/UsersInfo.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl new file mode 100644 index 0000000000..9720aca787 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleApPowerBootupReason { + USER_POWER_ON = 0, + SYSTEM_USER_DETECTION = 1, + SYSTEM_REMOTE_ACCESS = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl similarity index 94% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index d7b874a0be..cc12490233 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -34,7 +34,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleApPowerStateConfigFlag { - ENABLE_DEEP_SLEEP_FLAG = 1, - CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2, - ENABLE_HIBERNATION_FLAG = 4, + ENABLE_DEEP_SLEEP_FLAG = 0x1, + CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, + ENABLE_HIBERNATION_FLAG = 0x4, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl similarity index 88% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl index fc669ec17c..e4f7e54f75 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl @@ -34,14 +34,14 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleApPowerStateReport { - WAIT_FOR_VHAL = 1, - DEEP_SLEEP_ENTRY = 2, - DEEP_SLEEP_EXIT = 3, - SHUTDOWN_POSTPONE = 4, - SHUTDOWN_START = 5, - ON = 6, - SHUTDOWN_PREPARE = 7, - SHUTDOWN_CANCELLED = 8, - HIBERNATION_ENTRY = 9, - HIBERNATION_EXIT = 10, + WAIT_FOR_VHAL = 0x1, + DEEP_SLEEP_ENTRY = 0x2, + DEEP_SLEEP_EXIT = 0x3, + SHUTDOWN_POSTPONE = 0x4, + SHUTDOWN_START = 0x5, + ON = 0x6, + SHUTDOWN_PREPARE = 0x7, + SHUTDOWN_CANCELLED = 0x8, + HIBERNATION_ENTRY = 0x9, + HIBERNATION_EXIT = 0xA, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleArea.aidl similarity index 92% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleArea.aidl index 4f8b917256..db867f4cc1 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -34,11 +34,11 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleArea { - GLOBAL = 16777216, - WINDOW = 50331648, - MIRROR = 67108864, - SEAT = 83886080, - DOOR = 100663296, - WHEEL = 117440512, - MASK = 251658240, + GLOBAL = 0x01000000, + WINDOW = 0x03000000, + MIRROR = 0x04000000, + SEAT = 0x05000000, + DOOR = 0x06000000, + WHEEL = 0x07000000, + MASK = 0x0f000000, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl new file mode 100644 index 0000000000..04976d631d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaDoor { + ROW_1_LEFT = 0x00000001, + ROW_1_RIGHT = 0x00000004, + ROW_2_LEFT = 0x00000010, + ROW_2_RIGHT = 0x00000040, + ROW_3_LEFT = 0x00000100, + ROW_3_RIGHT = 0x00000400, + HOOD = 0x10000000, + REAR = 0x20000000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl new file mode 100644 index 0000000000..2d1c0483a2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaMirror { + DRIVER_LEFT = 0x00000001, + DRIVER_RIGHT = 0x00000002, + DRIVER_CENTER = 0x00000004, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl similarity index 89% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl index e76de324d3..44c9d54567 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -34,13 +34,13 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleAreaSeat { - ROW_1_LEFT = 1, - ROW_1_CENTER = 2, - ROW_1_RIGHT = 4, - ROW_2_LEFT = 16, - ROW_2_CENTER = 32, - ROW_2_RIGHT = 64, - ROW_3_LEFT = 256, - ROW_3_CENTER = 512, - ROW_3_RIGHT = 1024, + ROW_1_LEFT = 0x0001, + ROW_1_CENTER = 0x0002, + ROW_1_RIGHT = 0x0004, + ROW_2_LEFT = 0x0010, + ROW_2_CENTER = 0x0020, + ROW_2_RIGHT = 0x0040, + ROW_3_LEFT = 0x0100, + ROW_3_CENTER = 0x0200, + ROW_3_RIGHT = 0x0400, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl new file mode 100644 index 0000000000..d1b314e0ac --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaWheel { + UNKNOWN = 0x0, + LEFT_FRONT = 0x1, + RIGHT_FRONT = 0x2, + LEFT_REAR = 0x4, + RIGHT_REAR = 0x8, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl similarity index 86% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl index 6ec26fe261..2afcca3dd1 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl @@ -34,14 +34,14 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleAreaWindow { - FRONT_WINDSHIELD = 1, - REAR_WINDSHIELD = 2, - ROW_1_LEFT = 16, - ROW_1_RIGHT = 64, - ROW_2_LEFT = 256, - ROW_2_RIGHT = 1024, - ROW_3_LEFT = 4096, - ROW_3_RIGHT = 16384, - ROOF_TOP_1 = 65536, - ROOF_TOP_2 = 131072, + FRONT_WINDSHIELD = 0x00000001, + REAR_WINDSHIELD = 0x00000002, + ROW_1_LEFT = 0x00000010, + ROW_1_RIGHT = 0x00000040, + ROW_2_LEFT = 0x00000100, + ROW_2_RIGHT = 0x00000400, + ROW_3_LEFT = 0x00001000, + ROW_3_RIGHT = 0x00004000, + ROOF_TOP_1 = 0x00010000, + ROOF_TOP_2 = 0x00020000, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleDisplay.aidl similarity index 97% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleDisplay.aidl index 5aeafa4676..be335ec7e7 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleDisplay.aidl @@ -36,4 +36,7 @@ package android.hardware.automotive.vehicle; enum VehicleDisplay { MAIN = 0, INSTRUMENT_CLUSTER = 1, + HUD = 2, + INPUT = 3, + AUXILIARY = 4, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleGear.aidl similarity index 86% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleGear.aidl index db4760d7a3..b8a299c41a 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleGear.aidl @@ -34,18 +34,18 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleGear { - GEAR_UNKNOWN = 0, - GEAR_NEUTRAL = 1, - GEAR_REVERSE = 2, - GEAR_PARK = 4, - GEAR_DRIVE = 8, - GEAR_1 = 16, - GEAR_2 = 32, - GEAR_3 = 64, - GEAR_4 = 128, - GEAR_5 = 256, - GEAR_6 = 512, - GEAR_7 = 1024, - GEAR_8 = 2048, - GEAR_9 = 4096, + GEAR_UNKNOWN = 0x0000, + GEAR_NEUTRAL = 0x0001, + GEAR_REVERSE = 0x0002, + GEAR_PARK = 0x0004, + GEAR_DRIVE = 0x0008, + GEAR_1 = 0x0010, + GEAR_2 = 0x0020, + GEAR_3 = 0x0040, + GEAR_4 = 0x0080, + GEAR_5 = 0x0100, + GEAR_6 = 0x0200, + GEAR_7 = 0x0400, + GEAR_8 = 0x0800, + GEAR_9 = 0x1000, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl similarity index 94% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl index a85751f94f..4f9870a674 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl @@ -34,10 +34,10 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleHvacFanDirection { - UNKNOWN = 0, - FACE = 1, - FLOOR = 2, - FACE_AND_FLOOR = 3, - DEFROST = 4, - DEFROST_AND_FLOOR = 6, + UNKNOWN = 0x0, + FACE = 0x1, + FLOOR = 0x2, + FACE_AND_FLOOR = 0x3, + DEFROST = 0x4, + DEFROST_AND_FLOOR = 0x06, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl new file mode 100644 index 0000000000..29c5ed6f6e --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionButtonStateFlag { + BUTTON_PRIMARY = 0x0001, + BUTTON_SECONDARY = 0x0002, + BUTTON_TERTIARY = 0x0004, + BUTTON_BACK = 0x0008, + BUTTON_FORWARD = 0x0010, + BUTTON_STYLUS_PRIMARY = 0x0020, + BUTTON_STYLUS_SECONDARY = 0x0040, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl new file mode 100644 index 0000000000..db4b41eb9d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionInputAction { + ACTION_DOWN = 0, + ACTION_UP = 1, + ACTION_MOVE = 2, + ACTION_CANCEL = 3, + ACTION_OUTSIDE = 4, + ACTION_POINTER_DOWN = 5, + ACTION_POINTER_UP = 6, + ACTION_HOVER_MOVE = 7, + ACTION_SCROLL = 8, + ACTION_HOVER_ENTER = 9, + ACTION_HOVER_EXIT = 10, + ACTION_BUTTON_PRESS = 11, + ACTION_BUTTON_RELEASE = 12, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl new file mode 100644 index 0000000000..88c7873a43 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionInputSource { + SOURCE_UNKNOWN = 0, + SOURCE_KEYBOARD = 1, + SOURCE_DPAD = 2, + SOURCE_GAMEPAD = 3, + SOURCE_TOUCHSCREEN = 4, + SOURCE_MOUSE = 5, + SOURCE_STYLUS = 6, + SOURCE_BLUETOOTH_STYLUS = 7, + SOURCE_TRACKBALL = 8, + SOURCE_MOUSE_RELATIVE = 9, + SOURCE_TOUCHPAD = 10, + SOURCE_TOUCH_NAVIGATION = 11, + SOURCE_ROTARY_ENCODER = 12, + SOURCE_JOYSTICK = 13, + SOURCE_HDMI = 14, + SOURCE_SENSOR = 15, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl new file mode 100644 index 0000000000..2b3bc7f157 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionToolType { + TOOL_TYPE_UNKNOWN = 0, + TOOL_TYPE_FINGER = 1, + TOOL_TYPE_STYLUS = 2, + TOOL_TYPE_MOUSE = 3, + TOOL_TYPE_ERASER = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl similarity index 97% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl index 09d5423edc..f572a128bb 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl @@ -36,8 +36,8 @@ package android.hardware.automotive.vehicle; enum VehicleIgnitionState { UNDEFINED = 0, LOCK = 1, - OFF = 2, - ACC = 3, - ON = 4, - START = 5, + OFF, + ACC, + ON, + START, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleLightState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleLightState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl similarity index 98% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl index 0d3c636b16..f244884f98 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl @@ -37,5 +37,5 @@ enum VehicleLightSwitch { OFF = 0, ON = 1, DAYTIME_RUNNING = 2, - AUTOMATIC = 256, + AUTOMATIC = 0x100, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleOilLevel.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleOilLevel.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleProperty.aidl new file mode 100644 index 0000000000..ba75e7b261 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -0,0 +1,273 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleProperty { + INVALID = 0x00000000, + INFO_VIN = (((0x0100 + 0x10000000) + 0x01000000) + 0x00100000) /* 286261504 */, + INFO_MAKE = (((0x0101 + 0x10000000) + 0x01000000) + 0x00100000) /* 286261505 */, + INFO_MODEL = (((0x0102 + 0x10000000) + 0x01000000) + 0x00100000) /* 286261506 */, + INFO_MODEL_YEAR = (((0x0103 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407235 */, + INFO_FUEL_CAPACITY = (((0x0104 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504388 */, + INFO_FUEL_TYPE = (((0x0105 + 0x10000000) + 0x01000000) + 0x00410000) /* 289472773 */, + INFO_EV_BATTERY_CAPACITY = (((0x0106 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504390 */, + INFO_EV_CONNECTOR_TYPE = (((0x0107 + 0x10000000) + 0x01000000) + 0x00410000) /* 289472775 */, + INFO_FUEL_DOOR_LOCATION = (((0x0108 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407240 */, + INFO_EV_PORT_LOCATION = (((0x0109 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407241 */, + INFO_DRIVER_SEAT = (((0x010A + 0x10000000) + 0x05000000) + 0x00400000) /* 356516106 */, + INFO_EXTERIOR_DIMENSIONS = (((0x010B + 0x10000000) + 0x01000000) + 0x00410000) /* 289472779 */, + INFO_MULTI_EV_PORT_LOCATIONS = (((0x010C + 0x10000000) + 0x01000000) + 0x00410000) /* 289472780 */, + PERF_ODOMETER = (((0x0204 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504644 */, + PERF_VEHICLE_SPEED = (((0x0207 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504647 */, + PERF_VEHICLE_SPEED_DISPLAY = (((0x0208 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504648 */, + PERF_STEERING_ANGLE = (((0x0209 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504649 */, + PERF_REAR_STEERING_ANGLE = (((0x0210 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504656 */, + ENGINE_COOLANT_TEMP = (((0x0301 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504897 */, + ENGINE_OIL_LEVEL = (((0x0303 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407747 */, + ENGINE_OIL_TEMP = (((0x0304 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504900 */, + ENGINE_RPM = (((0x0305 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504901 */, + WHEEL_TICK = (((0x0306 + 0x10000000) + 0x01000000) + 0x00510000) /* 290521862 */, + FUEL_LEVEL = (((0x0307 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504903 */, + FUEL_DOOR_OPEN = (((0x0308 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310600 */, + EV_BATTERY_LEVEL = (((0x0309 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504905 */, + EV_CURRENT_BATTERY_CAPACITY = (((0x030D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291504909 */, + EV_CHARGE_PORT_OPEN = (((0x030A + 0x10000000) + 0x01000000) + 0x00200000) /* 287310602 */, + EV_CHARGE_PORT_CONNECTED = (((0x030B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310603 */, + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = (((0x030C + 0x10000000) + 0x01000000) + 0x00600000) /* 291504908 */, + RANGE_REMAINING = (((0x0308 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504904 */, + TIRE_PRESSURE = (((0x0309 + 0x10000000) + 0x07000000) + 0x00600000) /* 392168201 */, + CRITICALLY_LOW_TIRE_PRESSURE = (((0x030A + 0x10000000) + 0x07000000) + 0x00600000) /* 392168202 */, + ENGINE_IDLE_AUTO_STOP_ENABLED = (((0x0320 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310624 */, + GEAR_SELECTION = (((0x0400 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408000 */, + CURRENT_GEAR = (((0x0401 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408001 */, + PARKING_BRAKE_ON = (((0x0402 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310850 */, + PARKING_BRAKE_AUTO_APPLY = (((0x0403 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310851 */, + EV_BRAKE_REGENERATION_LEVEL = (((0x040C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408012 */, + FUEL_LEVEL_LOW = (((0x0405 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310853 */, + NIGHT_MODE = (((0x0407 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310855 */, + TURN_SIGNAL_STATE = (((0x0408 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408008 */, + IGNITION_STATE = (((0x0409 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408009 */, + ABS_ACTIVE = (((0x040A + 0x10000000) + 0x01000000) + 0x00200000) /* 287310858 */, + TRACTION_CONTROL_ACTIVE = (((0x040B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310859 */, + EV_STOPPING_MODE = (((0x040D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408013 */, + HVAC_FAN_SPEED = (((0x0500 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517120 */, + HVAC_FAN_DIRECTION = (((0x0501 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517121 */, + HVAC_TEMPERATURE_CURRENT = (((0x0502 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614274 */, + HVAC_TEMPERATURE_SET = (((0x0503 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614275 */, + HVAC_DEFROSTER = (((0x0504 + 0x10000000) + 0x03000000) + 0x00200000) /* 320865540 */, + HVAC_AC_ON = (((0x0505 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419973 */, + HVAC_MAX_AC_ON = (((0x0506 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419974 */, + HVAC_MAX_DEFROST_ON = (((0x0507 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419975 */, + HVAC_RECIRC_ON = (((0x0508 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419976 */, + HVAC_DUAL_ON = (((0x0509 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419977 */, + HVAC_AUTO_ON = (((0x050A + 0x10000000) + 0x05000000) + 0x00200000) /* 354419978 */, + HVAC_SEAT_TEMPERATURE = (((0x050B + 0x10000000) + 0x05000000) + 0x00400000) /* 356517131 */, + HVAC_SIDE_MIRROR_HEAT = (((0x050C + 0x10000000) + 0x04000000) + 0x00400000) /* 339739916 */, + HVAC_STEERING_WHEEL_HEAT = (((0x050D + 0x10000000) + 0x01000000) + 0x00400000) /* 289408269 */, + HVAC_TEMPERATURE_DISPLAY_UNITS = (((0x050E + 0x10000000) + 0x01000000) + 0x00400000) /* 289408270 */, + HVAC_ACTUAL_FAN_SPEED_RPM = (((0x050F + 0x10000000) + 0x05000000) + 0x00400000) /* 356517135 */, + HVAC_POWER_ON = (((0x0510 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419984 */, + HVAC_FAN_DIRECTION_AVAILABLE = (((0x0511 + 0x10000000) + 0x05000000) + 0x00410000) /* 356582673 */, + HVAC_AUTO_RECIRC_ON = (((0x0512 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419986 */, + HVAC_SEAT_VENTILATION = (((0x0513 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517139 */, + HVAC_ELECTRIC_DEFROSTER_ON = (((0x0514 + 0x10000000) + 0x03000000) + 0x00200000) /* 320865556 */, + HVAC_TEMPERATURE_VALUE_SUGGESTION = (((0x0515 + 0x10000000) + 0x01000000) + 0x00610000) /* 291570965 */, + DISTANCE_DISPLAY_UNITS = (((0x0600 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408512 */, + FUEL_VOLUME_DISPLAY_UNITS = (((0x0601 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408513 */, + TIRE_PRESSURE_DISPLAY_UNITS = (((0x0602 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408514 */, + EV_BATTERY_DISPLAY_UNITS = (((0x0603 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408515 */, + FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = (((0x0604 + 0x10000000) + 0x01000000) + 0x00200000) /* 287311364 */, + VEHICLE_SPEED_DISPLAY_UNITS = (((0x0605 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408517 */, + EXTERNAL_CAR_TIME = (((0x0608 + 0x10000000) + 0x01000000) + 0x00500000) /* 290457096 */, + ANDROID_EPOCH_TIME = (((0x0606 + 0x10000000) + 0x01000000) + 0x00500000) /* 290457094 */, + STORAGE_ENCRYPTION_BINDING_SEED = (((0x0607 + 0x10000000) + 0x01000000) + 0x00700000) /* 292554247 */, + ENV_OUTSIDE_TEMPERATURE = (((0x0703 + 0x10000000) + 0x01000000) + 0x00600000) /* 291505923 */, + AP_POWER_STATE_REQ = (((0x0A00 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475072 */, + AP_POWER_STATE_REPORT = (((0x0A01 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475073 */, + AP_POWER_BOOTUP_REASON = (((0x0A02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409538 */, + DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409539 */, + PER_DISPLAY_BRIGHTNESS = (((0x0A04 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475076 */, + HW_KEY_INPUT = (((0x0A10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475088 */, + HW_KEY_INPUT_V2 = (((0x0A11 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004177 */, + HW_MOTION_INPUT = (((0x0A12 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004178 */, + HW_ROTARY_INPUT = (((0x0A20 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475104 */, + HW_CUSTOM_INPUT = (((0X0A30 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475120 */, + DOOR_POS = (((0x0B00 + 0x10000000) + 0x06000000) + 0x00400000) /* 373295872 */, + DOOR_MOVE = (((0x0B01 + 0x10000000) + 0x06000000) + 0x00400000) /* 373295873 */, + DOOR_LOCK = (((0x0B02 + 0x10000000) + 0x06000000) + 0x00200000) /* 371198722 */, + DOOR_CHILD_LOCK_ENABLED = (((0x0B03 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.DOOR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 371198723 */, + MIRROR_Z_POS = (((0x0B40 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741504 */, + MIRROR_Z_MOVE = (((0x0B41 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741505 */, + MIRROR_Y_POS = (((0x0B42 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741506 */, + MIRROR_Y_MOVE = (((0x0B43 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741507 */, + MIRROR_LOCK = (((0x0B44 + 0x10000000) + 0x01000000) + 0x00200000) /* 287312708 */, + MIRROR_FOLD = (((0x0B45 + 0x10000000) + 0x01000000) + 0x00200000) /* 287312709 */, + MIRROR_AUTO_FOLD_ENABLED = (((0x0B46 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 337644358 */, + MIRROR_AUTO_TILT_ENABLED = (((0x0B47 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 337644359 */, + SEAT_MEMORY_SELECT = (((0x0B80 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518784 */, + SEAT_MEMORY_SET = (((0x0B81 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518785 */, + SEAT_BELT_BUCKLED = (((0x0B82 + 0x10000000) + 0x05000000) + 0x00200000) /* 354421634 */, + SEAT_BELT_HEIGHT_POS = (((0x0B83 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518787 */, + SEAT_BELT_HEIGHT_MOVE = (((0x0B84 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518788 */, + SEAT_FORE_AFT_POS = (((0x0B85 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518789 */, + SEAT_FORE_AFT_MOVE = (((0x0B86 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518790 */, + SEAT_BACKREST_ANGLE_1_POS = (((0x0B87 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518791 */, + SEAT_BACKREST_ANGLE_1_MOVE = (((0x0B88 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518792 */, + SEAT_BACKREST_ANGLE_2_POS = (((0x0B89 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518793 */, + SEAT_BACKREST_ANGLE_2_MOVE = (((0x0B8A + 0x10000000) + 0x05000000) + 0x00400000) /* 356518794 */, + SEAT_HEIGHT_POS = (((0x0B8B + 0x10000000) + 0x05000000) + 0x00400000) /* 356518795 */, + SEAT_HEIGHT_MOVE = (((0x0B8C + 0x10000000) + 0x05000000) + 0x00400000) /* 356518796 */, + SEAT_DEPTH_POS = (((0x0B8D + 0x10000000) + 0x05000000) + 0x00400000) /* 356518797 */, + SEAT_DEPTH_MOVE = (((0x0B8E + 0x10000000) + 0x05000000) + 0x00400000) /* 356518798 */, + SEAT_TILT_POS = (((0x0B8F + 0x10000000) + 0x05000000) + 0x00400000) /* 356518799 */, + SEAT_TILT_MOVE = (((0x0B90 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518800 */, + SEAT_LUMBAR_FORE_AFT_POS = (((0x0B91 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518801 */, + SEAT_LUMBAR_FORE_AFT_MOVE = (((0x0B92 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518802 */, + SEAT_LUMBAR_SIDE_SUPPORT_POS = (((0x0B93 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518803 */, + SEAT_LUMBAR_SIDE_SUPPORT_MOVE = (((0x0B94 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518804 */, + SEAT_HEADREST_HEIGHT_POS = (((0x0B95 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409941 */, + SEAT_HEADREST_HEIGHT_POS_V2 = (((0x0BA4 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518820 */, + SEAT_HEADREST_HEIGHT_MOVE = (((0x0B96 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518806 */, + SEAT_HEADREST_ANGLE_POS = (((0x0B97 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518807 */, + SEAT_HEADREST_ANGLE_MOVE = (((0x0B98 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518808 */, + SEAT_HEADREST_FORE_AFT_POS = (((0x0B99 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518809 */, + SEAT_HEADREST_FORE_AFT_MOVE = (((0x0B9A + 0x10000000) + 0x05000000) + 0x00400000) /* 356518810 */, + SEAT_FOOTWELL_LIGHTS_STATE = (((0x0B9B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518811 */, + SEAT_FOOTWELL_LIGHTS_SWITCH = (((0x0B9C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518812 */, + SEAT_EASY_ACCESS_ENABLED = (((0x0B9D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421661 */, + SEAT_AIRBAG_ENABLED = (((0x0B9E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421662 */, + SEAT_CUSHION_SIDE_SUPPORT_POS = (((0x0B9F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518815 */, + SEAT_CUSHION_SIDE_SUPPORT_MOVE = (((0x0BA0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518816 */, + SEAT_LUMBAR_VERTICAL_POS = (((0x0BA1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518817 */, + SEAT_LUMBAR_VERTICAL_MOVE = (((0x0BA2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518818 */, + SEAT_WALK_IN_POS = (((0x0BA3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518819 */, + SEAT_OCCUPANCY = (((0x0BB0 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518832 */, + WINDOW_POS = (((0x0BC0 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964416 */, + WINDOW_MOVE = (((0x0BC1 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964417 */, + WINDOW_LOCK = (((0x0BC4 + 0x10000000) + 0x03000000) + 0x00200000) /* 320867268 */, + WINDSHIELD_WIPERS_PERIOD = (((0x0BC5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964421 */, + WINDSHIELD_WIPERS_STATE = (((0x0BC6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964422 */, + WINDSHIELD_WIPERS_SWITCH = (((0x0BC7 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964423 */, + STEERING_WHEEL_DEPTH_POS = (((0x0BE0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410016 */, + STEERING_WHEEL_DEPTH_MOVE = (((0x0BE1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410017 */, + STEERING_WHEEL_HEIGHT_POS = (((0x0BE2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410018 */, + STEERING_WHEEL_HEIGHT_MOVE = (((0x0BE3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410019 */, + STEERING_WHEEL_THEFT_LOCK_ENABLED = (((0x0BE4 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312868 */, + STEERING_WHEEL_LOCKED = (((0x0BE5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312869 */, + STEERING_WHEEL_EASY_ACCESS_ENABLED = (((0x0BE6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312870 */, + GLOVE_BOX_DOOR_POS = (((0x0BF0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518896 */, + GLOVE_BOX_LOCKED = (((0x0BF1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421745 */, + VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */, + LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */, + OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, + OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, + OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, + OBD2_FREEZE_FRAME_CLEAR = (((0x0D03 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896067 */, + HEADLIGHTS_STATE = (((0x0E00 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410560 */, + HIGH_BEAM_LIGHTS_STATE = (((0x0E01 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410561 */, + FOG_LIGHTS_STATE = (((0x0E02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410562 */, + HAZARD_LIGHTS_STATE = (((0x0E03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410563 */, + HEADLIGHTS_SWITCH = (((0x0E10 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410576 */, + HIGH_BEAM_LIGHTS_SWITCH = (((0x0E11 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410577 */, + FOG_LIGHTS_SWITCH = (((0x0E12 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410578 */, + HAZARD_LIGHTS_SWITCH = (((0x0E13 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410579 */, + CABIN_LIGHTS_STATE = (((0x0F01 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410817 */, + CABIN_LIGHTS_SWITCH = (((0x0F02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410818 */, + READING_LIGHTS_STATE = (((0x0F03 + 0x10000000) + 0x05000000) + 0x00400000) /* 356519683 */, + READING_LIGHTS_SWITCH = (((0x0F04 + 0x10000000) + 0x05000000) + 0x00400000) /* 356519684 */, + STEERING_WHEEL_LIGHTS_STATE = (((0x0F0C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410828 */, + STEERING_WHEEL_LIGHTS_SWITCH = (((0x0F0D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410829 */, + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = (((0x0F05 + 0x10000000) + 0x01000000) + 0x00200000) /* 287313669 */, + DISABLED_OPTIONAL_FEATURES = (((0x0F06 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265094 */, + INITIAL_USER_INFO = (((0x0F07 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896583 */, + SWITCH_USER = (((0x0F08 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896584 */, + CREATE_USER = (((0x0F09 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896585 */, + REMOVE_USER = (((0x0F0A + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896586 */, + USER_IDENTIFICATION_ASSOCIATION = (((0x0F0B + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896587 */, + EVS_SERVICE_REQUEST = (((0x0F10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476368 */, + POWER_POLICY_REQ = (((0x0F21 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265121 */, + POWER_POLICY_GROUP_REQ = (((0x0F22 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265122 */, + CURRENT_POWER_POLICY = (((0x0F23 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265123 */, + WATCHDOG_ALIVE = (((0xF31 + 0x10000000) + 0x01000000) + 0x00500000) /* 290459441 */, + WATCHDOG_TERMINATED_PROCESS = (((0x0F32 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896626 */, + VHAL_HEARTBEAT = (((0x0F33 + 0x10000000) + 0x01000000) + 0x00500000) /* 290459443 */, + CLUSTER_SWITCH_UI = (((0x0F34 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410868 */, + CLUSTER_DISPLAY_STATE = (((0x0F35 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476405 */, + CLUSTER_REPORT_STATE = (((0x0F36 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896630 */, + CLUSTER_REQUEST_DISPLAY = (((0x0F37 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410871 */, + CLUSTER_NAVIGATION_STATE = (((0x0F38 + 0x10000000) + 0x01000000) + 0x00700000) /* 292556600 */, + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = (((0x0F39 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410873 */, + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = (((0x0F3A + 0x10000000) + 0x01000000) + 0x00400000) /* 289410874 */, + FRONT_FOG_LIGHTS_STATE = (((0x0F3B + 0x10000000) + 0x01000000) + 0x00400000) /* 289410875 */, + FRONT_FOG_LIGHTS_SWITCH = (((0x0F3C + 0x10000000) + 0x01000000) + 0x00400000) /* 289410876 */, + REAR_FOG_LIGHTS_STATE = (((0x0F3D + 0x10000000) + 0x01000000) + 0x00400000) /* 289410877 */, + REAR_FOG_LIGHTS_SWITCH = (((0x0F3E + 0x10000000) + 0x01000000) + 0x00400000) /* 289410878 */, + EV_CHARGE_CURRENT_DRAW_LIMIT = (((0x0F3F + 0x10000000) + 0x01000000) + 0x00600000) /* 291508031 */, + EV_CHARGE_PERCENT_LIMIT = (((0x0F40 + 0x10000000) + 0x01000000) + 0x00600000) /* 291508032 */, + EV_CHARGE_STATE = (((0x0F41 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410881 */, + EV_CHARGE_SWITCH = (((0x0F42 + 0x10000000) + 0x01000000) + 0x00200000) /* 287313730 */, + EV_CHARGE_TIME_REMAINING = (((0x0F43 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410883 */, + EV_REGENERATIVE_BRAKING_STATE = (((0x0F44 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410884 */, + TRAILER_PRESENT = (((0x0F45 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410885 */, + VEHICLE_CURB_WEIGHT = (((0x0F46 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410886 */, + GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = (((0x0F47 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410887 */, + SUPPORTED_PROPERTY_IDS = (((0x0F48 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476424 */, + SHUTDOWN_REQUEST = (((0x0F49 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410889 */, + VEHICLE_IN_USE = (((0x0F4A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313738 */, + AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313920 */, + AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411073 */, + FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313922 */, + FORWARD_COLLISION_WARNING_STATE = (((0x1003 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411075 */, + BLIND_SPOT_WARNING_ENABLED = (((0x1004 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313924 */, + BLIND_SPOT_WARNING_STATE = (((0x1005 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 339742725 */, + LANE_DEPARTURE_WARNING_ENABLED = (((0x1006 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313926 */, + LANE_DEPARTURE_WARNING_STATE = (((0x1007 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411079 */, + LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313928 */, + LANE_KEEP_ASSIST_STATE = (((0x1009 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411081 */, + LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313930 */, + LANE_CENTERING_ASSIST_COMMAND = (((0x100B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411083 */, + LANE_CENTERING_ASSIST_STATE = (((0x100C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411084 */, + EMERGENCY_LANE_KEEP_ASSIST_ENABLED = (((0x100D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313933 */, + EMERGENCY_LANE_KEEP_ASSIST_STATE = (((0x100E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411086 */, + CRUISE_CONTROL_ENABLED = (((0x100F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313935 */, + CRUISE_CONTROL_TYPE = (((0x1010 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411088 */, + CRUISE_CONTROL_STATE = (((0x1011 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411089 */, + CRUISE_CONTROL_COMMAND = (((0x1012 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411090 */, + CRUISE_CONTROL_TARGET_SPEED = (((0x1013 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291508243 */, + ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = (((0x1014 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411092 */, + ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE = (((0x1015 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411093 */, + HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */, + HANDS_ON_DETECTION_DRIVER_STATE = (((0x1017 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411095 */, + HANDS_ON_DETECTION_WARNING = (((0x1018 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411096 */, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl similarity index 96% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl index 0c049c4814..714d514cf4 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl @@ -34,7 +34,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehiclePropertyGroup { - SYSTEM = 268435456, - VENDOR = 536870912, - MASK = -268435456, + SYSTEM = 0x10000000, + VENDOR = 0x20000000, + MASK = 0xf0000000, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehiclePropertyType.aidl similarity index 87% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehiclePropertyType.aidl index da6d2c2168..7525cbbf69 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehiclePropertyType.aidl @@ -34,15 +34,15 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehiclePropertyType { - STRING = 1048576, - BOOLEAN = 2097152, - INT32 = 4194304, - INT32_VEC = 4259840, - INT64 = 5242880, - INT64_VEC = 5308416, - FLOAT = 6291456, - FLOAT_VEC = 6356992, - BYTES = 7340032, - MIXED = 14680064, - MASK = 16711680, + STRING = 0x00100000, + BOOLEAN = 0x00200000, + INT32 = 0x00400000, + INT32_VEC = 0x00410000, + INT64 = 0x00500000, + INT64_VEC = 0x00510000, + FLOAT = 0x00600000, + FLOAT_VEC = 0x00610000, + BYTES = 0x00700000, + MIXED = 0x00e00000, + MASK = 0x00ff0000, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl similarity index 97% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl index 78c17959b4..0431b45b9a 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl @@ -34,7 +34,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleTurnSignal { - NONE = 0, - RIGHT = 1, - LEFT = 2, + NONE = 0x00, + RIGHT = 0x01, + LEFT = 0x02, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleUnit.aidl similarity index 73% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleUnit.aidl index c80fdbbdbe..9aca98bec2 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -34,37 +34,38 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleUnit { - SHOULD_NOT_USE = 0, - METER_PER_SEC = 1, - RPM = 2, - HERTZ = 3, - PERCENTILE = 16, - MILLIMETER = 32, - METER = 33, - KILOMETER = 35, - MILE = 36, - CELSIUS = 48, - FAHRENHEIT = 49, - KELVIN = 50, - MILLILITER = 64, - LITER = 65, - GALLON = 66, - US_GALLON = 66, - IMPERIAL_GALLON = 67, - NANO_SECS = 80, - SECS = 83, - YEAR = 89, - WATT_HOUR = 96, - MILLIAMPERE = 97, - MILLIVOLT = 98, - MILLIWATTS = 99, - AMPERE_HOURS = 100, - KILOWATT_HOUR = 101, - AMPERE = 102, - KILOPASCAL = 112, - PSI = 113, - BAR = 114, - DEGREES = 128, - MILES_PER_HOUR = 144, - KILOMETERS_PER_HOUR = 145, + SHOULD_NOT_USE = 0x000, + METER_PER_SEC = 0x01, + RPM = 0x02, + HERTZ = 0x03, + PERCENTILE = 0x10, + MILLIMETER = 0x20, + METER = 0x21, + KILOMETER = 0x23, + MILE = 0x24, + CELSIUS = 0x30, + FAHRENHEIT = 0x31, + KELVIN = 0x32, + MILLILITER = 0x40, + LITER = 0x41, + GALLON = 0x42, + US_GALLON = 0x42, + IMPERIAL_GALLON = 0x43, + NANO_SECS = 0x50, + MILLI_SECS = 0x51, + SECS = 0x53, + YEAR = 0x59, + WATT_HOUR = 0x60, + MILLIAMPERE = 0x61, + MILLIVOLT = 0x62, + MILLIWATTS = 0x63, + AMPERE_HOURS = 0x64, + KILOWATT_HOUR = 0x65, + AMPERE = 0x66, + KILOPASCAL = 0x70, + PSI = 0x71, + BAR = 0x72, + DEGREES = 0x80, + MILES_PER_HOUR = 0x90, + KILOMETERS_PER_HOUR = 0x91, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl new file mode 100644 index 0000000000..3aa326c9c7 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleVendorPermission { + PERMISSION_DEFAULT = 0x00000000, + PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 0X00000001, + PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 0x00000002, + PERMISSION_SET_VENDOR_CATEGORY_DOOR = 0x00000003, + PERMISSION_GET_VENDOR_CATEGORY_DOOR = 0x00000004, + PERMISSION_SET_VENDOR_CATEGORY_SEAT = 0x00000005, + PERMISSION_GET_VENDOR_CATEGORY_SEAT = 0x00000006, + PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 0x00000007, + PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 0x00000008, + PERMISSION_SET_VENDOR_CATEGORY_INFO = 0x00000009, + PERMISSION_GET_VENDOR_CATEGORY_INFO = 0x0000000A, + PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 0x0000000B, + PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 0x0000000C, + PERMISSION_SET_VENDOR_CATEGORY_HVAC = 0x0000000D, + PERMISSION_GET_VENDOR_CATEGORY_HVAC = 0x0000000E, + PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 0x0000000F, + PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 0x00000010, + PERMISSION_SET_VENDOR_CATEGORY_1 = 0x00010000, + PERMISSION_GET_VENDOR_CATEGORY_1 = 0x00011000, + PERMISSION_SET_VENDOR_CATEGORY_2 = 0x00020000, + PERMISSION_GET_VENDOR_CATEGORY_2 = 0x00021000, + PERMISSION_SET_VENDOR_CATEGORY_3 = 0x00030000, + PERMISSION_GET_VENDOR_CATEGORY_3 = 0x00031000, + PERMISSION_SET_VENDOR_CATEGORY_4 = 0x00040000, + PERMISSION_GET_VENDOR_CATEGORY_4 = 0x00041000, + PERMISSION_SET_VENDOR_CATEGORY_5 = 0x00050000, + PERMISSION_GET_VENDOR_CATEGORY_5 = 0x00051000, + PERMISSION_SET_VENDOR_CATEGORY_6 = 0x00060000, + PERMISSION_GET_VENDOR_CATEGORY_6 = 0x00061000, + PERMISSION_SET_VENDOR_CATEGORY_7 = 0x00070000, + PERMISSION_GET_VENDOR_CATEGORY_7 = 0x00071000, + PERMISSION_SET_VENDOR_CATEGORY_8 = 0x00080000, + PERMISSION_GET_VENDOR_CATEGORY_8 = 0x00081000, + PERMISSION_SET_VENDOR_CATEGORY_9 = 0x00090000, + PERMISSION_GET_VENDOR_CATEGORY_9 = 0x00091000, + PERMISSION_SET_VENDOR_CATEGORY_10 = 0x000A0000, + PERMISSION_GET_VENDOR_CATEGORY_10 = 0x000A1000, + PERMISSION_NOT_ACCESSIBLE = 0xF0000000, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsMessageType.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsMessageType.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/WindshieldWipersState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/WindshieldWipersState.aidl new file mode 100644 index 0000000000..d0c1e8d70d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/WindshieldWipersState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum WindshieldWipersState { + OTHER = 0, + OFF = 1, + ON = 2, + SERVICE = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl new file mode 100644 index 0000000000..6c170fe6a4 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/2/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum WindshieldWipersSwitch { + OTHER = 0, + OFF = 1, + MIST = 2, + INTERMITTENT_LEVEL_1 = 3, + INTERMITTENT_LEVEL_2 = 4, + INTERMITTENT_LEVEL_3 = 5, + INTERMITTENT_LEVEL_4 = 6, + INTERMITTENT_LEVEL_5 = 7, + CONTINUOUS_LEVEL_1 = 8, + CONTINUOUS_LEVEL_2 = 9, + CONTINUOUS_LEVEL_3 = 10, + CONTINUOUS_LEVEL_4 = 11, + CONTINUOUS_LEVEL_5 = 12, + AUTO = 13, + SERVICE = 14, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl new file mode 100644 index 0000000000..b316df7454 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum AutomaticEmergencyBrakingState { + OTHER = 0, + ENABLED = 1, + ACTIVATED = 2, + USER_OVERRIDE = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl new file mode 100644 index 0000000000..535b0b1e2f --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum BlindSpotWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl new file mode 100644 index 0000000000..22c690c00f --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable CreateUserRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo newUserInfo; + @utf8InCpp String newUserName; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl new file mode 100644 index 0000000000..7d0196b4e5 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable CreateUserResponse { + int requestId; + android.hardware.automotive.vehicle.CreateUserStatus status = android.hardware.automotive.vehicle.CreateUserStatus.SUCCESS; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl similarity index 96% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl index 1363a64cca..4c3b751656 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl @@ -33,7 +33,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability -enum EvsServiceType { - REARVIEW = 0, - SURROUNDVIEW = 1, +enum CreateUserStatus { + SUCCESS = 1, + FAILURE = 2, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlCommand.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlCommand.aidl new file mode 100644 index 0000000000..d6a104d25b --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlCommand.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CruiseControlCommand { + ACTIVATE = 1, + SUSPEND = 2, + INCREASE_TARGET_SPEED = 3, + DECREASE_TARGET_SPEED = 4, + INCREASE_TARGET_TIME_GAP = 5, + DECREASE_TARGET_TIME_GAP = 6, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlState.aidl new file mode 100644 index 0000000000..ddaffa30c2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CruiseControlState { + OTHER = 0, + ENABLED = 1, + ACTIVATED = 2, + USER_OVERRIDE = 3, + SUSPENDED = 4, + FORCED_DEACTIVATION_WARNING = 5, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlType.aidl new file mode 100644 index 0000000000..aab9dfe966 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CruiseControlType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CruiseControlType { + OTHER = 0, + STANDARD = 1, + ADAPTIVE = 2, + PREDICTIVE = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CustomInputType.aidl new file mode 100644 index 0000000000..4decb6985d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CustomInputType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CustomInputType { + CUSTOM_EVENT_F1 = 1001, + CUSTOM_EVENT_F2 = 1002, + CUSTOM_EVENT_F3 = 1003, + CUSTOM_EVENT_F4 = 1004, + CUSTOM_EVENT_F5 = 1005, + CUSTOM_EVENT_F6 = 1006, + CUSTOM_EVENT_F7 = 1007, + CUSTOM_EVENT_F8 = 1008, + CUSTOM_EVENT_F9 = 1009, + CUSTOM_EVENT_F10 = 1010, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl new file mode 100644 index 0000000000..9704704eab --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum DiagnosticFloatSensorIndex { + CALCULATED_ENGINE_LOAD = 0, + ENGINE_COOLANT_TEMPERATURE = 1, + SHORT_TERM_FUEL_TRIM_BANK1 = 2, + LONG_TERM_FUEL_TRIM_BANK1 = 3, + SHORT_TERM_FUEL_TRIM_BANK2 = 4, + LONG_TERM_FUEL_TRIM_BANK2 = 5, + FUEL_PRESSURE = 6, + INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, + ENGINE_RPM = 8, + VEHICLE_SPEED = 9, + TIMING_ADVANCE = 10, + MAF_AIR_FLOW_RATE = 11, + THROTTLE_POSITION = 12, + OXYGEN_SENSOR1_VOLTAGE = 13, + OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, + OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, + OXYGEN_SENSOR2_VOLTAGE = 16, + OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, + OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, + OXYGEN_SENSOR3_VOLTAGE = 19, + OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, + OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, + OXYGEN_SENSOR4_VOLTAGE = 22, + OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, + OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, + OXYGEN_SENSOR5_VOLTAGE = 25, + OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, + OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, + OXYGEN_SENSOR6_VOLTAGE = 28, + OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, + OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, + OXYGEN_SENSOR7_VOLTAGE = 31, + OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, + OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, + OXYGEN_SENSOR8_VOLTAGE = 34, + OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, + OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, + FUEL_RAIL_PRESSURE = 37, + FUEL_RAIL_GAUGE_PRESSURE = 38, + COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, + EXHAUST_GAS_RECIRCULATION_ERROR = 40, + COMMANDED_EVAPORATIVE_PURGE = 41, + FUEL_TANK_LEVEL_INPUT = 42, + EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, + CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, + CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, + CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, + CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, + ABSOLUTE_LOAD_VALUE = 48, + FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, + RELATIVE_THROTTLE_POSITION = 50, + ABSOLUTE_THROTTLE_POSITION_B = 51, + ABSOLUTE_THROTTLE_POSITION_C = 52, + ACCELERATOR_PEDAL_POSITION_D = 53, + ACCELERATOR_PEDAL_POSITION_E = 54, + ACCELERATOR_PEDAL_POSITION_F = 55, + COMMANDED_THROTTLE_ACTUATOR = 56, + ETHANOL_FUEL_PERCENTAGE = 57, + ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, + RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, + HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, + FUEL_INJECTION_TIMING = 69, + ENGINE_FUEL_RATE = 70, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl new file mode 100644 index 0000000000..b3f13d4263 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum DiagnosticIntegerSensorIndex { + FUEL_SYSTEM_STATUS = 0, + MALFUNCTION_INDICATOR_LIGHT_ON = 1, + IGNITION_MONITORS_SUPPORTED = 2, + IGNITION_SPECIFIC_MONITORS = 3, + INTAKE_AIR_TEMPERATURE = 4, + COMMANDED_SECONDARY_AIR_STATUS = 5, + NUM_OXYGEN_SENSORS_PRESENT = 6, + RUNTIME_SINCE_ENGINE_START = 7, + DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, + WARMUPS_SINCE_CODES_CLEARED = 9, + DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, + ABSOLUTE_BAROMETRIC_PRESSURE = 11, + CONTROL_MODULE_VOLTAGE = 12, + AMBIENT_AIR_TEMPERATURE = 13, + TIME_WITH_MALFUNCTION_LIGHT_ON = 14, + TIME_SINCE_TROUBLE_CODES_CLEARED = 15, + MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, + MAX_OXYGEN_SENSOR_VOLTAGE = 17, + MAX_OXYGEN_SENSOR_CURRENT = 18, + MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, + MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, + FUEL_TYPE = 21, + FUEL_RAIL_ABSOLUTE_PRESSURE = 22, + ENGINE_OIL_TEMPERATURE = 23, + DRIVER_DEMAND_PERCENT_TORQUE = 24, + ENGINE_ACTUAL_PERCENT_TORQUE = 25, + ENGINE_REFERENCE_PERCENT_TORQUE = 26, + ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, + ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, + ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, + ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, + ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl new file mode 100644 index 0000000000..9772aeeba0 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ElectronicTollCollectionCardStatus { + UNKNOWN = 0, + ELECTRONIC_TOLL_COLLECTION_CARD_VALID = 1, + ELECTRONIC_TOLL_COLLECTION_CARD_INVALID = 2, + ELECTRONIC_TOLL_COLLECTION_CARD_NOT_INSERTED = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl new file mode 100644 index 0000000000..22cf2c388b --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ElectronicTollCollectionCardType { + UNKNOWN = 0, + JP_ELECTRONIC_TOLL_COLLECTION_CARD = 1, + JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2 = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl new file mode 100644 index 0000000000..078acde168 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EmergencyLaneKeepAssistState { + OTHER = 0, + ENABLED = 1, + WARNING_LEFT = 2, + WARNING_RIGHT = 3, + ACTIVATED_STEER_LEFT = 4, + ACTIVATED_STEER_RIGHT = 5, + USER_OVERRIDE = 6, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ErrorState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ErrorState.aidl new file mode 100644 index 0000000000..dd950ce88c --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ErrorState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ErrorState { + OTHER_ERROR_STATE = (-1) /* -1 */, + NOT_AVAILABLE_DISABLED = (-2) /* -2 */, + NOT_AVAILABLE_SPEED_LOW = (-3) /* -3 */, + NOT_AVAILABLE_SPEED_HIGH = (-4) /* -4 */, + NOT_AVAILABLE_POOR_VISIBILITY = (-5) /* -5 */, + NOT_AVAILABLE_SAFETY = (-6) /* -6 */, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvChargeState.aidl similarity index 94% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvChargeState.aidl index 9e834340b1..fe1c240a2d 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvChargeState.aidl @@ -33,10 +33,10 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability -enum VehicleAreaWheel { +enum EvChargeState { UNKNOWN = 0, - LEFT_FRONT = 1, - RIGHT_FRONT = 2, - LEFT_REAR = 4, - RIGHT_REAR = 8, + CHARGING = 1, + FULLY_CHARGED = 2, + NOT_CHARGING = 3, + ERROR = 4, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvConnectorType.aidl new file mode 100644 index 0000000000..b469578e77 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvConnectorType.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvConnectorType { + UNKNOWN = 0, + IEC_TYPE_1_AC = 1, + IEC_TYPE_2_AC = 2, + IEC_TYPE_3_AC = 3, + IEC_TYPE_4_DC = 4, + IEC_TYPE_1_CCS_DC = 5, + IEC_TYPE_2_CCS_DC = 6, + TESLA_ROADSTER = 7, + TESLA_HPWC = 8, + TESLA_SUPERCHARGER = 9, + GBT_AC = 10, + GBT_DC = 11, + OTHER = 101, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl new file mode 100644 index 0000000000..b8695623fb --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvRegenerativeBrakingState { + UNKNOWN = 0, + DISABLED = 1, + PARTIALLY_ENABLED = 2, + FULLY_ENABLED = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl new file mode 100644 index 0000000000..3be8d1263f --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvStoppingMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvStoppingMode { + OTHER = 0, + CREEP = 1, + ROLL = 2, + HOLD = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl similarity index 95% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl index c1e2fbd6ff..2fdb9b5a8d 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl @@ -33,8 +33,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability -enum VehicleAreaMirror { - DRIVER_LEFT = 1, - DRIVER_RIGHT = 2, - DRIVER_CENTER = 4, +enum EvsServiceRequestIndex { + TYPE = 0, + STATE = 1, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceState.aidl new file mode 100644 index 0000000000..df81ee7d27 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceState.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvsServiceState { + OFF = 0, + ON = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceType.aidl new file mode 100644 index 0000000000..285732cc39 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/EvsServiceType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum EvsServiceType { + REARVIEW = 0, + SURROUNDVIEW = 1, + FRONTVIEW = 2, + LEFTVIEW = 3, + RIGHTVIEW = 4, + DRIVERVIEW = 5, + FRONTPASSENGERSVIEW = 6, + REARPASSENGERSVIEW = 7, + USER_DEFINED = 1000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl new file mode 100644 index 0000000000..371885d3b5 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ForwardCollisionWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/FuelType.aidl new file mode 100644 index 0000000000..14bb61b7af --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/FuelType.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum FuelType { + FUEL_TYPE_UNKNOWN = 0, + FUEL_TYPE_UNLEADED = 1, + FUEL_TYPE_LEADED = 2, + FUEL_TYPE_DIESEL_1 = 3, + FUEL_TYPE_DIESEL_2 = 4, + FUEL_TYPE_BIODIESEL = 5, + FUEL_TYPE_E85 = 6, + FUEL_TYPE_LPG = 7, + FUEL_TYPE_CNG = 8, + FUEL_TYPE_LNG = 9, + FUEL_TYPE_ELECTRIC = 10, + FUEL_TYPE_HYDROGEN = 11, + FUEL_TYPE_OTHER = 12, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl new file mode 100644 index 0000000000..9c565ee818 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum GsrComplianceRequirementType { + GSR_COMPLIANCE_NOT_REQUIRED = 0, + GSR_COMPLIANCE_REQUIRED_V1 = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl new file mode 100644 index 0000000000..bb390f2224 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum HandsOnDetectionDriverState { + OTHER = 0, + HANDS_ON = 1, + HANDS_OFF = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl new file mode 100644 index 0000000000..4ea4d1d450 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum HandsOnDetectionWarning { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl new file mode 100644 index 0000000000..a4c048aadb --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable InitialUserInfoRequest { + int requestId; + android.hardware.automotive.vehicle.InitialUserInfoRequestType requestType = android.hardware.automotive.vehicle.InitialUserInfoRequestType.UNKNOWN; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl new file mode 100644 index 0000000000..51260fa7b0 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum InitialUserInfoRequestType { + UNKNOWN = 0, + FIRST_BOOT = 1, + FIRST_BOOT_AFTER_OTA = 2, + COLD_BOOT = 3, + RESUME = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl new file mode 100644 index 0000000000..f0e161261d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable InitialUserInfoResponse { + int requestId; + android.hardware.automotive.vehicle.InitialUserInfoResponseAction action = android.hardware.automotive.vehicle.InitialUserInfoResponseAction.DEFAULT; + android.hardware.automotive.vehicle.UserInfo userToSwitchOrCreate; + @utf8InCpp String userLocales; + @utf8InCpp String userNameToCreate; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl new file mode 100644 index 0000000000..d654b5c23e --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum InitialUserInfoResponseAction { + DEFAULT = 0, + SWITCH = 1, + CREATE = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl new file mode 100644 index 0000000000..9e726052e8 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneCenteringAssistCommand { + ACTIVATE = 1, + DEACTIVATE = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl new file mode 100644 index 0000000000..c5afe2be1a --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneCenteringAssistState { + OTHER = 0, + ENABLED = 1, + ACTIVATION_REQUESTED = 2, + ACTIVATED = 3, + USER_OVERRIDE = 4, + FORCED_DEACTIVATION_WARNING = 5, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl new file mode 100644 index 0000000000..cdddb6f2d2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneDepartureWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING_LEFT = 2, + WARNING_RIGHT = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl new file mode 100644 index 0000000000..9c92ff69c5 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LaneKeepAssistState { + OTHER = 0, + ENABLED = 1, + ACTIVATED_STEER_LEFT = 2, + ACTIVATED_STEER_RIGHT = 3, + USER_OVERRIDE = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl new file mode 100644 index 0000000000..27abe417dc --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LocationCharacterization { + PRIOR_LOCATIONS = 0x1, + GYROSCOPE_FUSION = 0x2, + ACCELEROMETER_FUSION = 0x4, + COMPASS_FUSION = 0x8, + WHEEL_SPEED_FUSION = 0x10, + STEERING_ANGLE_FUSION = 0x20, + CAR_SPEED_FUSION = 0x40, + DEAD_RECKONED = 0x80, + RAW_GNSS_ONLY = 0x100, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl new file mode 100644 index 0000000000..7d122241eb --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2CommonIgnitionMonitors { + COMPONENTS_AVAILABLE = (0x1 << 0) /* 1 */, + COMPONENTS_INCOMPLETE = (0x1 << 1) /* 2 */, + FUEL_SYSTEM_AVAILABLE = (0x1 << 2) /* 4 */, + FUEL_SYSTEM_INCOMPLETE = (0x1 << 3) /* 8 */, + MISFIRE_AVAILABLE = (0x1 << 4) /* 16 */, + MISFIRE_INCOMPLETE = (0x1 << 5) /* 32 */, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl new file mode 100644 index 0000000000..90240bf4bf --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2CompressionIgnitionMonitors { + COMPONENTS_AVAILABLE = (0x1 << 0) /* 1 */, + COMPONENTS_INCOMPLETE = (0x1 << 1) /* 2 */, + FUEL_SYSTEM_AVAILABLE = (0x1 << 2) /* 4 */, + FUEL_SYSTEM_INCOMPLETE = (0x1 << 3) /* 8 */, + MISFIRE_AVAILABLE = (0x1 << 4) /* 16 */, + MISFIRE_INCOMPLETE = (0x1 << 5) /* 32 */, + EGR_OR_VVT_AVAILABLE = (0x1 << 6) /* 64 */, + EGR_OR_VVT_INCOMPLETE = (0x1 << 7) /* 128 */, + PM_FILTER_AVAILABLE = (0x1 << 8) /* 256 */, + PM_FILTER_INCOMPLETE = (0x1 << 9) /* 512 */, + EXHAUST_GAS_SENSOR_AVAILABLE = (0x1 << 10) /* 1024 */, + EXHAUST_GAS_SENSOR_INCOMPLETE = (0x1 << 11) /* 2048 */, + BOOST_PRESSURE_AVAILABLE = (0x1 << 12) /* 4096 */, + BOOST_PRESSURE_INCOMPLETE = (0x1 << 13) /* 8192 */, + NOx_SCR_AVAILABLE = (0x1 << 14) /* 16384 */, + NOx_SCR_INCOMPLETE = (0x1 << 15) /* 32768 */, + NMHC_CATALYST_AVAILABLE = (0x1 << 16) /* 65536 */, + NMHC_CATALYST_INCOMPLETE = (0x1 << 17) /* 131072 */, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl new file mode 100644 index 0000000000..9d588ead1c --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2FuelSystemStatus { + OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1, + CLOSED_LOOP = 2, + OPEN_ENGINE_LOAD_OR_DECELERATION = 4, + OPEN_SYSTEM_FAILURE = 8, + CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl similarity index 74% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl index 01104c1baf..3ab3920d04 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl @@ -33,23 +33,29 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability -enum Obd2CompressionIgnitionMonitors { - COMPONENTS_AVAILABLE = 1, - COMPONENTS_INCOMPLETE = 2, - FUEL_SYSTEM_AVAILABLE = 4, - FUEL_SYSTEM_INCOMPLETE = 8, - MISFIRE_AVAILABLE = 16, - MISFIRE_INCOMPLETE = 32, - EGR_OR_VVT_AVAILABLE = 64, - EGR_OR_VVT_INCOMPLETE = 128, - PM_FILTER_AVAILABLE = 256, - PM_FILTER_INCOMPLETE = 512, - EXHAUST_GAS_SENSOR_AVAILABLE = 1024, - EXHAUST_GAS_SENSOR_INCOMPLETE = 2048, - BOOST_PRESSURE_AVAILABLE = 4096, - BOOST_PRESSURE_INCOMPLETE = 8192, - NOx_SCR_AVAILABLE = 16384, - NOx_SCR_INCOMPLETE = 32768, - NMHC_CATALYST_AVAILABLE = 65536, - NMHC_CATALYST_INCOMPLETE = 131072, +enum Obd2FuelType { + NOT_AVAILABLE = 0, + GASOLINE = 1, + METHANOL = 2, + ETHANOL = 3, + DIESEL = 4, + LPG = 5, + CNG = 6, + PROPANE = 7, + ELECTRIC = 8, + BIFUEL_RUNNING_GASOLINE = 9, + BIFUEL_RUNNING_METHANOL = 10, + BIFUEL_RUNNING_ETHANOL = 11, + BIFUEL_RUNNING_LPG = 12, + BIFUEL_RUNNING_CNG = 13, + BIFUEL_RUNNING_PROPANE = 14, + BIFUEL_RUNNING_ELECTRIC = 15, + BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16, + HYBRID_GASOLINE = 17, + HYBRID_ETHANOL = 18, + HYBRID_DIESEL = 19, + HYBRID_ELECTRIC = 20, + HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21, + HYBRID_REGENERATIVE = 22, + BIFUEL_RUNNING_DIESEL = 23, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl new file mode 100644 index 0000000000..ec8f1c2e57 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2IgnitionMonitorKind { + SPARK = 0, + COMPRESSION = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl new file mode 100644 index 0000000000..7f445bf564 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2SecondaryAirStatus { + UPSTREAM = 1, + DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2, + FROM_OUTSIDE_OR_OFF = 4, + PUMP_ON_FOR_DIAGNOSTICS = 8, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl new file mode 100644 index 0000000000..51e321b828 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum Obd2SparkIgnitionMonitors { + COMPONENTS_AVAILABLE = (0x1 << 0) /* 1 */, + COMPONENTS_INCOMPLETE = (0x1 << 1) /* 2 */, + FUEL_SYSTEM_AVAILABLE = (0x1 << 2) /* 4 */, + FUEL_SYSTEM_INCOMPLETE = (0x1 << 3) /* 8 */, + MISFIRE_AVAILABLE = (0x1 << 4) /* 16 */, + MISFIRE_INCOMPLETE = (0x1 << 5) /* 32 */, + EGR_AVAILABLE = (0x1 << 6) /* 64 */, + EGR_INCOMPLETE = (0x1 << 7) /* 128 */, + OXYGEN_SENSOR_HEATER_AVAILABLE = (0x1 << 8) /* 256 */, + OXYGEN_SENSOR_HEATER_INCOMPLETE = (0x1 << 9) /* 512 */, + OXYGEN_SENSOR_AVAILABLE = (0x1 << 10) /* 1024 */, + OXYGEN_SENSOR_INCOMPLETE = (0x1 << 11) /* 2048 */, + AC_REFRIGERANT_AVAILABLE = (0x1 << 12) /* 4096 */, + AC_REFRIGERANT_INCOMPLETE = (0x1 << 13) /* 8192 */, + SECONDARY_AIR_SYSTEM_AVAILABLE = (0x1 << 14) /* 16384 */, + SECONDARY_AIR_SYSTEM_INCOMPLETE = (0x1 << 15) /* 32768 */, + EVAPORATIVE_SYSTEM_AVAILABLE = (0x1 << 16) /* 65536 */, + EVAPORATIVE_SYSTEM_INCOMPLETE = (0x1 << 17) /* 131072 */, + HEATED_CATALYST_AVAILABLE = (0x1 << 18) /* 262144 */, + HEATED_CATALYST_INCOMPLETE = (0x1 << 19) /* 524288 */, + CATALYST_AVAILABLE = (0x1 << 20) /* 1048576 */, + CATALYST_INCOMPLETE = (0x1 << 21) /* 2097152 */, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/PortLocationType.aidl new file mode 100644 index 0000000000..b831c7ebd9 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/PortLocationType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum PortLocationType { + UNKNOWN = 0, + FRONT_LEFT = 1, + FRONT_RIGHT = 2, + REAR_RIGHT = 3, + REAR_LEFT = 4, + FRONT = 5, + REAR = 6, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl new file mode 100644 index 0000000000..f2838ad818 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ProcessTerminationReason { + NOT_RESPONDING = 1, + IO_OVERUSE = 2, + MEMORY_OVERUSE = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl new file mode 100644 index 0000000000..74457b9ab7 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable RemoveUserRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo removedUserInfo; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RotaryInputType.aidl new file mode 100644 index 0000000000..ff90034711 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/RotaryInputType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum RotaryInputType { + ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION = 0, + ROTARY_INPUT_TYPE_AUDIO_VOLUME = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl new file mode 100644 index 0000000000..a3e59f128d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum SwitchUserMessageType { + UNKNOWN = 0, + LEGACY_ANDROID_SWITCH = 1, + ANDROID_SWITCH = 2, + VEHICLE_RESPONSE = 3, + VEHICLE_REQUEST = 4, + ANDROID_POST_SWITCH = 5, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl new file mode 100644 index 0000000000..3012b7a51d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SwitchUserRequest { + int requestId; + android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; + android.hardware.automotive.vehicle.UserInfo targetUser; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl new file mode 100644 index 0000000000..8915d1b866 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SwitchUserResponse { + int requestId; + android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; + android.hardware.automotive.vehicle.SwitchUserStatus status = android.hardware.automotive.vehicle.SwitchUserStatus.SUCCESS; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl new file mode 100644 index 0000000000..c7be9ec949 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum SwitchUserStatus { + SUCCESS = 1, + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/TrailerState.aidl new file mode 100644 index 0000000000..2491340acd --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/TrailerState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum TrailerState { + UNKNOWN = 0, + NOT_PRESENT = 1, + PRESENT = 2, + ERROR = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl new file mode 100644 index 0000000000..a540f8ead8 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationAssociation { + android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; + android.hardware.automotive.vehicle.UserIdentificationAssociationValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationValue.UNKNOWN; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl new file mode 100644 index 0000000000..1fd9ee8c31 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum UserIdentificationAssociationSetValue { + INVALID = 0, + ASSOCIATE_CURRENT_USER = 1, + DISASSOCIATE_CURRENT_USER = 2, + DISASSOCIATE_ALL_USERS = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl new file mode 100644 index 0000000000..6498375b0f --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum UserIdentificationAssociationType { + INVALID = 0, + KEY_FOB = 1, + CUSTOM_1 = 101, + CUSTOM_2 = 102, + CUSTOM_3 = 103, + CUSTOM_4 = 104, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl new file mode 100644 index 0000000000..d5e01691fa --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum UserIdentificationAssociationValue { + UNKNOWN = 1, + ASSOCIATED_CURRENT_USER = 2, + ASSOCIATED_ANOTHER_USER = 3, + NOT_ASSOCIATED_ANY_USER = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl new file mode 100644 index 0000000000..fe7fd6f6bc --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationGetRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo userInfo; + int numberAssociationTypes; + android.hardware.automotive.vehicle.UserIdentificationAssociationType[] associationTypes; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl new file mode 100644 index 0000000000..3e2a2579cc --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationResponse { + int requestId; + int numberAssociation; + android.hardware.automotive.vehicle.UserIdentificationAssociation[] associations; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl new file mode 100644 index 0000000000..57840fb77c --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationSetAssociation { + android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; + android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue.INVALID; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl new file mode 100644 index 0000000000..db01b515a8 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationSetRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo userInfo; + int numberAssociations; + android.hardware.automotive.vehicle.UserIdentificationSetAssociation[] associations; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserInfo.aidl new file mode 100644 index 0000000000..feb5a73ed4 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UserInfo.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserInfo { + int userId = 0; + int flags; + const int USER_FLAG_SYSTEM = 0x01; + const int USER_FLAG_GUEST = 0x02; + const int USER_FLAG_EPHEMERAL = 0x04; + const int USER_FLAG_ADMIN = 0x08; + const int USER_FLAG_DISABLED = 0x10; + const int USER_FLAG_PROFILE = 0x20; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UsersInfo.aidl new file mode 100644 index 0000000000..edcef2edfd --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/UsersInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UsersInfo { + android.hardware.automotive.vehicle.UserInfo currentUser; + int numberUsers; + android.hardware.automotive.vehicle.UserInfo[] existingUsers; +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl new file mode 100644 index 0000000000..9720aca787 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleApPowerBootupReason { + USER_POWER_ON = 0, + SYSTEM_USER_DETECTION = 1, + SYSTEM_REMOTE_ACCESS = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl new file mode 100644 index 0000000000..cc12490233 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleApPowerStateConfigFlag { + ENABLE_DEEP_SLEEP_FLAG = 0x1, + CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, + ENABLE_HIBERNATION_FLAG = 0x4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl new file mode 100644 index 0000000000..e4f7e54f75 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleApPowerStateReport { + WAIT_FOR_VHAL = 0x1, + DEEP_SLEEP_ENTRY = 0x2, + DEEP_SLEEP_EXIT = 0x3, + SHUTDOWN_POSTPONE = 0x4, + SHUTDOWN_START = 0x5, + ON = 0x6, + SHUTDOWN_PREPARE = 0x7, + SHUTDOWN_CANCELLED = 0x8, + HIBERNATION_ENTRY = 0x9, + HIBERNATION_EXIT = 0xA, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl new file mode 100644 index 0000000000..8b94d31598 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleApPowerStateReq { + ON = 0, + SHUTDOWN_PREPARE = 1, + CANCEL_SHUTDOWN = 2, + FINISHED = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl new file mode 100644 index 0000000000..f995c73ee5 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleApPowerStateReqIndex { + STATE = 0, + ADDITIONAL = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl similarity index 90% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl rename to automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl index 11139f9a3a..3fde1c7869 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl @@ -33,13 +33,11 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability -enum VehicleAreaDoor { - ROW_1_LEFT = 1, - ROW_1_RIGHT = 4, - ROW_2_LEFT = 16, - ROW_2_RIGHT = 64, - ROW_3_LEFT = 256, - ROW_3_RIGHT = 1024, - HOOD = 268435456, - REAR = 536870912, +enum VehicleApPowerStateShutdownParam { + SHUTDOWN_IMMEDIATELY = 1, + CAN_SLEEP = 2, + SHUTDOWN_ONLY = 3, + SLEEP_IMMEDIATELY = 4, + HIBERNATE_IMMEDIATELY = 5, + CAN_HIBERNATE = 6, } diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl new file mode 100644 index 0000000000..db867f4cc1 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleArea { + GLOBAL = 0x01000000, + WINDOW = 0x03000000, + MIRROR = 0x04000000, + SEAT = 0x05000000, + DOOR = 0x06000000, + WHEEL = 0x07000000, + MASK = 0x0f000000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl new file mode 100644 index 0000000000..04976d631d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaDoor { + ROW_1_LEFT = 0x00000001, + ROW_1_RIGHT = 0x00000004, + ROW_2_LEFT = 0x00000010, + ROW_2_RIGHT = 0x00000040, + ROW_3_LEFT = 0x00000100, + ROW_3_RIGHT = 0x00000400, + HOOD = 0x10000000, + REAR = 0x20000000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl new file mode 100644 index 0000000000..2d1c0483a2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaMirror { + DRIVER_LEFT = 0x00000001, + DRIVER_RIGHT = 0x00000002, + DRIVER_CENTER = 0x00000004, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl new file mode 100644 index 0000000000..44c9d54567 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaSeat { + ROW_1_LEFT = 0x0001, + ROW_1_CENTER = 0x0002, + ROW_1_RIGHT = 0x0004, + ROW_2_LEFT = 0x0010, + ROW_2_CENTER = 0x0020, + ROW_2_RIGHT = 0x0040, + ROW_3_LEFT = 0x0100, + ROW_3_CENTER = 0x0200, + ROW_3_RIGHT = 0x0400, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl new file mode 100644 index 0000000000..d1b314e0ac --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaWheel { + UNKNOWN = 0x0, + LEFT_FRONT = 0x1, + RIGHT_FRONT = 0x2, + LEFT_REAR = 0x4, + RIGHT_REAR = 0x8, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl new file mode 100644 index 0000000000..2afcca3dd1 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAreaWindow { + FRONT_WINDSHIELD = 0x00000001, + REAR_WINDSHIELD = 0x00000002, + ROW_1_LEFT = 0x00000010, + ROW_1_RIGHT = 0x00000040, + ROW_2_LEFT = 0x00000100, + ROW_2_RIGHT = 0x00000400, + ROW_3_LEFT = 0x00001000, + ROW_3_RIGHT = 0x00004000, + ROOF_TOP_1 = 0x00010000, + ROOF_TOP_2 = 0x00020000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl new file mode 100644 index 0000000000..be335ec7e7 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleDisplay { + MAIN = 0, + INSTRUMENT_CLUSTER = 1, + HUD = 2, + INPUT = 3, + AUXILIARY = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleGear.aidl new file mode 100644 index 0000000000..b8a299c41a --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleGear.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleGear { + GEAR_UNKNOWN = 0x0000, + GEAR_NEUTRAL = 0x0001, + GEAR_REVERSE = 0x0002, + GEAR_PARK = 0x0004, + GEAR_DRIVE = 0x0008, + GEAR_1 = 0x0010, + GEAR_2 = 0x0020, + GEAR_3 = 0x0040, + GEAR_4 = 0x0080, + GEAR_5 = 0x0100, + GEAR_6 = 0x0200, + GEAR_7 = 0x0400, + GEAR_8 = 0x0800, + GEAR_9 = 0x1000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl new file mode 100644 index 0000000000..4f9870a674 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHvacFanDirection { + UNKNOWN = 0x0, + FACE = 0x1, + FLOOR = 0x2, + FACE_AND_FLOOR = 0x3, + DEFROST = 0x4, + DEFROST_AND_FLOOR = 0x06, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl new file mode 100644 index 0000000000..c4ac002067 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwKeyInputAction { + ACTION_DOWN = 0, + ACTION_UP = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl new file mode 100644 index 0000000000..29c5ed6f6e --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionButtonStateFlag { + BUTTON_PRIMARY = 0x0001, + BUTTON_SECONDARY = 0x0002, + BUTTON_TERTIARY = 0x0004, + BUTTON_BACK = 0x0008, + BUTTON_FORWARD = 0x0010, + BUTTON_STYLUS_PRIMARY = 0x0020, + BUTTON_STYLUS_SECONDARY = 0x0040, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl new file mode 100644 index 0000000000..db4b41eb9d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionInputAction { + ACTION_DOWN = 0, + ACTION_UP = 1, + ACTION_MOVE = 2, + ACTION_CANCEL = 3, + ACTION_OUTSIDE = 4, + ACTION_POINTER_DOWN = 5, + ACTION_POINTER_UP = 6, + ACTION_HOVER_MOVE = 7, + ACTION_SCROLL = 8, + ACTION_HOVER_ENTER = 9, + ACTION_HOVER_EXIT = 10, + ACTION_BUTTON_PRESS = 11, + ACTION_BUTTON_RELEASE = 12, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl new file mode 100644 index 0000000000..88c7873a43 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionInputSource { + SOURCE_UNKNOWN = 0, + SOURCE_KEYBOARD = 1, + SOURCE_DPAD = 2, + SOURCE_GAMEPAD = 3, + SOURCE_TOUCHSCREEN = 4, + SOURCE_MOUSE = 5, + SOURCE_STYLUS = 6, + SOURCE_BLUETOOTH_STYLUS = 7, + SOURCE_TRACKBALL = 8, + SOURCE_MOUSE_RELATIVE = 9, + SOURCE_TOUCHPAD = 10, + SOURCE_TOUCH_NAVIGATION = 11, + SOURCE_ROTARY_ENCODER = 12, + SOURCE_JOYSTICK = 13, + SOURCE_HDMI = 14, + SOURCE_SENSOR = 15, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl new file mode 100644 index 0000000000..2b3bc7f157 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleHwMotionToolType { + TOOL_TYPE_UNKNOWN = 0, + TOOL_TYPE_FINGER = 1, + TOOL_TYPE_STYLUS = 2, + TOOL_TYPE_MOUSE = 3, + TOOL_TYPE_ERASER = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl new file mode 100644 index 0000000000..f572a128bb --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleIgnitionState { + UNDEFINED = 0, + LOCK = 1, + OFF, + ACC, + ON, + START, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightState.aidl new file mode 100644 index 0000000000..d569851407 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleLightState { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl new file mode 100644 index 0000000000..f244884f98 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleLightSwitch { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, + AUTOMATIC = 0x100, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl new file mode 100644 index 0000000000..f2eb5aa913 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleOilLevel { + CRITICALLY_LOW = 0, + LOW = 1, + NORMAL = 2, + HIGH = 3, + ERROR = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl new file mode 100644 index 0000000000..ba75e7b261 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -0,0 +1,273 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleProperty { + INVALID = 0x00000000, + INFO_VIN = (((0x0100 + 0x10000000) + 0x01000000) + 0x00100000) /* 286261504 */, + INFO_MAKE = (((0x0101 + 0x10000000) + 0x01000000) + 0x00100000) /* 286261505 */, + INFO_MODEL = (((0x0102 + 0x10000000) + 0x01000000) + 0x00100000) /* 286261506 */, + INFO_MODEL_YEAR = (((0x0103 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407235 */, + INFO_FUEL_CAPACITY = (((0x0104 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504388 */, + INFO_FUEL_TYPE = (((0x0105 + 0x10000000) + 0x01000000) + 0x00410000) /* 289472773 */, + INFO_EV_BATTERY_CAPACITY = (((0x0106 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504390 */, + INFO_EV_CONNECTOR_TYPE = (((0x0107 + 0x10000000) + 0x01000000) + 0x00410000) /* 289472775 */, + INFO_FUEL_DOOR_LOCATION = (((0x0108 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407240 */, + INFO_EV_PORT_LOCATION = (((0x0109 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407241 */, + INFO_DRIVER_SEAT = (((0x010A + 0x10000000) + 0x05000000) + 0x00400000) /* 356516106 */, + INFO_EXTERIOR_DIMENSIONS = (((0x010B + 0x10000000) + 0x01000000) + 0x00410000) /* 289472779 */, + INFO_MULTI_EV_PORT_LOCATIONS = (((0x010C + 0x10000000) + 0x01000000) + 0x00410000) /* 289472780 */, + PERF_ODOMETER = (((0x0204 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504644 */, + PERF_VEHICLE_SPEED = (((0x0207 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504647 */, + PERF_VEHICLE_SPEED_DISPLAY = (((0x0208 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504648 */, + PERF_STEERING_ANGLE = (((0x0209 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504649 */, + PERF_REAR_STEERING_ANGLE = (((0x0210 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504656 */, + ENGINE_COOLANT_TEMP = (((0x0301 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504897 */, + ENGINE_OIL_LEVEL = (((0x0303 + 0x10000000) + 0x01000000) + 0x00400000) /* 289407747 */, + ENGINE_OIL_TEMP = (((0x0304 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504900 */, + ENGINE_RPM = (((0x0305 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504901 */, + WHEEL_TICK = (((0x0306 + 0x10000000) + 0x01000000) + 0x00510000) /* 290521862 */, + FUEL_LEVEL = (((0x0307 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504903 */, + FUEL_DOOR_OPEN = (((0x0308 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310600 */, + EV_BATTERY_LEVEL = (((0x0309 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504905 */, + EV_CURRENT_BATTERY_CAPACITY = (((0x030D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291504909 */, + EV_CHARGE_PORT_OPEN = (((0x030A + 0x10000000) + 0x01000000) + 0x00200000) /* 287310602 */, + EV_CHARGE_PORT_CONNECTED = (((0x030B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310603 */, + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = (((0x030C + 0x10000000) + 0x01000000) + 0x00600000) /* 291504908 */, + RANGE_REMAINING = (((0x0308 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504904 */, + TIRE_PRESSURE = (((0x0309 + 0x10000000) + 0x07000000) + 0x00600000) /* 392168201 */, + CRITICALLY_LOW_TIRE_PRESSURE = (((0x030A + 0x10000000) + 0x07000000) + 0x00600000) /* 392168202 */, + ENGINE_IDLE_AUTO_STOP_ENABLED = (((0x0320 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310624 */, + GEAR_SELECTION = (((0x0400 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408000 */, + CURRENT_GEAR = (((0x0401 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408001 */, + PARKING_BRAKE_ON = (((0x0402 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310850 */, + PARKING_BRAKE_AUTO_APPLY = (((0x0403 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310851 */, + EV_BRAKE_REGENERATION_LEVEL = (((0x040C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408012 */, + FUEL_LEVEL_LOW = (((0x0405 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310853 */, + NIGHT_MODE = (((0x0407 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310855 */, + TURN_SIGNAL_STATE = (((0x0408 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408008 */, + IGNITION_STATE = (((0x0409 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408009 */, + ABS_ACTIVE = (((0x040A + 0x10000000) + 0x01000000) + 0x00200000) /* 287310858 */, + TRACTION_CONTROL_ACTIVE = (((0x040B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310859 */, + EV_STOPPING_MODE = (((0x040D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408013 */, + HVAC_FAN_SPEED = (((0x0500 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517120 */, + HVAC_FAN_DIRECTION = (((0x0501 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517121 */, + HVAC_TEMPERATURE_CURRENT = (((0x0502 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614274 */, + HVAC_TEMPERATURE_SET = (((0x0503 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614275 */, + HVAC_DEFROSTER = (((0x0504 + 0x10000000) + 0x03000000) + 0x00200000) /* 320865540 */, + HVAC_AC_ON = (((0x0505 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419973 */, + HVAC_MAX_AC_ON = (((0x0506 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419974 */, + HVAC_MAX_DEFROST_ON = (((0x0507 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419975 */, + HVAC_RECIRC_ON = (((0x0508 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419976 */, + HVAC_DUAL_ON = (((0x0509 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419977 */, + HVAC_AUTO_ON = (((0x050A + 0x10000000) + 0x05000000) + 0x00200000) /* 354419978 */, + HVAC_SEAT_TEMPERATURE = (((0x050B + 0x10000000) + 0x05000000) + 0x00400000) /* 356517131 */, + HVAC_SIDE_MIRROR_HEAT = (((0x050C + 0x10000000) + 0x04000000) + 0x00400000) /* 339739916 */, + HVAC_STEERING_WHEEL_HEAT = (((0x050D + 0x10000000) + 0x01000000) + 0x00400000) /* 289408269 */, + HVAC_TEMPERATURE_DISPLAY_UNITS = (((0x050E + 0x10000000) + 0x01000000) + 0x00400000) /* 289408270 */, + HVAC_ACTUAL_FAN_SPEED_RPM = (((0x050F + 0x10000000) + 0x05000000) + 0x00400000) /* 356517135 */, + HVAC_POWER_ON = (((0x0510 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419984 */, + HVAC_FAN_DIRECTION_AVAILABLE = (((0x0511 + 0x10000000) + 0x05000000) + 0x00410000) /* 356582673 */, + HVAC_AUTO_RECIRC_ON = (((0x0512 + 0x10000000) + 0x05000000) + 0x00200000) /* 354419986 */, + HVAC_SEAT_VENTILATION = (((0x0513 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517139 */, + HVAC_ELECTRIC_DEFROSTER_ON = (((0x0514 + 0x10000000) + 0x03000000) + 0x00200000) /* 320865556 */, + HVAC_TEMPERATURE_VALUE_SUGGESTION = (((0x0515 + 0x10000000) + 0x01000000) + 0x00610000) /* 291570965 */, + DISTANCE_DISPLAY_UNITS = (((0x0600 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408512 */, + FUEL_VOLUME_DISPLAY_UNITS = (((0x0601 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408513 */, + TIRE_PRESSURE_DISPLAY_UNITS = (((0x0602 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408514 */, + EV_BATTERY_DISPLAY_UNITS = (((0x0603 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408515 */, + FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = (((0x0604 + 0x10000000) + 0x01000000) + 0x00200000) /* 287311364 */, + VEHICLE_SPEED_DISPLAY_UNITS = (((0x0605 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408517 */, + EXTERNAL_CAR_TIME = (((0x0608 + 0x10000000) + 0x01000000) + 0x00500000) /* 290457096 */, + ANDROID_EPOCH_TIME = (((0x0606 + 0x10000000) + 0x01000000) + 0x00500000) /* 290457094 */, + STORAGE_ENCRYPTION_BINDING_SEED = (((0x0607 + 0x10000000) + 0x01000000) + 0x00700000) /* 292554247 */, + ENV_OUTSIDE_TEMPERATURE = (((0x0703 + 0x10000000) + 0x01000000) + 0x00600000) /* 291505923 */, + AP_POWER_STATE_REQ = (((0x0A00 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475072 */, + AP_POWER_STATE_REPORT = (((0x0A01 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475073 */, + AP_POWER_BOOTUP_REASON = (((0x0A02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409538 */, + DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409539 */, + PER_DISPLAY_BRIGHTNESS = (((0x0A04 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475076 */, + HW_KEY_INPUT = (((0x0A10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475088 */, + HW_KEY_INPUT_V2 = (((0x0A11 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004177 */, + HW_MOTION_INPUT = (((0x0A12 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004178 */, + HW_ROTARY_INPUT = (((0x0A20 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475104 */, + HW_CUSTOM_INPUT = (((0X0A30 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475120 */, + DOOR_POS = (((0x0B00 + 0x10000000) + 0x06000000) + 0x00400000) /* 373295872 */, + DOOR_MOVE = (((0x0B01 + 0x10000000) + 0x06000000) + 0x00400000) /* 373295873 */, + DOOR_LOCK = (((0x0B02 + 0x10000000) + 0x06000000) + 0x00200000) /* 371198722 */, + DOOR_CHILD_LOCK_ENABLED = (((0x0B03 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.DOOR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 371198723 */, + MIRROR_Z_POS = (((0x0B40 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741504 */, + MIRROR_Z_MOVE = (((0x0B41 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741505 */, + MIRROR_Y_POS = (((0x0B42 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741506 */, + MIRROR_Y_MOVE = (((0x0B43 + 0x10000000) + 0x04000000) + 0x00400000) /* 339741507 */, + MIRROR_LOCK = (((0x0B44 + 0x10000000) + 0x01000000) + 0x00200000) /* 287312708 */, + MIRROR_FOLD = (((0x0B45 + 0x10000000) + 0x01000000) + 0x00200000) /* 287312709 */, + MIRROR_AUTO_FOLD_ENABLED = (((0x0B46 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 337644358 */, + MIRROR_AUTO_TILT_ENABLED = (((0x0B47 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 337644359 */, + SEAT_MEMORY_SELECT = (((0x0B80 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518784 */, + SEAT_MEMORY_SET = (((0x0B81 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518785 */, + SEAT_BELT_BUCKLED = (((0x0B82 + 0x10000000) + 0x05000000) + 0x00200000) /* 354421634 */, + SEAT_BELT_HEIGHT_POS = (((0x0B83 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518787 */, + SEAT_BELT_HEIGHT_MOVE = (((0x0B84 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518788 */, + SEAT_FORE_AFT_POS = (((0x0B85 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518789 */, + SEAT_FORE_AFT_MOVE = (((0x0B86 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518790 */, + SEAT_BACKREST_ANGLE_1_POS = (((0x0B87 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518791 */, + SEAT_BACKREST_ANGLE_1_MOVE = (((0x0B88 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518792 */, + SEAT_BACKREST_ANGLE_2_POS = (((0x0B89 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518793 */, + SEAT_BACKREST_ANGLE_2_MOVE = (((0x0B8A + 0x10000000) + 0x05000000) + 0x00400000) /* 356518794 */, + SEAT_HEIGHT_POS = (((0x0B8B + 0x10000000) + 0x05000000) + 0x00400000) /* 356518795 */, + SEAT_HEIGHT_MOVE = (((0x0B8C + 0x10000000) + 0x05000000) + 0x00400000) /* 356518796 */, + SEAT_DEPTH_POS = (((0x0B8D + 0x10000000) + 0x05000000) + 0x00400000) /* 356518797 */, + SEAT_DEPTH_MOVE = (((0x0B8E + 0x10000000) + 0x05000000) + 0x00400000) /* 356518798 */, + SEAT_TILT_POS = (((0x0B8F + 0x10000000) + 0x05000000) + 0x00400000) /* 356518799 */, + SEAT_TILT_MOVE = (((0x0B90 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518800 */, + SEAT_LUMBAR_FORE_AFT_POS = (((0x0B91 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518801 */, + SEAT_LUMBAR_FORE_AFT_MOVE = (((0x0B92 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518802 */, + SEAT_LUMBAR_SIDE_SUPPORT_POS = (((0x0B93 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518803 */, + SEAT_LUMBAR_SIDE_SUPPORT_MOVE = (((0x0B94 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518804 */, + SEAT_HEADREST_HEIGHT_POS = (((0x0B95 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409941 */, + SEAT_HEADREST_HEIGHT_POS_V2 = (((0x0BA4 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518820 */, + SEAT_HEADREST_HEIGHT_MOVE = (((0x0B96 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518806 */, + SEAT_HEADREST_ANGLE_POS = (((0x0B97 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518807 */, + SEAT_HEADREST_ANGLE_MOVE = (((0x0B98 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518808 */, + SEAT_HEADREST_FORE_AFT_POS = (((0x0B99 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518809 */, + SEAT_HEADREST_FORE_AFT_MOVE = (((0x0B9A + 0x10000000) + 0x05000000) + 0x00400000) /* 356518810 */, + SEAT_FOOTWELL_LIGHTS_STATE = (((0x0B9B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518811 */, + SEAT_FOOTWELL_LIGHTS_SWITCH = (((0x0B9C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518812 */, + SEAT_EASY_ACCESS_ENABLED = (((0x0B9D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421661 */, + SEAT_AIRBAG_ENABLED = (((0x0B9E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421662 */, + SEAT_CUSHION_SIDE_SUPPORT_POS = (((0x0B9F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518815 */, + SEAT_CUSHION_SIDE_SUPPORT_MOVE = (((0x0BA0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518816 */, + SEAT_LUMBAR_VERTICAL_POS = (((0x0BA1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518817 */, + SEAT_LUMBAR_VERTICAL_MOVE = (((0x0BA2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518818 */, + SEAT_WALK_IN_POS = (((0x0BA3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518819 */, + SEAT_OCCUPANCY = (((0x0BB0 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518832 */, + WINDOW_POS = (((0x0BC0 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964416 */, + WINDOW_MOVE = (((0x0BC1 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964417 */, + WINDOW_LOCK = (((0x0BC4 + 0x10000000) + 0x03000000) + 0x00200000) /* 320867268 */, + WINDSHIELD_WIPERS_PERIOD = (((0x0BC5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964421 */, + WINDSHIELD_WIPERS_STATE = (((0x0BC6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964422 */, + WINDSHIELD_WIPERS_SWITCH = (((0x0BC7 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.WINDOW) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 322964423 */, + STEERING_WHEEL_DEPTH_POS = (((0x0BE0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410016 */, + STEERING_WHEEL_DEPTH_MOVE = (((0x0BE1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410017 */, + STEERING_WHEEL_HEIGHT_POS = (((0x0BE2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410018 */, + STEERING_WHEEL_HEIGHT_MOVE = (((0x0BE3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410019 */, + STEERING_WHEEL_THEFT_LOCK_ENABLED = (((0x0BE4 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312868 */, + STEERING_WHEEL_LOCKED = (((0x0BE5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312869 */, + STEERING_WHEEL_EASY_ACCESS_ENABLED = (((0x0BE6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312870 */, + GLOVE_BOX_DOOR_POS = (((0x0BF0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518896 */, + GLOVE_BOX_LOCKED = (((0x0BF1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421745 */, + VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */, + LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */, + OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, + OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, + OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, + OBD2_FREEZE_FRAME_CLEAR = (((0x0D03 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896067 */, + HEADLIGHTS_STATE = (((0x0E00 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410560 */, + HIGH_BEAM_LIGHTS_STATE = (((0x0E01 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410561 */, + FOG_LIGHTS_STATE = (((0x0E02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410562 */, + HAZARD_LIGHTS_STATE = (((0x0E03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410563 */, + HEADLIGHTS_SWITCH = (((0x0E10 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410576 */, + HIGH_BEAM_LIGHTS_SWITCH = (((0x0E11 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410577 */, + FOG_LIGHTS_SWITCH = (((0x0E12 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410578 */, + HAZARD_LIGHTS_SWITCH = (((0x0E13 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410579 */, + CABIN_LIGHTS_STATE = (((0x0F01 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410817 */, + CABIN_LIGHTS_SWITCH = (((0x0F02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410818 */, + READING_LIGHTS_STATE = (((0x0F03 + 0x10000000) + 0x05000000) + 0x00400000) /* 356519683 */, + READING_LIGHTS_SWITCH = (((0x0F04 + 0x10000000) + 0x05000000) + 0x00400000) /* 356519684 */, + STEERING_WHEEL_LIGHTS_STATE = (((0x0F0C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410828 */, + STEERING_WHEEL_LIGHTS_SWITCH = (((0x0F0D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410829 */, + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = (((0x0F05 + 0x10000000) + 0x01000000) + 0x00200000) /* 287313669 */, + DISABLED_OPTIONAL_FEATURES = (((0x0F06 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265094 */, + INITIAL_USER_INFO = (((0x0F07 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896583 */, + SWITCH_USER = (((0x0F08 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896584 */, + CREATE_USER = (((0x0F09 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896585 */, + REMOVE_USER = (((0x0F0A + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896586 */, + USER_IDENTIFICATION_ASSOCIATION = (((0x0F0B + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896587 */, + EVS_SERVICE_REQUEST = (((0x0F10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476368 */, + POWER_POLICY_REQ = (((0x0F21 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265121 */, + POWER_POLICY_GROUP_REQ = (((0x0F22 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265122 */, + CURRENT_POWER_POLICY = (((0x0F23 + 0x10000000) + 0x01000000) + 0x00100000) /* 286265123 */, + WATCHDOG_ALIVE = (((0xF31 + 0x10000000) + 0x01000000) + 0x00500000) /* 290459441 */, + WATCHDOG_TERMINATED_PROCESS = (((0x0F32 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896626 */, + VHAL_HEARTBEAT = (((0x0F33 + 0x10000000) + 0x01000000) + 0x00500000) /* 290459443 */, + CLUSTER_SWITCH_UI = (((0x0F34 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410868 */, + CLUSTER_DISPLAY_STATE = (((0x0F35 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476405 */, + CLUSTER_REPORT_STATE = (((0x0F36 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896630 */, + CLUSTER_REQUEST_DISPLAY = (((0x0F37 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410871 */, + CLUSTER_NAVIGATION_STATE = (((0x0F38 + 0x10000000) + 0x01000000) + 0x00700000) /* 292556600 */, + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = (((0x0F39 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410873 */, + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = (((0x0F3A + 0x10000000) + 0x01000000) + 0x00400000) /* 289410874 */, + FRONT_FOG_LIGHTS_STATE = (((0x0F3B + 0x10000000) + 0x01000000) + 0x00400000) /* 289410875 */, + FRONT_FOG_LIGHTS_SWITCH = (((0x0F3C + 0x10000000) + 0x01000000) + 0x00400000) /* 289410876 */, + REAR_FOG_LIGHTS_STATE = (((0x0F3D + 0x10000000) + 0x01000000) + 0x00400000) /* 289410877 */, + REAR_FOG_LIGHTS_SWITCH = (((0x0F3E + 0x10000000) + 0x01000000) + 0x00400000) /* 289410878 */, + EV_CHARGE_CURRENT_DRAW_LIMIT = (((0x0F3F + 0x10000000) + 0x01000000) + 0x00600000) /* 291508031 */, + EV_CHARGE_PERCENT_LIMIT = (((0x0F40 + 0x10000000) + 0x01000000) + 0x00600000) /* 291508032 */, + EV_CHARGE_STATE = (((0x0F41 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410881 */, + EV_CHARGE_SWITCH = (((0x0F42 + 0x10000000) + 0x01000000) + 0x00200000) /* 287313730 */, + EV_CHARGE_TIME_REMAINING = (((0x0F43 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410883 */, + EV_REGENERATIVE_BRAKING_STATE = (((0x0F44 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410884 */, + TRAILER_PRESENT = (((0x0F45 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410885 */, + VEHICLE_CURB_WEIGHT = (((0x0F46 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410886 */, + GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = (((0x0F47 + 0x10000000) + 0x01000000) + 0x00400000) /* 289410887 */, + SUPPORTED_PROPERTY_IDS = (((0x0F48 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476424 */, + SHUTDOWN_REQUEST = (((0x0F49 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410889 */, + VEHICLE_IN_USE = (((0x0F4A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313738 */, + AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313920 */, + AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411073 */, + FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313922 */, + FORWARD_COLLISION_WARNING_STATE = (((0x1003 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411075 */, + BLIND_SPOT_WARNING_ENABLED = (((0x1004 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313924 */, + BLIND_SPOT_WARNING_STATE = (((0x1005 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.MIRROR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 339742725 */, + LANE_DEPARTURE_WARNING_ENABLED = (((0x1006 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313926 */, + LANE_DEPARTURE_WARNING_STATE = (((0x1007 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411079 */, + LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313928 */, + LANE_KEEP_ASSIST_STATE = (((0x1009 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411081 */, + LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313930 */, + LANE_CENTERING_ASSIST_COMMAND = (((0x100B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411083 */, + LANE_CENTERING_ASSIST_STATE = (((0x100C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411084 */, + EMERGENCY_LANE_KEEP_ASSIST_ENABLED = (((0x100D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313933 */, + EMERGENCY_LANE_KEEP_ASSIST_STATE = (((0x100E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411086 */, + CRUISE_CONTROL_ENABLED = (((0x100F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313935 */, + CRUISE_CONTROL_TYPE = (((0x1010 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411088 */, + CRUISE_CONTROL_STATE = (((0x1011 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411089 */, + CRUISE_CONTROL_COMMAND = (((0x1012 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411090 */, + CRUISE_CONTROL_TARGET_SPEED = (((0x1013 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291508243 */, + ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = (((0x1014 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411092 */, + ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE = (((0x1015 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411093 */, + HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */, + HANDS_ON_DETECTION_DRIVER_STATE = (((0x1017 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411095 */, + HANDS_ON_DETECTION_WARNING = (((0x1018 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411096 */, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl new file mode 100644 index 0000000000..714d514cf4 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehiclePropertyGroup { + SYSTEM = 0x10000000, + VENDOR = 0x20000000, + MASK = 0xf0000000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl new file mode 100644 index 0000000000..7525cbbf69 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehiclePropertyType { + STRING = 0x00100000, + BOOLEAN = 0x00200000, + INT32 = 0x00400000, + INT32_VEC = 0x00410000, + INT64 = 0x00500000, + INT64_VEC = 0x00510000, + FLOAT = 0x00600000, + FLOAT_VEC = 0x00610000, + BYTES = 0x00700000, + MIXED = 0x00e00000, + MASK = 0x00ff0000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl new file mode 100644 index 0000000000..3e870e8925 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleSeatOccupancyState { + UNKNOWN = 0, + VACANT = 1, + OCCUPIED = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl new file mode 100644 index 0000000000..0431b45b9a --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleTurnSignal { + NONE = 0x00, + RIGHT = 0x01, + LEFT = 0x02, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleUnit.aidl new file mode 100644 index 0000000000..9aca98bec2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleUnit { + SHOULD_NOT_USE = 0x000, + METER_PER_SEC = 0x01, + RPM = 0x02, + HERTZ = 0x03, + PERCENTILE = 0x10, + MILLIMETER = 0x20, + METER = 0x21, + KILOMETER = 0x23, + MILE = 0x24, + CELSIUS = 0x30, + FAHRENHEIT = 0x31, + KELVIN = 0x32, + MILLILITER = 0x40, + LITER = 0x41, + GALLON = 0x42, + US_GALLON = 0x42, + IMPERIAL_GALLON = 0x43, + NANO_SECS = 0x50, + MILLI_SECS = 0x51, + SECS = 0x53, + YEAR = 0x59, + WATT_HOUR = 0x60, + MILLIAMPERE = 0x61, + MILLIVOLT = 0x62, + MILLIWATTS = 0x63, + AMPERE_HOURS = 0x64, + KILOWATT_HOUR = 0x65, + AMPERE = 0x66, + KILOPASCAL = 0x70, + PSI = 0x71, + BAR = 0x72, + DEGREES = 0x80, + MILES_PER_HOUR = 0x90, + KILOMETERS_PER_HOUR = 0x91, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl new file mode 100644 index 0000000000..3aa326c9c7 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleVendorPermission { + PERMISSION_DEFAULT = 0x00000000, + PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 0X00000001, + PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 0x00000002, + PERMISSION_SET_VENDOR_CATEGORY_DOOR = 0x00000003, + PERMISSION_GET_VENDOR_CATEGORY_DOOR = 0x00000004, + PERMISSION_SET_VENDOR_CATEGORY_SEAT = 0x00000005, + PERMISSION_GET_VENDOR_CATEGORY_SEAT = 0x00000006, + PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 0x00000007, + PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 0x00000008, + PERMISSION_SET_VENDOR_CATEGORY_INFO = 0x00000009, + PERMISSION_GET_VENDOR_CATEGORY_INFO = 0x0000000A, + PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 0x0000000B, + PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 0x0000000C, + PERMISSION_SET_VENDOR_CATEGORY_HVAC = 0x0000000D, + PERMISSION_GET_VENDOR_CATEGORY_HVAC = 0x0000000E, + PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 0x0000000F, + PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 0x00000010, + PERMISSION_SET_VENDOR_CATEGORY_1 = 0x00010000, + PERMISSION_GET_VENDOR_CATEGORY_1 = 0x00011000, + PERMISSION_SET_VENDOR_CATEGORY_2 = 0x00020000, + PERMISSION_GET_VENDOR_CATEGORY_2 = 0x00021000, + PERMISSION_SET_VENDOR_CATEGORY_3 = 0x00030000, + PERMISSION_GET_VENDOR_CATEGORY_3 = 0x00031000, + PERMISSION_SET_VENDOR_CATEGORY_4 = 0x00040000, + PERMISSION_GET_VENDOR_CATEGORY_4 = 0x00041000, + PERMISSION_SET_VENDOR_CATEGORY_5 = 0x00050000, + PERMISSION_GET_VENDOR_CATEGORY_5 = 0x00051000, + PERMISSION_SET_VENDOR_CATEGORY_6 = 0x00060000, + PERMISSION_GET_VENDOR_CATEGORY_6 = 0x00061000, + PERMISSION_SET_VENDOR_CATEGORY_7 = 0x00070000, + PERMISSION_GET_VENDOR_CATEGORY_7 = 0x00071000, + PERMISSION_SET_VENDOR_CATEGORY_8 = 0x00080000, + PERMISSION_GET_VENDOR_CATEGORY_8 = 0x00081000, + PERMISSION_SET_VENDOR_CATEGORY_9 = 0x00090000, + PERMISSION_GET_VENDOR_CATEGORY_9 = 0x00091000, + PERMISSION_SET_VENDOR_CATEGORY_10 = 0x000A0000, + PERMISSION_GET_VENDOR_CATEGORY_10 = 0x000A1000, + PERMISSION_NOT_ACCESSIBLE = 0xF0000000, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..0dcfbc4a5d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsAvailabilityStateIntegerValuesIndex { + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_ASSOCIATED_LAYERS = 2, + LAYERS_START = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..45514d081a --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsBaseMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageType.aidl new file mode 100644 index 0000000000..1248c069ce --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageType.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsMessageType { + SUBSCRIBE = 1, + SUBSCRIBE_TO_PUBLISHER = 2, + UNSUBSCRIBE = 3, + UNSUBSCRIBE_TO_PUBLISHER = 4, + OFFERING = 5, + AVAILABILITY_REQUEST = 6, + SUBSCRIPTIONS_REQUEST = 7, + AVAILABILITY_RESPONSE = 8, + AVAILABILITY_CHANGE = 9, + SUBSCRIPTIONS_RESPONSE = 10, + SUBSCRIPTIONS_CHANGE = 11, + DATA = 12, + PUBLISHER_ID_REQUEST = 13, + PUBLISHER_ID_RESPONSE = 14, + PUBLISHER_INFORMATION_REQUEST = 15, + PUBLISHER_INFORMATION_RESPONSE = 16, + START_SESSION = 17, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl new file mode 100644 index 0000000000..8b0e3a5ef2 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex { + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, + PUBLISHER_ID = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl new file mode 100644 index 0000000000..65dd4ae395 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsMessageWithLayerIntegerValuesIndex { + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..fc2a9c1844 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsOfferingMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, + NUMBER_OF_OFFERS = 2, + OFFERING_START = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl new file mode 100644 index 0000000000..a9b017fdb1 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsPublisherInformationIntegerValuesIndex { + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..d942bc8392 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsStartSessionMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, + SERVICE_ID = 1, + CLIENT_ID = 2, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..796d7f722c --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VmsSubscriptionsStateIntegerValuesIndex { + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_LAYERS = 2, + NUMBER_OF_ASSOCIATED_LAYERS = 3, + SUBSCRIPTIONS_START = 4, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersState.aidl new file mode 100644 index 0000000000..d0c1e8d70d --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum WindshieldWipersState { + OTHER = 0, + OFF = 1, + ON = 2, + SERVICE = 3, +} diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl new file mode 100644 index 0000000000..6c170fe6a4 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum WindshieldWipersSwitch { + OTHER = 0, + OFF = 1, + MIST = 2, + INTERMITTENT_LEVEL_1 = 3, + INTERMITTENT_LEVEL_2 = 4, + INTERMITTENT_LEVEL_3 = 5, + INTERMITTENT_LEVEL_4 = 6, + INTERMITTENT_LEVEL_5 = 7, + CONTINUOUS_LEVEL_1 = 8, + CONTINUOUS_LEVEL_2 = 9, + CONTINUOUS_LEVEL_3 = 10, + CONTINUOUS_LEVEL_4 = 11, + CONTINUOUS_LEVEL_5 = 12, + AUTO = 13, + SERVICE = 14, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl new file mode 100644 index 0000000000..540c6633a3 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Automatic Emergency Braking (AEB). + */ +@VintfStability +@Backing(type="int") +enum AutomaticEmergencyBrakingState { + + /** + * This state is used as an alternative to any AutomaticEmergencyBrakingState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#AUTOMATIC_EMERGENCY_BRAKING_STATE should not use this state. The framework + * can use this field to remain backwards compatible if AutomaticEmergencyBrakingState is + * extended to include additional states. + */ + OTHER = 0, + /** + * AEB is enabled and monitoring safety, but brakes are not activated. + */ + ENABLED = 1, + /** + * AEB is enabled and currently has the brakes applied for the vehicle. + */ + ACTIVATED = 2, + /** + * Many AEB implementations allow the driver to override AEB. This means that the car has + * determined it should brake, but a user decides to take over and do something else. This is + * often done for safety reasons and to ensure that the driver can always take control of the + * vehicle. This state should be set when the user is actively overriding the AEB system. + */ + USER_OVERRIDE = 3, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl new file mode 100644 index 0000000000..3f567c0dce --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/BlindSpotWarningState.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Blind Spot Warning State (BSW). + */ +@VintfStability +@Backing(type="int") +enum BlindSpotWarningState { + + /** + * This state is used as an alternative to any BlindSpotWarningState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#BLIND_SPOT_WARNING_STATE should not use this state. The framework + * can use this field to remain backwards compatible if BlindSpotWarningState is + * extended to include additional states. + */ + OTHER = 0, + /** + * BSW is enabled and monitoring safety, but no vehicle or object detected in the vehicle's + * blind spot. + */ + NO_WARNING = 1, + /** + * BSW is enabled, detects a vehicle or object in the vehicle's blind spot, and is actively + * warning the user. + */ + WARNING = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserRequest.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserResponse.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CreateUserStatus.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlCommand.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlCommand.aidl new file mode 100644 index 0000000000..18e140506d --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlCommand.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the Cruise Control (CC) commands. + * + * This enum could be extended in future releases to include additional feature states. + */ +@VintfStability +@Backing(type="int") +enum CruiseControlCommand { + /** + * Activate cruise control, which means CC takes control of maintaining the vehicle's target + * speed without the driver having to keep their foot on the accelerator. The target speed for + * CC is generally set to the vehicle's speed at the time of activation. + */ + ACTIVATE = 1, + /** + * Suspend cruise control, but still keep it enabled. Once CC is activated again, the + * target speed should resume to the previous setting. + */ + SUSPEND = 2, + /** + * Increase the target speed when CC is activated. The increment value should be decided by the + * OEM. The updated value can be read from CRUISE_CONTROL_TARGET_SPEED. + */ + INCREASE_TARGET_SPEED = 3, + /** + * Decrease the target speed when CC is activated. The decrement value should be decided by the + * OEM. The updated value can be read from CRUISE_CONTROL_TARGET_SPEED. + */ + DECREASE_TARGET_SPEED = 4, + /** + * Increase the target time gap or distance from the vehicle ahead when adaptive/predictive CC + * is activated. The increment value should be decided by the OEM. The updated value can be read + * from ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP. Setting this command on a standard CC vehicle + * should return StatusCode.NOT_AVAILABLE. + */ + INCREASE_TARGET_TIME_GAP = 5, + /** + * Decrease the target time gap or distance from the vehicle ahead when adaptive/predictive CC + * is activated. The decrement value should be decided by the 0EM. The updated value can be read + * from ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP. Setting this command on a standard CC vehicle + * should return StatusCode.NOT_AVAILABLE. + */ + DECREASE_TARGET_TIME_GAP = 6, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlState.aidl new file mode 100644 index 0000000000..0e55e00948 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlState.aidl @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current state of Cruise Control (CC). + * + * This enum could be extended in future releases to include additional feature states. + */ +@VintfStability +@Backing(type="int") +enum CruiseControlState { + /** + * This state is used as an alternative for any CruiseControlState value that is not defined in + * the platform. Ideally, implementations of VehicleProperty#CRUISE_CONTROL_STATE should not use + * this state. The framework can use this field to remain backwards compatible if + * CruiseControlState is extended to include additional states. + */ + OTHER = 0, + /** + * CC is enabled but the ADAS system is not actively controlling the vehicle's speed. + */ + ENABLED = 1, + /** + * CC is enabled and activated, so the ADAS system is actively controlling the vehicle's speed. + */ + ACTIVATED = 2, + /** + * Most CC implementations allow the driver to override CC. This means that the car has + * determined it should maintain a certain speed and/or maintain a certain distance from a + * leading vehicle, but the driver decides to take over and do something else. This is often + * done for safety reasons and to ensure that the driver can always take control of the vehicle. + * This state should be set when the user is actively overriding the CC system. + */ + USER_OVERRIDE = 3, + /** + * Suspended state indicates CC is enabled and was activated, but now is suspended. This could + * be caused by the user tapping the brakes while CC is ACTIVATED or the user using the + * VehicleProperty#CRUISE_CONTROL_COMMAND to suspend CC. Once CC is suspended, the CC system + * gives control of the vehicle back to the driver, but saves the target speed and/or target + * time gap settings in case CC is resumed. This state can also be used when adaptive/predictive + * CC slows to a stop and needs a user signal to start again. + */ + SUSPENDED = 4, + /** + * When CC is in the ACTIVATED state but may potentially need to deactivate because of external + * conditions (e.g. roads curvature is too extreme, the driver does not have their hands on the + * steering wheel for a long period of time, or the driver is not paying attention), then the + * ADAS system will notify the driver of a potential need to deactivate and give control back to + * the driver. + */ + FORCED_DEACTIVATION_WARNING = 5, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlType.aidl new file mode 100644 index 0000000000..2367b828db --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CruiseControlType.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current type of Cruise Control (CC). + * + * This enum could be extended in future releases to include additional feature states. + */ +@VintfStability +@Backing(type="int") +enum CruiseControlType { + /** + * This state is used as an alternative for any CruiseControlType value that is not defined in + * the platform. Ideally, implementations of VehicleProperty#CRUISE_CONTROL_TYPE should not use + * this state. The framework can use this field to remain backwards compatible if + * CruiseControlType is extended to include additional types. + */ + OTHER = 0, + /** + * Standard cruise control is when a system in the vehicle automatically maintains a set speed + * without the driver having to keep their foot on the accelerator. This version of cruise + * control does not include automatic acceleration and deceleration to maintain a set time gap + * from a vehicle ahead. + */ + STANDARD = 1, + /** + * Adaptive cruise control is when a system in the vehicle automatically accelerates and + * decelerates to maintain a set speed and/or a set time gap from a vehicle ahead. + */ + ADAPTIVE = 2, + /** + * Predictive cruise control is a version of adaptive cruise control that also considers road + * topography, road curvature, speed limit and traffic signs, etc. to actively adjust braking, + * acceleration, gear shifting, etc. for the vehicle. This feature is often used to optimize + * fuel consumption. + */ + PREDICTIVE = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CustomInputType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CustomInputType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl new file mode 100644 index 0000000000..302b9aff4b --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.aidl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by emergency lane keep assist to enumerate state. + * + * This enum could be extended in future releases to include additional feature states. + */ +@VintfStability +@Backing(type="int") +enum EmergencyLaneKeepAssistState { + /** + * This state is used as an alternative for any EmergencyLaneKeepAssistState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#EMERGENCY_LANE_KEEP_ASSIST_STATE should not use this state. The framework can + * use this field to remain backwards compatible if EmergencyLaneKeepAssistState is extended to + * include additional states. + */ + OTHER = 0, + /** + * ELKA is enabled and monitoring safety, but no safety event is detected and steering assist is + * not activated. + */ + ENABLED = 1, + /** + * ELKA is enabled and a safety event is detected. Vehicle is sending out a warning to the + * driver indicating that there is a dangerous maneuver on the left side of the vehicle. + */ + WARNING_LEFT = 2, + /** + * ELKA is enabled and a safety event is detected. Vehicle is sending out a warning to the + * driver indicating that there is a dangerous maneuver on the right side of the vehicle. + */ + WARNING_RIGHT = 3, + /** + * ELKA is enabled and currently has steering assist applied to the vehicle. Steering assist + * nudges the vehicle towards the left, which generally means the steering wheel turns counter + * clockwise. This is usually in response to the driver making an unsafe right lane change. + */ + ACTIVATED_STEER_LEFT = 4, + /** + * ELKA is enabled and currently has steering assist applied to the vehicle. Steering assist + * nudges the vehicle towards the right, which generally means the steering wheel turns + * clockwise. This is usually in response to the driver making an unsafe left lane change. + */ + ACTIVATED_STEER_RIGHT = 5, + /** + * Many safety feature implementations allow the driver to override said feature. This means + * that the car has determined it should take some action, but a user decides to take over and + * do something else. This is often done for safety reasons and to ensure that the driver can + * always take control of the vehicle. This state should be set when the user is currently + * overriding ELKA. + */ + USER_OVERRIDE = 6, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ErrorState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ErrorState.aidl new file mode 100644 index 0000000000..ba44672976 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ErrorState.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the possible error states. For version 2 of this interface, ErrorState is used + * by ADAS STATE properties, but its use may be expanded in future releases. + */ +@VintfStability +@Backing(type="int") +enum ErrorState { + + /** + * This state is used as an alternative to any ErrorState value that is not defined in the + * platform. Ideally, implementations of vehicle properties should not use this state. The + * framework can use this field to remain backwards compatible if this enum is extended to + * include additional states. + */ + OTHER_ERROR_STATE = -1, + /** + * Vehicle property is not available because the feature is disabled. + */ + NOT_AVAILABLE_DISABLED = -2, + /** + * Vehicle property is not available because the vehicle speed is too low to use this feature. + */ + NOT_AVAILABLE_SPEED_LOW = -3, + /** + * Vehicle property is not available because the vehicle speed is too high to use this feature. + */ + NOT_AVAILABLE_SPEED_HIGH = -4, + /** + * Vehicle property is not available because sensor or camera visibility is insufficient to use + * this feature. For example, this can be caused by bird poop blocking the camera, poor weather + * conditions such as snow or fog, or by any object obstructing the required sensors. + */ + NOT_AVAILABLE_POOR_VISIBILITY = -5, + /** + * Vehicle property is not available because there is a safety risk that makes this feature + * unavailable to use presently. For example, this can be caused by someone blocking the trunk + * door while it is closing, or by the system being in a faulty state. + */ + NOT_AVAILABLE_SAFETY = -6, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvChargeState.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvChargeState.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvConnectorType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvConnectorType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvStoppingMode.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvStoppingMode.aidl new file mode 100644 index 0000000000..8c5ac46c4e --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvStoppingMode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by EV_STOPPING_MODE to enumerate the current state of the stopping mode. + * + * This enum may be extended to include more states in the future. + */ +@VintfStability +@Backing(type="int") +enum EvStoppingMode { + /** + * Other EV stopping mode. Ideally, this should never be used. + */ + OTHER = 0, + /** + * Vehicle slowly moves forward when the brake pedal is released. + */ + CREEP = 1, + /** + * Vehicle rolls freely when the brake pedal is released (similar to neutral gear). + */ + ROLL = 2, + /** + * Vehicle stops and holds its position when the brake pedal is released. + */ + HOLD = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceState.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceState.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceType.aidl similarity index 84% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceType.aidl index 6c621f79ad..20582dca0f 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/EvsServiceType.aidl @@ -24,4 +24,11 @@ package android.hardware.automotive.vehicle; enum EvsServiceType { REARVIEW = 0, SURROUNDVIEW = 1, + FRONTVIEW = 2, + LEFTVIEW = 3, + RIGHTVIEW = 4, + DRIVERVIEW = 5, + FRONTPASSENGERSVIEW = 6, + REARPASSENGERSVIEW = 7, + USER_DEFINED = 1000, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl new file mode 100644 index 0000000000..b20cf259d2 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ForwardCollisionWarningState.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Forward Collision Warning State (FCW). + */ +@VintfStability +@Backing(type="int") +enum ForwardCollisionWarningState { + + /** + * This state is used as an alternative to any ForwardCollisionWarningState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#FORWARD_COLLISION_WARNING_STATE should not use this state. The framework + * can use this field to remain backwards compatible if ForwardCollisionWarningState is + * extended to include additional states. + */ + OTHER = 0, + /** + * FCW is enabled and monitoring safety, but no potential collision is detected. + */ + NO_WARNING = 1, + /** + * FCW is enabled, detects a potential collision, and is actively warning the user. + */ + WARNING = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/FuelType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/FuelType.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl new file mode 100644 index 0000000000..fb3ca9fcd4 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/GsrComplianceRequirementType.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT to indicate what + * kind of general safety regulation compliance requirement is enforced. + */ +@VintfStability +@Backing(type="int") +enum GsrComplianceRequirementType { + /** + * GSR compliance is not required. + */ + GSR_COMPLIANCE_NOT_REQUIRED = 0, + + /** + * GSR compliance is required and the requirement solution version is 1. + */ + GSR_COMPLIANCE_REQUIRED_V1 = 1, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl new file mode 100644 index 0000000000..4a36999ecb --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current driver state of Hands On Detection (HOD). + */ +@VintfStability +@Backing(type="int") +enum HandsOnDetectionDriverState { + /** + * This state is used as an alternative for any HandsOnDetectionDriverState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#HANDS_ON_DETECTION_DRIVER_STATE should not use this state. The framework + * can use this field to remain backwards compatible if HandsOnDetectionDriverState is + * extended to include additional states. + */ + OTHER = 0, + /** + * The system detects that the driver has their hands on the steering wheel. + */ + HANDS_ON = 1, + /** + * The system detects that the driver has their hands off the steering wheel. + */ + HANDS_OFF = 2, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl new file mode 100644 index 0000000000..c1a58ce609 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/HandsOnDetectionWarning.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current warning state of Hands On Detection (HOD). + */ +@VintfStability +@Backing(type="int") +enum HandsOnDetectionWarning { + /** + * This state is used as an alternative for any HandsOnDetectionWarning value that is + * defined in the platform. Ideally, implementations of + * VehicleProperty#HANDS_ON_DETECTION_WARNING should not use this state. The framework + * can use this field to remain backwards compatible if HandsOnDetectionWarning is + * extended to include additional states. + */ + OTHER = 0, + /** + * HOD is enabled and the driver's current safety does not warrant sending a warning. This + * state is independent of whether the driver actually has their hands on or off the wheel. + */ + NO_WARNING = 1, + /** + * HOD is enabled and the driver's hands have been off the wheel for too long a duration, + * and the vehicle is sending a warning to the driver as a consequence of this. + */ + WARNING = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl new file mode 100644 index 0000000000..d8b0e65857 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by Lane Centering Assist (LCA) to enumerate commands. + */ +@VintfStability +@Backing(type="int") +enum LaneCenteringAssistCommand { + /** + * When VehicleProperty#LANE_CENTERING_ASSIST_STATE = LaneCenteringAssistState#ENABLED, this + * command sends a request to activate steering control that keeps the vehicle centered in its + * lane. While waiting for the LCA System to take control of the vehicle, + * VehicleProperty#LANE_CENTERING_ASSIST_STATE must be in the + * LaneCenteringAssistState#ACTIVATION_REQUESTED state. Once the vehicle takes control of + * steering, then VehicleProperty#LANE_CENTERING_ASSIST_STATE must be in the + * LaneCenteringAssistState#ACTIVATED state. Otherwise, an error can be communicated through an + * ErrorState value. + */ + ACTIVATE = 1, + /** + * When VehicleProperty#LANE_CENTERING_ASSIST_STATE is set to + * LaneCenteringAssistState#ACTIVATION_REQUESTED or LaneCenteringAssistState#ACTIVATED, this + * command deactivates steering control and the driver should take full control of the vehicle. + * If this command succeeds, VehicleProperty#LANE_CENTERING_ASSIST_STATE must be updated to + * LaneCenteringAssistState#ENABLED. + */ + DEACTIVATE = 2, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl new file mode 100644 index 0000000000..340a669d2d --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneCenteringAssistState.aidl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Lane Centering Assist (LCA). + */ +@VintfStability +@Backing(type="int") +enum LaneCenteringAssistState { + + /** + * This state is used as an alternative for any LaneCenteringAssistState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#LANE_CENTERING_ASSIST_STATE should not use this state. The framework + * can use this field to remain backwards compatible if LaneCenteringAssistState is + * extended to include additional states. + */ + OTHER = 0, + /** + * LCA is enabled but the ADAS system has not received an activation signal from the driver. + * Therefore, LCA is not steering the car and waits for the driver to send a + * LaneCenteringAssistCommand#ACTIVATE command. + */ + ENABLED = 1, + /** + * LCA is enabled and the driver has sent an activation command to the LCA system, but the + * system has not started actively steering the vehicle. This may happen when LCA needs time to + * detect valid lane lines. The activation command can be sent through the + * VehicleProperty#LANE_CENTERING_ASSIST_COMMAND vehicle property or through a system external + * to Android. Once LCA is actively steering the vehicle, the state must be updated to + * ACTIVATED. If the feature is not able to activate, then the cause can be communicated through + * the ErrorState values and then return to the ENABLED state. + */ + ACTIVATION_REQUESTED = 2, + /** + * LCA is enabled and actively steering the car to keep it centered in its lane. + */ + ACTIVATED = 3, + /** + * Many LCA implementations allow the driver to override LCA. This means that the car has + * determined it should go a certain direction to keep the car centered in the lane, but a user + * decides to take over and do something else. This is often done for safety reasons and to + * ensure that the driver can always take control of the vehicle. This state should be set when + * the user is actively overriding the LCA system. + */ + USER_OVERRIDE = 4, + /** + * When LCA is in the ACTIVATED state but it will potentially need to deactivate because of + * external conditions (e.g. roads curvature is too extreme, the driver does not have their + * hands on the steering wheel for a long period of time, or the driver is not paying + * attention), then the ADAS system will notify the driver of a potential need to deactivate and + * give control back to the driver. + */ + FORCED_DEACTIVATION_WARNING = 5, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl new file mode 100644 index 0000000000..c12c5765ad --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneDepartureWarningState.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Lane Departure Warning (LDW). + */ +@VintfStability +@Backing(type="int") +enum LaneDepartureWarningState { + + /** + * This state is used as an alternative for any LaneDepartureWarningState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#LANE_DEPARTURE_WARNING_STATE should not use this state. The framework + * can use this field to remain backwards compatible if LaneDepartureWarningState is + * extended to include additional states. + */ + OTHER = 0, + /** + * LDW is enabled and monitoring, but the vehicle is centered in the lane. + */ + NO_WARNING = 1, + /** + * LDW is enabled, detects the vehicle is approaching or crossing lane lines on the left side + * of the vehicle, and is currently warning the user. + */ + WARNING_LEFT = 2, + /** + * LDW is enabled, detects the vehicle is approaching or crossing lane lines on the right side + * of the vehicle, and is currently warning the user. + */ + WARNING_RIGHT = 3, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl new file mode 100644 index 0000000000..c1c15a0e93 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LaneKeepAssistState.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Lane Keep Assist (LKA). + */ +@VintfStability +@Backing(type="int") +enum LaneKeepAssistState { + + /** + * This state is used as an alternative for any LaneKeepAssistState value that is not defined in + * the platform. Ideally, implementations of VehicleProperty#LANE_KEEP_ASSIST_STATE should not + * use this state. The framework can use this field to remain backwards compatible if + * LaneKeepAssistState is extended to include additional states. + */ + OTHER = 0, + /** + * LKA is enabled and monitoring, but steering assist is not activated. + */ + ENABLED = 1, + /** + * LKA is enabled and currently has steering assist applied for the vehicle. Steering assist is + * steering toward the left direction, which generally means the steering wheel turns counter + * clockwise. This is usually in response to the vehicle drifting to the right. Once steering + * assist is completed, LKA must return to the ENABLED state. + */ + ACTIVATED_STEER_LEFT = 2, + /** + * LKA is enabled and currently has steering assist applied for the vehicle. Steering assist is + * steering toward the right direction, which generally means the steering wheel turns + * clockwise. This is usually in response to the vehicle drifting to the left. Once steering + * assist is completed, LKA must return to the ENABLED state. + */ + ACTIVATED_STEER_RIGHT = 3, + /** + * Many LKA implementations allow the driver to override LKA. This means that the car has + * determined it should take some action, but a user decides to take over and do something else. + * This is often done for safety reasons and to ensure that the driver can always take control + * of the vehicle. This state should be set when the user is actively overriding the LKA system. + */ + USER_OVERRIDE = 4, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl new file mode 100644 index 0000000000..e06df40c90 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by LOCATION_CHARACTERIZATION to enumerate the supported bit flags. + * + * These flags are used to indicate to what transformations are performed on the + * GNSS data before the location data is sent, so that location processing + * algorithms can take into account prior fusion. + * + * This enum can be extended in future releases to include additional bit flags. + */ +@VintfStability +@Backing(type="int") +enum LocationCharacterization { + /** + * Prior location samples have been used to refine the raw GNSS data (e.g. a + * Kalman Filter). + */ + PRIOR_LOCATIONS = 0x1, + /** + * Gyroscope data has been used to refine the raw GNSS data. + */ + GYROSCOPE_FUSION = 0x2, + /** + * Accelerometer data has been used to refine the raw GNSS data. + */ + ACCELEROMETER_FUSION = 0x4, + /** + * Compass data has been used to refine the raw GNSS data. + */ + COMPASS_FUSION = 0x8, + /** + * Wheel speed has been used to refine the raw GNSS data. + */ + WHEEL_SPEED_FUSION = 0x10, + /** + * Steering angle has been used to refine the raw GNSS data. + */ + STEERING_ANGLE_FUSION = 0x20, + /** + * Car speed has been used to refine the raw GNSS data. + */ + CAR_SPEED_FUSION = 0x40, + /** + * Some effort is made to dead-reckon location. In particular, this means that + * relative changes in location have meaning when no GNSS satellite is + * available. + */ + DEAD_RECKONED = 0x80, + /** + * Location is based on GNSS satellite signals without sufficient fusion of + * other sensors for complete dead reckoning. This flag should be set when + * relative changes to location cannot be relied on when no GNSS satellite is + * available. + */ + RAW_GNSS_ONLY = 0x100, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2FuelType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/PortLocationType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/PortLocationType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RemoveUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RemoveUserRequest.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RotaryInputType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/RotaryInputType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserRequest.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserResponse.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserStatus.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/SwitchUserStatus.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/TrailerState.aidl new file mode 100644 index 0000000000..ef653746c2 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/TrailerState.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current state of VehicleProperty#TRAILER_PRESENT. + */ +@VintfStability +@Backing(type="int") +enum TrailerState { + /** + * This state is used as an alternative for any TrailerState value that is not defined in the + * platform. Ideally, implementations of VehicleProperty#TRAILER_PRESENT should not use this + * state. The framework can use this field to remain backwards compatible if TrailerState is + * extended to include additional states. + */ + UNKNOWN = 0, + /** + * A trailer is not attached to the vehicle. + */ + NOT_PRESENT = 1, + /** + * A trailer is attached to the vehicle. + */ + PRESENT = 2, + /** + * The state of the trailer is not available due to an error. + */ + ERROR = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserInfo.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UserInfo.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UsersInfo.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/UsersInfo.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl new file mode 100644 index 0000000000..e325b380b7 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Vehicle AP power bootup reason. + */ +@VintfStability +@Backing(type="int") +enum VehicleApPowerBootupReason { + /** + * Power on due to user's pressing of power key or rotating of ignition + * switch. + */ + USER_POWER_ON = 0, + /** + * Automatic power on triggered by door unlock or any other kind of automatic + * user detection. + */ + SYSTEM_USER_DETECTION = 1, + /** + * Automatic power on to execute a remote task. This is triggered by + * receiving a wakeup message from TCU wakeup client. + */ + SYSTEM_REMOTE_ACCESS = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl new file mode 100644 index 0000000000..6f7f78386a --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 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; + +/** + * List of different supported area types for vehicle properties. + * Used to construct property IDs in the VehicleProperty enum. + * + * Some properties may be associated with particular areas in the vehicle. For example, + * VehicleProperty#DOOR_LOCK property must be associated with a particular door, thus this property + * must be of the VehicleArea#DOOR area type. + * + * Other properties may not be associated with a particular area in the vehicle. These kinds of + * properties must be of the VehicleArea#GLOBAL area type. + * + * Note: This is not the same as areaId used in VehicleAreaConfig. E.g. for a global property, the + * property ID is of the VehicleArea#GLOBAL area type, however, the area ID must be 0. + */ +@VintfStability +@Backing(type="int") +// A better name would be VehicleAreaType +enum VehicleArea { + /** + * A global property is a property that applies to the entire vehicle and is not associated with + * a specific area. For example, FUEL_LEVEL, HVAC_STEERING_WHEEL_HEAT are global properties. + */ + GLOBAL = 0x01000000, + /** WINDOW maps to enum VehicleAreaWindow */ + WINDOW = 0x03000000, + /** MIRROR maps to enum VehicleAreaMirror */ + MIRROR = 0x04000000, + /** SEAT maps to enum VehicleAreaSeat */ + SEAT = 0x05000000, + /** DOOR maps to enum VehicleAreaDoor */ + DOOR = 0x06000000, + /** WHEEL maps to enum VehicleAreaWheel */ + WHEEL = 0x07000000, + + MASK = 0x0f000000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleDisplay.aidl similarity index 57% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleDisplay.aidl index dab03496cb..6642eee501 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleDisplay.aidl @@ -18,18 +18,26 @@ package android.hardware.automotive.vehicle; @VintfStability @Backing(type="int") -enum VehicleArea { - GLOBAL = 0x01000000, - /** WINDOW maps to enum VehicleAreaWindow */ - WINDOW = 0x03000000, - /** MIRROR maps to enum VehicleAreaMirror */ - MIRROR = 0x04000000, - /** SEAT maps to enum VehicleAreaSeat */ - SEAT = 0x05000000, - /** DOOR maps to enum VehicleAreaDoor */ - DOOR = 0x06000000, - /** WHEEL maps to enum VehicleAreaWheel */ - WHEEL = 0x07000000, +enum VehicleDisplay { + /** + * The primary Android display (for example, center console) + */ + MAIN = 0, + /** + * Instrument cluster display. This may exist only for driver + */ + INSTRUMENT_CLUSTER = 1, - MASK = 0x0f000000, + /** + * Head Up Display. This may exist only for driver + */ + HUD = 2, + /** + * Dedicated display for showing IME for {@code MAIN} + */ + INPUT = 3, + /** + * Auxiliary display which can provide additional screen for {@code MAIN} display + */ + AUXILIARY = 4, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleGear.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleGear.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl similarity index 92% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl index fa5d711ef3..f5b77dea10 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl @@ -29,6 +29,9 @@ enum VehicleHvacFanDirection { * FACE_AND_FLOOR = FACE | FLOOR */ FACE_AND_FLOOR = 0x3, + /** + * DEFROST may also be described as the windshield fan direction. + */ DEFROST = 0x4, /** * DEFROST_AND_FLOOR = DEFROST | FLOOR diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl new file mode 100644 index 0000000000..5313a55b12 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionButtonStateFlag.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * See {@code android.view.MotionEvent#getButtonState()} for more details. + */ +@VintfStability +@Backing(type="int") +enum VehicleHwMotionButtonStateFlag { + /** + * Button state primary + */ + BUTTON_PRIMARY = 0x0001, + /** + * Button state secondary + */ + BUTTON_SECONDARY = 0x0002, + /** + * Button state tertiary + */ + BUTTON_TERTIARY = 0x0004, + /** + * Button state back + */ + BUTTON_BACK = 0x0008, + /** + * Button state forward + */ + BUTTON_FORWARD = 0x0010, + /** + * Button state stylus primary + */ + BUTTON_STYLUS_PRIMARY = 0x0020, + /** + * Button state stylus secondary + */ + BUTTON_STYLUS_SECONDARY = 0x0040, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl new file mode 100644 index 0000000000..d80119a1b9 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputAction.aidl @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * See {@code android.view.MotionEvent#ACTION_*} fields for more details. + */ +@VintfStability +@Backing(type="int") +enum VehicleHwMotionInputAction { + /** + * Motion down + */ + ACTION_DOWN = 0, + /** + * Motion up + */ + ACTION_UP = 1, + /** + * Motion move + */ + ACTION_MOVE = 2, + /** + * Motion cancel + */ + ACTION_CANCEL = 3, + /** + * Motion outside + */ + ACTION_OUTSIDE = 4, + /** + * Motion pointer down + */ + ACTION_POINTER_DOWN = 5, + /** + * Motion pointer up + */ + ACTION_POINTER_UP = 6, + /** + * Motion hover move + */ + ACTION_HOVER_MOVE = 7, + /** + * Motion scroll + */ + ACTION_SCROLL = 8, + /** + * Motion hover enter + */ + ACTION_HOVER_ENTER = 9, + /** + * Motion hover exit + */ + ACTION_HOVER_EXIT = 10, + /** + * Motion button press + */ + ACTION_BUTTON_PRESS = 11, + /** + * Motion button release + */ + ACTION_BUTTON_RELEASE = 12, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl new file mode 100644 index 0000000000..fb799838d4 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionInputSource.aidl @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * See {@code android.view.InputDevice#SOURCE_*} for more details. + */ +@VintfStability +@Backing(type="int") +enum VehicleHwMotionInputSource { + /** + * Unknown source + */ + SOURCE_UNKNOWN = 0, + /** + * Source keyboard + */ + SOURCE_KEYBOARD = 1, + /** + * Source dpad + */ + SOURCE_DPAD = 2, + /** + * Source game pad + */ + SOURCE_GAMEPAD = 3, + /** + * Source touch screen + */ + SOURCE_TOUCHSCREEN = 4, + /** + * Source mouse + */ + SOURCE_MOUSE = 5, + /** + * Source stylus + */ + SOURCE_STYLUS = 6, + /** + * Source bluetooth stylus + */ + SOURCE_BLUETOOTH_STYLUS = 7, + /** + * Source trackball + */ + SOURCE_TRACKBALL = 8, + /** + * Source mouse relative + */ + SOURCE_MOUSE_RELATIVE = 9, + /** + * Source touchpad + */ + SOURCE_TOUCHPAD = 10, + /** + * Source touch navigation + */ + SOURCE_TOUCH_NAVIGATION = 11, + /** + * Source rotary encoder + */ + SOURCE_ROTARY_ENCODER = 12, + /** + * Source joystick + */ + SOURCE_JOYSTICK = 13, + /** + * Source hdmi + */ + SOURCE_HDMI = 14, + /** + * Source sensor + */ + SOURCE_SENSOR = 15, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl new file mode 100644 index 0000000000..08c9aed606 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleHwMotionToolType.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 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; + +/** + * See {@code android.view.MotionEvent#TOOL_TYPE_*} for more details. + */ +@VintfStability +@Backing(type="int") +enum VehicleHwMotionToolType { + /** + * Unknown type such as for a trackballl or other non-pointing device + */ + TOOL_TYPE_UNKNOWN = 0, + /** + * Finger type + */ + TOOL_TYPE_FINGER = 1, + /** + * Stylus type + */ + TOOL_TYPE_STYLUS = 2, + /** + * Mouse type + */ + TOOL_TYPE_MOUSE = 3, + /** + * Eraser type + */ + TOOL_TYPE_ERASER = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightState.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightState.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleOilLevel.aidl new file mode 100644 index 0000000000..3c722bad8e --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleOilLevel.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current level of VehicleProperty#ENGINE_OIL_LEVEL. + */ +@VintfStability +@Backing(type="int") +enum VehicleOilLevel { + /** + * The oil level of the engine is critically low, so the vehicle may be unsafe to drive. + */ + CRITICALLY_LOW = 0, + /** + * The oil level of the engine is low and needs to be replaced. + */ + LOW = 1, + /** + * The oil level of the engine is normal for the vehicle. + */ + NORMAL = 2, + /** + * The oil level of the engine is high, so the vehicle may be unsafe to drive. + */ + HIGH = 3, + /** + * This value represents an error when retrieving the oil level of the engine. + */ + ERROR = 4, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl new file mode 100644 index 0000000000..d9c6de7ef9 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -0,0 +1,4962 @@ +/* + * Copyright (C) 2021 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.VehicleArea; +import android.hardware.automotive.vehicle.VehiclePropertyGroup; +import android.hardware.automotive.vehicle.VehiclePropertyType; +/** + * Declares all vehicle properties. VehicleProperty has a bitwise structure. + * Each property must have: + * - a unique id from range 0x0100 - 0xffff + * - associated data type using VehiclePropertyType + * - property group (VehiclePropertyGroup) + * - vehicle area (VehicleArea) + * + * Vendors are allowed to extend this enum with their own properties. In this + * case they must use VehiclePropertyGroup:VENDOR flag when the property is + * declared. + * + * When a property's status field is not set to AVAILABLE: + * - IVehicle#set may return StatusCode::NOT_AVAILABLE. + * - IVehicle#get is not guaranteed to work. + * + * Properties set to values out of range must be ignored and no action taken + * in response to such ill formed requests. + */ +@VintfStability +@Backing(type="int") +enum VehicleProperty { + /** + * Undefined property. + * + * This property must never be used/supported. + */ + INVALID = 0x00000000, + /** + * VIN of vehicle + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + INFO_VIN = 0x0100 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Manufacturer of vehicle + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + INFO_MAKE = 0x0101 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Model of vehicle + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + INFO_MODEL = 0x0102 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Model year of vehicle. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:YEAR + */ + INFO_MODEL_YEAR = 0x0103 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fuel capacity of the vehicle in milliliters + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLILITER + */ + INFO_FUEL_CAPACITY = 0x0104 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * List of fuels the vehicle may use. + * + * FuelType::FUEL_TYPE_ELECTRIC must only be included if the vehicle is plug in rechargeable. + * For example: + * An FHEV (Fully Hybrid Electric Vehicle) must not include FuelType::FUEL_TYPE_ELECTRIC in + * INFO_FUEL_TYPE's INT32_VEC value. So INFO_FUEL_TYPE can be populated as such: + * int32Values = { FuelType::FUEL_TYPE_UNLEADED } + * On the other hand, a PHEV (Partially Hybrid Electric Vehicle) is plug in rechargeable, and + * hence should include FuelType::FUEL_TYPE_ELECTRIC in INFO_FUEL_TYPE's INT32_VEC value. So + * INFO_FUEL_TYPE can be populated as such: + * int32Values = { FuelType::FUEL_TYPE_UNLEADED, FuelType::FUEL_TYPE_ELECTRIC } + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @data_enum FuelType + */ + INFO_FUEL_TYPE = 0x0105 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Nominal battery capacity for EV or hybrid vehicle + * + * Returns the nominal battery capacity, if EV or hybrid. This is the battery capacity when the + * vehicle is new. This value might be different from EV_CURRENT_BATTERY_CAPACITY because + * EV_CURRENT_BATTERY_CAPACITY returns the real-time battery capacity taking into account + * factors such as battery aging and temperature dependency. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:WH + */ + INFO_EV_BATTERY_CAPACITY = 0x0106 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * List of connectors this EV may use + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @data_enum EvConnectorType + * @access VehiclePropertyAccess.READ + */ + INFO_EV_CONNECTOR_TYPE = 0x0107 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Fuel door location + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @data_enum PortLocationType + * @access VehiclePropertyAccess.READ + */ + INFO_FUEL_DOOR_LOCATION = 0x0108 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * EV port location + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @data_enum PortLocationType + */ + INFO_EV_PORT_LOCATION = 0x0109 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Driver's seat location + * VHAL implementations must ignore the areaId. Use VehicleArea:GLOBAL. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @data_enum VehicleAreaSeat + * @access VehiclePropertyAccess.READ + */ + INFO_DRIVER_SEAT = 0x010A + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Exterior dimensions of vehicle. + * + * int32Values[0] = height + * int32Values[1] = length + * int32Values[2] = width + * int32Values[3] = width including mirrors + * int32Values[4] = wheel base + * int32Values[5] = track width front + * int32Values[6] = track width rear + * int32Values[7] = curb to curb turning radius + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLIMETER + */ + INFO_EXTERIOR_DIMENSIONS = 0x010B + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Multiple EV port locations + * + * Implement this property if the vehicle has multiple EV ports. + * Port locations are defined in PortLocationType. + * For example, a car has one port in front left and one port in rear left: + * int32Values[0] = PortLocationType::FRONT_LEFT + * int32Values[0] = PortLocationType::REAR_LEFT + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @data_enum PortLocationType + */ + INFO_MULTI_EV_PORT_LOCATIONS = 0x010C + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Current odometer value of the vehicle + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:KILOMETER + */ + PERF_ODOMETER = 0x0204 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Speed of the vehicle + * + * The value must be positive when the vehicle is moving forward and negative when + * the vehicle is moving backward. This value is independent of gear value + * (CURRENT_GEAR or GEAR_SELECTION), for example, if GEAR_SELECTION is GEAR_NEUTRAL, + * PERF_VEHICLE_SPEED is positive when the vehicle is moving forward, negative when moving + * backward, and zero when not moving. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:METER_PER_SEC + */ + PERF_VEHICLE_SPEED = 0x0207 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Speed of the vehicle for displays + * + * Some cars display a slightly slower speed than the actual speed. This is + * usually displayed on the speedometer. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:METER_PER_SEC + */ + PERF_VEHICLE_SPEED_DISPLAY = 0x0208 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Front bicycle model steering angle for vehicle + * + * Angle is in degrees. Left is negative. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:DEGREES + */ + PERF_STEERING_ANGLE = 0x0209 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Rear bicycle model steering angle for vehicle + * + * Angle is in degrees. Left is negative. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:DEGREES + */ + PERF_REAR_STEERING_ANGLE = 0x0210 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Temperature of engine coolant + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:CELSIUS + */ + ENGINE_COOLANT_TEMP = 0x0301 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Engine oil level + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleOilLevel + */ + ENGINE_OIL_LEVEL = 0x0303 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Temperature of engine oil + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:CELSIUS + */ + ENGINE_OIL_TEMP = 0x0304 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Engine rpm + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:RPM + */ + ENGINE_RPM = 0x0305 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Reports wheel ticks + * + * The first element in the vector is a reset count. A reset indicates + * previous tick counts are not comparable with this and future ones. Some + * sort of discontinuity in tick counting has occurred. + * + * The next four elements represent ticks for individual wheels in the + * following order: front left, front right, rear right, rear left. All + * tick counts are cumulative. Tick counts increment when the vehicle + * moves forward, and decrement when vehicles moves in reverse. The ticks + * should be reset to 0 when the vehicle is started by the user. + * + * int64Values[0] = reset count + * int64Values[1] = front left ticks + * int64Values[2] = front right ticks + * int64Values[3] = rear right ticks + * int64Values[4] = rear left ticks + * + * configArray is used to indicate the micrometers-per-wheel-tick value and + * which wheels are supported. configArray is set as follows: + * + * configArray[0], bits [0:3] = supported wheels. Uses enum Wheel. For example, if all wheels + * are supported, then configArray[0] = VehicleAreaWheel::LEFT_FRONT + * | VehicleAreaWheel::RIGHT_FRONT | VehicleAreaWheel::LEFT_REAR + * | VehicleAreaWheel::RIGHT_REAR + * configArray[1] = micrometers per front left wheel tick + * configArray[2] = micrometers per front right wheel tick + * configArray[3] = micrometers per rear right wheel tick + * configArray[4] = micrometers per rear left wheel tick + * + * NOTE: If a wheel is not supported, its value shall always be set to 0. + * + * VehiclePropValue.timestamp must be correctly filled in. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + */ + WHEEL_TICK = 0x0306 + 0x10000000 + 0x01000000 + + 0x00510000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64_VEC + /** + * Fuel remaining in the vehicle, in milliliters + * + * Value may not exceed INFO_FUEL_CAPACITY + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLILITER + */ + FUEL_LEVEL = 0x0307 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Fuel door open + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + FUEL_DOOR_OPEN = 0x0308 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Battery level for EV or hybrid vehicle + * + * Returns the current battery level, if EV or hybrid. This value will not exceed + * EV_CURRENT_BATTERY_CAPACITY. To calculate the battery percentage, use: + * (EV_BATTERY_LEVEL/EV_CURRENT_BATTERY_CAPACITY)*100. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:WH + */ + EV_BATTERY_LEVEL = 0x0309 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Current battery capacity for EV or hybrid vehicle + * + * Returns the actual value of battery capacity, if EV or hybrid. This property captures the + * real-time battery capacity taking into account factors such as battery aging and temperature + * dependency. Therefore, this value might be different from INFO_EV_BATTERY_CAPACITY because + * INFO_EV_BATTERY_CAPACITY returns the nominal battery capacity from when the vehicle was new. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:WH + */ + EV_CURRENT_BATTERY_CAPACITY = + 0x030D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT, + /** + * EV charge port open + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + EV_CHARGE_PORT_OPEN = 0x030A + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * EV charge port connected + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + EV_CHARGE_PORT_CONNECTED = 0x030B + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * EV instantaneous charge rate in milliwatts + * + * Positive value indicates battery is being charged. + * Negative value indicates battery being discharged. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MW + */ + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 0x030C + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Range remaining + * + * Meters remaining of fuel and charge. Range remaining shall account for + * all energy sources in a vehicle. For example, a hybrid car's range will + * be the sum of the ranges based on fuel and battery. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE because a navigation app could + * update the range if it has a more accurate estimate based on the upcoming route. However, + * this property can be implemented as VehiclePropertyAccess.READ only at the OEM's discretion. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ_WRITE + * @unit VehicleUnit:METER + */ + RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Tire pressure + * + * Each tires is identified by its areaConfig.areaId config and their + * minFloatValue/maxFloatValue are used to store OEM recommended pressure + * range. The minFloatValue and maxFloatValue in VehicleAreaConfig must be defined. + * The minFloatValue in the areaConfig data represents the lower bound of + * the recommended tire pressure. + * The maxFloatValue in the areaConfig data represents the upper bound of + * the recommended tire pressure. + * For example: + * The following areaConfig indicates the recommended tire pressure + * of left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL. + * .areaConfigs = { + * VehicleAreaConfig { + * .areaId = VehicleAreaWheel::LEFT_FRONT, + * .minFloatValue = 200.0, + * .maxFloatValue = 240.0, + * } + * }, + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:KILOPASCAL + */ + TIRE_PRESSURE = 0x0309 + 0x10000000 + 0x07000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT + /** + * Critically low tire pressure + * + * This property indicates the critically low pressure threshold for each tire. + * It indicates when it is time for tires to be replaced or fixed. The value + * must be less than or equal to minFloatValue in TIRE_PRESSURE. + * Minimum and maximum property values (that is, minFloatValue, maxFloatValue) + * are not applicable to this property. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:KILOPASCAL + */ + CRITICALLY_LOW_TIRE_PRESSURE = 0x030A + 0x10000000 + 0x07000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT + /** + * Represents feature for engine idle automatic stop. + * + * If true, the vehicle may automatically shut off the engine when it is not needed and then + * automatically restart it when needed. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + ENGINE_IDLE_AUTO_STOP_ENABLED = + 0x0320 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Currently selected gear + * + * This is the gear selected by the user. + * + * Values in the config data must represent the list of supported gears for this vehicle. For + * example, config data for an automatic transmission must contain {GEAR_NEUTRAL, GEAR_REVERSE, + * GEAR_PARK, GEAR_DRIVE, GEAR_1, GEAR_2,...} and for manual transmission the list must be + * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...} + * + * In the case of an automatic transmission vehicle that allows the driver to select specific + * gears on demand (i.e. "manual mode"), GEAR_SELECTION's value must be set to the specific gear + * selected by the driver instead of simply GEAR_DRIVE. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleGear + */ + GEAR_SELECTION = 0x0400 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Current gear. In non-manual case, selected gear may not + * match the current gear. For example, if the selected gear is GEAR_DRIVE, + * the current gear will be one of GEAR_1, GEAR_2 etc, which reflects + * the actual gear the transmission is currently running in. + * + * Values in the config data must represent the list of supported gears + * for this vehicle. For example, config data for an automatic transmission + * must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...} + * and for manual transmission the list must be + * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the + * same as that of the supported gears reported in GEAR_SELECTION. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleGear + */ + CURRENT_GEAR = 0x0401 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Parking brake state. + * + * This property is true indicates that the car's parking brake is currently engaged. False + * implies that the car's parking brake is currently disengaged. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + PARKING_BRAKE_ON = 0x0402 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Auto-apply parking brake. + * + * This property is true indicates that the car's automatic parking brake feature is currently + * enabled. False indicates that the car's automatic parking brake feature is currently + * disabled. + * + * This property is often confused with PARKING_BRAKE_ON. The difference is that + * PARKING_BRAKE_ON describes whether the actual parking brake is currently on/off, whereas + * PARKING_BRAKE_AUTO_APPLY describes whether the feature of automatic parking brake is enabled/ + * disabled, and does not describe the current state of the actual parking brake. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + PARKING_BRAKE_AUTO_APPLY = 0x0403 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Regenerative braking level of a electronic vehicle + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between + * minInt32Value and maxInt32Value must be supported. The minInt32Value must be 0. + * + * The maxInt32Value indicates the maximum amount of energy regenerated from braking. The + * minInt32Value indicates no regenerative braking. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + EV_BRAKE_REGENERATION_LEVEL = + 0x040C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Warning for fuel low level. + * + * This property corresponds to the low fuel warning on the dashboard. + * Once FUEL_LEVEL_LOW is set, it should not be cleared until more fuel is + * added to the vehicle. This property may take into account all fuel + * sources for a vehicle - for example: + * + * For a gas powered vehicle, this property is based soley on gas level. + * For a battery powered vehicle, this property is based solely on battery level. + * For a hybrid vehicle, this property may be based on the combination of gas and battery + * levels, at the OEM's discretion. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + FUEL_LEVEL_LOW = 0x0405 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Night mode + * + * True indicates that the night mode sensor has detected that the car cabin environment has + * low light. The platform could use this, for example, to enable appropriate UI for + * better viewing in dark or low light environments. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + NIGHT_MODE = 0x0407 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * State of the vehicles turn signals + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleTurnSignal + */ + TURN_SIGNAL_STATE = 0x0408 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Represents ignition state + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleIgnitionState + */ + IGNITION_STATE = 0x0409 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * ABS is active + * + * Set to true when ABS is active. Reset to false when ABS is off. This + * property may be intermittently set (pulsing) based on the real-time + * state of the ABS system. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + ABS_ACTIVE = 0x040A + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Traction Control is active + * + * Set to true when traction control (TC) is active. Reset to false when + * TC is off. This property may be intermittently set (pulsing) based on + * the real-time state of the TC system. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + TRACTION_CONTROL_ACTIVE = 0x040B + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Represents property for the current stopping mode of the vehicle. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of EvStoppingMode are supported. + * + * The EvStoppingMode enum may be extended to include more states in the future. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum EvStoppingMode + */ + EV_STOPPING_MODE = + 0x040D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * HVAC Properties + * + * Additional rules for mapping non-GLOBAL VehicleArea type HVAC properties + * to AreaIDs: + * - Every “area” for a specific VehicleArea type that is affected by the + * property, must be included in an area ID for that property. + * + * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three + * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two + * temperature control units -- driver side and passenger side. + * - A valid mapping set of AreaIDs for HVAC_TEMPERATURE_SET would be a + * two element array: + * - ROW_1_LEFT | ROW_2_LEFT + * - ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT + * - An alternative mapping for the same hardware configuration would be: + * - ROW_1_LEFT | ROW_2_CENTER | ROW_2_LEFT + * - ROW_1_RIGHT | ROW_2_RIGHT + * The temperature controllers are assigned to the seats which they + * "most influence", but every seat must be included exactly once. The + * assignment of the center rear seat to the left or right AreaID may seem + * arbitrary, but the inclusion of every seat in exactly one AreaID ensures + * that the seats in the car are all expressed and that a "reasonable" way + * to affect each seat is available. + * + * Example 2: A car has three seat rows with two seats in the front row (ROW_1_LEFT, + * ROW_1_RIGHT) and three seats in the second (ROW_2_LEFT, ROW_2_CENTER, + * ROW_2_RIGHT) and third rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). There + * are three temperature control units -- driver side, passenger side, and rear. + * - A reasonable way to map HVAC_TEMPERATURE_SET to AreaIDs is a three + * element array: + * - ROW_1_LEFT + * - ROW_1_RIGHT + * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT + * + * Example 3: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three + * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). Suppose the car + * supports HVAC_AUTO_ON for just the two front seats. + * - A valid mapping set of AreaIDs for HVAC_AUTO_ON would be: + * - ROW_1_LEFT | ROW_1_RIGHT + * - If HVAC_AUTO_ON had two separate control units for the driver side + * and passenger side, an alternative mapping would be: + * - ROW_1_LEFT + * - ROW_1_RIGHT + * + * + * Fan speed setting + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the lowest fan speed. + * The maxInt32Value indicates the highest fan speed. + * + * This property is not in any particular unit but in a specified range of relative speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Fan direction setting + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleHvacFanDirection + */ + HVAC_FAN_DIRECTION = 0x0501 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * HVAC current temperature. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:CELSIUS + */ + HVAC_TEMPERATURE_CURRENT = 0x0502 + 0x10000000 + 0x05000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT + /** + * HVAC, target temperature set. + * + * The configArray is used to indicate the valid values for HVAC in Fahrenheit and Celsius. + * Android might use it in the HVAC app UI. + * The configArray is set as follows: + * configArray[0] = [the lower bound of the supported temperature in Celsius] * 10. + * configArray[1] = [the upper bound of the supported temperature in Celsius] * 10. + * configArray[2] = [the increment in Celsius] * 10. + * configArray[3] = [the lower bound of the supported temperature in Fahrenheit] * 10. + * configArray[4] = [the upper bound of the supported temperature in Fahrenheit] * 10. + * configArray[5] = [the increment in Fahrenheit] * 10. + * For example, if the vehicle supports temperature values as: + * [16.0, 16.5, 17.0 ,..., 28.0] in Celsius + * [60.5, 61.5, 62.5 ,..., 85.5] in Fahrenheit. + * The configArray should be configArray = {160, 280, 5, 605, 825, 10}. + * + * If the vehicle supports HVAC_TEMPERATURE_VALUE_SUGGESTION, the application can use + * that property to get the suggested value before setting HVAC_TEMPERATURE_SET. Otherwise, + * the application may choose the value in HVAC_TEMPERATURE_SET configArray by itself. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @unit VehicleUnit:CELSIUS + */ + HVAC_TEMPERATURE_SET = 0x0503 + 0x10000000 + 0x05000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT + /** + * Fan-based defrost for designated window. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_DEFROSTER = 0x0504 + 0x10000000 + 0x03000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN + /** + * On/off AC for designated areaId + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @config_flags Supported areaIds + */ + HVAC_AC_ON = 0x0505 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * On/off max AC + * + * When MAX AC is on, the ECU may adjust the vent position, fan speed, + * temperature, etc as necessary to cool the vehicle as quickly as possible. + * Any parameters modified as a side effect of turning on/off the MAX AC + * parameter shall generate onPropertyEvent() callbacks to the VHAL. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_MAX_AC_ON = 0x0506 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * On/off max defrost + * + * When MAX DEFROST is on, the ECU may adjust the vent position, fan speed, + * temperature, etc as necessary to defrost the windows as quickly as + * possible. Any parameters modified as a side effect of turning on/off + * the MAX DEFROST parameter shall generate onPropertyEvent() callbacks to + * the VHAL. + * The AreaIDs for HVAC_MAX_DEFROST_ON indicate MAX DEFROST can be controlled + * in the area. + * For example: + * areaConfig.areaId = {ROW_1_LEFT | ROW_1_RIGHT} indicates HVAC_MAX_DEFROST_ON + * only can be controlled for the front rows. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_MAX_DEFROST_ON = 0x0507 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Recirculation on/off + * + * Controls the supply of exterior air to the cabin. Recirc “on” means the + * majority of the airflow into the cabin is originating in the cabin. + * Recirc “off” means the majority of the airflow into the cabin is coming + * from outside the car. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_RECIRC_ON = 0x0508 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Enable temperature coupling between areas. + * + * The AreaIDs for HVAC_DUAL_ON property shall contain a combination of + * HVAC_TEMPERATURE_SET AreaIDs that can be coupled together. If + * HVAC_TEMPERATURE_SET is mapped to AreaIDs [a_1, a_2, ..., a_n], and if + * HVAC_DUAL_ON can be enabled to couple a_i and a_j, then HVAC_DUAL_ON + * property must be mapped to [a_i | a_j]. Further, if a_k and a_l can also + * be coupled together separately then HVAC_DUAL_ON must be mapped to + * [a_i | a_j, a_k | a_l]. + * + * Example: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three + * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two + * temperature control units -- driver side and passenger side -- which can + * be optionally synchronized. This may be expressed in the AreaIDs this way: + * - HVAC_TEMPERATURE_SET->[ROW_1_LEFT | ROW_2_LEFT, ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT] + * - HVAC_DUAL_ON->[ROW_1_LEFT | ROW_2_LEFT | ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT] + * + * When the property is enabled, the ECU must synchronize the temperature + * for the affected areas. Any parameters modified as a side effect + * of turning on/off the DUAL_ON parameter shall generate + * onPropertyEvent() callbacks to the VHAL. In addition, if setting + * a temperature (i.e. driver's temperature) changes another temperature + * (i.e. front passenger's temperature), then the appropriate + * onPropertyEvent() callbacks must be generated. If a user changes a + * temperature that breaks the coupling (e.g. setting the passenger + * temperature independently) then the VHAL must send the appropriate + * onPropertyEvent() callbacks (i.e. HVAC_DUAL_ON = false, + * HVAC_TEMPERATURE_SET[AreaID] = xxx, etc). + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_DUAL_ON = 0x0509 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * On/off automatic climate control. + * + * If true, automatic climate control is on. If false, automatic climate control is off. + * + * If the vehicle does not support directly turning off automatic climate control, then OEMs + * should add logic in their VHAL implementation so that setting HVAC_AUTO_ON to false would + * change the necessary HVAC settings to indirectly turn off HVAC_AUTO_ON. Ideally, this should + * not be disruptive to the user, so OEMs should change back to the previous state any settings + * that were modified once automatic climate control is off. That way the only outcome should be + * that HVAC_AUTO_ON is off. If restoring the HVAC settings to its previous settings is not + * possible, then the OEM should choose the least disruptive change and implement that. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_AUTO_ON = 0x050A + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Seat heating/cooling + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the maximum seat temperature heating setting. + * The minInt32Value must be 0, unless the vehicle supports seat cooling as well. In this case, + * minInt32Value indicates the maximum seat temperature cooling setting. + * + * This property is not in any particular unit, but in a specified range of relative temperature + * settings. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_SEAT_TEMPERATURE = 0x050B + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Side Mirror Heat + * + * Increasing values denote higher heating levels for side mirrors. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value in the config data represents the maximum heating level. + * The minInt32Value in the config data MUST be zero and indicates no heating. + * + * This property is not in any particular unit but in a specified range of relative heating + * settings. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_SIDE_MIRROR_HEAT = 0x050C + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Steering Wheel Heating/Cooling + * + * Sets the amount of heating/cooling for the steering wheel. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the maximum steering wheel heating setting. + * The minInt32Value should be 0, unless the vehicle supports steering wheel cooling as well. In + * such a case, the minInt32Value indicates the maximum steering wheel cooling setting. + * + * This property is not in any particular unit but in a specified range of heating settings. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_STEERING_WHEEL_HEAT = 0x050D + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Temperature units for display + * + * Indicates whether the vehicle is displaying temperature to the user as + * Celsius or Fahrenheit. + * VehiclePropConfig.configArray is used to indicate the supported temperature display units. + * For example: configArray[0] = CELSIUS + * configArray[1] = FAHRENHEIT + * + * This parameter MAY be used for displaying any HVAC temperature in the system. + * Values must be one of VehicleUnit::CELSIUS or VehicleUnit::FAHRENHEIT + * Note that internally, all temperatures are represented in floating point Celsius. + * + * If updating HVAC_TEMPERATURE_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS + * properties, then their values must be updated and communicated to the AAOS framework as well. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleUnit + */ + HVAC_TEMPERATURE_DISPLAY_UNITS = 0x050E + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Actual fan speed + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + HVAC_ACTUAL_FAN_SPEED_RPM = 0x050F + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Represents global power state for HVAC. Setting this property to false + * MAY mark some properties that control individual HVAC features/subsystems + * to UNAVAILABLE state. Setting this property to true MAY mark some + * properties that control individual HVAC features/subsystems to AVAILABLE + * state (unless any/all of them are UNAVAILABLE on their own individual + * merits). + * + * [Definition] HvacPower_DependentProperties: Properties that need HVAC to be + * powered on in order to enable their functionality. For example, in some cars, + * in order to turn on the AC, HVAC must be powered on first. + * + * HvacPower_DependentProperties list must be set in the + * VehiclePropConfig.configArray. HvacPower_DependentProperties must only contain + * properties that are associated with VehicleArea:SEAT. Properties that are not + * associated with VehicleArea:SEAT, for example, HVAC_DEFROSTER, must never + * depend on HVAC_POWER_ON property and must never be part of + * HvacPower_DependentProperties list. + * + * AreaID mapping for HVAC_POWER_ON property must contain all AreaIDs that + * HvacPower_DependentProperties are mapped to. + * + * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three back + * seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). If the HVAC features (AC, + * Temperature etc.) throughout the car are dependent on a single HVAC power + * controller then HVAC_POWER_ON must be mapped to + * [ROW_1_LEFT | ROW_1_RIGHT | ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT]. + * + * Example 2: A car has two seats in the front row (ROW_1_LEFT, ROW_1_RIGHT) and + * three seats in the second (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT) and third + * rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). If the car has temperature + * controllers in the front row which can operate entirely independently of + * temperature controllers in the back of the vehicle, then HVAC_POWER_ON + * must be mapped to a two element array: + * - ROW_1_LEFT | ROW_1_RIGHT + * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Fan Positions Available + * + * This is a bit mask of fan positions available for the zone. Each + * available fan direction is denoted by a separate entry in the vector. A + * fan direction may have multiple bits from vehicle_hvac_fan_direction set. + * For instance, a typical car may have the following fan positions: + * - FAN_DIRECTION_FACE (0x1) + * - FAN_DIRECTION_FLOOR (0x2) + * - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) + * - FAN_DIRECTION_DEFROST (0x4) + * - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6) + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @data_enum VehicleHvacFanDirection + */ + HVAC_FAN_DIRECTION_AVAILABLE = 0x0511 + 0x10000000 + 0x05000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32_VEC + /** + * Automatic recirculation on/off + * + * When automatic recirculation is ON, the HVAC system may automatically + * switch to recirculation mode if the vehicle detects poor incoming air + * quality. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_AUTO_RECIRC_ON = 0x0512 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Seat ventilation + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value must be 0. + * The maxInt32Value indicates the maximum ventilation setting available for the seat. + * + * This property is not in any particular unit but in the specified range of ventilation + * settings. + * + * Used by HVAC apps and Assistant to enable, change, or read state of seat + * ventilation. This is different than seating cooling. It can be on at the + * same time as cooling, or not. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_SEAT_VENTILATION = 0x0513 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Electric defrosters' status + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_ELECTRIC_DEFROSTER_ON = 0x0514 + 0x10000000 + 0x03000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN + /** + * Suggested values for setting HVAC temperature. + * + * Implement the property to help applications understand the closest supported temperature + * value in Celsius or Fahrenheit. + * + * floatValues[0] = the requested value that an application wants to set a temperature to. + * floatValues[1] = the unit for floatValues[0]. It should be one of + * {VehicleUnit:CELSIUS, VehicleUnit:FAHRENHEIT}. + * floatValues[2] = the value OEMs suggested in CELSIUS. This value is not included + * in the request. + * floatValues[3] = the value OEMs suggested in FAHRENHEIT. This value is not included + * in the request. + * + * An application calls set(VehiclePropValue propValue) with the requested value and unit for + * the value. OEMs need to return the suggested values in floatValues[2] and floatValues[3] by + * onPropertyEvent() callbacks. + * + * For example, when a user uses the voice assistant to set HVAC temperature to 66.2 in + * Fahrenheit. + * First, an application will set this property with the value + * [66.2, (float)VehicleUnit:FAHRENHEIT,0,0]. + * If OEMs suggest to set 19.0 in Celsius or 66.5 in Fahrenheit for user's request, then VHAL + * must generate a callback with property value + * [66.2, (float)VehicleUnit:FAHRENHEIT, 19.0, 66.5]. After the voice assistant gets the + * callback, it will inform the user and set HVAC temperature to the suggested value. + * + * Another example, an application receives 21 Celsius as the current temperature value by + * querying HVC_TEMPERATURE_SET. But the application wants to know what value is displayed on + * the car's UI in Fahrenheit. + * For this, the application sets the property to [21, (float)VehicleUnit:CELSIUS, 0, 0]. If + * the suggested value by the OEM for 21 Celsius is 70 Fahrenheit, then VHAL must generate a + * callback with property value [21, (float)VehicleUnit:CELSIUS, 21.0, 70.0]. + * In this case, the application can know that the value is 70.0 Fahrenheit in the car’s UI. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HVAC_TEMPERATURE_VALUE_SUGGESTION = 0x0515 + 0x10000000 + 0x01000000 + + 0x00610000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT_VEC + /** + * Distance units for display + * + * Indicates which units the car is using to display distances to the user. Eg. Mile, Meter + * Kilometer. + * + * Distance units are defined in VehicleUnit. + * VehiclePropConfig.configArray is used to indicate the supported distance display units. + * For example: configArray[0] = METER + * configArray[1] = KILOMETER + * configArray[2] = MILE + * + * If updating DISTANCE_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS properties, + * then their values must be updated and communicated to the AAOS framework as well. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleUnit + */ + DISTANCE_DISPLAY_UNITS = 0x0600 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fuel volume units for display + * + * Indicates which units the car is using to display fuel volume to the user. Eg. Liter or + * Gallon. + * + * VehiclePropConfig.configArray is used to indicate the supported fuel volume display units. + * Volume units are defined in VehicleUnit. + * For example: configArray[0] = LITER + * configArray[1] = GALLON + * + * If updating FUEL_VOLUME_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS properties, + * then their values must be updated and communicated to the AAOS framework as well. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleUnit + */ + FUEL_VOLUME_DISPLAY_UNITS = 0x0601 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Tire pressure units for display + * + * Indicates which units the car is using to display tire pressure to the user. Eg. PSI, Bar or + * Kilopascal. + * + * VehiclePropConfig.configArray is used to indicate the supported pressure display units. + * Pressure units are defined in VehicleUnit. + * For example: configArray[0] = KILOPASCAL + * configArray[1] = PSI + * configArray[2] = BAR + * + * If updating TIRE_PRESSURE_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS + * properties, then their values must be updated and communicated to the AAOS framework as well. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleUnit + */ + TIRE_PRESSURE_DISPLAY_UNITS = 0x0602 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * EV battery units for display + * + * Indicates which units the car is using to display EV battery information to the user. Eg. + * watt-hours(Wh), kilowatt-hours(kWh) or ampere-hours(Ah). + * + * VehiclePropConfig.configArray is used to indicate the supported electrical energy units. + * Electrical energy units are defined in VehicleUnit. + * For example: configArray[0] = WATT_HOUR + * configArray[1] = AMPERE_HOURS + * configArray[2] = KILOWATT_HOUR + * + * If updating EV_BATTERY_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS properties, + * then their values must be updated and communicated to the AAOS framework as well. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleUnit + */ + EV_BATTERY_DISPLAY_UNITS = 0x0603 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fuel consumption units for display + * + * Indicates type of units the car is using to display fuel consumption information to user + * True indicates units are distance over volume such as MPG. + * False indicates units are volume over distance such as L/100KM. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 0x0604 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Speed units for display + * + * Indicates type of units the car is using to display speed to user. Eg. m/s, km/h, or mph. + * + * VehiclePropConfig.configArray is used to indicate the supported speed display units. + * Pressure units are defined in VehicleUnit. + * For example: configArray[0] = METER_PER_SEC + * configArray[1] = MILES_PER_HOUR + * configArray[2] = KILOMETERS_PER_HOUR + * + * If updating VEHICLE_SPEED_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS + * properties, then their values must be updated and communicated to the AAOS framework as well. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + VEHICLE_SPEED_DISPLAY_UNITS = 0x0605 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Current date and time suggestion for the Car, encoded as Epoch time + * (in milliseconds). This value denotes the number of milliseconds seconds + * that have elapsed since 1/1/1970 UTC. + * + * This property signals a change in CarTime to Android. If the property is supported, VHAL + * must report the most accurate current CarTime when this property is read, and publish a + * change to this property when the CarTime value has changed. An on-change event for this + * property must be published when CarTime changes for any reason other than the natural elapse + * of time (time delta smaller than 500ms should not trigger an on change event). Android will + * read and subscribe to this property to fetch time from VHAL. This can be useful to + * synchronize Android's time with other vehicle systems (dash clock etc). + * int64Values[0] = provided Epoch time (in milliseconds) + * + * Whenever a new Value for the property is received, AAOS will create + * and send an "ExternalTimeSuggestion" to the "TimeDetectorService". + * If other sources do not have a higher priority, Android will use this + * to set the system time. For information on how to adjust time source + * priorities and how time suggestions are handled (including how Android + * handles gitter, drift, and minimum resolution) see Time Detector Service + * documentation. + * + * Note that the property may take >0 ms to get propagated through the stack + * and, having a timestamped property helps reduce any time drift. So, + * for all reads to the property, the timestamp can be used to negate this + * drift: + * drift = elapsedTime - PropValue.timestamp + * effectiveTime = PropValue.value.int64Values[0] + drift + * + * It is strongly recommended that this property must not be used to retrieve + * time from ECUs using protocols (GNSS, NTP, Telephony etc). Since these + * protocols are already supported by Android, it is recommended to use + * Android’s own systems for them instead of wiring those through the VHAL + * using this property. + * + * WARNING: The value available through this property should not be dependent + * on value written by Android to ANDROID_EPOCH_TIME property in any way. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLI_SECS + */ + EXTERNAL_CAR_TIME = 0x0608 + 0x10000000 // VehiclePropertyGroup:SYSTEM + + 0x01000000 // VehicleArea:GLOBAL + + 0x00500000, // VehiclePropertyType:INT64 + /** + * Current date and time, encoded as Epoch time (in milliseconds). + * This value denotes the number of milliseconds seconds that have + * elapsed since 1/1/1970 UTC. + * + * CarServices will write to this value to give VHAL the Android system's + * time, if the VHAL supports this property. This can be useful to + * synchronize other vehicle systems (dash clock etc) with Android's time. + * + * AAOS writes to this property once during boot, and + * will thereafter write only when some time-source changes are propagated. + * AAOS will fill in VehiclePropValue.timestamp correctly. + * Note that AAOS will not send updates for natural elapse of time. + * int64Values[0] = provided Unix time (in milliseconds) + * + * Note that the property may take >0 ms to get propagated through the stack + * and, having a timestamped property helps reduce any time drift. So, + * for all writes to the property, the timestamp can be used to negate this + * drift: + * drift = elapsedTime - PropValue.timestamp + * effectiveTime = PropValue.value.int64Values[0] + drift + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + * @unit VehicleUnit:MILLI_SECS + */ + ANDROID_EPOCH_TIME = 0x0606 + 0x10000000 + 0x01000000 + + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 + /** + * External encryption binding seed. + * + * This value is mixed with the local key storage encryption key. + * This property holds 16 bytes, and is expected to be persisted on an ECU separate from + * the IVI. The property is initially set by AAOS, who generates it using a CSRNG. + * AAOS will then read the property on subsequent boots. The binding seed is expected to be + * reliably persisted. Any loss of the seed results in a factory reset of the IVI. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STORAGE_ENCRYPTION_BINDING_SEED = 0x0607 + 0x10000000 + 0x01000000 + + 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES + /** + * Outside temperature + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:CELSIUS + */ + ENV_OUTSIDE_TEMPERATURE = 0x0703 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Property to control power state of application processor + * + * It is assumed that AP's power state is controlled by a separate power + * controller. + * + * For configuration information, VehiclePropConfig.configArray must have bit flag combining + * values in VehicleApPowerStateConfigFlag. + * + * int32Values[0] : VehicleApPowerStateReq enum value + * int32Values[1] : additional parameter relevant for each state, + * 0 if not used. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + AP_POWER_STATE_REQ = 0x0A00 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to report power state of application processor + * + * It is assumed that AP's power state is controller by separate power + * controller. + * + * int32Values[0] : VehicleApPowerStateReport enum value + * int32Values[1] : Time in ms to wake up, if necessary. Otherwise 0. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + AP_POWER_STATE_REPORT = 0x0A01 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to report bootup reason for the current power on. This is a + * static property that will not change for the whole duration until power + * off. For example, even if user presses power on button after automatic + * power on with door unlock, bootup reason must stay with + * VehicleApPowerBootupReason#USER_UNLOCK. + * + * int32Values[0] must be VehicleApPowerBootupReason. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + AP_POWER_BOOTUP_REASON = 0x0A02 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Property to represent brightness of the display. + * + * Some cars have single control for the brightness of all displays and this + * property is to share change in that control. In cars which have displays + * whose brightness is controlled separately, they must use + * PER_DISPLAY_BRIGHTNESS. + * + * Only one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be + * implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by + * AAOS. + * + * If this is writable, android side can set this value when user changes + * display brightness from Settings. If this is read only, user may still + * change display brightness from Settings, but that must not be reflected + * to other displays. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + DISPLAY_BRIGHTNESS = 0x0A03 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Property to represent brightness of the displays which are controlled separately. + * + * Some cars have one or more displays whose brightness is controlled + * separately and this property is to inform the brightness of each + * passenger display. In cars where all displays' brightness is controlled + * together, they must use DISPLAY_BRIGHTNESS. + * + * Only one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be + * implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by + * AAOS. + * + * The display port uniquely identifies a physical connector on the device + * for display output, ranging from 0 to 255. + * + * int32Values[0] : display port + * int32Values[1] : brightness + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + PER_DISPLAY_BRIGHTNESS = 0x0A04 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to feed H/W input events to android + * + * int32Values[0] : action defined by VehicleHwKeyInputAction + * int32Values[1] : key code, must use standard android key code + * int32Values[2] : target display defined in VehicleDisplay. Events not + * tied to specific display must be sent to + * VehicleDisplay#MAIN. + * int32Values[3] : [optional] Number of ticks. The value must be equal or + * greater than 1. When omitted, Android will default to 1. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @config_flags + */ + HW_KEY_INPUT = 0x0A10 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to feed H/W input events to android + * + * int32array[0]: target display defined by VehicleDisplay like VehicleDisplay::MAIN, + * VehicleDisplay::INSTRUMENT_CLUSTER, VehicleDisplay::AUX + * int32array[1]: key code, must use standard android key code like KEYCODE_HOME, KEYCODE_BACK + * int32array[2]: action defined in VehicleHwKeyInputAction like + * VehicleHwKeyInputAction::ACTION_UP, VehicleHwKeyInputAction::ACTION_UP + * int32array[3]: repeat count of the event. For key down events, this is the repeat count + * with the first down starting at 0 and counting up from there. For key up + * events, this is always equal to 0 + * + * int64array[0]: down time, elapsed nanoseconds since boot. Denotes the time of the most + * recent key down event. For the down event, it will be the event time of the + * down event itself + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @config_flags + */ + HW_KEY_INPUT_V2 = + 0x0A11 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.MIXED, + /** + * Property to feed H/W input events to android + * + * int32array[0]: target display defined by VehicleDisplay like VehicleDisplay::MAIN, + * VehicleDisplay::INSTRUMENT_CLUSTER, VehicleDisplay::AUX + * int32array[1]: input type defined in VehicleHwMotionInputSource like + * VehicleHwMotionInputSource::SOURCE_KEYBOARD, + * VehicleHwMotionInputSource::SOURCE_DPAD + * int32array[2]: action code defined in VehicleHwMotionInputAction like + * VehicleHwMotionInputAction::ACTION_UP, VehicleHwMotionInputAction::ACTION_DOWN + * int32array[3]: button state flag defined in VehicleHwMotionButtonStateFlag like + * VehicleHwMotionButtonStateFlag::BUTTON_PRIMARY, + * VehicleHwMotionButtonStateFlag::BUTTON_SECONDARY + * int32array[4]: pointer events count, N. N must be a positive integer + * int32array[5:5+N-1]: pointer id, length N + * int32array[5+N:5+2*N-1] : tool type, length N. As defined in VehicleHwMotionToolType like + * VehicleHwMotionToolType::TOOL_TYPE_FINGER, + * VehicleHwMotionToolType::TOOL_TYPE_STYLUS + * + * floatArray[0:N-1] : x data, length N + * floatArray[N:2*N-1] : y data, length N + * floatArray[2*N:3*N-1] : pressure data, length N + * floatArray[3*N:4*N-1] : size data, length N + * + * int64array[0]: down time, elapsed nanoseconds since boot. Denotes the time when the user + * originally pressed down to start a stream of position events. For the down + * event, it will be the event time of the down event itself + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @config_flags + */ + HW_MOTION_INPUT = + 0x0A12 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.MIXED, + /** + * Property to feed H/W rotary events to android + * + * int32Values[0] : RotaryInputType identifying which rotary knob rotated + * int32Values[1] : number of detents (clicks), positive for clockwise, + * negative for counterclockwise + * int32Values[2] : target display defined in VehicleDisplay. Events not + * tied to specific display must be sent to + * VehicleDisplay#MAIN. + * int32values[3 .. 3 + abs(number of detents) - 2]: + * nanosecond deltas between pairs of consecutive detents, + * if the number of detents is > 1 or < -1 + * + * VehiclePropValue.timestamp: when the rotation occurred. If the number of + * detents is > 1 or < -1, this is when the + * first detent of rotation occurred. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @data_enum RotaryInputType + * @access VehiclePropertyAccess.READ + */ + HW_ROTARY_INPUT = 0x0A20 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Defines a custom OEM partner input event. + * + * This input event must be used by OEM partners who wish to propagate events not supported + * by Android. It is composed by an array of int32 values only. + * + * The Android properties are: + * + * int32Values[0] : Input code identifying the function representing this event. Valid event + * types are defined by CustomInputType.CUSTOM_EVENT_F1 up to + * CustomInputType.CUSTOM_EVENT_F10. They represent the custom event to be + * defined by OEM partners. + * int32Values[1] : target display type defined in VehicleDisplay. Events not tied to specific + * display must be sent to VehicleDisplay#MAIN. + * int32Values[2] : repeat counter, if 0 then event is not repeated. Values 1 or above means + * how many times this event repeated. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @data_enum CustomInputType + * @access VehiclePropertyAccess.READ + */ + HW_CUSTOM_INPUT = 0X0A30 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /*************************************************************************** + * Most Car Cabin properties have both a POSition and MOVE parameter. These + * are used to control the various movements for seats, doors, and windows + * in a vehicle. + * + * A POS parameter allows the user to set the absolution position. For + * instance, for a door, 0 indicates fully closed and max value indicates + * fully open. Thus, a value halfway between min and max must indicate + * the door is halfway open. + * + * A MOVE parameter moves the device in a particular direction. The sign + * indicates direction, and the magnitude indicates speed (if multiple + * speeds are available). For a door, a move of -1 will close the door, and + * a move of +1 will open it. Once a door reaches the limit of open/close, + * the door should automatically stop moving. The user must NOT need to + * send a MOVE(0) command to stop the door at the end of its range. + **************************************************************************/ + + /** + * Door position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the door is closed. The minInt32Value must be 0. + * The maxInt32Value indicates the door is fully open. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * closed and fully open positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * Some vehicles (minivans) can open the door electronically. Hence, the + * ability to write this property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + DOOR_POS = 0x0B00 + 0x10000000 + 0x06000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 + /** + * Door move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the door while opening. + * The minInt32Value represents the maximum movement speed of the door while closing. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the door reaches the positional limit, the value must reset to 0. If DOOR_MOVE's value is + * currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + DOOR_MOVE = 0x0B01 + 0x10000000 + 0x06000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 + /** + * Door lock + * + * 'true' indicates door is locked + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + DOOR_LOCK = 0x0B02 + 0x10000000 + 0x06000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:BOOLEAN + /** + * Door child lock feature enabled + * + * Returns true if the door child lock feature is enabled and false if it is disabled. + * + * If enabled, the door is unable to be opened from the inside. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + DOOR_CHILD_LOCK_ENABLED = + 0x0B03 + VehiclePropertyGroup.SYSTEM + VehicleArea.DOOR + VehiclePropertyType.BOOLEAN, + /** + * Mirror Z Position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the mirror is tilted completely downwards. This must be a + * non-positive value. + * The maxInt32Value indicates the mirror is tilted completely upwards. This must be a + * non-negative value. + * 0 indicates the mirror is not tilted in either direction. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * fully downward and fully upwards positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + MIRROR_Z_POS = 0x0B40 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Z Move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the mirror while tilting upwards. + * The minInt32Value represents the maximum movement speed of the mirror while tilting + * downwards. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the mirror reaches the positional limit, the value must reset to 0. If MIRROR_Z_MOVE's value + * is currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + MIRROR_Z_MOVE = 0x0B41 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Y Position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the mirror is tilted completely to the left. This must be a + * non-positive value. + * The maxInt32Value indicates the mirror is tilted completely to the right. This must be a + * non-negative value. + * 0 indicates the mirror is not tilted in either direction. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * left extreme and right extreme positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + MIRROR_Y_POS = 0x0B42 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Y Move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the mirror while tilting right. + * The minInt32Value represents the maximum movement speed of the mirror while tilting left. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the mirror reaches the positional limit, the value must reset to 0. If MIRROR_Y_MOVE's value + * is currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + MIRROR_Y_MOVE = 0x0B43 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Lock + * + * True indicates mirror positions are locked and not changeable + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + MIRROR_LOCK = 0x0B44 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Mirror Fold + * + * True indicates mirrors are folded + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + MIRROR_FOLD = 0x0B45 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + + /** + * Represents property for Mirror Auto Fold feature. + * + * This property is true when the feature for automatically folding the vehicle's side mirrors + * (for example, when the mirrors fold inward automatically when one exits and locks the + * vehicle) is enabled. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + + MIRROR_AUTO_FOLD_ENABLED = + 0x0B46 + VehiclePropertyGroup.SYSTEM + VehicleArea.MIRROR + VehiclePropertyType.BOOLEAN, + + /** + * Represents property for Mirror Auto Tilt feature. + * + * This property is true when the feature for automatically tilting the vehicle's side mirrors + * (for example, when the mirrors tilt downward automatically when one reverses the vehicle) is + * enabled. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + + MIRROR_AUTO_TILT_ENABLED = + 0x0B47 + VehiclePropertyGroup.SYSTEM + VehicleArea.MIRROR + VehiclePropertyType.BOOLEAN, + + /** + * Seat memory select + * + * This parameter selects the memory preset to use to select the seat position. The + * maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All integers between + * minInt32Value and maxInt32Value must be supported. The minInt32Value is always 0, and the + * maxInt32Value determines the number of seat preset memory slots available (i.e. + * numSeatPresets - 1). + * + * For instance, if the driver's seat has 3 memory presets, the maxInt32Value will be 2. When + * the user wants to select a preset, the desired preset number (0, 1, or 2) is set. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + SEAT_MEMORY_SELECT = 0x0B80 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat memory set + * + * This setting allows the user to save the current seat position settings into the selected + * preset slot. The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. The + * minInt32Value must be 0, and the maxInt32Value for each seat position must match the + * maxInt32Value for SEAT_MEMORY_SELECT. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + SEAT_MEMORY_SET = 0x0B81 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seatbelt buckled + * + * True indicates belt is buckled. + * + * Write access indicates automatic seat buckling capabilities. There are + * no known cars at this time, but you never know... + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BELT_BUCKLED = 0x0B82 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Seatbelt height position + * + * Adjusts the shoulder belt anchor point. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat belt's shoulder anchor is at its lowest position. + * The maxInt32Value indicates the seat belt's shoulder anchor is at its highest position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * lowest and highest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BELT_HEIGHT_POS = 0x0B83 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seatbelt height move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat belt's shoulder anchor + * while moving upwards. + * The minInt32Value represents the maximum movement speed of the seat belt's shoulder anchor + * while moving downwards. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat belt reaches the positional limit, the value must reset to 0. If + * SEAT_BELT_HEIGHT_MOVE's value is currently 0, then that means there is no movement currently + * occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BELT_HEIGHT_MOVE = 0x0B84 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat fore/aft position + * + * Sets the seat position forward and backwards. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat is at its rearward-most linear position. + * The maxInt32Value indicates the seat is at its forward-most linear position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * closest and farthest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_FORE_AFT_POS = 0x0B85 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat fore/aft move + * + * This property moves the entire seat forward/backward in the direction that it is facing. + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat while moving forward. + * The minInt32Value represents the maximum movement speed of the seat while moving backward. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat reaches the positional limit, the value must reset to 0. If SEAT_FORE_AFT_MOVE's + * value is currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_FORE_AFT_MOVE = 0x0B86 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 1 position + * + * Backrest angle 1 is the actuator closest to the bottom of the seat. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat backrest's full recline position w.r.t the + * actuator at the bottom of the seat. + * The maxInt32Value indicates the seat backrest's most upright/forward position w.r.t the + * actuator at the bottom of the seat. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * full recline and upright/forward positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BACKREST_ANGLE_1_POS = 0x0B87 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 1 move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat backrest while angling + * forward. + * The minInt32Value represents the maximum movement speed of the seat backrest while reclining. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat backrest reaches the positional limit, the value must reset to 0. If + * SEAT_BACKREST_ANGLE_1_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BACKREST_ANGLE_1_MOVE = 0x0B88 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 2 position + * + * Backrest angle 2 is the next actuator up from the bottom of the seat. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat backrest's full recline position w.r.t the next + * actuator in the backrest from the one at the bottom of the seat (see + * SEAT_BACKREST_ANGLE_1_POS for additional details). + * The maxInt32Value indicates the seat backrest's most upright/forward position w.r.t the + * next actuator in the backrest from the one at the bottom of the seat(see + * SEAT_BACKREST_ANGLE_1_POS for additional details). + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * full recline and upright/forward positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BACKREST_ANGLE_2_POS = 0x0B89 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 2 move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat backrest while angling + * forward. + * The minInt32Value represents the maximum movement speed of the seat backrest while reclining. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat backrest reaches the positional limit, the value must reset to 0. If + * SEAT_BACKREST_ANGLE_2_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_BACKREST_ANGLE_2_MOVE = 0x0B8A + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat height position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat is in its lowest position. + * The maxInt32Value indicates the seat is in its highest position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * lowest and highest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEIGHT_POS = 0x0B8B + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat height move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat while moving upward. + * The minInt32Value represents the maximum movement speed of the seat while moving downward. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat reaches the positional limit, the value must reset to 0. If SEAT_HEIGHT_MOVE's value + * is currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEIGHT_MOVE = 0x0B8C + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat depth position + * + * Sets the seat depth, distance from back rest to front edge of seat. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat is in its shallowest position (i.e. the position with + * the smallest distance between the front edge of the seat cushion and the rear end of the + * seat). + * The maxInt32Value indicates the seat is in its deepest position (i.e. the position with the + * largest distance between the front edge of the seat cushion and the rear end of the seat). + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * shallowest and deepest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_DEPTH_POS = 0x0B8D + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat depth move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat while getting deeper + * The minInt32Value represents the maximum movement speed of the seat while getting shallower. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat backrest reaches the positional limit, the value must reset to 0. If + * SEAT_DEPTH_MOVE's value is currently 0, then that means there is no movement currently + * occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_DEPTH_MOVE = 0x0B8E + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat tilt position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the seat bottom is angled at its lowest angular position. This + * corresponds to the seat's front edge at its lowest possible position relative to the rear + * end of the seat. + * The maxInt32Value indicates the seat bottom is angled at its highest angular position. This + * corresponds to the seat's front edge at its highest possible position relative to the rear + * end of the seat. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * lowest and highest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_TILT_POS = 0x0B8F + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat tilt move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the front edge of the seat while + * moving upward. + * The minInt32Value represents the maximum movement speed of the front edge of the seat while + * moving downward. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat bottom reaches the positional limit, the value must reset to 0. If SEAT_TILT_MOVE's + * value is currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_TILT_MOVE = 0x0B90 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumber fore/aft position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the lumbar support is in its rearward most position (i.e. least + * supportive position). + * The maxInt32Value indicates the lumbar support is in its forward most position (i.e. most + * supportive position). + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * forward and rearward positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_LUMBAR_FORE_AFT_POS = 0x0B91 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumbar fore/aft move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat's lumbar support while + * moving forward. + * The minInt32Value represents the maximum movement speed of the seat's lumbar support while + * moving backward. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat's lumbar support reaches the positional limit, the value must reset to 0. If + * SEAT_LUMBAR_FORE_AFT_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_LUMBAR_FORE_AFT_MOVE = 0x0B92 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumbar side support position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the lumbar side support is in its thinnest position (i.e. + * most support). + * The maxInt32Value indicates the lumbar side support is in its widest position (i.e. + * least support). + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * thinnest and widest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_LUMBAR_SIDE_SUPPORT_POS = 0x0B93 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumbar side support move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat's lumbar side support + * while getting wider. + * The minInt32Value represents the maximum movement speed of the seat's lumbar side support + * while getting thinner. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat's lumbar side support reaches the positional limit, the value must reset to 0. If + * SEAT_LUMBAR_SIDE_SUPPORT_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 0x0B94 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * (Deprecated) Headrest height position + * + * This property is deprecated because it is defined as type VehicleArea:GLOBAL, which means all + * seats use the same value. Use SEAT_HEADREST_HEIGHT_POS_V2 instead which fixes this issue by + * being defined as type VehicleArea:SEAT. + * + * Sets the headrest height. + * Max value indicates tallest setting. + * Min value indicates shortest setting. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_HEIGHT_POS = 0x0B95 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Headrest height position + * + * Sets the headrest height for supported seats. VehiclePropConfig.areaConfigs specifies which + * seats are supported. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the headrest is in its lowest position. + * The maxInt32Value indicates the headrest is in its highest position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * lowest and highest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_HEIGHT_POS_V2 = + 0x0BA4 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + + /** + * Headrest height move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat's headrest while moving + * up. + * The minInt32Value represents the maximum movement speed of the seat's headrest while moving + * down. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat's headrest reaches the positional limit, the value must reset to 0. If + * SEAT_HEADREST_HEIGHT_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_HEIGHT_MOVE = 0x0B96 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest angle position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the headrest is in its full recline position. + * The maxInt32Value indicates the headrest is in its most upright/forward position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * full recline and most upright/forward positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_ANGLE_POS = 0x0B97 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest angle move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat's headrest while moving + * into an upright/forward position. + * The minInt32Value represents the maximum movement speed of the seat's headrest while moving + * into a shallow position. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat's headrest reaches the positional limit, the value must reset to 0. If + * SEAT_HEADREST_ANGLE_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_ANGLE_MOVE = 0x0B98 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest fore/aft position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the headrest is in its rearward-most linear position. + * The maxInt32Value indicates the headrest is in its forward-most linear position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * forward and rearward positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_FORE_AFT_POS = 0x0B99 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest fore/aft move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat's headrest while moving + * forward. + * The minInt32Value represents the maximum movement speed of the seat's headrest while moving + * backward. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat's headrest reaches the positional limit, the value must reset to 0. If + * SEAT_HEADREST_FORE_AFT_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_HEADREST_FORE_AFT_MOVE = 0x0B9A + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Represents property for the seat footwell lights state. + * + * SEAT_FOOTWELL_LIGHTS_STATE reflects the current state of the lights at any point in time. + * This is different from the function of SEAT_FOOTWELL_LIGHTS_SWITCH which represents the + * position of the switch controlling the lights. Therefore, SEAT_FOOTWELL_LIGHTS_STATE may not + * match the value of SEAT_FOOTWELL_LIGHTS_SWITCH (e.g. SEAT_FOOTWELL_LIGHTS_SWITCH=AUTOMATIC + * and SEAT_FOOTWELL_LIGHTS_STATE=ON). + * + * This property should only be implemented if SEAT_FOOTWELL_LIGHTS_STATE's value may be + * different from that of CABIN_LIGHTS_STATE. + * + * For each supported area ID, the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of VehicleLightState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + SEAT_FOOTWELL_LIGHTS_STATE = + 0x0B9B + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Represents property for the seat footwell lights switch. + * + * SEAT_FOOTWELL_LIGHTS_SWITCH represents the position of the switch controlling the lights. + * This is different from the function of SEAT_FOOTWELL_LIGHTS_STATE which reflects the current + * state of the lights at any point in time. Therefore, SEAT_FOOTWELL_LIGHTS_SWITCH may not + * match the value of SEAT_FOOTWELL_LIGHTS_STATE (e.g. SEAT_FOOTWELL_LIGHTS_SWITCH=AUTOMATIC and + * SEAT_FOOTWELL_LIGHTS_STATE=ON). + * + * This property should only be implemented if SEAT_FOOTWELL_LIGHTS_SWITCH's value may be + * different from that of CABIN_LIGHTS_SWITCH. + * + * For each supported area ID, the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of VehicleLightSwitch are supported. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + SEAT_FOOTWELL_LIGHTS_SWITCH = + 0x0B9C + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Represents property for Seat easy access feature. + * + * If true, the seat will automatically adjust to make it easier for the occupant to enter and + * exit the vehicle. Each area ID must map to the seat that the user is trying to enter/exit + * with the help of the easy access feature. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_EASY_ACCESS_ENABLED = + 0x0B9D + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, + /** + * Represents feature to enable/disable a seat's ability to deploy airbag(s) when triggered + * (e.g. by a crash). + * + * If true, it means the seat's airbags are enabled, and if triggered (e.g. by a crash), they + * will deploy. If false, it means the seat's airbags are disabled, and they will not deploy + * under any circumstance. This property does not indicate if the airbags are deployed or not. + * + * This property can be set to VehiclePropertyAccess.READ read only for the sake of regulation + * or safety concerns. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_AIRBAG_ENABLED = + 0x0B9E + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, + /** + * Represents property for seat’s hipside (bottom cushion’s side) support position. + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the seat cushion side support is in its widest position (i.e. + * least support). + * The minInt32Value indicates the seat cushion side support is in its thinnest position (i.e. + * most support). + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * thinnest and widest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_CUSHION_SIDE_SUPPORT_POS = + 0x0B9F + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Represents property for movement direction and speed of seat cushion side support. + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value represents the maximum movement speed of the seat cushion side support when + * growing wider (i.e. support is decreasing). + * The minInt32Value represents the maximum movement speed of the seat cushion side support when + * growing thinner (i.e. support is increasing). + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat cushion side support reaches the positional limit, the value must reset to 0. If + * SEAT_CUSHION_SIDE_SUPPORT_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_CUSHION_SIDE_SUPPORT_MOVE = + 0x0BA0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Represents property for seat’s lumbar support vertical position. + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the lumbar support's highest position. + * The minInt32Value indicates the lumbar support's lowest position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * lowest and highest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_LUMBAR_VERTICAL_POS = + 0x0BA1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Represents property for vertical movement direction and speed of seat lumbar support. + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the lumbar support is moving at the fastest upward speed. + * The minInt32Value indicates the lumbar support is moving at the fastest downward speed. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the seat cushion side support reaches the positional limit, the value must reset to 0. If + * SEAT_LUMBAR_VERTICAL_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_LUMBAR_VERTICAL_MOVE = + 0x0BA2 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Represents property that indicates the current walk-in position of the seat. + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the normal seat position. The minInt32Value must be 0. + * The maxInt32Value indicates the seat is in the full walk-in position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * normal and walk-in positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * The area ID must match the seat that actually moves when the walk-in feature activates, not + * the intended seat the passengers will sit in. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SEAT_WALK_IN_POS = + 0x0BA3 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Seat Occupancy + * + * Indicates whether a particular seat is occupied or not, to the best of the car's ability + * to determine. Valid values are from the VehicleSeatOccupancyState enum. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleSeatOccupancyState + */ + SEAT_OCCUPANCY = 0x0BB0 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Window Position + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates the window is closed/fully open out of plane. If the window + * cannot open out of plane, then minInt32Value is the position of the window when fully closed + * and must be 0. If the window can open out of plane, the minInt32Value indicates the window + * is fully open in its position out of plane and will be a negative value. See the example + * below for a more detailed explanation. + * The maxInt32Value indicates the window is fully open. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * closed/fully open out-of-plane and fully open positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * For example, this is how the property should work for a window that can move out of plane: + * For a window that may open out of plane (i.e. vent mode of sunroof) this + * parameter will work with negative values as follows: + * Max = sunroof completely open + * 0 = sunroof closed. + * Min = sunroof vent completely open + * + * Note that in this mode, 0 indicates the window is closed. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + WINDOW_POS = 0x0BC0 + 0x10000000 + 0x03000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 + /** + * Window Move + * + * The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers + * between minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the window is opening in plane/closing in the out of plane + * direction at the fastest speed. + * The minInt32Value indicates the window is closing in plane/opening in the out of plane + * direction at the fastest speed. + * + * Larger absolute values, either positive or negative, indicate a faster movement speed. Once + * the window reaches the positional limit, the value must reset to 0. If WINDOW_MOVE's value is + * currently 0, then that means there is no movement currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * For a window that may open out of plane (i.e. vent mode of sunroof) this + * parameter will work as follows: + * + * If sunroof is open: + * Max = open the sunroof further, automatically stop when fully open. + * Min = close the sunroof, automatically stop when sunroof is closed. + * + * If vent is open: + * Max = close the vent, automatically stop when vent is closed. + * Min = open the vent further, automatically stop when vent is fully open. + * + * If sunroof is in the closed position: + * Max = open the sunroof, automatically stop when sunroof is fully open. + * Min = open the vent, automatically stop when vent is fully open. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 + /** + * Window Lock + * + * True indicates windows are locked and can't be moved. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + WINDOW_LOCK = 0x0BC4 + 0x10000000 + 0x03000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN + /** + * Windshield wipers period (milliseconds). + * + * Returns the instantaneous time period for 1 full cycle of the windshield wipers in + * milliseconds. A full cycle is defined as a wiper moving from and returning to its rest + * position. + * + * When an intermittent wiper setting is selected, this property value must be set to 0 during + * the "pause" period of the intermittent wiping. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. The maxInt32Value + * for each area ID must specify the longest wiper period. The minInt32Value must be set to 0 + * for each area ID. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLI_SECS + */ + WINDSHIELD_WIPERS_PERIOD = + 0x0BC5 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32, + + /** + * Windshield wipers state. + * + * Returns the current state of the windshield wipers. The value of WINDSHIELD_WIPERS_STATE may + * not match the value of WINDSHIELD_WIPERS_SWITCH. (e.g. WINDSHIELD_WIPERS_STATE = ON and + * WINDSHIELD_WIPERS_SWITCH = WindshieldWipersSwitch#AUTO). + * + * If WINDSHIELD_WIPERS_STATE = ON and WINDSHIELD_WIPERS_PERIOD is implemented, then + * WINDSHIELD_WIPERS_PERIOD must reflect the time period of 1 full cycle of the wipers. + * + * For each supported area ID, the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states in WindshieldWipersState are supported (including OTHER, which is not + * recommended). + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum WindshieldWipersState + */ + WINDSHIELD_WIPERS_STATE = + 0x0BC6 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32, + + /** + * Windshield wipers switch. + * + * Represents the position of the switch controlling the windshield wipers. The value of + * WINDSHIELD_WIPERS_SWITCH may not match the value of WINDSHIELD_WIPERS_STATE (e.g. + * WINDSHIELD_WIPERS_SWITCH = AUTO and WINDSHIELD_WIPERS_STATE = WindshieldWipersState#ON). + * + * For each supported area ID, the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states in WindshieldWipersSwitch are supported (including OTHER, which is not + * recommended). + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * If this property is implemented as VehiclePropertyAccess.READ_WRITE and the OTHER state is + * listed in the VehicleAreaConfig#supportedEnumValues array, then OTHER is not a supported + * value for writing. It is only a supported value for reading. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum WindshieldWipersSwitch + */ + WINDSHIELD_WIPERS_SWITCH = + 0x0BC7 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32, + + /** + * Steering wheel depth position + * + * All steering wheel properties' unique ids start from 0x0BE0. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between + * minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the steering wheel position furthest from the driver. + * The minInt32Value indicates the steering wheel position closest to the driver. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * closest and furthest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_DEPTH_POS = + 0x0BE0 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Steering wheel depth movement + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between + * minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the steering wheel moving away from the driver. + * The minInt32Value indicates the steering wheel moving towards the driver. + * + * Larger integers, either positive or negative, indicate a faster movement speed. Once the + * steering wheel reaches the positional limit, the value must reset to 0. If + * STEERING_WHEEL_DEPTH_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_DEPTH_MOVE = + 0x0BE1 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Steering wheel height position + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between + * minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the steering wheel being in the highest position. + * The minInt32Value indicates the steering wheel being in the lowest position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * lowest and highest positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_HEIGHT_POS = + 0x0BE2 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Steering wheel height movement + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All values between + * minInt32Value and maxInt32Value must be supported. + * + * The maxInt32Value indicates the steering wheel moving upwards. + * The minInt32Value indicates the steering wheel moving downwards. + * + * Larger integers, either positive or negative, indicate a faster movement speed. Once the + * steering wheel reaches the positional limit, the value must reset to 0. If + * STEERING_WHEEL_HEIGHT_MOVE's value is currently 0, then that means there is no movement + * currently occurring. + * + * This property is not in any particular unit but in a specified range of relative movement + * speeds. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_HEIGHT_MOVE = + 0x0BE3 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Steering wheel theft lock feature enabled + * + * If true, the steering wheel will lock automatically to prevent theft in certain + * situations. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_THEFT_LOCK_ENABLED = + 0x0BE4 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Steering wheel locked + * + * If true, the steering wheel's position is locked and not changeable. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_LOCKED = + 0x0BE5 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Steering wheel easy access feature enabled + * + * If true, the driver’s steering wheel will automatically adjust to make it easier for the + * driver to enter and exit the vehicle. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + STEERING_WHEEL_EASY_ACCESS_ENABLED = + 0x0BE6 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Property that represents the current position of the glove box door. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * All integers between minInt32Value and maxInt32Value must be supported. + * + * The minInt32Value indicates that the glove box door is closed. The minInt32Value must be 0. + * The maxInt32Value indicates that the glove box door is in the fully open position. + * + * Values in between minInt32Value and maxInt32Value indicate a transition state between the + * closed and fully open positions. + * + * This property is not in any particular unit but in a specified range of relative positions. + * + * The area ID must match the seat by which the glove box is intended to be used (e.g. if the + * front right dashboard has a glove box embedded in it, then the area ID should be + * SEAT_1_RIGHT). + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + GLOVE_BOX_DOOR_POS = + 0x0BF0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + + /** + * Lock or unlock the glove box. + * + * If true, the glove box is locked. If false, the glove box is unlocked. + * + * The area ID must match the seat by which the glove box is intended to be used (e.g. if the + * front right dashboard has a glove box embedded in it, then the area ID should be + * VehicleAreaSeat#ROW_1_RIGHT). + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + GLOVE_BOX_LOCKED = + 0x0BF1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, + + /** + * Vehicle Maps Service (VMS) message + * + * This property uses MIXED data to communicate vms messages. + * + * Its contents are to be interpreted as follows: + * the indices defined in VmsMessageIntegerValuesIndex are to be used to + * read from int32Values; + * bytes is a serialized VMS message as defined in the vms protocol + * which is opaque to the framework; + * + * IVehicle#get must always return StatusCode::NOT_AVAILABLE. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + VEHICLE_MAP_SERVICE = 0x0C00 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Characterization of inputs used for computing location. + * + * This property must indicate what (if any) data and sensor inputs are considered by the system + * when computing the vehicle's location that is shared with Android through the GNSS HAL. + * + * The value must return a collection of bit flags. The bit flags are defined in + * LocationCharacterization. The value must also include exactly one of DEAD_RECKONED or + * RAW_GNSS_ONLY among its collection of bit flags. + * + * When this property is not supported, it is assumed that no additional sensor inputs are fused + * into the GNSS updates provided through the GNSS HAL. That is unless otherwise specified + * through the GNSS HAL interfaces. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + LOCATION_CHARACTERIZATION = + 0x0C10 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * OBD2 Live Sensor Data + * + * Reports a snapshot of the current (live) values of the OBD2 sensors available. + * + * The configArray is set as follows: + * configArray[0] = number of vendor-specific integer-valued sensors + * configArray[1] = number of vendor-specific float-valued sensors + * + * The values of this property are to be interpreted as in the following example. + * Considering a configArray = {2,3} + * int32Values must be a vector containing Obd2IntegerSensorIndex.LAST_SYSTEM_INDEX + 2 + * elements (that is, 33 elements); + * floatValues must be a vector containing Obd2FloatSensorIndex.LAST_SYSTEM_INDEX + 3 + * elements (that is, 73 elements); + * + * It is possible for each frame to contain a different subset of sensor values, both system + * provided sensors, and vendor-specific ones. In order to support that, the bytes element + * of the property value is used as a bitmask,. + * + * bytes must have a sufficient number of bytes to represent the total number of possible + * sensors (in this case, 14 bytes to represent 106 possible values); it is to be read as + * a contiguous bitmask such that each bit indicates the presence or absence of a sensor + * from the frame, starting with as many bits as the size of int32Values, immediately + * followed by as many bits as the size of floatValues. + * + * For example, should bytes[0] = 0x4C (0b01001100) it would mean that: + * int32Values[0 and 1] are not valid sensor values + * int32Values[2 and 3] are valid sensor values + * int32Values[4 and 5] are not valid sensor values + * int32Values[6] is a valid sensor value + * int32Values[7] is not a valid sensor value + * Should bytes[5] = 0x61 (0b01100001) it would mean that: + * int32Values[32] is a valid sensor value + * floatValues[0 thru 3] are not valid sensor values + * floatValues[4 and 5] are valid sensor values + * floatValues[6] is not a valid sensor value + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + OBD2_LIVE_FRAME = 0x0D00 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Freeze Frame Sensor Data + * + * Reports a snapshot of the value of the OBD2 sensors available at the time that a fault + * occurred and was detected. + * + * A configArray must be provided with the same meaning as defined for OBD2_LIVE_FRAME. + * + * The values of this property are to be interpreted in a similar fashion as those for + * OBD2_LIVE_FRAME, with the exception that the stringValue field may contain a non-empty + * diagnostic troubleshooting code (DTC). + * + * A IVehicle#get request of this property must provide a value for int64Values[0]. + * This will be interpreted as the timestamp of the freeze frame to retrieve. A list of + * timestamps can be obtained by a IVehicle#get of OBD2_FREEZE_FRAME_INFO. + * + * Should no freeze frame be available at the given timestamp, a response of NOT_AVAILABLE + * must be returned by the implementation. Because vehicles may have limited storage for + * freeze frames, it is possible for a frame request to respond with NOT_AVAILABLE even if + * the associated timestamp has been recently obtained via OBD2_FREEZE_FRAME_INFO. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + OBD2_FREEZE_FRAME = 0x0D01 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Freeze Frame Information + * + * This property describes the current freeze frames stored in vehicle + * memory and available for retrieval via OBD2_FREEZE_FRAME. + * + * The values are to be interpreted as follows: + * each element of int64Values must be the timestamp at which a a fault code + * has been detected and the corresponding freeze frame stored, and each + * such element can be used as the key to OBD2_FREEZE_FRAME to retrieve + * the corresponding freeze frame. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + OBD2_FREEZE_FRAME_INFO = 0x0D02 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Freeze Frame Clear + * + * This property allows deletion of any of the freeze frames stored in + * vehicle memory, as described by OBD2_FREEZE_FRAME_INFO. + * + * The configArray is set as follows: + * configArray[0] = 1 if the implementation is able to clear individual freeze frames + * by timestamp, 0 otherwise + * + * IVehicle#set of this property is to be interpreted as follows: + * if int64Values contains no elements, then all frames stored must be cleared; + * if int64Values contains one or more elements, then frames at the timestamps + * stored in int64Values must be cleared, and the others not cleared. Should the + * vehicle not support selective clearing of freeze frames, this latter mode must + * return NOT_AVAILABLE. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + OBD2_FREEZE_FRAME_CLEAR = 0x0D03 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Headlights State + * + * Return the current state of headlights. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + HEADLIGHTS_STATE = 0x0E00 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * High beam lights state + * + * Return the current state of high beam lights. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + HIGH_BEAM_LIGHTS_STATE = 0x0E01 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fog light state + * + * Return the current state of fog lights. + * + * If the car has both front and rear fog lights: + * If front and rear fog lights can only be controlled together: FOG_LIGHTS_STATE must be + * implemented. FRONT_FOG_LIGHTS_STATE and REAR_FOG_LIGHTS_STATE must not be implemented. + * + * If the front and rear fog lights can only be controlled independently: FOG_LIGHTS_STATE + * must not be implemented. FRONT_FOG_LIGHTS_STATE and REAR_FOG_LIGHTS_STATE must be + * implemented. + * + * If the car has only front fog lights: + * Only one of FOG_LIGHTS_STATE or FRONT_FOG_LIGHTS_STATE must be implemented and not both. + * REAR_FOG_LIGHTS_STATE must not be implemented. + * + * If the car has only rear fog lights: + * Only one of FOG_LIGHTS_STATE or REAR_FOG_LIGHTS_STATE must be implemented and not both. + * FRONT_FOG_LIGHTS_STATE must not be implemented. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + FOG_LIGHTS_STATE = 0x0E02 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Hazard light status + * + * Return the current status of hazard lights. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + HAZARD_LIGHTS_STATE = 0x0E03 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Headlight switch + * + * The setting that the user wants. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + HEADLIGHTS_SWITCH = 0x0E10 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * High beam light switch + * + * The setting that the user wants. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + HIGH_BEAM_LIGHTS_SWITCH = 0x0E11 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fog light switch + * + * The setting that the user wants. + * + * If the car has both front and rear fog lights: + * If front and rear fog lights can only be controlled together: FOG_LIGHTS_SWITCH must be + * implemented. FRONT_FOG_LIGHTS_SWITCH and REAR_FOG_LIGHTS_SWITCH must not be implemented. + * + * If the front and rear fog lights can only be controlled independently: FOG_LIGHTS_SWITCH + * must not be implemented. FRONT_FOG_LIGHTS_SWITCH and REAR_FOG_LIGHTS_SWITCH must be + * implemented. + * + * If the car has only front fog lights: + * Only one of FOG_LIGHTS_SWITCH or FRONT_FOG_LIGHTS_SWITCH must be implemented and not both. + * REAR_FOG_LIGHTS_SWITCH must not be implemented. + * + * If the car has only rear fog lights: + * Only one of FOG_LIGHTS_SWITCH or REAR_FOG_LIGHTS_SWITCH must be implemented and not both. + * FRONT_FOG_LIGHTS_SWITCH must not be implemented. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + FOG_LIGHTS_SWITCH = 0x0E12 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Hazard light switch + * + * The setting that the user wants. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + HAZARD_LIGHTS_SWITCH = 0x0E13 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Cabin lights + * + * Return current status of cabin lights. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + CABIN_LIGHTS_STATE = 0x0F01 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Cabin lights switch + * + * The position of the physical switch which controls the cabin lights. + * This might be different than the CABIN_LIGHTS_STATE if the lights are on because a door + * is open or because of a voice command. + * For example, while the switch is in the "off" or "automatic" position. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + CABIN_LIGHTS_SWITCH = 0x0F02 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Reading lights + * + * Return current status of reading lights. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + READING_LIGHTS_STATE = 0x0F03 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Reading lights switch + * + * The position of the physical switch which controls the reading lights. + * This might be different than the READING_LIGHTS_STATE if the lights are on because a door + * is open or because of a voice command. + * For example, while the switch is in the "off" or "automatic" position. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + READING_LIGHTS_SWITCH = 0x0F04 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Steering wheel lights state + * + * Represents the current state of the steering wheel lights. This is different from + * STEERING_WHEEL_LIGHTS_SWITCH which represents the position of the switch controlling + * the lights. Therefore, STEERING_WHEEL_LIGHTS_STATE may not match the value of + * STEERING_WHEEL_LIGHTS_SWITCH (e.g. STEERING_WHEEL_LIGHTS_SWITCH=AUTOMATIC and + * STEERING_WHEEL_LIGHTS_STATE=ON). + * + * This property should only be implemented if STEERING_WHEEL_LIGHTS_STATE's value may be + * different from that of CABIN_LIGHTS_STATE. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of VehicleLightState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + STEERING_WHEEL_LIGHTS_STATE = + 0x0F0C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Steering wheel lights switch + * + * Represents the position of the switch controlling the steering wheel lights. This is + * different from STEERING_WHEEL_LIGHTS_STATE which represents the current state of the steering + * wheel lights. Therefore, STEERING_WHEEL_LIGHTS_SWITCH may not match the value of + * STEERING_WHEEL_LIGHTS_STATE (e.g. STEERING_WHEEL_LIGHTS_SWITCH=AUTOMATIC and + * STEERING_WHEEL_LIGHTS_STATE=ON). + * + * This property should only be implemented if STEERING_WHEEL_LIGHTS_SWITCH's value may be + * different from that of CABIN_LIGHTS_SWITCH. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of VehicleLightSwitch are supported. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + STEERING_WHEEL_LIGHTS_SWITCH = + 0x0F0D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Support customize permissions for vendor properties + * + * Implement this property if vehicle hal support customize vendor permissions feature. + * VehiclePropConfig.configArray is used to indicate vendor properties and permissions + * which selected for this vendor property. The permission must be one of enum in + * VehicleVendorPermission. + * The configArray is set as follows: + * configArray[n] = propId : property ID for the vendor property + * configArray[n+1] = one of enums in VehicleVendorPermission. It indicates the permission + * for reading value of the property. + * configArray[n+2] = one of enums in VehicleVendorPermission. It indicates the permission + * for writing value of the property. + * + * For example: + * configArray = { + * vendor_prop_1, PERMISSION_VENDOR_SEAT_READ, PERMISSION_VENDOR_SEAT_WRITE, + * vendor_prop_2, PERMISSION_VENDOR_INFO, PERMISSION_NOT_ACCESSIBLE, + * } + * If vendor properties are not in this array, they will have the default vendor permission. + * If vendor chose PERMISSION_NOT_ACCESSIBLE, android will not have access to the property. In + * the example, Android can not write value for vendor_prop_2. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 0x0F05 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Allow disabling optional featurs from vhal. + * + * This property reports optional features that should be disabled. + * All allowed optional features for the system is declared in Car service overlay, + * config_allowed_optional_car_features. + * This property allows disabling features defined in the overlay. Without this property, + * all the features declared in the overlay will be enabled. + * + * Value read should include all features disabled with ',' separation. + * ex) "com.android.car.user.CarUserNoticeService,storage_monitoring" + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + DISABLED_OPTIONAL_FEATURES = 0x0F06 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Defines the initial Android user to be used during initialization. + * + * This property is called by the Android system when it initializes and it lets the HAL + * define which Android user should be started. + * + * This request is made by setting a VehiclePropValue (defined by InitialUserInfoRequest), + * and the HAL must respond with a property change event (defined by InitialUserInfoResponse). + * If the HAL doesn't respond after some time (defined by the Android system), the Android + * system will proceed as if HAL returned a response of action + * InitialUserInfoResponseAction:DEFAULT. + * + * For example, on first boot, the request could be: + * + * int32[0]: 42 // request id (arbitrary number set by Android system) + * int32[1]: 1 // InitialUserInfoRequestType::FIRST_BOOT + * int32[2]: 0 // id of current user (usersInfo.currentUser.userId) + * int32[3]: 1 // flag of current user (usersInfo.currentUser.flags = SYSTEM) + * int32[4]: 1 // number of existing users (usersInfo.numberUsers); + * int32[5]: 0 // user #0 (usersInfo.existingUsers[0].userId) + * int32[6]: 1 // flags of user #0 (usersInfo.existingUsers[0].flags) + * + * And if the HAL want to respond with the creation of an admin user called "Owner", the + * response would be: + * + * int32[0]: 42 // must match the request id from the request + * int32[1]: 2 // action = InitialUserInfoResponseAction::CREATE + * int32[2]: -10000 // userToSwitchOrCreate.userId (not used as user will be created) + * int32[3]: 8 // userToSwitchOrCreate.flags = ADMIN + * string: "||Owner" // userLocales + separator + userNameToCreate + * + * Notice the string value represents multiple values, separated by ||. The first value is the + * (optional) system locales for the user to be created (in this case, it's empty, meaning it + * will use Android's default value), while the second value is the (also optional) name of the + * to user to be created (when the type of response is InitialUserInfoResponseAction:CREATE). + * For example, to create the same "Owner" user with "en-US" and "pt-BR" locales, the string + * value of the response would be "en-US,pt-BR||Owner". As such, neither the locale nor the + * name can have || on it, although a single | is fine. + * + * NOTE: if the HAL doesn't support user management, then it should not define this property, + * which in turn would disable the other user-related properties (for example, the Android + * system would never issue them and user-related requests from the HAL layer would be ignored + * by the Android System). But if it supports user management, then it must support all core + * user-related properties (INITIAL_USER_INFO, SWITCH_USER, CREATE_USER, and REMOVE_USER). + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + INITIAL_USER_INFO = 0x0F07 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Defines a request to switch the foreground Android user. + * + * This property is used primarily by the Android System to inform the HAL that the + * current foreground Android user is switching, but it could also be used by the HAL to request + * the Android system to switch users - the + * + * When the request is made by Android, it sets a VehiclePropValue and the HAL must responde + * with a property change event; when the HAL is making the request, it must also do it through + * a property change event (the main difference is that the request id will be positive in the + * former case, and negative in the latter; the SwitchUserMessageType will also be different). + * + * The format of both request is defined by SwitchUserRequest and the format of the response + * (when needed) is defined by SwitchUserResponse. How the HAL (or Android System) should + * proceed depends on the message type (which is defined by the SwitchUserMessageType + * parameter), as defined below. + * + * 1.LEGACY_ANDROID_SWITCH + * ----------------------- + * + * Called by the Android System to indicate the Android user is about to change, when the change + * request was made in a way that is not integrated with the HAL (for example, through + * adb shell am switch-user). + * + * The HAL can switch its internal user once it receives this request, but it doesn't need to + * reply back to the Android System. If its internal user cannot be changed for some reason, + * then it must wait for the SWITCH_USER(type=ANDROID_POST_SWITCH) call to recover + * (for example, it could issue a SWITCH_USER(type=VEHICLE_REQUEST) to switch back to + * the previous user), but ideally it should never fail (as switching back could result in a + * confusing experience for the end user). + * + * For example, if the system have users (0, 10, 11) and it's switching from 0 to 11 (where none + * of them have any special flag), the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 1 // SwitchUserMessageType::LEGACY_ANDROID_SWITCH + * int32[2]: 11 // target user id + * int32[3]: 0 // target user flags (none) + * int32[4]: 10 // current user + * int32[5]: 0 // current user flags (none) + * int32[6]: 3 // number of users + * int32[7]: 0 // user #0 (Android user id 0) + * int32[8]: 0 // flags of user #0 (none) + * int32[9]: 10 // user #1 (Android user id 10) + * int32[10]: 0 // flags of user #1 (none) + * int32[11]: 11 // user #2 (Android user id 11) + * int32[12]: 0 // flags of user #2 (none) + * + * 2.ANDROID_SWITCH + * ---------------- + * Called by the Android System to indicate the Android user is about to change, but Android + * will wait for the HAL's response (up to some time) before proceeding. + * + * The HAL must switch its internal user once it receives this request, then respond back to + * Android with a SWITCH_USER(type=VEHICLE_RESPONSE) indicating whether its internal + * user was switched or not (through the SwitchUserStatus enum). + * + * For example, if Android has users (0, 10, 11) and it's switching from 10 to 11 (where + * none of them have any special flag), the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 2 // SwitchUserMessageType::ANDROID_SWITCH + * int32[2]: 11 // target user id + * int32[3]: 0 // target user flags (none) + * int32[4]: 10 // current user + * int32[5]: 0 // current user flags (none) + * int32[6]: 3 // number of users + * int32[7]: 0 // 1st user (user 0) + * int32[8]: 1 // 1st user flags (SYSTEM) + * int32[9]: 10 // 2nd user (user 10) + * int32[10]: 0 // 2nd user flags (none) + * int32[11]: 11 // 3rd user (user 11) + * int32[12]: 0 // 3rd user flags (none) + * + * If the request succeeded, the HAL must update the property with: + * + * int32[0]: 42 // request id + * int32[1]: 3 // messageType = SwitchUserMessageType::VEHICLE_RESPONSE + * int32[2]: 1 // status = SwitchUserStatus::SUCCESS + * + * But if it failed, the response would be something like: + * + * int32[0]: 42 // request id + * int32[1]: 3 // messageType = SwitchUserMessageType::VEHICLE_RESPONSE + * int32[2]: 2 // status = SwitchUserStatus::FAILURE + * string: "108-D'OH!" // OEM-specific error message + * + * 3.VEHICLE_RESPONSE + * ------------------ + * Called by the HAL to indicate whether a request of type ANDROID_SWITCH should proceed or + * abort - see the ANDROID_SWITCH section above for more info. + * + * 4.VEHICLE_REQUEST + * ------------------ + * Called by the HAL to request that the current foreground Android user is switched. + * + * This is useful in situations where Android started as one user, but the vehicle identified + * the driver as another user. For example, user A unlocked the car using the key fob of user B; + * the INITIAL_USER_INFO request returned user B, but then a face recognition subsubsystem + * identified the user as A. + * + * The HAL makes this request by a property change event (passing a negative request id), and + * the Android system will response by issue an ANDROID_POST_SWITCH call which the same + * request id. + * + * For example, if the current foreground Android user is 10 and the HAL asked it to switch to + * 11, the request would be: + * + * int32[0]: -108 // request id + * int32[1]: 4 // messageType = SwitchUserMessageType::VEHICLE_REQUEST + * int32[2]: 11 // Android user id + * + * If the request succeeded and Android has 3 users (0, 10, 11), the response would be: + * + * int32[0]: -108 // request id + * int32[1]: 5 // messageType = SwitchUserMessageType::ANDROID_POST_SWITCH + * int32[2]: 11 // target user id + * int32[3]: 0 // target user id flags (none) + * int32[4]: 11 // current user + * int32[5]: 0 // current user flags (none) + * int32[6]: 3 // number of users + * int32[7]: 0 // 1st user (user 0) + * int32[8]: 0 // 1st user flags (none) + * int32[9]: 10 // 2nd user (user 10) + * int32[10]: 4 // 2nd user flags (none) + * int32[11]: 11 // 3rd user (user 11) + * int32[12]: 3 // 3rd user flags (none) + * + * Notice that both the current and target user ids are the same - if the request failed, then + * they would be different (i.e, target user would be 11, but current user would still be 10). + * + * 5.ANDROID_POST_SWITCH + * --------------------- + * Called by the Android System after a request to switch a user was made. + * + * This property is called after switch requests of any type (i.e., LEGACY_ANDROID_SWITCH, + * ANDROID_SWITCH, or VEHICLE_REQUEST) and can be used to determine if the request succeeded or + * failed: + * + * 1. When it succeeded, it's called when the Android user is in the unlocked state and the + * value of the current and target users ids in the response are the same. This would be + * equivalent to receiving an Intent.ACTION_USER_UNLOCKED in an Android app. + * 2. When it failed it's called right away and the value of the current and target users ids + * in the response are different (as the current user didn't change to the target). + * 3. If a new switch request is made before the HAL responded to the previous one or before + * the user was unlocked, then the ANDROID_POST_SWITCH request is not made. For example, + * the driver could accidentally switch to the wrong user which has lock credentials, then + * switch to the right one before entering the credentials. + * + * The HAL can update its internal state once it receives this request, but it doesn't need to + * reply back to the Android System. + * + * Request: the first N values as defined by INITIAL_USER_INFO (where the request-specific + * value at index 1 is SwitchUserMessageType::ANDROID_POST_SWITCH), then 2 more values for the + * target user id (i.e., the Android user id that was requested to be switched to) and its flags + * (as defined by UserFlags). + * + * Response: none. + * + * Example: see VEHICLE_REQUEST section above. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + SWITCH_USER = 0x0F08 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Called by the Android System after an Android user was created. + * + * The HAL can use this property to create its equivalent user. + * + * This is an async request: Android makes the request by setting a VehiclePropValue, and HAL + * must respond with a property change indicating whether the request succeeded or failed. If + * it failed, the Android system will remove the user. + * + * The format of the request is defined by CreateUserRequest and the format of the response by + * CreateUserResponse. + * + * For example, if system had 2 users (0 and 10) and a 3rd one (which is an ephemeral guest) was + * created, the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 11 // Android id of the created user + * int32[2]: 6 // Android flags (ephemeral guest) of the created user + * int32[3]: 10 // current user + * int32[4]: 0 // current user flags (none) + * int32[5]: 3 // number of users + * int32[6]: 0 // 1st user (user 0) + * int32[7]: 0 // 1st user flags (none) + * int32[8]: 10 // 2nd user (user 10) + * int32[9]: 0 // 2nd user flags (none) + * int32[19]: 11 // 3rd user (user 11) + * int32[11]: 6 // 3rd user flags (ephemeral guest) + * string: "ElGuesto" // name of the new user + * + * Then if the request succeeded, the HAL would return: + * + * int32[0]: 42 // request id + * int32[1]: 1 // CreateUserStatus::SUCCESS + * + * But if it failed: + * + * int32[0]: 42 // request id + * int32[1]: 2 // CreateUserStatus::FAILURE + * string: "D'OH!" // The meaning is a blackbox - it's passed to the caller (like Settings UI), + * // which in turn can take the proper action. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + CREATE_USER = 0x0F09 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Called by the Android System after an Android user was removed. + * + * The HAL can use this property to remove its equivalent user. + * + * This is write-only call - the Android System is not expecting a reply from the HAL. Hence, + * this request should not fail - if the equivalent HAL user cannot be removed, then HAL should + * mark it as inactive or recover in some other way. + * + * The request is made by setting the VehiclePropValue with the contents defined by + * RemoveUserRequest. + * + * For example, if system had 3 users (0, 10, and 11) and user 11 was removed, the request + * would be: + * + * int32[0]: 42 // request id + * int32[1]: 11 // (Android user id of the removed user) + * int32[2]: 0 // (Android user flags of the removed user) + * int32[3]: 10 // current user + * int32[4]: 0 // current user flags (none) + * int32[5]: 2 // number of users + * int32[6]: 0 // 1st user (user 0) + * int32[7]: 0 // 1st user flags (none) + * int32[8]: 10 // 2nd user (user 10) + * int32[9]: 0 // 2nd user flags (none) + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.WRITE + */ + REMOVE_USER = 0x0F0A + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Property used to associate (or query the association) the current user with vehicle-specific + * identification mechanisms (such as key FOB). + * + * This is an optional user management property - the OEM could still support user management + * without defining it. In fact, this property could be used without supporting the core + * user-related functions described on INITIAL_USER_INFO. + * + * To query the association, the Android system gets the property, passing a VehiclePropValue + * containing the types of associations are being queried, as defined by + * UserIdentificationGetRequest. The HAL must return right away, returning a VehiclePropValue + * with a UserIdentificationResponse. Notice that user identification should have already + * happened while system is booting up and the VHAL implementation should only return the + * already identified association (like the key FOB used to unlock the car), instead of starting + * a new association from the get call. + * + * To associate types, the Android system sets the property, passing a VehiclePropValue + * containing the types and values of associations being set, as defined by the + * UserIdentificationSetRequest. The HAL will then use a property change event (whose + * VehiclePropValue is defined by UserIdentificationResponse) indicating the current status of + * the types after the request. + * + * For example, to query if the current user (10) is associated with the FOB that unlocked the + * car and a custom mechanism provided by the OEM, the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 10 (Android user id) + * int32[2]: 0 (Android user flags) + * int32[3]: 2 (number of types queried) + * int32[4]: 1 (1st type queried, UserIdentificationAssociationType::KEY_FOB) + * int32[5]: 101 (2nd type queried, UserIdentificationAssociationType::CUSTOM_1) + * + * If the user is associated with the FOB but not with the custom mechanism, the response would + * be: + * + * int32[0]: 42 // request id + * int32[1]: 2 (number of associations in the response) + * int32[2]: 1 (1st type: UserIdentificationAssociationType::KEY_FOB) + * int32[3]: 2 (1st value: UserIdentificationAssociationValue::ASSOCIATED_CURRENT_USER) + * int32[4]: 101 (2st type: UserIdentificationAssociationType::CUSTOM_1) + * int32[5]: 4 (2nd value: UserIdentificationAssociationValue::NOT_ASSOCIATED_ANY_USER) + * + * Then to associate the user with the custom mechanism, a set request would be made: + * + * int32[0]: 43 // request id + * int32[1]: 10 (Android user id) + * int32[2]: 0 (Android user flags) + * int32[3]: 1 (number of associations being set) + * int32[4]: 101 (1st type: UserIdentificationAssociationType::CUSTOM_1) + * int32[5]: 1 (1st value: UserIdentificationAssociationSetValue::ASSOCIATE_CURRENT_USER) + * + * If the request succeeded, the response would be simply: + * + * int32[0]: 43 // request id + * int32[1]: 1 (number of associations in the response) + * int32[2]: 101 (1st type: UserIdentificationAssociationType::CUSTOM_1) + * int32[3]: 1 (1st value: UserIdentificationAssociationValue::ASSOCIATED_CURRENT_USER) + * + * Notice that the set request adds associations, but doesn't remove the existing ones. In the + * example above, the end state would be 2 associations (FOB and CUSTOM_1). If we wanted to + * associate the user with just CUSTOM_1 but not FOB, then the request should have been: + * + * int32[0]: 43 // request id + * int32[1]: 10 (Android user id) + * int32[2]: 2 (number of types set) + * int32[3]: 1 (1st type: UserIdentificationAssociationType::KEY_FOB) + * int32[4]: 2 (1st value: UserIdentificationAssociationValue::DISASSOCIATE_CURRENT_USER) + * int32[5]: 101 (2nd type: UserIdentificationAssociationType::CUSTOM_1) + * int32[6]: 1 (2nd value: UserIdentificationAssociationValue::ASSOCIATE_CURRENT_USER) + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + USER_IDENTIFICATION_ASSOCIATION = 0x0F0B + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Enable/request an EVS service. + * + * The property provides a generalized way to trigger EVS services. VHAL + * should use this property to request Android to start or stop EVS service. + * + * int32Values[0] = a type of the EVS service. The value must be one of enums in + * EvsServiceType. + * int32Values[1] = the state of the EVS service. The value must be one of enums in + * EvsServiceState. + * + * For example, to enable rear view EVS service, android side can set the property value as + * [EvsServiceType::REAR_VIEW, EvsServiceState::ON]. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + EVS_SERVICE_REQUEST = 0x0F10 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Defines a request to apply power policy. + * + * VHAL sets this property to change car power policy. Car power policy service subscribes to + * this property and actually changes the power policy. + * The request is made by setting the VehiclePropValue with the ID of a power policy which is + * defined at /vendor/etc/automotive/power_policy.xml. + * If the given ID is not defined, car power policy service ignores the request + * and the current power policy is maintained. + * + * string: "sample_policy_id" // power policy ID + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + POWER_POLICY_REQ = 0x0F21 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Defines a request to set the power polic group used to decide a default power policy per + * power status transition. + * + * VHAL sets this property with the ID of a power policy group in order to set the default power + * policy applied at power status transition. Power policy groups are defined at + * /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy service + * ignores the request. + * Car power policy service subscribes to this property and sets the power policy group. + * The actual application of power policy takes place when the system power status changes and + * there is a valid mapped power policy for the new power status. + * + * string: "sample_policy_group_id" // power policy group ID + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + POWER_POLICY_GROUP_REQ = 0x0F22 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Notifies the current power policy to VHAL layer. + * + * Car power policy service sets this property when the current power policy is changed. + * + * string: "sample_policy_id" // power policy ID + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + CURRENT_POWER_POLICY = 0x0F23 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Defines an event that car watchdog updates to tell it's alive. + * + * Car watchdog sets this property to system uptime in milliseconds at every 3 second. + * During the boot, the update may take longer time. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + WATCHDOG_ALIVE = 0xF31 + 0x10000000 + 0x01000000 + + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 + /** + * Defines a process terminated by car watchdog and the reason of termination. + * + * int32Values[0]: 1 // ProcessTerminationReason showing why a process is terminated. + * string: "/system/bin/log" // Process execution command. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + WATCHDOG_TERMINATED_PROCESS = 0x0F32 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Defines an event that VHAL signals to car watchdog as a heartbeat. + * + * If VHAL supports this property, VHAL should write system uptime to this property at every 3 + * second. Car watchdog subscribes to this property and checks if the property is updated at + * every 3 second. With the buffer time of 3 second, car watchdog waits for a heart beat to be + * signaled up to 6 seconds from the last heart beat. If it isn’t, car watchdog considers + * VHAL unhealthy and terminates it. + * If this property is not supported by VHAL, car watchdog doesn't check VHAL health status. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + VHAL_HEARTBEAT = 0x0F33 + 0x10000000 + 0x01000000 + + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 + /** + * Starts the ClusterUI in cluster display. + * + * int32: the type of ClusterUI to show + * 0 indicates ClusterHome, that is a home screen of cluster display, and provides + * the default UI and a kind of launcher functionality for cluster display. + * the other values are followed by OEM's definition. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + CLUSTER_SWITCH_UI = 0x0F34 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Changes the state of the cluster display. + * + * Bounds: the area to render the cluster Activity. + * Inset: the area which Activity should avoid from placing any important + * information. + * + * int32[0]: on/off: 0 - off, 1 - on, -1 - don't care + * int32[1]: Bounds - left: positive number - left position in pixels + -1 - don't care (should set all Bounds fields) + * int32[2]: Bounds - top: same format with 'left' + * int32[3]: Bounds - right: same format with 'left' + * int32[4]: Bounds - bottom: same format with 'left' + * int32[5]: Inset - left: positive number - actual left inset value in pixels + -1 - don't care (should set "don't care" all Inset fields) + * int32[6]: Inset - top: same format with 'left' + * int32[7]: Inset - right: same format with 'left' + * int32[8]: Inset - bottom: same format with 'left' + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + CLUSTER_DISPLAY_STATE = 0x0F35 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Reports the current display state and ClusterUI state. + * + * ClusterHome will send this message when it handles CLUSTER_SWITCH_UI, CLUSTER_DISPLAY_STATE. + * + * In addition, ClusterHome should send this message when it starts for the first time. + * When ClusterOS receives this message and if the internal expectation is different with the + * received message, then it should send CLUSTER_SWITCH_UI, CLUSTER_DISPLAY_STATE again to + * match the state. + * + * int32[0]: on/off: 0 - off, 1 - on + * int32[1]: Bounds - left + * int32[2]: Bounds - top + * int32[3]: Bounds - right + * int32[4]: Bounds - bottom + * int32[5]: Inset - left + * int32[6]: Inset - top + * int32[7]: Inset - right + * int32[8]: Inset - bottom + * int32[9]: the type of ClusterUI in the fullscreen or main screen. + * 0 indicates ClusterHome. + * the other values are followed by OEM's definition. + * int32[10]: the type of ClusterUI in sub screen if the currently two UIs are shown. + * -1 indicates the area isn't used any more. + * bytes: the array to represent the availability of ClusterUI. + * 0 indicates non-available and 1 indicates available. + * For example, let's assume a car supports 3 OEM defined ClusterUI like HOME, MAPS, CALL, + * and it only supports CALL UI only when the cellular network is available. Then, if the + * nework is avaibale, it'll send [1 1 1], and if it's out of network, it'll send [1 1 0]. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + CLUSTER_REPORT_STATE = 0x0F36 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Requests to change the cluster display state to show some ClusterUI. + * + * When the current display state is off and ClusterHome sends this message to ClusterOS to + * request to turn the display on to show some specific ClusterUI. + * ClusterOS should response this with CLUSTER_DISPLAY_STATE. + * + * int32: the type of ClusterUI to show + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Informs the current navigation state. + * + * bytes: the serialized message of NavigationStateProto. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x10000000 + 0x01000000 + + 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES + /** + * Electronic Toll Collection card type. + * + * This property indicates the type of ETC card in this vehicle. + * If the head unit is aware of an ETC card attached to the vehicle, this property should + * return the type of card attached; otherwise, this property should be UNAVAILABLE. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum ElectronicTollCollectionCardType + */ + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 0x0F39 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Electronic Toll Collection card status. + * + * This property indicates the status of ETC card in this vehicle. + * If the head unit is aware of an ETC card attached to the vehicle, + * ELECTRONIC_TOLL_COLLECTION_CARD_TYPE gives that status of the card; otherwise, + * this property should be UNAVAILABLE. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum ElectronicTollCollectionCardStatus + */ + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 0x0F3A + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Front fog lights state + * + * Return the current state of the front fog lights. + * Only one of FOG_LIGHTS_STATE or FRONT_FOG_LIGHTS_STATE must be implemented. Please refer to + * the documentation on FOG_LIGHTS_STATE for more information. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + FRONT_FOG_LIGHTS_STATE = 0x0F3B + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Front fog lights switch + * + * The setting that the user wants. + * Only one of FOG_LIGHTS_SWITCH or FRONT_FOG_LIGHTS_SWITCH must be implemented. Please refer to + * the documentation on FOG_LIGHTS_SWITCH for more information. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + FRONT_FOG_LIGHTS_SWITCH = 0x0F3C + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Rear fog lights state + * + * Return the current state of the rear fog lights. + * Only one of FOG_LIGHTS_STATE or REAR_FOG_LIGHTS_STATE must be implemented. Please refer to + * the documentation on FOG_LIGHTS_STATE for more information. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleLightState + */ + REAR_FOG_LIGHTS_STATE = 0x0F3D + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Rear fog lights switch + * + * The setting that the user wants. + * Only one of FOG_LIGHTS_SWITCH or REAR_FOG_LIGHTS_SWITCH must be implemented. Please refer to + * the documentation on FOG_LIGHTS_SWITCH for more information. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum VehicleLightSwitch + */ + REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Indicates the maximum current draw threshold for charging set by the user + * + * configArray[0] is used to specify the max current draw allowed by + * the vehicle in Amperes. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @unit VehicleUnit:AMPERE + */ + EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + + /** + * Indicates the maximum charge percent threshold set by the user + * + * Returns a float value from 0 to 100. + * + * configArray is used to specify the valid values. + * For example, if the vehicle supports the following charge percent limit values: + * [20, 40, 60, 80, 100] + * then the configArray should be {20, 40, 60, 80, 100} + * If the configArray is empty then all values from 0 to 100 must be valid. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + + /** + * Charging state of the car + * + * Returns the current charging state of the car. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum EvChargeState + */ + EV_CHARGE_STATE = 0x0F41 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Start or stop charging the EV battery + * + * The setting that the user wants. Setting this property to true starts the battery charging + * and setting to false stops charging. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + + /** + * Estimated charge time remaining in seconds + * + * Returns 0 if the vehicle is not charging. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:SECS + */ + EV_CHARGE_TIME_REMAINING = 0x0F43 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Regenerative braking or one-pedal drive state of the car + * + * Returns the current state associated with the regenerative braking + * setting in the car + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum EvRegenerativeBrakingState + */ + EV_REGENERATIVE_BRAKING_STATE = 0x0F44 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Indicates if there is a trailer present or not. + * + * Returns the trailer state of the car. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum TrailerState + */ + TRAILER_PRESENT = 0x0F45 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Vehicle’s curb weight + * + * Returns the vehicle's curb weight in kilograms. Curb weight is + * the total weight of the vehicle with standard equipment and all + * necessary operating consumables such as motor oil,transmission oil, + * brake fluid, coolant, air conditioning refrigerant, and weight of + * fuel at nominal tank capacity, while not loaded with either passengers + * or cargo. + * + * configArray[0] is used to specify the vehicle’s gross weight in kilograms. + * The vehicle’s gross weight is the maximum operating weight of the vehicle + * as specified by the manufacturer including the vehicle's chassis, body, engine, + * engine fluids, fuel, accessories, driver, passengers and cargo but excluding + * that of any trailers. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:KILOGRAM + */ + + VEHICLE_CURB_WEIGHT = 0x0F46 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * EU's General security regulation compliance requirement. + * + * Returns whether general security regulation compliance is required, if + * so, what type of requirement. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @data_enum GsrComplianceRequirementType + */ + GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = 0x0F47 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * (Deprecated) List of all supported property IDs. + * + * A list of all supported property IDs (including this property). This property is required for + * HIDL VHAL to work with large amount of vehicle prop configs where the getAllPropConfigs + * payload exceeds the binder limitation. This issue is fixed in AIDL version using + * LargeParcelable in getAllPropConfigs, so this property is deprecated. + * + * In HIDL VHAL implementation, if the amount of data returned in getAllPropConfigs exceeds the + * binder limitation, vendor must support this property and return all the supported property + * IDs. Car service will divide this list into smaller sub lists and use getPropConfigs([ids]) + * to query the sub lists. The results will be merged together in Car Service. + * + * The config array for this property must contain one int element which is the number of + * configs per getPropConfigs request by Car Service. This number must be small enough so that + * each getPropConfigs payload will not exceed binder limitation, however, a smaller number will + * cause more requests, which increase overhead to fetch all the configs. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + SUPPORTED_PROPERTY_IDS = 0x0F48 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + + /** + * Request the head unit to be shutdown. + * + *

This usually involves telling a separate system outside the head unit (e.g. a power + * controller) to prepare shutting down the head unit. + * + *

This does not mean the head unit will shutdown immediately. + * + *

This means that another system will start sending a shutdown signal to the head unit, + * which will cause VHAL to send SHUTDOWN_PREPARE message to Android. Android will then start + * the shut down process by handling the message. + * + *

This property is only for issuing a request and only supports writing. Every time this + * property value is set, the request to shutdown will be issued no matter what the current + * property value is. The current property value is meaningless. + * + *

Since this property is write-only, subscribing is not allowed and no property change + * event will be generated. + * + *

The value to set indicates the shutdown option, it must be one of + * {@code VehicleApPowerStateShutdownParam}, e.g., + * VehicleApPowerStateShutdownParam.SLEEP_IMMEDIATELY. This shutdown option might not be honored + * if the system doesn't support such option. In such case, an error will not be returned. + * + *

For configuration information, VehiclePropConfig.configArray must have bit flag combining + * values in {@code VehicleApPowerStateConfigFlag} to indicate which shutdown options are + * supported. + * + *

Returns error if failed to send the shutdown request to the other system. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + * @data_enum VehicleApPowerStateShutdownParam + */ + SHUTDOWN_REQUEST = + 0x0F49 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Whether the vehicle is currently in use. + * + *

In-use means a human user is present and is intended to use the vehicle. This doesn't + * necessarily means the human user is in the vehicle. For example, if the human user unlocks + * the vehicle remotely, the vehicle is considered in use. + * + *

If this property is supported: + * + *

Each time user powers on the vehicle or the system detects the user is present, + * VEHICLE_IN_USE must be set to true. Each time user powers off the vehicle or the system + * detects the user is not present, VEHICLE_IN_USE must be set to false. + * + *

This property is different than AP_POWER_BOOTUP_REASON in the sense that + * AP_POWER_BOOTUP_REASON is only set once during the system bootup. However, this property + * might change multiple times during a system bootup cycle. + * + *

For example, a device is currently not in use. The system bootup to execute a remote task. + * VEHICLE_IN_USE is false. While the remote task is executing, the user enters the vehicle and + * powers on the vehicle. VEHICLE_IN_USE is set to true. After a driving session, user powers + * off the vehicle, VEHICLE_IN_USE is set to false. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + VEHICLE_IN_USE = + 0x0F4A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /*********************************************************************************************** + * Start of ADAS Properties + * + * Allocate IDs in range of 0x1000 (inclusive) to 0x1100 (exclusive) for ADAS properties + **********************************************************************************************/ + + /** + * Enable or disable Automatic Emergency Braking (AEB). + * + * Set true to enable AEB and false to disable AEB. When AEB is enabled, the ADAS system in the + * vehicle should be turned on and monitoring to avoid potential collisions. + * + * In general, AUTOMATIC_EMERGENCY_BRAKING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * low, that information must be conveyed through the ErrorState values in the + * AUTOMATIC_EMERGENCY_BRAKING_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + AUTOMATIC_EMERGENCY_BRAKING_ENABLED = + 0x1000 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Automatic Emergency Braking (AEB) state. + * + * Returns the current state of AEB. This property must always return a valid state defined in + * AutomaticEmergencyBrakingState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * If AEB includes forward collision warnings before activating the brakes, those warnings must + * be surfaced through the Forward Collision Warning (FCW) properties. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both AutomaticEmergencyBrakingState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum AutomaticEmergencyBrakingState + * @data_enum ErrorState + */ + AUTOMATIC_EMERGENCY_BRAKING_STATE = + 0x1001 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Enable or disable Forward Collision Warning (FCW). + * + * Set true to enable FCW and false to disable FCW. When FCW is enabled, the ADAS system in the + * vehicle should be turned on and monitoring for potential collisions. + * + * In general, FORWARD_COLLISION_WARNING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * low, that information must be conveyed through the ErrorState values in the + * FORWARD_COLLISION_WARNING_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + FORWARD_COLLISION_WARNING_ENABLED = + 0x1002 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Forward Collision Warning (FCW) state. + * + * Returns the current state of FCW. This property must always return a valid state defined in + * ForwardCollisionWarningState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both ForwardCollisionWarningState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum ForwardCollisionWarningState + * @data_enum ErrorState + */ + FORWARD_COLLISION_WARNING_STATE = + 0x1003 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Enable and disable Blind Spot Warning (BSW). + * + * Set true to enable BSW and false to disable BSW. When BSW is enabled, the ADAS system in the + * vehicle should be turned on and monitoring for objects in the vehicle’s blind spots. + * + * In general, BLIND_SPOT_WARNING_ENABLED should always return true or false. If the feature is + * not available due to some temporary state, such as the vehicle speed being too low, that + * information must be conveyed through the ErrorState values in the BLIND_SPOT_WARNING_STATE + * property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + BLIND_SPOT_WARNING_ENABLED = + 0x1004 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Blind Spot Warning (BSW) state. + * + * Returns the current state of BSW. This property must always return a valid state defined in + * BlindSpotWarningState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * For each supported area ID, the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both BlindSpotWarningState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum BlindSpotWarningState + * @data_enum ErrorState + */ + BLIND_SPOT_WARNING_STATE = + 0x1005 + VehiclePropertyGroup.SYSTEM + VehicleArea.MIRROR + VehiclePropertyType.INT32, + + /** + * Enable or disable Lane Departure Warning (LDW). + * + * Set true to enable LDW and false to disable LDW. When LDW is enabled, the ADAS system in the + * vehicle should be turned on and monitoring if the vehicle is approaching or crossing lane + * lines, in which case a warning will be given. + * + * In general, LANE_DEPARTURE_WARNING_ENABLED should always return true or false. If the feature + * is not available due to some temporary state, such as the vehicle speed being too low or too + * high, that information must be conveyed through the ErrorState values in the + * LANE_DEPARTURE_WARNING_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + LANE_DEPARTURE_WARNING_ENABLED = + 0x1006 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Lane Departure Warning (LDW) state. + * + * Returns the current state of LDW. This property must always return a valid state defined in + * LaneDepartureWarningState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both LaneDepartureWarningState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum LaneDepartureWarningState + * @data_enum ErrorState + */ + LANE_DEPARTURE_WARNING_STATE = + 0x1007 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Enable or disable Lane Keep Assist (LKA). + * + * Set true to enable LKA and false to disable LKA. When LKA is enabled, the ADAS system in the + * vehicle should be turned on and monitoring if the driver unintentionally drifts toward or + * over the lane marking. If an unintentional lane departure is detected, the system applies + * steering control to return the vehicle into the current lane. + * + * This is different from Lane Centering Assist (LCA) which, when activated, applies continuous + * steering control to keep the vehicle centered in the current lane. + * + * In general, LANE_KEEP_ASSIST_ENABLED should always return true or false. If the feature is + * not available due to some temporary state, such as the vehicle speed being too low or too + * high, that information must be conveyed through the ErrorState values in the + * LANE_KEEP_ASSIST_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + LANE_KEEP_ASSIST_ENABLED = + 0x1008 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Lane Keep Assist (LKA) state. + * + * Returns the current state of LKA. This property must always return a valid state defined in + * LaneKeepAssistState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * If LKA includes lane departure warnings before applying steering corrections, those warnings + * must be surfaced through the Lane Departure Warning (LDW) properties. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both LaneKeepAssistState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum LaneKeepAssistState + * @data_enum ErrorState + */ + LANE_KEEP_ASSIST_STATE = + 0x1009 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Enable or disable Lane Centering Assist (LCA). + * + * Set true to enable LCA and false to disable LCA. When LCA is enabled, the ADAS system in the + * vehicle should be turned on and waiting for an activation signal from the driver. Once the + * feature is activated, the ADAS system should be steering the vehicle to keep it centered in + * its current lane. + * + * This is different from Lane Keep Assist (LKA) which monitors if the driver unintentionally + * drifts toward or over the lane marking. If an unintentional lane departure is detected, the + * system applies steering control to return the vehicle into the current lane. + * + * In general, LANE_CENTERING_ASSIST_ENABLED should always return true or false. If the feature + * is not available due to some temporary state, such as the vehicle speed being too low or too + * high, that information must be conveyed through the ErrorState values in the + * LANE_CENTERING_ASSIST_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + LANE_CENTERING_ASSIST_ENABLED = + 0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Lane Centering Assist (LCA) commands. + * + * Commands to activate and suspend LCA. + * + * When the command ACTIVATE from LaneCenteringAssistCommmand is sent, + * LANE_CENTERING_ASSIST_STATE must be set to LaneCenteringAssistState#ACTIVATION_REQUESTED. + * When the ACTIVATE command succeeds, LANE_CENTERING_ASSIST_STATE must be set to + * LaneCenteringAssistState#ACTIVATED. When the command DEACTIVATE from + * LaneCenteringAssistCommmand succeeds, LANE_CENTERING_ASSIST_STATE must be set to + * LaneCenteringAssistState#ENABLED. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless + * all enum values of LaneCenteringAssistCommand are supported. + * + * When this property is not available because LCA is disabled (i.e. + * LANE_CENTERING_ASSIST_ENABLED is false), this property must return + * StatusCode#NOT_AVAILABLE_DISABLED. If LANE_CENTERING_ASSIST_STATE is implemented and the + * state is set to an ErrorState value, then this property must return a StatusCode that aligns + * with the ErrorState value. For example, if LANE_CENTERING_ASSIST_STATE is set to + * ErrorState#NOT_AVAILABLE_SPEED_LOW, then this property must return + * StatusCode#NOT_AVAILABLE_SPEED_LOW. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + * @data_enum LaneCenteringAssistCommmand + */ + LANE_CENTERING_ASSIST_COMMAND = + 0x100B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Lane Centering Assist (LCA) state. + * + * Returns the current state of LCA. This property must always return a valid state defined in + * LaneCenteringAssistState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * If LCA includes lane departure warnings, those warnings must be surfaced through the Lane + * Departure Warning (LDW) properties. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both LaneCenteringAssistState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum LaneCenteringAssistState + * @data_enum ErrorState + */ + LANE_CENTERING_ASSIST_STATE = + 0x100C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /* + * Enable or disable Emergency Lane Keep Assist (ELKA). + * + * Set true to enable ELKA and false to disable ELKA. When ELKA is enabled, the ADAS system in + * the vehicle should be on and monitoring for unsafe lane changes by the driver. When an unsafe + * maneuver is detected, ELKA alerts the driver and applies steering corrections to keep the + * vehicle in its original lane. + * + * In general, EMERGENCY_LANE_KEEP_ASSIST_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * low, that information must be conveyed through the ErrorState values in the + * EMERGENCY_LANE_KEEP_ASSIST_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + EMERGENCY_LANE_KEEP_ASSIST_ENABLED = + 0x100D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Emergency Lane Keep Assist (ELKA) state. + * + * Returns the current state of ELKA. Generally, this property should return a valid state + * defined in the EmergencyLaneKeepAssistState or ErrorState. For example, if the feature is not + * available due to some temporary state, that information should be conveyed through + * ErrorState. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of EmergencyLaneKeepAssistState (including OTHER, which is not recommended) + * and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum EmergencyLaneKeepAssistState + * @data_enum ErrorState + */ + EMERGENCY_LANE_KEEP_ASSIST_STATE = + 0x100E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Enable or disable cruise control (CC). + * + * Set true to enable CC and false to disable CC. This property is shared by all forms of + * CruiseControlType(s). + * + * When CC is enabled, the ADAS system in the vehicle should be turned on and responding to + * commands. + * + * In general, CRUISE_CONTROL_ENABLED should always return true or false. If the feature is not + * available due to some temporary state, such as the vehicle speed being too low, that + * information must be conveyed through the ErrorState values in the CRUISE_CONTROL_STATE + * property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + CRUISE_CONTROL_ENABLED = + 0x100F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Current type of Cruise Control (CC). + * + * When CRUISE_CONTROL_ENABLED is true, this property returns the type of CC that is currently + * enabled (for example, standard CC, adaptive CC, predictive CC, etc.). Generally, this + * property should return a valid state defined in the CruiseControlType or ErrorState. For + * example, if the feature is not available due to some temporary state, that information should + * be conveyed through ErrorState. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of CruiseControlType (including OTHER, which is not recommended) and + * ErrorState are supported. + * + * Trying to write CruiseControlType#OTHER or an ErrorState to this property will throw an + * IllegalArgumentException. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @data_enum CruiseControlType + * @data_enum ErrorState + */ + CRUISE_CONTROL_TYPE = + 0x1010 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Current state of Cruise Control (CC). + * + * This property returns the current state of CC. Generally, this property should return a valid + * state defined in the CruiseControlState or ErrorState. For example, if the feature is not + * available due to some temporary state, that information should be conveyed through + * ErrorState. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of CruiseControlState (including OTHER, which is not recommended) and + * ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum CruiseControlState + * @data_enum ErrorState + */ + CRUISE_CONTROL_STATE = + 0x1011 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Write Cruise Control (CC) commands. + * + * See CruiseControlCommand for the details about each supported command. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of CruiseControlState are supported. Any unsupported commands sent through + * this property must return StatusCode#INVALID_ARG. + * + * When this property is not available because CC is disabled (i.e. CRUISE_CONTROL_ENABLED is + * false), this property must return StatusCode#NOT_AVAILABLE_DISABLED. If CRUISE_CONTROL_STATE + * is implemented and the state is set to an ErrorState value, then this property must return a + * StatusCode that aligns with the ErrorState value. For example, if CRUISE_CONTROL_STATE is set + * to ErrorState#NOT_AVAILABLE_SPEED_LOW, then this property must return + * StatusCode#NOT_AVAILABLE_SPEED_LOW. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + * @data_enum CruiseControlCommand + */ + CRUISE_CONTROL_COMMAND = + 0x1012 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Current target speed for Cruise Control (CC). + * + * OEMs should set the minFloatValue and maxFloatValue values for this property to define the + * min and max target speed values. These values must be non-negative. + * + * The maxFloatValue represents the upper bound of the target speed. + * The minFloatValue represents the lower bound of the target speed. + * + * When this property is not available because CC is disabled (i.e. CRUISE_CONTROL_ENABLED is + * false), this property must return StatusCode#NOT_AVAILABLE_DISABLED. If CRUISE_CONTROL_STATE + * is implemented and the state is set to an ErrorState value, then this property must return a + * StatusCode that aligns with the ErrorState value. For example, if CRUISE_CONTROL_STATE is set + * to ErrorState#NOT_AVAILABLE_SPEED_LOW, then this property must return + * StatusCode#NOT_AVAILABLE_SPEED_LOW. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:METER_PER_SEC + */ + CRUISE_CONTROL_TARGET_SPEED = + 0x1013 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT, + + /** + * Current target time gap for Adaptive Cruise Control (ACC) or Predictive Cruise Control in + * milliseconds. + * + * This property should specify the target time gap to a leading vehicle. This gap is defined as + * the time to travel the distance between the leading vehicle's rear-most point to the ACC + * vehicle's front-most point. The actual time gap from a leading vehicle can be above or below + * this value. + * + * The possible values to set for the target time gap should be specified in configArray in + * ascending order. All values must be positive. If the property is writable, all values must be + * writable. + * + * When this property is not available because CC is disabled (i.e. CRUISE_CONTROL_ENABLED is + * false), this property must return StatusCode#NOT_AVAILABLE_DISABLED. If CRUISE_CONTROL_STATE + * is implemented and the state is set to an ErrorState value, then this property must return a + * StatusCode that aligns with the ErrorState value. For example, if CRUISE_CONTROL_STATE is set + * to ErrorState#NOT_AVAILABLE_SPEED_LOW, then this property must return + * StatusCode#NOT_AVAILABLE_SPEED_LOW. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @unit VehicleUnit:MILLI_SECS + */ + ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = + 0x1014 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Measured distance from leading vehicle when using Adaptive Cruise Control (ACC) or + * Predictive Cruise Control. + * + * Returns the measured distance in millimeters between the rear-most point of the leading + * vehicle and the front-most point of the ACC vehicle. + * + * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. + * The minInt32Value should be 0. + * The maxInt32Value should be populated with the maximum range the distance sensor can support. + * This value should be non-negative. + * + * When no lead vehicle is detected (that is, when there is no leading vehicle or the leading + * vehicle is too far away for the sensor to detect), this property should return + * StatusCode.NOT_AVAILABLE. + * + * When this property is not available because CC is disabled (i.e. CRUISE_CONTROL_ENABLED is + * false), this property must return StatusCode#NOT_AVAILABLE_DISABLED. If CRUISE_CONTROL_STATE + * is implemented and the state is set to an ErrorState value, then this property must return a + * StatusCode that aligns with the ErrorState value. For example, if CRUISE_CONTROL_STATE is set + * to ErrorState#NOT_AVAILABLE_SPEED_LOW, then this property must return + * StatusCode#NOT_AVAILABLE_SPEED_LOW. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLIMETER + */ + ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE = + 0x1015 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Enable or disable Hands On Detection (HOD). + * + * Set true to enable HOD and false to disable HOD. When HOD is enabled, a system inside the + * vehicle should be monitoring the presence of the driver's hands on the steering wheel and + * send a warning if it detects that the driver's hands are no longer on the steering wheel. + * + * In general, HANDS_ON_DETECTION_ENABLED should always return true or false. If the feature is + * not available due to some temporary state, that information must be conveyed through the + * ErrorState values in the HANDS_ON_DETECTION_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + HANDS_ON_DETECTION_ENABLED = + 0x1016 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + + /** + * Hands On Detection (HOD) driver state. + * + * Returns whether the driver's hands are on the steering wheel. Generally, this property should + * return a valid state defined in the HandsOnDetectionDriverState or ErrorState. For example, + * if the feature is not available due to some temporary state, that information should be + * conveyed through ErrorState. + * + * If the vehicle wants to send a warning to the user because the driver's hands have been off + * the steering wheel for too long, the warning should be surfaced through + * HANDS_ON_DETECTION_WARNING. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both HandsOnDetectionDriverState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum HandsOnDetectionDriverState + * @data_enum ErrorState + */ + HANDS_ON_DETECTION_DRIVER_STATE = + 0x1017 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Hands On Detection (HOD) warning. + * + * Returns whether a warning is being sent to the driver for having their hands off the wheel + * for too long a duration. + * + * Generally, this property should return a valid state defined in HandsOnDetectionWarning or + * ErrorState. For example, if the feature is not available due to some temporary state, that + * information should be conveyed through an ErrorState. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both HandsOnDetectionWarning (including OTHER, which is not recommended) + * and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum HandsOnDetectionWarning + * @data_enum ErrorState + */ + HANDS_ON_DETECTION_WARNING = + 0x1018 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /*************************************************************************** + * End of ADAS Properties + **************************************************************************/ +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyType.aidl similarity index 92% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyType.aidl index 62d26de3c3..7a68b4abc6 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyType.aidl @@ -25,6 +25,10 @@ package android.hardware.automotive.vehicle; @Backing(type="int") enum VehiclePropertyType { STRING = 0x00100000, + /** + * Boolean values should be specified through the int32Values in RawPropValues. + * int32Value = {0} represents false and int32Value = {1} represents true. + */ BOOLEAN = 0x00200000, INT32 = 0x00400000, INT32_VEC = 0x00410000, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleUnit.aidl similarity index 98% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleUnit.aidl index 3817b74ce9..d4f9086e2b 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -43,6 +43,7 @@ enum VehicleUnit { US_GALLON = 0x42, IMPERIAL_GALLON = 0x43, NANO_SECS = 0x50, + MILLI_SECS = 0x51, SECS = 0x53, YEAR = 0x59, WATT_HOUR = 0x60, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageType.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageType.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl similarity index 100% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl rename to automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersState.aidl new file mode 100644 index 0000000000..820fcc8659 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersState.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current state of VehicleProperty#WINDSHIELD_WIPERS_STATE. + */ +@VintfStability +@Backing(type="int") +enum WindshieldWipersState { + + /** + * This state is used as an alternative for any WindshieldWipersState value that is not defined + * in the platform. Ideally, implementations of VehicleProperty#WINDSHIELD_WIPERS_STATE should + * not use this state. The framework can use this field to remain backwards compatible if + * WindshieldWipersState is extended to include additional states. + */ + OTHER = 0, + /** + * This state indicates the windshield wipers are currently off. If + * VehicleProperty#WINDSHIELD_WIPERS_SWITCH is implemented, then it may be set to any of the + * following modes: OFF or AUTO. + */ + OFF = 1, + /** + * This state indicates the windshield wipers are currently on. If + * VehicleProperty#WINDSHIELD_WIPERS_SWITCH is implemented, then it may be set to any of the + * following modes: MIST, INTERMITTENT_LEVEL_*, CONTINUOUS_LEVEL_*, or AUTO. + */ + ON = 2, + /** + * Windshield wipers are in the service mode. + */ + SERVICE = 3, +} diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl new file mode 100644 index 0000000000..911d7ebfa5 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/WindshieldWipersSwitch.aidl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current position of VehicleProperty#WINDSHIELD_WIPERS_SWITCH. + */ +@VintfStability +@Backing(type="int") +enum WindshieldWipersSwitch { + + /** + * This value is used as an alternative for any WindshieldWipersSwitch value that is not defined + * in the platform. Ideally, implementations of VehicleProperty#WINDSHIELD_WIPERS_SWITCH should + * not use this value. The framework can use this field to remain backwards compatible if + * WindshieldWipersSwitch is extended to include additional values. + */ + OTHER = 0, + /** + * The windshield wipers switch is set to the off position. + */ + OFF = 1, + /** + * MIST mode performs a single wipe, and then returns to the OFF position. + */ + MIST = 2, + /** + * INTERMITTENT_LEVEL_* modes performs intermittent wiping. As the level increases, the + * intermittent time period decreases. + */ + INTERMITTENT_LEVEL_1 = 3, + INTERMITTENT_LEVEL_2 = 4, + INTERMITTENT_LEVEL_3 = 5, + INTERMITTENT_LEVEL_4 = 6, + INTERMITTENT_LEVEL_5 = 7, + /** + * CONTINUOUS_LEVEL_* modes performs continuous wiping. As the level increases the speed of the + * wiping increases as well. + */ + CONTINUOUS_LEVEL_1 = 8, + CONTINUOUS_LEVEL_2 = 9, + CONTINUOUS_LEVEL_3 = 10, + CONTINUOUS_LEVEL_4 = 11, + CONTINUOUS_LEVEL_5 = 12, + /** + * AUTO allows the vehicle to decide the required wiping level based on the exterior weather + * conditions. + */ + AUTO = 13, + /** + * Windshield wipers are set to the service mode. + */ + SERVICE = 14, +} diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py new file mode 100644 index 0000000000..c36cbb015e --- /dev/null +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -0,0 +1,245 @@ +#!/usr/bin/python + +# Copyright (C) 2022 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +"""A script to generate Java files and CPP header files based on annotations in VehicleProperty.aidl + + Need ANDROID_BUILD_TOP environmental variable to be set. This script will update + ChangeModeForVehicleProperty.h and AccessForVehicleProperty.h under generated_lib/cpp and + ChangeModeForVehicleProperty.java and AccessForVehicleProperty.java under generated_lib/java. + + Usage: + $ python generate_annotation_enums.py +""" +import os +import re +import sys + +PROP_AIDL_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/" + + "automotive/vehicle/VehicleProperty.aidl") +CHANGE_MODE_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" + + "ChangeModeForVehicleProperty.h") +ACCESS_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" + + "AccessForVehicleProperty.h") +CHANGE_MODE_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/" + + "ChangeModeForVehicleProperty.java") +ACCESS_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/" + + "AccessForVehicleProperty.java") + +TAB = " " +RE_ENUM_START = re.compile("\s*enum VehicleProperty \{") +RE_ENUM_END = re.compile("\s*\}\;") +RE_COMMENT_BEGIN = re.compile("\s*\/\*\*?") +RE_COMMENT_END = re.compile("\s*\*\/") +RE_CHANGE_MODE = re.compile("\s*\* @change_mode (\S+)\s*") +RE_ACCESS = re.compile("\s*\* @access (\S+)\s*") +RE_VALUE = re.compile("\s*(\w+)\s*=(.*)") + +LICENSE = """/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DO NOT EDIT MANUALLY!!! + * + * Generated by tools/generate_annotation_enums.py. + */ + +// clang-format off + +""" + +CHANGE_MODE_CPP_HEADER = """#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_ +#define android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_ + +#include +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +std::unordered_map ChangeModeForVehicleProperty = { +""" + +CHANGE_MODE_CPP_FOOTER = """ +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android +} // aidl + +#endif // android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_ +""" + +ACCESS_CPP_HEADER = """#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_ +#define android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_ + +#include +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +std::unordered_map AccessForVehicleProperty = { +""" + +ACCESS_CPP_FOOTER = """ +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android +} // aidl + +#endif // android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_ +""" + +CHANGE_MODE_JAVA_HEADER = """package android.hardware.automotive.vehicle; + +import java.util.Map; + +public final class ChangeModeForVehicleProperty { + + public static final Map values = Map.ofEntries( +""" + +CHANGE_MODE_JAVA_FOOTER = """ + ); + +} +""" + +ACCESS_JAVA_HEADER = """package android.hardware.automotive.vehicle; + +import java.util.Map; + +public final class AccessForVehicleProperty { + + public static final Map values = Map.ofEntries( +""" + +ACCESS_JAVA_FOOTER = """ + ); + +} +""" + + +class Converter: + + def __init__(self, name, annotation_re): + self.name = name + self.annotation_re = annotation_re + + def convert(self, input, output, header, footer, cpp): + processing = False + in_comment = False + content = LICENSE + header + annotation = None + id = 0 + with open(input, 'r') as f: + for line in f.readlines(): + if RE_ENUM_START.match(line): + processing = True + annotation = None + elif RE_ENUM_END.match(line): + processing = False + if not processing: + continue + if RE_COMMENT_BEGIN.match(line): + in_comment = True + if RE_COMMENT_END.match(line): + in_comment = False + if in_comment: + match = self.annotation_re.match(line) + if match: + annotation = match.group(1) + else: + match = RE_VALUE.match(line) + if match: + prop_name = match.group(1) + if prop_name == "INVALID": + continue + if not annotation: + print("No @" + self.name + " annotation for property: " + prop_name) + sys.exit(1) + if id != 0: + content += "\n" + if cpp: + annotation = annotation.replace(".", "::") + content += (TAB + TAB + "{VehicleProperty::" + prop_name + ", " + + annotation + "},") + else: + content += (TAB + TAB + "Map.entry(VehicleProperty." + prop_name + ", " + + annotation + "),") + id += 1 + + # Remove the additional "," at the end for the Java file. + if not cpp: + content = content[:-1] + + content += footer + + with open(output, 'w') as f: + f.write(content) + + +def main(): + android_top = os.environ['ANDROID_BUILD_TOP'] + if not android_top: + print("ANDROID_BUILD_TOP is not in envorinmental variable, please run source and lunch " + + "at the android root") + + aidl_file = os.path.join(android_top, PROP_AIDL_FILE_PATH) + change_mode_cpp_output = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH); + access_cpp_output = os.path.join(android_top, ACCESS_CPP_FILE_PATH); + change_mode_java_output = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH); + access_java_output = os.path.join(android_top, ACCESS_JAVA_FILE_PATH); + + c = Converter("change_mode", RE_CHANGE_MODE); + c.convert(aidl_file, change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, True) + c.convert(aidl_file, change_mode_java_output, CHANGE_MODE_JAVA_HEADER, CHANGE_MODE_JAVA_FOOTER, False) + c = Converter("access", RE_ACCESS) + c.convert(aidl_file, access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True) + c.convert(aidl_file, access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False) + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/automotive/vehicle/vhal_static_cpp_lib.mk b/automotive/vehicle/vhal_static_cpp_lib.mk new file mode 100644 index 0000000000..995589c47e --- /dev/null +++ b/automotive/vehicle/vhal_static_cpp_lib.mk @@ -0,0 +1,20 @@ +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This make file contains the latest version of static cpp libraries for VHAL +# interface and VHAL properties. + +LOCAL_STATIC_LIBRARIES += \ + android.hardware.automotive.vehicle-V2-ndk \ + android.hardware.automotive.vehicle.property-V2-ndk diff --git a/automotive/vehicle/vts/Android.bp b/automotive/vehicle/vts/Android.bp index b78e0ff7c4..736787b881 100644 --- a/automotive/vehicle/vts/Android.bp +++ b/automotive/vehicle/vts/Android.bp @@ -44,6 +44,8 @@ cc_test { test_suites: [ "general-tests", "vts", + "automotive-tests", + "automotive-general-tests", ], require_root: true, } diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index c431d85eef..8bcad1e0cb 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -44,10 +44,13 @@ using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehicleArea; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::android::getAidlHalInstanceNames; using ::android::base::ScopedLockAssertion; using ::android::base::StringPrintf; +using ::android::frameworks::automotive::vhal::ErrorCode; using ::android::frameworks::automotive::vhal::HalPropError; using ::android::frameworks::automotive::vhal::IHalPropConfig; using ::android::frameworks::automotive::vhal::IHalPropValue; @@ -113,6 +116,9 @@ class VtsVehicleCallback final : public ISubscriptionCallback { class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam { public: + void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access, + VehiclePropertyChangeMode changeMode, VehiclePropertyGroup group, + VehicleArea area, VehiclePropertyType propertyType); virtual void SetUp() override { auto descriptor = GetParam(); if (descriptor.isAidlService) { @@ -287,7 +293,31 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, setNotWritableProp) { auto setValueResult = mVhalClient->setValueSync(*getValueResult.value()); ASSERT_FALSE(setValueResult.ok()) << "Expect set a read-only value to fail"; - ASSERT_EQ(setValueResult.error().code(), StatusCode::ACCESS_DENIED); + ASSERT_EQ(setValueResult.error().code(), ErrorCode::ACCESS_DENIED_FROM_VHAL); +} + +// Test get(), set() and getAllPropConfigs() on VehicleProperty::INVALID. +TEST_P(VtsHalAutomotiveVehicleTargetTest, getSetPropertyIdInvalid) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::getSetPropertyIdInvalid"); + + int32_t propId = toInt(VehicleProperty::INVALID); + auto getValueResult = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); + ASSERT_FALSE(getValueResult.ok()) << "Expect get on VehicleProperty::INVALID to fail"; + ASSERT_EQ(getValueResult.error().code(), ErrorCode::INVALID_ARG); + + auto propToSet = mVhalClient->createHalPropValue(propId); + propToSet->setInt32Values({0}); + auto setValueResult = mVhalClient->setValueSync(*propToSet); + ASSERT_FALSE(setValueResult.ok()) << "Expect set on VehicleProperty::INVALID to fail"; + ASSERT_EQ(setValueResult.error().code(), ErrorCode::INVALID_ARG); + + auto result = mVhalClient->getAllPropConfigs(); + ASSERT_TRUE(result.ok()); + for (const auto& cfgPtr : result.value()) { + const IHalPropConfig& cfg = *cfgPtr; + ASSERT_FALSE(cfg.getPropId() == propId) << "Expect VehicleProperty::INVALID to not be " + "included in propConfigs"; + } } // Test subscribe() and unsubscribe(). @@ -419,6 +449,422 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetValuesTimestampAIDL) { } } +// Helper function to compare actual vs expected property config +void VtsHalAutomotiveVehicleTargetTest::verifyProperty(VehicleProperty propId, + VehiclePropertyAccess access, + VehiclePropertyChangeMode changeMode, + VehiclePropertyGroup group, VehicleArea area, + VehiclePropertyType propertyType) { + int expectedPropId = toInt(propId); + int expectedAccess = toInt(access); + int expectedChangeMode = toInt(changeMode); + int expectedGroup = toInt(group); + int expectedArea = toInt(area); + int expectedPropertyType = toInt(propertyType); + + auto result = mVhalClient->getAllPropConfigs(); + ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " + << result.error().message(); + + // Check if property is implemented by getting all configs and looking to see if the expected + // property id is in that list. + bool isExpectedPropIdImplemented = false; + for (const auto& cfgPtr : result.value()) { + const IHalPropConfig& cfg = *cfgPtr; + if (expectedPropId == cfg.getPropId()) { + isExpectedPropIdImplemented = true; + break; + } + } + + if (!isExpectedPropIdImplemented) { + GTEST_SKIP() << StringPrintf("Property %" PRId32 " has not been implemented", + expectedPropId); + } + + result = mVhalClient->getPropConfigs({expectedPropId}); + ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " + << result.error().message(); + + ASSERT_EQ(result.value().size(), 1u) + << StringPrintf("Expect to get exactly 1 config, got %zu", result.value().size()); + + const auto& config = result.value().at(0); + int actualPropId = config->getPropId(); + int actualAccess = config->getAccess(); + int actualChangeMode = config->getChangeMode(); + int actualGroup = actualPropId & toInt(VehiclePropertyGroup::MASK); + int actualArea = actualPropId & toInt(VehicleArea::MASK); + int actualPropertyType = actualPropId & toInt(VehiclePropertyType::MASK); + + ASSERT_EQ(actualPropId, expectedPropId) + << StringPrintf("Expect to get property ID: %i, got %i", expectedPropId, actualPropId); + + if (expectedAccess == toInt(VehiclePropertyAccess::READ_WRITE)) { + ASSERT_TRUE(actualAccess == expectedAccess || + actualAccess == toInt(VehiclePropertyAccess::READ)) + << StringPrintf("Expect to get VehiclePropertyAccess: %i or %i, got %i", + expectedAccess, toInt(VehiclePropertyAccess::READ), actualAccess); + } else { + ASSERT_EQ(actualAccess, expectedAccess) << StringPrintf( + "Expect to get VehiclePropertyAccess: %i, got %i", expectedAccess, actualAccess); + } + + ASSERT_EQ(actualChangeMode, expectedChangeMode) + << StringPrintf("Expect to get VehiclePropertyChangeMode: %i, got %i", + expectedChangeMode, actualChangeMode); + ASSERT_EQ(actualGroup, expectedGroup) << StringPrintf( + "Expect to get VehiclePropertyGroup: %i, got %i", expectedGroup, actualGroup); + ASSERT_EQ(actualArea, expectedArea) + << StringPrintf("Expect to get VehicleArea: %i, got %i", expectedArea, actualArea); + ASSERT_EQ(actualPropertyType, expectedPropertyType) + << StringPrintf("Expect to get VehiclePropertyType: %i, got %i", expectedPropertyType, + actualPropertyType); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLocationCharacterizationConfig) { + verifyProperty(VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { + verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistStateConfig) { + verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlEnabledConfig) { + verifyProperty(VehicleProperty::CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTypeConfig) { + verifyProperty(VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlStateConfig) { + verifyProperty(VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlCommandConfig) { + verifyProperty(VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTargetSpeedConfig) { + verifyProperty(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAdaptiveCruiseControlTargetTimeGapConfig) { + verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, + verifyAdaptiveCruiseControlLeadVehicleMeasuredDistanceConfig) { + verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, + VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionEnabledConfig) { + verifyProperty(VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionDriverStateConfig) { + verifyProperty(VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionWarningConfig) { + verifyProperty(VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { + verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvStoppingModeConfig) { + verifyProperty(VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvCurrentBatteryCapacityConfig) { + verifyProperty(VehicleProperty::EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEngineIdleAutoStopEnabledConfig) { + verifyProperty(VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDoorChildLockEnabledConfig) { + verifyProperty(VehicleProperty::DOOR_CHILD_LOCK_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::DOOR, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersPeriodConfig) { + verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::WINDOW, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersStateConfig) { + verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::WINDOW, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersSwitchConfig) { + verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::WINDOW, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthPosConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthMoveConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelHeightPosConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelHeightMoveConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelTheftLockEnabledConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLockedConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_LOCKED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelEasyAccessEnabledConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLightsStateConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLightsSwitchConfig) { + verifyProperty(VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyGloveBoxDoorPosConfig) { + verifyProperty(VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyGloveBoxLockedConfig) { + verifyProperty(VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyMirrorAutoFoldEnabledConfig) { + verifyProperty(VehicleProperty::MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::MIRROR, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyMirrorAutoTiltEnabledConfig) { + verifyProperty(VehicleProperty::MIRROR_AUTO_TILT_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::MIRROR, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatHeadrestHeightPosV2Config) { + verifyProperty(VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatWalkInPosConfig) { + verifyProperty(VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatFootwellLightsStateConfig) { + verifyProperty(VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatFootwellLightsSwitchConfig) { + verifyProperty(VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatEasyAccessEnabledConfig) { + verifyProperty(VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagEnabledConfig) { + verifyProperty(VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportPosConfig) { + verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportMoveConfig) { + verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatLumbarVerticalPosConfig) { + verifyProperty(VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatLumbarVerticalMoveConfig) { + verifyProperty(VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingEnabledConfig) { + verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingStateConfig) { + verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningEnabledConfig) { + verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningStateConfig) { + verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningEnabledConfig) { + verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningStateConfig) { + verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::MIRROR, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningEnabledConfig) { + verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningStateConfig) { + verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistEnabledConfig) { + verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistStateConfig) { + verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistEnabledConfig) { + verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistCommandConfig) { + verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) { + verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + std::vector getDescriptors() { std::vector descriptors; for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { diff --git a/biometrics/common/aidl/Android.bp b/biometrics/common/aidl/Android.bp index 0f795f8bc4..b41a9374ea 100644 --- a/biometrics/common/aidl/Android.bp +++ b/biometrics/common/aidl/Android.bp @@ -32,7 +32,10 @@ aidl_interface { version: "2", imports: [], }, + { + version: "3", + imports: [], + }, ], - } diff --git a/biometrics/common/aidl/OWNERS b/biometrics/common/aidl/OWNERS deleted file mode 100644 index 36d726136f..0000000000 --- a/biometrics/common/aidl/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -ilyamaty@google.com -kchyn@google.com diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/.hash b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/.hash new file mode 100644 index 0000000000..15b5032bbe --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/.hash @@ -0,0 +1 @@ +a9ebb97f5abea1dc6800b69d821ef61944e80e65 diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/AuthenticateReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/AuthenticateReason.aidl new file mode 100644 index 0000000000..f639ead601 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/AuthenticateReason.aidl @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@VintfStability +union AuthenticateReason { + android.hardware.biometrics.common.AuthenticateReason.Vendor vendorAuthenticateReason; + android.hardware.biometrics.common.AuthenticateReason.Face faceAuthenticateReason; + android.hardware.biometrics.common.AuthenticateReason.Fingerprint fingerprintAuthenticateReason; + @VintfStability + parcelable Vendor { + ParcelableHolder extension; + } + @Backing(type="int") @VintfStability + enum Fingerprint { + UNKNOWN, + } + @Backing(type="int") @VintfStability + enum Face { + UNKNOWN, + STARTED_WAKING_UP, + PRIMARY_BOUNCER_SHOWN, + ASSISTANT_VISIBLE, + ALTERNATE_BIOMETRIC_BOUNCER_SHOWN, + NOTIFICATION_PANEL_CLICKED, + OCCLUDING_APP_REQUESTED, + PICK_UP_GESTURE_TRIGGERED, + QS_EXPANDED, + SWIPE_UP_ON_BOUNCER, + UDFPS_POINTER_DOWN, + } +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/CommonProps.aidl new file mode 100644 index 0000000000..1eb8541352 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/CommonProps.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@VintfStability +parcelable CommonProps { + int sensorId; + android.hardware.biometrics.common.SensorStrength sensorStrength = android.hardware.biometrics.common.SensorStrength.CONVENIENCE; + int maxEnrollmentsPerUser; + android.hardware.biometrics.common.ComponentInfo[] componentInfo; +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/ComponentInfo.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/ComponentInfo.aidl new file mode 100644 index 0000000000..471ed2ba37 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/ComponentInfo.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@VintfStability +parcelable ComponentInfo { + String componentId; + String hardwareVersion; + String firmwareVersion; + String serialNumber; + String softwareVersion; +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/DisplayState.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/DisplayState.aidl new file mode 100644 index 0000000000..176e8d603b --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/DisplayState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum DisplayState { + UNKNOWN, + LOCKSCREEN, + NO_UI, + SCREENSAVER, + AOD, +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/ICancellationSignal.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/ICancellationSignal.aidl new file mode 100644 index 0000000000..670114f10a --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/ICancellationSignal.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@VintfStability +interface ICancellationSignal { + oneway void cancel(); +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/OperationContext.aidl new file mode 100644 index 0000000000..378017e8d4 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/OperationContext.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@VintfStability +parcelable OperationContext { + int id = 0; + android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN; + /** + * @deprecated use displayState instead. + */ + boolean isAod = false; + boolean isCrypto = false; + android.hardware.biometrics.common.WakeReason wakeReason = android.hardware.biometrics.common.WakeReason.UNKNOWN; + android.hardware.biometrics.common.DisplayState displayState = android.hardware.biometrics.common.DisplayState.UNKNOWN; + @nullable android.hardware.biometrics.common.AuthenticateReason authenticateReason; +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/OperationReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/OperationReason.aidl new file mode 100644 index 0000000000..188054a45a --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/OperationReason.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@Backing(type="byte") @VintfStability +enum OperationReason { + UNKNOWN, + BIOMETRIC_PROMPT, + KEYGUARD, +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/SensorStrength.aidl new file mode 100644 index 0000000000..c93178167d --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/SensorStrength.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@Backing(type="byte") @VintfStability +enum SensorStrength { + CONVENIENCE, + WEAK, + STRONG, +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/WakeReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/WakeReason.aidl new file mode 100644 index 0000000000..6a08776280 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/3/android/hardware/biometrics/common/WakeReason.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum WakeReason { + UNKNOWN, + POWER_BUTTON, + GESTURE, + WAKE_KEY, + WAKE_MOTION, + LID, + DISPLAY_GROUP_ADDED, + TAP, + LIFT, + BIOMETRIC, +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/AuthenticateReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/AuthenticateReason.aidl new file mode 100644 index 0000000000..f639ead601 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/AuthenticateReason.aidl @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@VintfStability +union AuthenticateReason { + android.hardware.biometrics.common.AuthenticateReason.Vendor vendorAuthenticateReason; + android.hardware.biometrics.common.AuthenticateReason.Face faceAuthenticateReason; + android.hardware.biometrics.common.AuthenticateReason.Fingerprint fingerprintAuthenticateReason; + @VintfStability + parcelable Vendor { + ParcelableHolder extension; + } + @Backing(type="int") @VintfStability + enum Fingerprint { + UNKNOWN, + } + @Backing(type="int") @VintfStability + enum Face { + UNKNOWN, + STARTED_WAKING_UP, + PRIMARY_BOUNCER_SHOWN, + ASSISTANT_VISIBLE, + ALTERNATE_BIOMETRIC_BOUNCER_SHOWN, + NOTIFICATION_PANEL_CLICKED, + OCCLUDING_APP_REQUESTED, + PICK_UP_GESTURE_TRIGGERED, + QS_EXPANDED, + SWIPE_UP_ON_BOUNCER, + UDFPS_POINTER_DOWN, + } +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl index d4433c5bde..1eb8541352 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.common; +/* @hide */ @VintfStability parcelable CommonProps { int sensorId; diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ComponentInfo.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ComponentInfo.aidl index ad11ddaa6d..471ed2ba37 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ComponentInfo.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ComponentInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.common; +/* @hide */ @VintfStability parcelable ComponentInfo { String componentId; diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/DisplayState.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/DisplayState.aidl new file mode 100644 index 0000000000..176e8d603b --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/DisplayState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum DisplayState { + UNKNOWN, + LOCKSCREEN, + NO_UI, + SCREENSAVER, + AOD, +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl index 2bc6a6df05..670114f10a 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.common; +/* @hide */ @VintfStability interface ICancellationSignal { oneway void cancel(); diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl index 9d1cb8ff86..378017e8d4 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl @@ -32,10 +32,17 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.common; +/* @hide */ @VintfStability parcelable OperationContext { int id = 0; android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN; + /** + * @deprecated use displayState instead. + */ boolean isAod = false; boolean isCrypto = false; + android.hardware.biometrics.common.WakeReason wakeReason = android.hardware.biometrics.common.WakeReason.UNKNOWN; + android.hardware.biometrics.common.DisplayState displayState = android.hardware.biometrics.common.DisplayState.UNKNOWN; + @nullable android.hardware.biometrics.common.AuthenticateReason authenticateReason; } diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl index 3da3a6ab0b..188054a45a 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl @@ -32,9 +32,10 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.common; +/* @hide */ @Backing(type="byte") @VintfStability enum OperationReason { - UNKNOWN = 0, - BIOMETRIC_PROMPT = 1, - KEYGUARD = 2, + UNKNOWN, + BIOMETRIC_PROMPT, + KEYGUARD, } diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl index 6675d091e5..c93178167d 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl @@ -32,9 +32,10 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.common; +/* @hide */ @Backing(type="byte") @VintfStability enum SensorStrength { - CONVENIENCE = 0, - WEAK = 1, - STRONG = 2, + CONVENIENCE, + WEAK, + STRONG, } diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/WakeReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/WakeReason.aidl new file mode 100644 index 0000000000..6a08776280 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/WakeReason.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum WakeReason { + UNKNOWN, + POWER_BUTTON, + GESTURE, + WAKE_KEY, + WAKE_MOTION, + LID, + DISPLAY_GROUP_ADDED, + TAP, + LIFT, + BIOMETRIC, +} diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/AuthenticateReason.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/AuthenticateReason.aidl new file mode 100644 index 0000000000..fcf52949be --- /dev/null +++ b/biometrics/common/aidl/android/hardware/biometrics/common/AuthenticateReason.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.common; + +/** + * Reason for an authenticate operation. + * + * @hide + */ +@VintfStability +union AuthenticateReason { + /** Vendor reason for invoking an authenticate operation. */ + @VintfStability + parcelable Vendor { + ParcelableHolder extension; + } + + /** Reason for invoking fingerprint authentication. */ + @VintfStability + @Backing(type="int") + enum Fingerprint { + UNKNOWN, + } + + /** Reason for invoking face authentication. */ + @VintfStability + @Backing(type="int") + enum Face { + UNKNOWN, + STARTED_WAKING_UP, + PRIMARY_BOUNCER_SHOWN, + ASSISTANT_VISIBLE, + ALTERNATE_BIOMETRIC_BOUNCER_SHOWN, + NOTIFICATION_PANEL_CLICKED, + OCCLUDING_APP_REQUESTED, + PICK_UP_GESTURE_TRIGGERED, + QS_EXPANDED, + SWIPE_UP_ON_BOUNCER, + UDFPS_POINTER_DOWN, + } + + AuthenticateReason.Vendor vendorAuthenticateReason; + AuthenticateReason.Face faceAuthenticateReason; + AuthenticateReason.Fingerprint fingerprintAuthenticateReason; +} diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl index 2f5af5dbc9..cdedf4f18e 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl @@ -18,7 +18,9 @@ package android.hardware.biometrics.common; import android.hardware.biometrics.common.ComponentInfo; import android.hardware.biometrics.common.SensorStrength; - +/** + * @hide + */ @VintfStability parcelable CommonProps { /** diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/ComponentInfo.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/ComponentInfo.aidl index b268eef976..1da9cf6f04 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/ComponentInfo.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/ComponentInfo.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.common; - +/** + * @hide + */ @VintfStability parcelable ComponentInfo { /** diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/DisplayState.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/DisplayState.aidl new file mode 100644 index 0000000000..d01eac83f3 --- /dev/null +++ b/biometrics/common/aidl/android/hardware/biometrics/common/DisplayState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.common; + +/** + * Display state during an operation. + * + * @hide + */ +@VintfStability +@Backing(type="int") +enum DisplayState { + /** The display state is unknown. */ + UNKNOWN, + + /** The display is on and showing the lockscreen (or an occluding app). */ + LOCKSCREEN, + + /** The display is off or dozing. */ + NO_UI, + + /** The display is showing a screensaver (dreaming). */ + SCREENSAVER, + + /** The display is dreaming with always on display. */ + AOD, +} diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/ICancellationSignal.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/ICancellationSignal.aidl index 10102561b5..b9b1f39e28 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/ICancellationSignal.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/ICancellationSignal.aidl @@ -15,9 +15,10 @@ */ package android.hardware.biometrics.common; - +/** + * @hide + */ @VintfStability oneway interface ICancellationSignal { void cancel(); } - diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl index 72fe660126..f4191d751a 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl @@ -16,10 +16,14 @@ package android.hardware.biometrics.common; +import android.hardware.biometrics.common.AuthenticateReason; +import android.hardware.biometrics.common.DisplayState; import android.hardware.biometrics.common.OperationReason; +import android.hardware.biometrics.common.WakeReason; /** * Additional context associated with an operation. + * @hide */ @VintfStability parcelable OperationContext { @@ -41,9 +45,30 @@ parcelable OperationContext { */ OperationReason reason = OperationReason.UNKNOWN; - /* Flag indicating that the display is in AOD mode. */ + /** @deprecated use displayState instead. */ boolean isAod = false; /** Flag indicating that crypto was requested. */ boolean isCrypto = false; + + /** + * An associated wake reason for this operation or WakeReason.UNKNOWN if this + * operation was not associated with a device wake up event. + * + * This should be interpreted as a hint to enable optimizations or tracing. The + * framework may choose to use WakeReason.UNKNOWN at any time based on the device's + * policy. + */ + WakeReason wakeReason = WakeReason.UNKNOWN; + + /** The current display state. */ + DisplayState displayState = DisplayState.UNKNOWN; + + /** + * An associated reason for an authenticate operation. + * + * This should be interpreted as a hint to enable optimizations or tracing. The + * framework may choose to omit the reason at any time based on the device's policy. + */ + @nullable AuthenticateReason authenticateReason; } diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl index abc25ed663..1775c435b8 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl @@ -16,6 +16,10 @@ package android.hardware.biometrics.common; +/** + * The reason for invoking an operation. + * @hide + */ @VintfStability @Backing(type="byte") enum OperationReason { diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl index 790691cbfc..b5c09996c1 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.common; - +/** + * @hide + */ @VintfStability @Backing(type="byte") enum SensorStrength { @@ -40,4 +42,4 @@ enum SensorStrength { * HardwareAuthToken(s). */ STRONG, -} \ No newline at end of file +} diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/WakeReason.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/WakeReason.aidl new file mode 100644 index 0000000000..2f36b003ee --- /dev/null +++ b/biometrics/common/aidl/android/hardware/biometrics/common/WakeReason.aidl @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.common; + +/** + * The wake event associated with an operation, if applicable. + * + * The events largely shadow constants defined in PowerManager but they may deviate over time. + * @hide + */ +@VintfStability +@Backing(type="int") +enum WakeReason { + /** + * A normal operation without an explicit reason. + */ + UNKNOWN, + + /** + * Waking up due to power button press. + */ + POWER_BUTTON, + + /** + * Waking up due to a user performed gesture. This includes user + * interactions with UI on the screen such as the notification shade. This does not include + * WakeReason.TAP or WakeReason.LIFT. + */ + GESTURE, + + /** + * Waking up because a wake key other than power was pressed. + */ + WAKE_KEY, + + /** + * Waking up because a wake motion was performed. + */ + WAKE_MOTION, + + /** + * Waking due to the lid being opened. + */ + LID, + + /** + * Waking due to display group being added. + */ + DISPLAY_GROUP_ADDED, + + /** + * Waking up due to the user single or double tapping on the screen. This + * wake reason is used when the user is not tapping on a specific UI element; rather, the device + * wakes up due to a generic tap on the screen. + */ + TAP, + + /** + * Waking up due to a user performed lift gesture. + */ + LIFT, + + /** + * Waking up due to a user interacting with a biometric. + */ + BIOMETRIC, +} diff --git a/biometrics/common/thread/Android.bp b/biometrics/common/thread/Android.bp new file mode 100644 index 0000000000..a497d01524 --- /dev/null +++ b/biometrics/common/thread/Android.bp @@ -0,0 +1,26 @@ +cc_library { + // 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 + name: "android.hardware.biometrics.common.thread", + export_include_dirs: ["include"], + vendor: true, + srcs: [ + "WorkerThread.cpp", + ], +} + +cc_test_host { + name: "android.hardware.biometrics.common.WorkerThreadTest", + local_include_dirs: ["include"], + srcs: [ + "tests/WorkerThreadTest.cpp", + "WorkerThread.cpp", + ], + shared_libs: [ + "libcutils", + ], + test_suites: ["general-tests"], +} diff --git a/biometrics/fingerprint/aidl/default/WorkerThread.cpp b/biometrics/common/thread/WorkerThread.cpp similarity index 89% rename from biometrics/fingerprint/aidl/default/WorkerThread.cpp rename to biometrics/common/thread/WorkerThread.cpp index d1a63d07ee..61d1a13422 100644 --- a/biometrics/fingerprint/aidl/default/WorkerThread.cpp +++ b/biometrics/common/thread/WorkerThread.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "WorkerThread.h" +#include "thread/WorkerThread.h" -namespace aidl::android::hardware::biometrics::fingerprint { +namespace aidl::android::hardware::biometrics { // It's important that mThread is initialized after everything else because it runs a member // function that may use any member of this class. @@ -31,7 +31,10 @@ WorkerThread::WorkerThread(size_t maxQueueSize) WorkerThread::~WorkerThread() { // This is a signal for threadFunc to terminate as soon as possible, and a hint for schedule // that it doesn't need to do any work. - mIsDestructing = true; + { + std::unique_lock lock(mQueueMutex); + mIsDestructing = true; + } mQueueCond.notify_all(); mThread.join(); } @@ -65,4 +68,4 @@ void WorkerThread::threadFunc() { } } -} // namespace aidl::android::hardware::biometrics::fingerprint +} // namespace aidl::android::hardware::biometrics diff --git a/biometrics/fingerprint/aidl/default/include/Callable.h b/biometrics/common/thread/include/thread/Callable.h similarity index 92% rename from biometrics/fingerprint/aidl/default/include/Callable.h rename to biometrics/common/thread/include/thread/Callable.h index c6295117e5..6eeff76521 100644 --- a/biometrics/fingerprint/aidl/default/include/Callable.h +++ b/biometrics/common/thread/include/thread/Callable.h @@ -16,7 +16,7 @@ #pragma once -namespace aidl::android::hardware::biometrics::fingerprint { +namespace aidl::android::hardware::biometrics { // Interface for representing parameterless functions. Unlike std::function, this can also // represent move-only lambdas. @@ -51,4 +51,4 @@ std::unique_ptr Callable::from(T func) { return std::make_unique>(std::move(func)); } -} // namespace aidl::android::hardware::biometrics::fingerprint \ No newline at end of file +} // namespace aidl::android::hardware::biometrics \ No newline at end of file diff --git a/biometrics/fingerprint/aidl/default/include/WorkerThread.h b/biometrics/common/thread/include/thread/WorkerThread.h similarity index 96% rename from biometrics/fingerprint/aidl/default/include/WorkerThread.h rename to biometrics/common/thread/include/thread/WorkerThread.h index 6fff4f2cb7..5f89a7f1c4 100644 --- a/biometrics/fingerprint/aidl/default/include/WorkerThread.h +++ b/biometrics/common/thread/include/thread/WorkerThread.h @@ -23,7 +23,7 @@ #include "Callable.h" -namespace aidl::android::hardware::biometrics::fingerprint { +namespace aidl::android::hardware::biometrics { // A class that encapsulates a worker thread and a task queue, and provides a convenient interface // for a Session to schedule its tasks for asynchronous execution. @@ -76,4 +76,4 @@ class WorkerThread final { std::thread mThread; }; -} // namespace aidl::android::hardware::biometrics::fingerprint +} // namespace aidl::android::hardware::biometrics diff --git a/biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp b/biometrics/common/thread/tests/WorkerThreadTest.cpp similarity index 96% rename from biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp rename to biometrics/common/thread/tests/WorkerThreadTest.cpp index 902fb40c6b..5bb9e7e886 100644 --- a/biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp +++ b/biometrics/common/thread/tests/WorkerThreadTest.cpp @@ -21,12 +21,11 @@ #include -#include "WorkerThread.h" +#include "thread/WorkerThread.h" namespace { -using aidl::android::hardware::biometrics::fingerprint::Callable; -using aidl::android::hardware::biometrics::fingerprint::WorkerThread; +using namespace aidl::android::hardware::biometrics; using namespace std::chrono_literals; TEST(WorkerThreadTest, ScheduleReturnsTrueWhenQueueHasSpace) { diff --git a/biometrics/common/util/Android.bp b/biometrics/common/util/Android.bp new file mode 100644 index 0000000000..b990812856 --- /dev/null +++ b/biometrics/common/util/Android.bp @@ -0,0 +1,18 @@ +cc_library { + // 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 + name: "android.hardware.biometrics.common.util", + export_include_dirs: ["include"], + vendor: true, + srcs: [ + "CancellationSignal.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.biometrics.common-V3-ndk", + ], +} diff --git a/biometrics/fingerprint/aidl/default/CancellationSignal.cpp b/biometrics/common/util/CancellationSignal.cpp similarity index 87% rename from biometrics/fingerprint/aidl/default/CancellationSignal.cpp rename to biometrics/common/util/CancellationSignal.cpp index 659831616d..7888838b48 100644 --- a/biometrics/fingerprint/aidl/default/CancellationSignal.cpp +++ b/biometrics/common/util/CancellationSignal.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "CancellationSignal.h" +#include "util/CancellationSignal.h" #include #include -namespace aidl::android::hardware::biometrics::fingerprint { +namespace aidl::android::hardware::biometrics { CancellationSignal::CancellationSignal(std::promise&& cancellationPromise) : mCancellationPromise(std::move(cancellationPromise)) {} @@ -34,4 +34,4 @@ bool shouldCancel(const std::future& f) { return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; } -} // namespace aidl::android::hardware::biometrics::fingerprint +} // namespace aidl::android::hardware::biometrics diff --git a/biometrics/fingerprint/aidl/default/include/CancellationSignal.h b/biometrics/common/util/include/util/CancellationSignal.h similarity index 84% rename from biometrics/fingerprint/aidl/default/include/CancellationSignal.h rename to biometrics/common/util/include/util/CancellationSignal.h index 99f2fbae97..be77e29fc0 100644 --- a/biometrics/fingerprint/aidl/default/include/CancellationSignal.h +++ b/biometrics/common/util/include/util/CancellationSignal.h @@ -17,13 +17,10 @@ #pragma once #include -#include #include #include -#include "WorkerThread.h" - -namespace aidl::android::hardware::biometrics::fingerprint { +namespace aidl::android::hardware::biometrics { class CancellationSignal : public common::BnCancellationSignal { public: @@ -39,4 +36,4 @@ class CancellationSignal : public common::BnCancellationSignal { // to this future should be cancelled. bool shouldCancel(const std::future& cancellationFuture); -} // namespace aidl::android::hardware::biometrics::fingerprint +} // namespace aidl::android::hardware::biometrics diff --git a/biometrics/common/util/include/util/Util.h b/biometrics/common/util/include/util/Util.h new file mode 100644 index 0000000000..da19dc6afe --- /dev/null +++ b/biometrics/common/util/include/util/Util.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include +#include +#include + +namespace aidl::android::hardware::biometrics { + +#define SLEEP_MS(x) \ + if (x > 0) std::this_thread::sleep_for(std::chrono::milliseconds(x)) +#define BEGIN_OP(x) \ + do { \ + LOG(INFO) << __func__; \ + SLEEP_MS(x); \ + } while (0) +#define IS_TRUE(x) ((x == "1") || (x == "true")) + +// This is for non-test situations, such as casual cuttlefish users, that don't +// set an explicit value. +// Some operations (i.e. enroll, authenticate) will be executed in tight loops +// by parts of the UI or fail if there is no latency. For example, the +// Face settings page constantly runs auth and the enrollment UI uses a +// cancel/restart cycle that requires some latency while the activities change. +#define DEFAULT_LATENCY 400 + +class Util { + public: + static int64_t getSystemNanoTime() { + timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + return now.tv_sec * 1000000000LL + now.tv_nsec; + } + + static bool hasElapsed(int64_t start, int64_t durationMillis) { + auto now = getSystemNanoTime(); + if (now < start) return true; + if (durationMillis <= 0) return true; + return ((now - start) / 1000000LL) > durationMillis; + } + + static std::vector split(const std::string& str, const std::string& sep) { + std::regex regex(sep); + std::vector parts( + std::sregex_token_iterator(str.begin(), str.end(), regex, -1), + std::sregex_token_iterator()); + return parts; + } +}; + +} // namespace aidl::android::hardware::biometrics diff --git a/biometrics/face/1.0/vts/functional/OWNERS b/biometrics/face/1.0/vts/functional/OWNERS deleted file mode 100644 index 7651b694f4..0000000000 --- a/biometrics/face/1.0/vts/functional/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# Bug component: 432605 -ilyamaty@google.com diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 78f113d3bf..79df9c6354 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -14,9 +14,9 @@ aidl_interface { "android/hardware/biometrics/face/**/*.aidl", ], imports: [ - "android.hardware.biometrics.common-V2", + "android.hardware.biometrics.common-V3", "android.hardware.common-V2", - "android.hardware.keymaster-V3", + "android.hardware.keymaster-V4", ], stability: "vintf", backend: { @@ -44,7 +44,16 @@ aidl_interface { "android.hardware.keymaster-V3", ], }, + { + version: "3", + imports: [ + "android.hardware.biometrics.common-V3", + "android.hardware.common-V2", + "android.hardware.keymaster-V4", + ], + }, ], + frozen: true, } diff --git a/biometrics/face/aidl/OWNERS b/biometrics/face/aidl/OWNERS deleted file mode 100644 index 36d726136f..0000000000 --- a/biometrics/face/aidl/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -ilyamaty@google.com -kchyn@google.com diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/.hash b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/.hash new file mode 100644 index 0000000000..3b42823a6c --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/.hash @@ -0,0 +1 @@ +fca1ab84dda6c013b251270d848eb6d964a6d765 diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/AcquiredInfo.aidl new file mode 100644 index 0000000000..5312ca16d6 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum AcquiredInfo { + UNKNOWN, + GOOD, + INSUFFICIENT, + TOO_BRIGHT, + TOO_DARK, + TOO_CLOSE, + TOO_FAR, + FACE_TOO_HIGH, + FACE_TOO_LOW, + FACE_TOO_RIGHT, + FACE_TOO_LEFT, + POOR_GAZE, + NOT_DETECTED, + TOO_MUCH_MOTION, + RECALIBRATE, + TOO_DIFFERENT, + TOO_SIMILAR, + PAN_TOO_EXTREME, + TILT_TOO_EXTREME, + ROLL_TOO_EXTREME, + FACE_OBSCURED, + START, + SENSOR_DIRTY, + VENDOR, + FIRST_FRAME_RECEIVED, + DARK_GLASSES_DETECTED, + MOUTH_COVERING_DETECTED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/AuthenticationFrame.aidl new file mode 100644 index 0000000000..20bc76779b --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/AuthenticationFrame.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable AuthenticationFrame { + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/BaseFrame.aidl new file mode 100644 index 0000000000..67b5cf4169 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/BaseFrame.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable BaseFrame { + android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN; + int vendorCode; + float pan; + float tilt; + float distance; + boolean isCancellable; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Cell.aidl new file mode 100644 index 0000000000..6be8c8e975 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Cell.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable Cell { + int x; + int y; + int z; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentFrame.aidl new file mode 100644 index 0000000000..0ea10d6ddb --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable EnrollmentFrame { + @nullable android.hardware.biometrics.face.Cell cell; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentStage.aidl new file mode 100644 index 0000000000..a203dbec18 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum EnrollmentStage { + UNKNOWN, + FIRST_FRAME_RECEIVED, + WAITING_FOR_CENTERING, + HOLD_STILL_IN_CENTER, + ENROLLING_MOVEMENT_1, + ENROLLING_MOVEMENT_2, + ENROLLMENT_FINISHED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentStageConfig.aidl new file mode 100644 index 0000000000..48db2cf615 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable EnrollmentStageConfig { + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + List cells; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentType.aidl new file mode 100644 index 0000000000..da1e8a3e95 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/EnrollmentType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum EnrollmentType { + DEFAULT, + ACCESSIBILITY, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Error.aidl new file mode 100644 index 0000000000..28eb420587 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Error.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum Error { + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + REENROLL_REQUIRED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/FaceSensorType.aidl new file mode 100644 index 0000000000..bf1677ceec --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/FaceSensorType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum FaceSensorType { + UNKNOWN, + RGB, + IR, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Feature.aidl new file mode 100644 index 0000000000..924e6af44e --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/Feature.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum Feature { + REQUIRE_ATTENTION, + REQUIRE_DIVERSE_POSES, + DEBUG, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/IFace.aidl new file mode 100644 index 0000000000..fc4a4d04bb --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/IFace.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +interface IFace { + android.hardware.biometrics.face.SensorProps[] getSensorProps(); + android.hardware.biometrics.face.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.face.ISessionCallback cb); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/ISession.aidl new file mode 100644 index 0000000000..366553485a --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/ISession.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +interface ISession { + void generateChallenge(); + void revokeChallenge(in long challenge); + android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType); + android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface); + android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); + android.hardware.biometrics.common.ICancellationSignal detectInteraction(); + void enumerateEnrollments(); + void removeEnrollments(in int[] enrollmentIds); + void getFeatures(); + void setFeature(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.Feature feature, boolean enabled); + void getAuthenticatorId(); + void invalidateAuthenticatorId(); + void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); + void close(); + android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); + void onContextChanged(in android.hardware.biometrics.common.OperationContext context); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/ISessionCallback.aidl new file mode 100644 index 0000000000..bbace29aa0 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/ISessionCallback.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +interface ISessionCallback { + void onChallengeGenerated(in long challenge); + void onChallengeRevoked(in long challenge); + void onAuthenticationFrame(in android.hardware.biometrics.face.AuthenticationFrame frame); + void onEnrollmentFrame(in android.hardware.biometrics.face.EnrollmentFrame frame); + void onError(in android.hardware.biometrics.face.Error error, in int vendorCode); + void onEnrollmentProgress(in int enrollmentId, int remaining); + void onAuthenticationSucceeded(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat); + void onAuthenticationFailed(); + void onLockoutTimed(in long durationMillis); + void onLockoutPermanent(); + void onLockoutCleared(); + void onInteractionDetected(); + void onEnrollmentsEnumerated(in int[] enrollmentIds); + void onFeaturesRetrieved(in android.hardware.biometrics.face.Feature[] features); + void onFeatureSet(android.hardware.biometrics.face.Feature feature); + void onEnrollmentsRemoved(in int[] enrollmentIds); + void onAuthenticatorIdRetrieved(in long authenticatorId); + void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/SensorProps.aidl new file mode 100644 index 0000000000..8b3c51bb12 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/3/android/hardware/biometrics/face/SensorProps.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable SensorProps { + android.hardware.biometrics.common.CommonProps commonProps; + android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.UNKNOWN; + boolean halControlsPreview; + int previewDisplayId; + int enrollPreviewWidth; + int enrollPreviewHeight; + float enrollTranslationX; + float enrollTranslationY; + float enrollPreviewScale; + boolean supportsDetectInteraction; +} diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl index a92b3667fe..2be76cb901 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl @@ -178,6 +178,8 @@ interface ISession { * 2) A face is rejected, and ISessionCallback#onAuthenticationFailed is invoked. * 3) Any non-recoverable error occurs (such as lockout). See the full list of * authentication-specific errors in the Error enum. + * 4) ISessionCallback#onLockoutPermanent is invoked. + * 5) ISessionCallback#onLockoutTimed is invoked. * * Note that upon successful authentication, the lockout counter for this (sensorId, userId) * pair must be cleared. diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl index b3c348d521..9eb575cc3c 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl @@ -119,6 +119,8 @@ interface ISessionCallback { * lockout, and authentication can be restarted after a period of time. See * ISession#resetLockout. * + * This ends the authentication lifecycle. + * * @param sensorId Sensor for which the user is locked out. * @param userId User for which the sensor is locked out. * @param durationMillis Remaining duration of the lockout. @@ -131,6 +133,8 @@ interface ISessionCallback { * Authentication is disabled until the user unlocks with their device credential * (PIN/Pattern/Password). See ISession#resetLockout. * + * This ends the authentication lifecycle. + * * @param sensorId Sensor for which the user is locked out. * @param userId User for which the sensor is locked out. */ diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index 8aa06f8b5c..82ad9174a5 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -26,12 +26,45 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.biometrics.face-V2-ndk", - "android.hardware.biometrics.common-V2-ndk", + "android.hardware.biometrics.face-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.common.thread", + "android.hardware.biometrics.common.util", ], srcs: [ "main.cpp", "Face.cpp", + "FakeFaceEngine.cpp", "Session.cpp", ], + static_libs: ["libandroid.hardware.biometrics.face.VirtualProps"], +} + +sysprop_library { + name: "android.hardware.biometrics.face.VirtualProps", + srcs: ["face.sysprop"], + property_owner: "Vendor", + vendor: true, +} + +cc_test { + name: "android.hardware.biometrics.face.FakeFaceEngineTest", + srcs: [ + "tests/FakeFaceEngineTest.cpp", + "FakeFaceEngine.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + ], + static_libs: [ + "libandroid.hardware.biometrics.face.VirtualProps", + "android.hardware.biometrics.face-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.keymaster-V4-ndk", + "android.hardware.biometrics.common.util", + ], + vendor: true, + test_suites: ["general-tests"], + require_root: true, } diff --git a/biometrics/face/aidl/default/Face.cpp b/biometrics/face/aidl/default/Face.cpp index aca3e135f6..652a7e1f6c 100644 --- a/biometrics/face/aidl/default/Face.cpp +++ b/biometrics/face/aidl/default/Face.cpp @@ -17,12 +17,14 @@ #include "Face.h" #include "Session.h" +#include "FakeFaceEngine.h" + namespace aidl::android::hardware::biometrics::face { const int kSensorId = 4; -const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG; +const common::SensorStrength kSensorStrength = FakeFaceEngine::GetSensorStrength(); const int kMaxEnrollmentsPerUser = 5; -const FaceSensorType kSensorType = FaceSensorType::RGB; +const FaceSensorType kSensorType = FakeFaceEngine::GetSensorType(); const bool kHalControlsPreview = true; const std::string kHwComponentId = "faceSensor"; const std::string kHardwareVersion = "vendor/model/revision"; @@ -69,7 +71,7 @@ ndk::ScopedAStatus Face::getSensorProps(std::vector* return_val) { ndk::ScopedAStatus Face::createSession(int32_t /*sensorId*/, int32_t /*userId*/, const std::shared_ptr& cb, std::shared_ptr* return_val) { - *return_val = SharedRefBase::make(cb); + *return_val = SharedRefBase::make(std::make_unique(), cb); return ndk::ScopedAStatus::ok(); } diff --git a/biometrics/face/aidl/default/FakeFaceEngine.cpp b/biometrics/face/aidl/default/FakeFaceEngine.cpp new file mode 100644 index 0000000000..0f088f4331 --- /dev/null +++ b/biometrics/face/aidl/default/FakeFaceEngine.cpp @@ -0,0 +1,318 @@ +#include "FakeFaceEngine.h" + +#include + +#include + +#include "util/CancellationSignal.h" +#include "util/Util.h" + +using namespace ::android::face::virt; + +namespace aidl::android::hardware::biometrics::face { + +FaceSensorType FakeFaceEngine::GetSensorType() { + std::string type = FaceHalProperties::type().value_or(""); + if (type == "IR") { + return FaceSensorType::IR; + } else { + FaceHalProperties::type("RGB"); + return FaceSensorType::RGB; + } +} + +common::SensorStrength FakeFaceEngine::GetSensorStrength() { + std::string strength = FaceHalProperties::strength().value_or(""); + if (strength == "convenience") { + return common::SensorStrength::CONVENIENCE; + } else if (strength == "weak") { + return common::SensorStrength::WEAK; + } else { + FaceHalProperties::strength("strong"); + return common::SensorStrength::STRONG; + } +} + +void FakeFaceEngine::generateChallengeImpl(ISessionCallback* cb) { + BEGIN_OP(0); + std::uniform_int_distribution dist; + auto challenge = dist(mRandom); + FaceHalProperties::challenge(challenge); + cb->onChallengeGenerated(challenge); +} + +void FakeFaceEngine::revokeChallengeImpl(ISessionCallback* cb, int64_t challenge) { + BEGIN_OP(0); + FaceHalProperties::challenge({}); + cb->onChallengeRevoked(challenge); +} +void FakeFaceEngine::getEnrollmentConfigImpl(ISessionCallback* /*cb*/, + std::vector* /*return_val*/) {} +void FakeFaceEngine::enrollImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat, + EnrollmentType /*enrollmentType*/, + const std::vector& /*features*/, + const std::future& cancel) { + BEGIN_OP(FaceHalProperties::operation_start_enroll_latency().value_or(0)); + // format is ",::,::... + auto nextEnroll = FaceHalProperties::next_enrollment().value_or(""); + // Erase the next enrollment + FaceHalProperties::next_enrollment({}); + + AuthenticationFrame frame; + frame.data.acquiredInfo = AcquiredInfo::START; + frame.data.vendorCode = 0; + cb->onAuthenticationFrame(frame); + + // Do proper HAT verification in the real implementation. + if (hat.mac.empty()) { + LOG(ERROR) << "Fail: hat"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + if (FaceHalProperties::operation_enroll_fails().value_or(false)) { + LOG(ERROR) << "Fail: operation_enroll_fails"; + cb->onError(Error::VENDOR, 0 /* vendorError */); + return; + } + + auto parts = Util::split(nextEnroll, ","); + if (parts.size() < 2) { + LOG(ERROR) << "Fail: invalid next_enrollment for : " << nextEnroll; + cb->onError(Error::VENDOR, 0 /* vendorError */); + return; + } + + auto enrollmentId = std::stoi(parts[0]); + const int numBuckets = parts.size() - 1; + for (size_t i = 1; i < parts.size(); i++) { + auto enrollHit = Util::split(parts[i], ":"); + if (enrollHit.size() != 3) { + LOG(ERROR) << "Error when unpacking enrollment hit: " << parts[i]; + cb->onError(Error::VENDOR, 0 /* vendorError */); + } + std::string bucket = enrollHit[0]; + std::string delay = enrollHit[1]; + std::string succeeds = enrollHit[2]; + + SLEEP_MS(std::stoi(delay)); + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + + if (!IS_TRUE(succeeds)) { // end and failed + LOG(ERROR) << "Fail: requested by caller: " << parts[i]; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); + return; + } + + EnrollmentFrame frame; + + frame.data.acquiredInfo = AcquiredInfo::GOOD; + frame.data.vendorCode = 0; + cb->onEnrollmentFrame(frame); + + frame.data.acquiredInfo = AcquiredInfo::VENDOR; + frame.data.vendorCode = std::stoi(bucket); + cb->onEnrollmentFrame(frame); + + int remainingBuckets = numBuckets - i; + if (remainingBuckets > 0) { + cb->onEnrollmentProgress(enrollmentId, remainingBuckets); + } + } + + auto enrollments = FaceHalProperties::enrollments(); + enrollments.push_back(enrollmentId); + FaceHalProperties::enrollments(enrollments); + LOG(INFO) << "enrolled : " << enrollmentId; + cb->onEnrollmentProgress(enrollmentId, 0); +} + +void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationId*/, + const std::future& cancel) { + BEGIN_OP(FaceHalProperties::operation_authenticate_latency().value_or(0)); + + // Signal to the framework that we have begun authenticating. + AuthenticationFrame frame; + frame.data.acquiredInfo = AcquiredInfo::START; + frame.data.vendorCode = 0; + cb->onAuthenticationFrame(frame); + + // Also signal that we have opened the camera. + frame = {}; + frame.data.acquiredInfo = AcquiredInfo::FIRST_FRAME_RECEIVED; + frame.data.vendorCode = 0; + cb->onAuthenticationFrame(frame); + + auto now = Util::getSystemNanoTime(); + int64_t duration = FaceHalProperties::operation_authenticate_duration().value_or(0); + if (duration > 0) { + do { + SLEEP_MS(5); + } while (!Util::hasElapsed(now, duration)); + } + + if (FaceHalProperties::operation_authenticate_fails().value_or(false)) { + LOG(ERROR) << "Fail: operation_authenticate_fails"; + cb->onError(Error::VENDOR, 0 /* vendorError */); + return; + } + + if (FaceHalProperties::lockout().value_or(false)) { + LOG(ERROR) << "Fail: lockout"; + cb->onLockoutPermanent(); + cb->onError(Error::HW_UNAVAILABLE, 0 /* vendorError */); + return; + } + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + + auto id = FaceHalProperties::enrollment_hit().value_or(0); + auto enrolls = FaceHalProperties::enrollments(); + auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); + if (id < 0 || !isEnrolled) { + LOG(ERROR) << (isEnrolled ? "invalid enrollment hit" : "Fail: not enrolled"); + cb->onAuthenticationFailed(); + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + cb->onAuthenticationSucceeded(id, {} /* hat */); +} + +void FakeFaceEngine::detectInteractionImpl(ISessionCallback* cb, const std::future& cancel) { + BEGIN_OP(FaceHalProperties::operation_detect_interaction_latency().value_or(0)); + + if (FaceHalProperties::operation_detect_interaction_fails().value_or(false)) { + LOG(ERROR) << "Fail: operation_detect_interaction_fails"; + cb->onError(Error::VENDOR, 0 /* vendorError */); + return; + } + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + + auto id = FaceHalProperties::enrollment_hit().value_or(0); + auto enrolls = FaceHalProperties::enrollments(); + auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); + if (id <= 0 || !isEnrolled) { + LOG(ERROR) << "Fail: not enrolled"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + cb->onInteractionDetected(); +} + +void FakeFaceEngine::enumerateEnrollmentsImpl(ISessionCallback* cb) { + BEGIN_OP(0); + std::vector enrollments; + for (const auto& enrollmentId : FaceHalProperties::enrollments()) { + if (enrollmentId) { + enrollments.push_back(*enrollmentId); + } + } + cb->onEnrollmentsEnumerated(enrollments); +} + +void FakeFaceEngine::removeEnrollmentsImpl(ISessionCallback* cb, + const std::vector& enrollmentIds) { + BEGIN_OP(0); + + std::vector> newEnrollments; + for (const auto& enrollment : FaceHalProperties::enrollments()) { + auto id = enrollment.value_or(0); + if (std::find(enrollmentIds.begin(), enrollmentIds.end(), id) == enrollmentIds.end()) { + newEnrollments.emplace_back(id); + } + } + FaceHalProperties::enrollments(newEnrollments); + cb->onEnrollmentsRemoved(enrollmentIds); +} + +void FakeFaceEngine::getFeaturesImpl(ISessionCallback* cb) { + BEGIN_OP(0); + + if (FaceHalProperties::enrollments().empty()) { + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); + return; + } + + std::vector featuresToReturn = {}; + for (const auto& feature : FaceHalProperties::features()) { + if (feature) { + featuresToReturn.push_back((Feature)(*feature)); + } + } + cb->onFeaturesRetrieved(featuresToReturn); +} + +void FakeFaceEngine::setFeatureImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat, + Feature feature, bool enabled) { + BEGIN_OP(0); + + if (FaceHalProperties::enrollments().empty()) { + LOG(ERROR) << "Unable to set feature, enrollments are empty"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); + return; + } + + if (hat.mac.empty()) { + LOG(ERROR) << "Unable to set feature, invalid hat"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); + return; + } + + auto features = FaceHalProperties::features(); + + auto itr = std::find_if(features.begin(), features.end(), [feature](const auto& theFeature) { + return *theFeature == (int)feature; + }); + + if (!enabled && (itr != features.end())) { + features.erase(itr); + } else if (enabled && (itr == features.end())) { + features.push_back((int)feature); + } + + FaceHalProperties::features(features); + cb->onFeatureSet(feature); +} + +void FakeFaceEngine::getAuthenticatorIdImpl(ISessionCallback* cb) { + BEGIN_OP(0); + // If this is a weak HAL return 0 per the spec. + if (GetSensorStrength() != common::SensorStrength::STRONG) { + cb->onAuthenticatorIdRetrieved(0); + } else { + cb->onAuthenticatorIdRetrieved(FaceHalProperties::authenticator_id().value_or(0)); + } +} + +void FakeFaceEngine::invalidateAuthenticatorIdImpl(ISessionCallback* cb) { + BEGIN_OP(0); + int64_t authenticatorId = FaceHalProperties::authenticator_id().value_or(0); + int64_t newId = authenticatorId + 1; + FaceHalProperties::authenticator_id(newId); + cb->onAuthenticatorIdInvalidated(newId); +} + +void FakeFaceEngine::resetLockoutImpl(ISessionCallback* cb, + const keymaster::HardwareAuthToken& /*hat*/) { + BEGIN_OP(0); + FaceHalProperties::lockout(false); + cb->onLockoutCleared(); +} + +} // namespace aidl::android::hardware::biometrics::face \ No newline at end of file diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h new file mode 100644 index 0000000000..edb54ce0f8 --- /dev/null +++ b/biometrics/face/aidl/default/FakeFaceEngine.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include + +#include +#include + +namespace aidl::android::hardware::biometrics::face { + +namespace face = aidl::android::hardware::biometrics::face; +namespace common = aidl::android::hardware::biometrics::common; +namespace keymaster = aidl::android::hardware::keymaster; + +using aidl::android::hardware::common::NativeHandle; +// A fake engine that is backed by system properties instead of hardware. +class FakeFaceEngine { + public: + FakeFaceEngine() : mRandom(std::mt19937::default_seed) {} + + static face::FaceSensorType GetSensorType(); + static common::SensorStrength GetSensorStrength(); + void generateChallengeImpl(ISessionCallback* cb); + void revokeChallengeImpl(ISessionCallback* cb, int64_t challenge); + void getEnrollmentConfigImpl(ISessionCallback* cb, + std::vector* return_val); + void enrollImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat, + EnrollmentType enrollmentType, const std::vector& features, + const std::future& cancel); + void authenticateImpl(ISessionCallback* cb, int64_t operationId, + const std::future& cancel); + void detectInteractionImpl(ISessionCallback* cb, const std::future& cancel); + void enumerateEnrollmentsImpl(ISessionCallback* cb); + void removeEnrollmentsImpl(ISessionCallback* cb, const std::vector& enrollmentIds); + void getFeaturesImpl(ISessionCallback* cb); + void setFeatureImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat, + Feature feature, bool enabled); + void getAuthenticatorIdImpl(ISessionCallback* cb); + void invalidateAuthenticatorIdImpl(ISessionCallback* cb); + void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/); + + std::mt19937 mRandom; +}; + +} // namespace aidl::android::hardware::biometrics::face \ No newline at end of file diff --git a/biometrics/face/aidl/default/README.md b/biometrics/face/aidl/default/README.md new file mode 100644 index 0000000000..16559733c0 --- /dev/null +++ b/biometrics/face/aidl/default/README.md @@ -0,0 +1,77 @@ +# Virtual Face HAL + +This is a virtual HAL implementation that is backed by system properties +instead of actual hardware. It's intended for testing and UI development +on debuggable builds to allow devices to masquerade as alternative device +types and for emulators. + +## Device Selection + +You can either run the FakeFaceEngine on a [real device](#actual-device) or a [virtual device/cuttlefish](#getting-started-on-a-virtual-device-cuttlefish). This document should +help you to get started on either one. + +After setting up a device, go ahead and try out [enrolling](#enrolling) & [authenticating](#authenticating) + +### Getting started on a Virtual Device (cuttlefish) + + +Note, I'm running this via a cloudtop virtual device. + +1. Setup cuttlefish on cloudtop, See [this](https://g3doc.corp.google.com/company/teams/android/teampages/acloud/getting_started.md?cl=head) for more details. +2. acloud create --local-image +3. Enter in the shell command to disable hidl + +```shell +$ adb root +$ adb shell settings put secure com.android.server.biometrics.AuthService.hidlDisabled 1 +$ adb reboot +``` +4. You should now be able to do fake enrollments and authentications (as seen down below) + +### Actual Device + +1. Modify your real devices make file (I.E. vendor/google/products/{YOUR_DEVICE}.mk) +2. Ensure that there is no other face HAL that is being included by the device +3. Add the following +``` +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.biometrics.face.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.biometrics.face.xml + +PRODUCT_PACKAGES += \ + android.hardware.biometrics.face-service.example \ + +``` +4. Now build and flash m -j120 && flash +5. Run the following commands + +```shell +# This is a temporary workaround +$ adb root +$ adb shell setprop persist.vendor.face.virtual.type RGB +$ adb shell setprop persist.vendor.face.virtual.strength strong +$ adb shell locksettings set-pin 0000 +$ adb reboot +``` + +## Enrolling + +```shell +# authenticar_id,bucket_id:duration:(true|false).... +$ adb shell setprop vendor.face.virtual.next_enrollment 1,0:500:true,5:250:true,10:150:true,15:500:true +$ adb shell am start -n com.android.settings/.biometrics.face.FaceEnrollIntroduction +# If you would like to get rid of the enrollment, run the follwoing command +$ adb shell setprop persist.vendor.face.virtual.enrollments \"\" +``` + +## Authenticating + +```shell +# If enrollment hasn't been setup +$ adb shell setprop persist.vendor.face.virtual.enrollments 1 +$ adb shell cmd face sync +# After enrollment has been setup +$ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800 +$ adb shell setprop vendor.face.virtual.enrollment_hit 1 +# Power button press to simulate auth +$ adb shell input keyevent 26 +``` diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp index 984a1a99dc..1188459f3f 100644 --- a/biometrics/face/aidl/default/Session.cpp +++ b/biometrics/face/aidl/default/Session.cpp @@ -14,139 +14,135 @@ * limitations under the License. */ -#include #include #include "Session.h" namespace aidl::android::hardware::biometrics::face { -class CancellationSignal : public common::BnCancellationSignal { - private: - std::shared_ptr cb_; +constexpr size_t MAX_WORKER_QUEUE_SIZE = 5; - public: - explicit CancellationSignal(std::shared_ptr cb) : cb_(std::move(cb)) {} - - ndk::ScopedAStatus cancel() override { - cb_->onError(Error::CANCELED, 0 /* vendorCode */); - return ndk::ScopedAStatus::ok(); - } -}; - -Session::Session(std::shared_ptr cb) - : cb_(std::move(cb)), mRandom(std::mt19937::default_seed) {} +Session::Session(std::unique_ptr engine, std::shared_ptr cb) + : mEngine(std::move(engine)), mCb(std::move(cb)), mRandom(std::mt19937::default_seed) { + mThread = std::make_unique(MAX_WORKER_QUEUE_SIZE); +} ndk::ScopedAStatus Session::generateChallenge() { LOG(INFO) << "generateChallenge"; - if (cb_) { - std::uniform_int_distribution dist; - auto challenge = dist(mRandom); - cb_->onChallengeGenerated(challenge); - } + mThread->schedule(Callable::from([this] { mEngine->generateChallengeImpl(mCb.get()); })); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::revokeChallenge(int64_t challenge) { LOG(INFO) << "revokeChallenge"; - if (cb_) { - cb_->onChallengeRevoked(challenge); - } + mThread->schedule(Callable::from( + [this, challenge] { mEngine->revokeChallengeImpl(mCb.get(), challenge); })); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::getEnrollmentConfig(EnrollmentType /*enrollmentType*/, - std::vector* return_val) { - *return_val = {}; +ndk::ScopedAStatus Session::getEnrollmentConfig( + EnrollmentType /*enrollmentType*/, std::vector* cancellationSignal) { + *cancellationSignal = {}; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::enroll( - const keymaster::HardwareAuthToken& /*hat*/, EnrollmentType /*enrollmentType*/, - const std::vector& /*features*/, - const std::optional& /*previewSurface*/, - std::shared_ptr* /*return_val*/) { + const keymaster::HardwareAuthToken& hat, EnrollmentType enrollmentType, + const std::vector& features, const std::optional& /*previewSurface*/, + std::shared_ptr* cancellationSignal) { LOG(INFO) << "enroll"; - if (cb_) { - cb_->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); - } + std::promise cancellationPromise; + auto cancFuture = cancellationPromise.get_future(); + + mThread->schedule(Callable::from( + [this, hat, enrollmentType, features, cancFuture = std::move(cancFuture)] { + mEngine->enrollImpl(mCb.get(), hat, enrollmentType, features, cancFuture); + })); + + *cancellationSignal = SharedRefBase::make(std::move(cancellationPromise)); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::authenticate(int64_t /*keystoreOperationId*/, - std::shared_ptr* return_val) { +ndk::ScopedAStatus Session::authenticate( + int64_t keystoreOperationId, + std::shared_ptr* cancellationSignal) { LOG(INFO) << "authenticate"; - if (cb_) { - cb_->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); - } - *return_val = SharedRefBase::make(cb_); + std::promise cancellationPromise; + auto cancFuture = cancellationPromise.get_future(); + + mThread->schedule( + Callable::from([this, keystoreOperationId, cancFuture = std::move(cancFuture)] { + mEngine->authenticateImpl(mCb.get(), keystoreOperationId, cancFuture); + })); + + *cancellationSignal = SharedRefBase::make(std::move(cancellationPromise)); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::detectInteraction( - std::shared_ptr* /*return_val*/) { + std::shared_ptr* cancellationSignal) { LOG(INFO) << "detectInteraction"; + std::promise cancellationPromise; + auto cancFuture = cancellationPromise.get_future(); + + mThread->schedule(Callable::from([this, cancFuture = std::move(cancFuture)] { + mEngine->detectInteractionImpl(mCb.get(), cancFuture); + })); + + *cancellationSignal = SharedRefBase::make(std::move(cancellationPromise)); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::enumerateEnrollments() { LOG(INFO) << "enumerateEnrollments"; - if (cb_) { - cb_->onEnrollmentsEnumerated(std::vector()); - } + mThread->schedule(Callable::from([this] { mEngine->enumerateEnrollmentsImpl(mCb.get()); })); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::removeEnrollments(const std::vector& /*enrollmentIds*/) { +ndk::ScopedAStatus Session::removeEnrollments(const std::vector& enrollmentIds) { LOG(INFO) << "removeEnrollments"; - if (cb_) { - cb_->onEnrollmentsRemoved(std::vector()); - } + mThread->schedule(Callable::from( + [this, enrollmentIds] { mEngine->removeEnrollmentsImpl(mCb.get(), enrollmentIds); })); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::getFeatures() { LOG(INFO) << "getFeatures"; - if (cb_) { - // Must error out with UNABLE_TO_PROCESS when no faces are enrolled. - cb_->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); - } + mThread->schedule(Callable::from([this] { mEngine->getFeaturesImpl(mCb.get()); })); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::setFeature(const keymaster::HardwareAuthToken& /*hat*/, - Feature /*feature*/, bool /*enabled*/) { +ndk::ScopedAStatus Session::setFeature(const keymaster::HardwareAuthToken& hat, Feature feature, + bool enabled) { LOG(INFO) << "setFeature"; + mThread->schedule(Callable::from([this, hat, feature, enabled] { + mEngine->setFeatureImpl(mCb.get(), hat, feature, enabled); + })); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::getAuthenticatorId() { LOG(INFO) << "getAuthenticatorId"; - if (cb_) { - cb_->onAuthenticatorIdRetrieved(0 /* authenticatorId */); - } + mThread->schedule(Callable::from([this] { mEngine->getAuthenticatorIdImpl(mCb.get()); })); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::invalidateAuthenticatorId() { LOG(INFO) << "invalidateAuthenticatorId"; - if (cb_) { - cb_->onAuthenticatorIdInvalidated(0); - } + mThread->schedule( + Callable::from([this] { mEngine->invalidateAuthenticatorIdImpl(mCb.get()); })); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::resetLockout(const keymaster::HardwareAuthToken& /*hat*/) { +ndk::ScopedAStatus Session::resetLockout(const keymaster::HardwareAuthToken& hat) { LOG(INFO) << "resetLockout"; - if (cb_) { - cb_->onLockoutCleared(); - } + mThread->schedule(Callable::from([this, hat] { mEngine->resetLockoutImpl(mCb.get(), hat); })); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::close() { - if (cb_) { - cb_->onSessionClosed(); + if (mCb) { + mCb->onSessionClosed(); } return ndk::ScopedAStatus::ok(); } diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h index 9db17d2df9..7ca6a1f4ff 100644 --- a/biometrics/face/aidl/default/Session.h +++ b/biometrics/face/aidl/default/Session.h @@ -21,6 +21,10 @@ #include #include +#include "FakeFaceEngine.h" +#include "thread/WorkerThread.h" +#include "util/CancellationSignal.h" + namespace aidl::android::hardware::biometrics::face { namespace common = aidl::android::hardware::biometrics::common; @@ -30,7 +34,7 @@ using aidl::android::hardware::common::NativeHandle; class Session : public BnSession { public: - explicit Session(std::shared_ptr cb); + explicit Session(std::unique_ptr engine, std::shared_ptr cb); ndk::ScopedAStatus generateChallenge() override; @@ -85,8 +89,11 @@ class Session : public BnSession { ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override; private: - std::shared_ptr cb_; + std::unique_ptr mEngine; + std::shared_ptr mCb; std::mt19937 mRandom; + std::unique_ptr mThread; + std::shared_ptr mCancellationSignal; }; } // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt b/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt new file mode 100644 index 0000000000..95489205f6 --- /dev/null +++ b/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt @@ -0,0 +1,98 @@ +props { + owner: Vendor + module: "android.face.virt.FaceHalProperties" + prop { + api_name: "authenticator_id" + type: Long + access: ReadWrite + prop_name: "vendor.face.virtual.authenticator_id" + } + prop { + api_name: "challenge" + type: Long + access: ReadWrite + prop_name: "vendor.face.virtual.challenge" + } + prop { + api_name: "enrollment_hit" + type: Integer + access: ReadWrite + prop_name: "vendor.face.virtual.enrollment_hit" + } + prop { + api_name: "enrollments" + type: IntegerList + access: ReadWrite + prop_name: "persist.vendor.face.virtual.enrollments" + } + prop { + api_name: "features" + type: IntegerList + access: ReadWrite + prop_name: "persist.vendor.face.virtual.features" + } + prop { + api_name: "lockout" + access: ReadWrite + prop_name: "vendor.face.virtual.lockout" + } + prop { + api_name: "next_enrollment" + type: String + access: ReadWrite + prop_name: "vendor.face.virtual.next_enrollment" + } + prop { + api_name: "operation_authenticate_duration" + type: Integer + access: ReadWrite + prop_name: "vendor.face.virtual.operation_authenticate_duration" + } + prop { + api_name: "operation_authenticate_fails" + access: ReadWrite + prop_name: "vendor.face.virtual.operation_authenticate_fails" + } + prop { + api_name: "operation_authenticate_latency" + type: Integer + access: ReadWrite + prop_name: "vendor.face.virtual.operation_authenticate_latency" + } + prop { + api_name: "operation_detect_interaction_fails" + access: ReadWrite + prop_name: "vendor.face.virtual.operation_detect_interaction_fails" + } + prop { + api_name: "operation_detect_interaction_latency" + type: Integer + access: ReadWrite + prop_name: "vendor.face.virtual.operation_detect_interaction_latency" + } + prop { + api_name: "operation_enroll_fails" + access: ReadWrite + prop_name: "vendor.face.virtual.operation_enroll_fails" + } + prop { + api_name: "operation_start_enroll_latency" + type: Integer + access: ReadWrite + prop_name: "vendor.face.virtual.operation_start_enroll_latency" + } + prop { + api_name: "strength" + type: String + access: ReadWrite + prop_name: "persist.vendor.face.virtual.strength" + enum_values: "convenience|weak|strong" + } + prop { + api_name: "type" + type: String + access: ReadWrite + prop_name: "persist.vendor.face.virtual.type" + enum_values: "IR|RGB" + } +} diff --git a/biometrics/face/aidl/default/face-default.xml b/biometrics/face/aidl/default/face-default.xml index e6ef842734..8f2fbb8def 100644 --- a/biometrics/face/aidl/default/face-default.xml +++ b/biometrics/face/aidl/default/face-default.xml @@ -1,7 +1,7 @@ android.hardware.biometrics.face - 2 + 3 IFace/default diff --git a/biometrics/face/aidl/default/face.sysprop b/biometrics/face/aidl/default/face.sysprop new file mode 100644 index 0000000000..6b0f37fec5 --- /dev/null +++ b/biometrics/face/aidl/default/face.sysprop @@ -0,0 +1,159 @@ +# face.sysprop +# module becomes static class (Java) / namespace (C++) for serving API +module: "android.face.virt.FaceHalProperties" +owner: Vendor + +# type of face sensor +prop { + prop_name: "persist.vendor.face.virtual.type" + type: String + scope: Public + access: ReadWrite + enum_values: "IR|RGB" + api_name: "type" +} + +# the strength of the sensor +prop { + prop_name: "persist.vendor.face.virtual.strength" + type: String + scope: Public + access: ReadWrite + enum_values: "convenience|weak|strong" + api_name: "strength" +} + +# ids of current enrollments +prop { + prop_name: "persist.vendor.face.virtual.enrollments" + type: IntegerList + scope: Public + access: ReadWrite + api_name: "enrollments" +} + +# List of features +prop { + prop_name: "persist.vendor.face.virtual.features" + type: IntegerList + scope: Public + access: ReadWrite + api_name: "features" +} + +# authenticate and detectInteraction will succeed with this +# enrollment id, when present, otherwise they will error +prop { + prop_name: "vendor.face.virtual.enrollment_hit" + type: Integer + scope: Public + access: ReadWrite + api_name: "enrollment_hit" +} + +# The initial latency for enrollment +prop { + prop_name: "vendor.face.virtual.operation_start_enroll_latency" + type: Integer + scope: Public + access: ReadWrite + api_name: "operation_start_enroll_latency" +} + +# the next enrollment in the format: +# ",::,..." +# for example: "0:1,0:100:1,1:200:1" indicating that bucket 0 took +# 50 milliseconds, bucket 1 took 100 milliseconds, bucket 2 took 200 milliseconds. +# Note that it is up to the configuration to determine how many buckets are required +# to complete an enrollment +prop { + prop_name: "vendor.face.virtual.next_enrollment" + type: String + scope: Public + access: ReadWrite + api_name: "next_enrollment" +} + +# value for getAuthenticatorId or 0 +prop { + prop_name: "vendor.face.virtual.authenticator_id" + type: Long + scope: Public + access: ReadWrite + api_name: "authenticator_id" +} + +# value for generateChallenge +prop { + prop_name: "vendor.face.virtual.challenge" + type: Long + scope: Public + access: ReadWrite + api_name: "challenge" +} + +# if locked out +prop { + prop_name: "vendor.face.virtual.lockout" + type: Boolean + scope: Public + access: ReadWrite + api_name: "lockout" +} + +# force all authenticate operations to fail +prop { + prop_name: "vendor.face.virtual.operation_authenticate_fails" + type: Boolean + scope: Public + access: ReadWrite + api_name: "operation_authenticate_fails" +} + +# force all detectInteraction operations to fail +prop { + prop_name: "vendor.face.virtual.operation_detect_interaction_fails" + type: Boolean + scope: Public + access: ReadWrite + api_name: "operation_detect_interaction_fails" +} + +# force all enroll operations to fail +prop { + prop_name: "vendor.face.virtual.operation_enroll_fails" + type: Boolean + scope: Public + access: ReadWrite + api_name: "operation_enroll_fails" +} + +# add a latency to authentication operations +# Note that this latency is the initial authentication latency that occurs before +# the HAL will send AcquiredInfo::START and AcquiredInfo::FIRST_FRAME_RECEIVED +prop { + prop_name: "vendor.face.virtual.operation_authenticate_latency" + type: Integer + scope: Public + access: ReadWrite + api_name: "operation_authenticate_latency" +} + +# add a latency to detectInteraction operations +prop { + prop_name: "vendor.face.virtual.operation_detect_interaction_latency" + type: Integer + scope: Public + access: ReadWrite + api_name: "operation_detect_interaction_latency" +} + +# millisecond duration for authenticate operations +# (waits for changes to enrollment_hit) +prop { + prop_name: "vendor.face.virtual.operation_authenticate_duration" + type: Integer + scope: Public + access: ReadWrite + api_name: "operation_authenticate_duration" +} diff --git a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp new file mode 100644 index 0000000000..c8ad6b7dc3 --- /dev/null +++ b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp @@ -0,0 +1,383 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include +#include + +#include "FakeFaceEngine.h" + +using namespace ::android::face::virt; +using namespace ::aidl::android::hardware::biometrics::face; +using namespace ::aidl::android::hardware::keymaster; + +namespace aidl::android::hardware::biometrics::face { + +class TestSessionCallback : public BnSessionCallback { + public: + ndk::ScopedAStatus onChallengeGenerated(int64_t challenge) override { + mLastChallenge = challenge; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onChallengeRevoked(int64_t challenge) override { + mLastChallengeRevoked = challenge; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onError(Error error, int32_t) override { + mError = error; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentProgress(int32_t enrollmentId, int32_t remaining) override { + if (remaining == 0) mLastEnrolled = enrollmentId; + return ndk::ScopedAStatus::ok(); + }; + + ::ndk::ScopedAStatus onAuthenticationSucceeded(int32_t enrollmentId, + const HardwareAuthToken&) override { + mLastAuthenticated = enrollmentId; + mAuthenticateFailed = false; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationFailed() override { + mLastAuthenticated = 0; + mAuthenticateFailed = true; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onInteractionDetected() override { + mInteractionDetectedCount++; + return ndk::ScopedAStatus::ok(); + }; + + ::ndk::ScopedAStatus onEnrollmentFrame(const EnrollmentFrame& frame) override { + mEnrollmentFrames.push_back(frame.data.vendorCode); + return ndk::ScopedAStatus::ok(); + } + + ::ndk::ScopedAStatus onEnrollmentsEnumerated( + const std::vector& enrollmentIds) override { + mLastEnrollmentsEnumerated = enrollmentIds; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentsRemoved(const std::vector& enrollmentIds) override { + mLastEnrollmentRemoved = enrollmentIds; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t authenticatorId) override { + mLastAuthenticatorId = authenticatorId; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdInvalidated(int64_t authenticatorId) override { + mLastAuthenticatorId = authenticatorId; + mAuthenticatorIdInvalidated = true; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationFrame(const AuthenticationFrame& /*authFrame*/) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onLockoutPermanent() override { + mLockoutPermanent = true; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onLockoutTimed(int64_t /* timeout */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onLockoutCleared() override { + mLockoutPermanent = false; + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); } + + ::ndk::ScopedAStatus onFeaturesRetrieved(const std::vector& features) override { + mFeatures = features; + return ndk::ScopedAStatus::ok(); + } + + ::ndk::ScopedAStatus onFeatureSet(Feature feature) override { + mLastFeatureSet = feature; + return ndk::ScopedAStatus::ok(); + } + + Error mError = Error::UNKNOWN; + int64_t mLastChallenge = -1; + int64_t mLastChallengeRevoked = -1; + int32_t mLastEnrolled = -1; + int32_t mLastAuthenticated = -1; + int64_t mLastAuthenticatorId = -1; + std::vector mLastEnrollmentsEnumerated; + std::vector mLastEnrollmentRemoved; + std::vector mFeatures; + Feature mLastFeatureSet; + std::vector mEnrollmentFrames; + bool mAuthenticateFailed = false; + bool mAuthenticatorIdInvalidated = false; + bool mLockoutPermanent = false; + int mInteractionDetectedCount = 0; +}; + +class FakeFaceEngineTest : public ::testing::Test { + protected: + void SetUp() override { + LOG(ERROR) << "JRM SETUP"; + mCallback = ndk::SharedRefBase::make(); + FaceHalProperties::enrollments({}); + FaceHalProperties::challenge({}); + FaceHalProperties::features({}); + FaceHalProperties::authenticator_id({}); + FaceHalProperties::strength(""); + } + + FakeFaceEngine mEngine; + std::shared_ptr mCallback; + std::promise mCancel; +}; + +TEST_F(FakeFaceEngineTest, one_eq_one) { + ASSERT_EQ(1, 1); +} + +TEST_F(FakeFaceEngineTest, GenerateChallenge) { + mEngine.generateChallengeImpl(mCallback.get()); + ASSERT_EQ(FaceHalProperties::challenge().value(), mCallback->mLastChallenge); +} + +TEST_F(FakeFaceEngineTest, RevokeChallenge) { + auto challenge = FaceHalProperties::challenge().value_or(10); + mEngine.revokeChallengeImpl(mCallback.get(), challenge); + ASSERT_FALSE(FaceHalProperties::challenge().has_value()); + ASSERT_EQ(challenge, mCallback->mLastChallengeRevoked); +} + +TEST_F(FakeFaceEngineTest, ResetLockout) { + FaceHalProperties::lockout(true); + mEngine.resetLockoutImpl(mCallback.get(), {}); + ASSERT_FALSE(mCallback->mLockoutPermanent); + ASSERT_FALSE(FaceHalProperties::lockout().value_or(true)); +} + +TEST_F(FakeFaceEngineTest, AuthenticatorId) { + FaceHalProperties::authenticator_id(50); + mEngine.getAuthenticatorIdImpl(mCallback.get()); + ASSERT_EQ(50, mCallback->mLastAuthenticatorId); + ASSERT_FALSE(mCallback->mAuthenticatorIdInvalidated); +} + +TEST_F(FakeFaceEngineTest, GetAuthenticatorIdWeakReturnsZero) { + FaceHalProperties::strength("weak"); + FaceHalProperties::authenticator_id(500); + mEngine.getAuthenticatorIdImpl(mCallback.get()); + ASSERT_EQ(0, mCallback->mLastAuthenticatorId); + ASSERT_FALSE(mCallback->mAuthenticatorIdInvalidated); +} + +TEST_F(FakeFaceEngineTest, AuthenticatorIdInvalidate) { + FaceHalProperties::authenticator_id(500); + mEngine.invalidateAuthenticatorIdImpl(mCallback.get()); + ASSERT_NE(500, FaceHalProperties::authenticator_id().value()); + ASSERT_TRUE(mCallback->mAuthenticatorIdInvalidated); +} + +TEST_F(FakeFaceEngineTest, Enroll) { + FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:true"); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/, + mCancel.get_future()); + ASSERT_FALSE(FaceHalProperties::next_enrollment().has_value()); + ASSERT_EQ(1, FaceHalProperties::enrollments().size()); + ASSERT_EQ(1, FaceHalProperties::enrollments()[0].value()); + ASSERT_EQ(1, mCallback->mLastEnrolled); +} + +TEST_F(FakeFaceEngineTest, EnrollFails) { + FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:false"); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/, + mCancel.get_future()); + ASSERT_FALSE(FaceHalProperties::next_enrollment().has_value()); + ASSERT_EQ(0, FaceHalProperties::enrollments().size()); +} + +TEST_F(FakeFaceEngineTest, EnrollCancel) { + FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:false"); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mCancel.set_value(); + mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/, + mCancel.get_future()); + ASSERT_EQ(Error::CANCELED, mCallback->mError); + ASSERT_EQ(-1, mCallback->mLastEnrolled); + ASSERT_EQ(0, FaceHalProperties::enrollments().size()); + ASSERT_FALSE(FaceHalProperties::next_enrollment().has_value()); +} + +TEST_F(FakeFaceEngineTest, Authenticate) { + FaceHalProperties::enrollments({100}); + FaceHalProperties::enrollment_hit(100); + mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, mCancel.get_future()); + + ASSERT_EQ(100, mCallback->mLastAuthenticated); + ASSERT_FALSE(mCallback->mAuthenticateFailed); +} + +TEST_F(FakeFaceEngineTest, AuthenticateCancel) { + FaceHalProperties::enrollments({100}); + FaceHalProperties::enrollment_hit(100); + mCancel.set_value(); + mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, mCancel.get_future()); + ASSERT_EQ(Error::CANCELED, mCallback->mError); +} + +TEST_F(FakeFaceEngineTest, AuthenticateFailedForUnEnrolled) { + FaceHalProperties::enrollments({3}); + FaceHalProperties::enrollment_hit(100); + mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, mCancel.get_future()); + ASSERT_EQ(Error::UNABLE_TO_PROCESS, mCallback->mError); + ASSERT_TRUE(mCallback->mAuthenticateFailed); +} + +TEST_F(FakeFaceEngineTest, DetectInteraction) { + FaceHalProperties::enrollments({100}); + FaceHalProperties::enrollment_hit(100); + ASSERT_EQ(0, mCallback->mInteractionDetectedCount); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(1, mCallback->mInteractionDetectedCount); +} + +TEST_F(FakeFaceEngineTest, DetectInteractionCancel) { + FaceHalProperties::enrollments({100}); + FaceHalProperties::enrollment_hit(100); + mCancel.set_value(); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(Error::CANCELED, mCallback->mError); +} + +TEST_F(FakeFaceEngineTest, GetFeatureEmpty) { + mEngine.getFeaturesImpl(mCallback.get()); + ASSERT_TRUE(mCallback->mFeatures.empty()); +} + +TEST_F(FakeFaceEngineTest, SetFeature) { + FaceHalProperties::enrollments({1}); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_ATTENTION, true); + auto features = mCallback->mFeatures; + ASSERT_TRUE(features.empty()); + ASSERT_EQ(Feature::REQUIRE_ATTENTION, mCallback->mLastFeatureSet); + + mEngine.getFeaturesImpl(mCallback.get()); + features = mCallback->mFeatures; + ASSERT_FALSE(features.empty()); + ASSERT_NE(features.end(), + std::find(features.begin(), features.end(), Feature::REQUIRE_ATTENTION)); +} + +TEST_F(FakeFaceEngineTest, ToggleFeature) { + FaceHalProperties::enrollments({1}); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_ATTENTION, true); + mEngine.getFeaturesImpl(mCallback.get()); + auto features = mCallback->mFeatures; + ASSERT_FALSE(features.empty()); + ASSERT_NE(features.end(), + std::find(features.begin(), features.end(), Feature::REQUIRE_ATTENTION)); + + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_ATTENTION, false); + mEngine.getFeaturesImpl(mCallback.get()); + features = mCallback->mFeatures; + ASSERT_TRUE(features.empty()); +} + +TEST_F(FakeFaceEngineTest, TurningOffNonExistentFeatureDoesNothing) { + FaceHalProperties::enrollments({1}); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_ATTENTION, false); + mEngine.getFeaturesImpl(mCallback.get()); + auto features = mCallback->mFeatures; + ASSERT_TRUE(features.empty()); +} + +TEST_F(FakeFaceEngineTest, SetMultipleFeatures) { + FaceHalProperties::enrollments({1}); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_ATTENTION, true); + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_DIVERSE_POSES, true); + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::DEBUG, true); + mEngine.getFeaturesImpl(mCallback.get()); + auto features = mCallback->mFeatures; + ASSERT_EQ(3, features.size()); + ASSERT_NE(features.end(), + std::find(features.begin(), features.end(), Feature::REQUIRE_ATTENTION)); + ASSERT_NE(features.end(), + std::find(features.begin(), features.end(), Feature::REQUIRE_DIVERSE_POSES)); + ASSERT_NE(features.end(), std::find(features.begin(), features.end(), Feature::DEBUG)); +} + +TEST_F(FakeFaceEngineTest, SetMultipleFeaturesAndTurnOffSome) { + FaceHalProperties::enrollments({1}); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_ATTENTION, true); + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::REQUIRE_DIVERSE_POSES, true); + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::DEBUG, true); + mEngine.setFeatureImpl(mCallback.get(), hat, Feature::DEBUG, false); + mEngine.getFeaturesImpl(mCallback.get()); + auto features = mCallback->mFeatures; + ASSERT_EQ(2, features.size()); + ASSERT_NE(features.end(), + std::find(features.begin(), features.end(), Feature::REQUIRE_ATTENTION)); + ASSERT_NE(features.end(), + std::find(features.begin(), features.end(), Feature::REQUIRE_DIVERSE_POSES)); + ASSERT_EQ(features.end(), std::find(features.begin(), features.end(), Feature::DEBUG)); +} + +TEST_F(FakeFaceEngineTest, Enumerate) { + FaceHalProperties::enrollments({120, 3}); + mEngine.enumerateEnrollmentsImpl(mCallback.get()); + auto enrolls = mCallback->mLastEnrollmentsEnumerated; + ASSERT_FALSE(enrolls.empty()); + ASSERT_NE(enrolls.end(), std::find(enrolls.begin(), enrolls.end(), 120)); + ASSERT_NE(enrolls.end(), std::find(enrolls.begin(), enrolls.end(), 3)); +} + +TEST_F(FakeFaceEngineTest, RemoveEnrollments) { + FaceHalProperties::enrollments({120, 3, 100}); + mEngine.removeEnrollmentsImpl(mCallback.get(), {120, 100}); + mEngine.enumerateEnrollmentsImpl(mCallback.get()); + auto enrolls = mCallback->mLastEnrollmentsEnumerated; + ASSERT_FALSE(enrolls.empty()); + ASSERT_EQ(enrolls.end(), std::find(enrolls.begin(), enrolls.end(), 120)); + ASSERT_NE(enrolls.end(), std::find(enrolls.begin(), enrolls.end(), 3)); + ASSERT_EQ(enrolls.end(), std::find(enrolls.begin(), enrolls.end(), 100)); +} + +TEST_F(FakeFaceEngineTest, ResetLockoutWithAuth) { + FaceHalProperties::lockout(true); + FaceHalProperties::enrollments({33}); + FaceHalProperties::enrollment_hit(33); + auto cancelFuture = mCancel.get_future(); + mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, cancelFuture); + + ASSERT_TRUE(mCallback->mLockoutPermanent); + + mEngine.resetLockoutImpl(mCallback.get(), {} /* hat */); + ASSERT_FALSE(mCallback->mLockoutPermanent); + FaceHalProperties::enrollment_hit(33); + mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, cancelFuture); + ASSERT_EQ(33, mCallback->mLastAuthenticated); + ASSERT_FALSE(mCallback->mAuthenticateFailed); +} + +} // namespace aidl::android::hardware::biometrics::face \ No newline at end of file diff --git a/biometrics/face/aidl/vts/Android.bp b/biometrics/face/aidl/vts/Android.bp index 4171ac3364..f62c4e4b01 100644 --- a/biometrics/face/aidl/vts/Android.bp +++ b/biometrics/face/aidl/vts/Android.bp @@ -15,10 +15,10 @@ cc_test { ], srcs: ["VtsHalBiometricsFaceTargetTest.cpp"], static_libs: [ - "android.hardware.biometrics.common-V2-ndk", - "android.hardware.biometrics.face-V2-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.face-V3-ndk", "android.hardware.common-V2-ndk", - "android.hardware.keymaster-V3-ndk", + "android.hardware.keymaster-V4-ndk", ], shared_libs: [ "libbinder_ndk", diff --git a/biometrics/fingerprint/2.1/vts/functional/OWNERS b/biometrics/fingerprint/2.1/vts/functional/OWNERS deleted file mode 100644 index 0014ce917a..0000000000 --- a/biometrics/fingerprint/2.1/vts/functional/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# Bug component: 114777 -ilyamaty@google.com diff --git a/biometrics/fingerprint/2.2/vts/functional/OWNERS b/biometrics/fingerprint/2.2/vts/functional/OWNERS deleted file mode 100644 index 0014ce917a..0000000000 --- a/biometrics/fingerprint/2.2/vts/functional/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# Bug component: 114777 -ilyamaty@google.com diff --git a/biometrics/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp index 620e2702b6..c543a93f08 100644 --- a/biometrics/fingerprint/aidl/Android.bp +++ b/biometrics/fingerprint/aidl/Android.bp @@ -14,8 +14,8 @@ aidl_interface { "android/hardware/biometrics/fingerprint/**/*.aidl", ], imports: [ - "android.hardware.biometrics.common-V2", - "android.hardware.keymaster-V3", + "android.hardware.biometrics.common-V3", + "android.hardware.keymaster-V4", ], stability: "vintf", backend: { @@ -41,7 +41,14 @@ aidl_interface { "android.hardware.keymaster-V3", ], }, + { + version: "3", + imports: [ + "android.hardware.biometrics.common-V3", + "android.hardware.keymaster-V4", + ], + }, ], - + frozen: true, } diff --git a/biometrics/fingerprint/aidl/OWNERS b/biometrics/fingerprint/aidl/OWNERS deleted file mode 100644 index 36d726136f..0000000000 --- a/biometrics/fingerprint/aidl/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -ilyamaty@google.com -kchyn@google.com diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/.hash b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/.hash new file mode 100644 index 0000000000..34b605dd72 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/.hash @@ -0,0 +1 @@ +637371b53fb7faf9bd43aa51b72c23852d6e6d96 diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl new file mode 100644 index 0000000000..7075f715fd --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum AcquiredInfo { + UNKNOWN, + GOOD, + PARTIAL, + INSUFFICIENT, + SENSOR_DIRTY, + TOO_SLOW, + TOO_FAST, + VENDOR, + START, + TOO_DARK, + TOO_BRIGHT, + IMMOBILE, + RETRYING_CAPTURE, + LIFT_TOO_SOON, + POWER_PRESS, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/Error.aidl new file mode 100644 index 0000000000..9eeaac53ec --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/Error.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum Error { + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + BAD_CALIBRATION, + POWER_PRESS, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl new file mode 100644 index 0000000000..381aaf7365 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FingerprintSensorType { + UNKNOWN, + REAR, + UNDER_DISPLAY_ULTRASONIC, + UNDER_DISPLAY_OPTICAL, + POWER_BUTTON, + HOME_BUTTON, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/IFingerprint.aidl new file mode 100644 index 0000000000..0b6f3008ac --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/IFingerprint.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +interface IFingerprint { + android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps(); + android.hardware.biometrics.fingerprint.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.ISessionCallback cb); +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/ISession.aidl new file mode 100644 index 0000000000..4fdcefc8ff --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/ISession.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +interface ISession { + void generateChallenge(); + void revokeChallenge(in long challenge); + android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat); + android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); + android.hardware.biometrics.common.ICancellationSignal detectInteraction(); + void enumerateEnrollments(); + void removeEnrollments(in int[] enrollmentIds); + void getAuthenticatorId(); + void invalidateAuthenticatorId(); + void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); + void close(); + /** + * @deprecated use onPointerDownWithContext instead. + */ + void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); + /** + * @deprecated use onPointerUpWithContext instead. + */ + void onPointerUp(in int pointerId); + void onUiReady(); + android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); + void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void onContextChanged(in android.hardware.biometrics.common.OperationContext context); + void onPointerCancelWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void setIgnoreDisplayTouches(in boolean shouldIgnore); +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/ISessionCallback.aidl new file mode 100644 index 0000000000..be18ffed1a --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/ISessionCallback.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +interface ISessionCallback { + void onChallengeGenerated(in long challenge); + void onChallengeRevoked(in long challenge); + void onAcquired(in android.hardware.biometrics.fingerprint.AcquiredInfo info, in int vendorCode); + void onError(in android.hardware.biometrics.fingerprint.Error error, in int vendorCode); + void onEnrollmentProgress(in int enrollmentId, int remaining); + void onAuthenticationSucceeded(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat); + void onAuthenticationFailed(); + void onLockoutTimed(in long durationMillis); + void onLockoutPermanent(); + void onLockoutCleared(); + void onInteractionDetected(); + void onEnrollmentsEnumerated(in int[] enrollmentIds); + void onEnrollmentsRemoved(in int[] enrollmentIds); + void onAuthenticatorIdRetrieved(in long authenticatorId); + void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/PointerContext.aidl new file mode 100644 index 0000000000..d9bf0854ca --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@JavaDerive(equals=true) @VintfStability +parcelable PointerContext { + int pointerId = (-1) /* -1 */; + float x = 0f; + float y = 0f; + float minor = 0f; + float major = 0f; + float orientation = 0f; + boolean isAod = false; + long time = 0; + long gestureStart = 0; +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorLocation.aidl new file mode 100644 index 0000000000..965576e822 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +parcelable SensorLocation { + /** + * @deprecated use the display field instead. This field was never used. + */ + int displayId; + int sensorLocationX; + int sensorLocationY; + int sensorRadius; + String display = ""; + android.hardware.biometrics.fingerprint.SensorShape sensorShape = android.hardware.biometrics.fingerprint.SensorShape.CIRCLE; +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorProps.aidl new file mode 100644 index 0000000000..a97d819dba --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +parcelable SensorProps { + android.hardware.biometrics.common.CommonProps commonProps; + android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType = android.hardware.biometrics.fingerprint.FingerprintSensorType.UNKNOWN; + android.hardware.biometrics.fingerprint.SensorLocation[] sensorLocations; + boolean supportsNavigationGestures; + boolean supportsDetectInteraction; + boolean halHandlesDisplayTouches; + boolean halControlsIllumination; + @nullable android.hardware.biometrics.fingerprint.TouchDetectionParameters touchDetectionParameters; +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..f673b1c806 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..2e3ec4f574 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/3/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +parcelable TouchDetectionParameters { + float targetSize = 1.0f; + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl index c51aa033d4..7075f715fd 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -32,19 +32,22 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @Backing(type="byte") @VintfStability enum AcquiredInfo { - UNKNOWN = 0, - GOOD = 1, - PARTIAL = 2, - INSUFFICIENT = 3, - SENSOR_DIRTY = 4, - TOO_SLOW = 5, - TOO_FAST = 6, - VENDOR = 7, - START = 8, - TOO_DARK = 9, - TOO_BRIGHT = 10, - IMMOBILE = 11, - RETRYING_CAPTURE = 12, + UNKNOWN, + GOOD, + PARTIAL, + INSUFFICIENT, + SENSOR_DIRTY, + TOO_SLOW, + TOO_FAST, + VENDOR, + START, + TOO_DARK, + TOO_BRIGHT, + IMMOBILE, + RETRYING_CAPTURE, + LIFT_TOO_SOON, + POWER_PRESS, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl index af7bc3c56b..9eeaac53ec 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl @@ -32,15 +32,17 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @Backing(type="byte") @VintfStability enum Error { - UNKNOWN = 0, - HW_UNAVAILABLE = 1, - UNABLE_TO_PROCESS = 2, - TIMEOUT = 3, - NO_SPACE = 4, - CANCELED = 5, - UNABLE_TO_REMOVE = 6, - VENDOR = 7, - BAD_CALIBRATION = 8, + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + BAD_CALIBRATION, + POWER_PRESS, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl index 9c208c4e7c..381aaf7365 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl @@ -32,12 +32,13 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @Backing(type="byte") @VintfStability enum FingerprintSensorType { - UNKNOWN = 0, - REAR = 1, - UNDER_DISPLAY_ULTRASONIC = 2, - UNDER_DISPLAY_OPTICAL = 3, - POWER_BUTTON = 4, - HOME_BUTTON = 5, + UNKNOWN, + REAR, + UNDER_DISPLAY_ULTRASONIC, + UNDER_DISPLAY_OPTICAL, + POWER_BUTTON, + HOME_BUTTON, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl index 5d3df6fbaa..0b6f3008ac 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @VintfStability interface IFingerprint { android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps(); diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl index 30f299d1fc..4fdcefc8ff 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @VintfStability interface ISession { void generateChallenge(); @@ -45,7 +46,13 @@ interface ISession { void invalidateAuthenticatorId(); void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); void close(); + /** + * @deprecated use onPointerDownWithContext instead. + */ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); + /** + * @deprecated use onPointerUpWithContext instead. + */ void onPointerUp(in int pointerId); void onUiReady(); android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); @@ -54,4 +61,6 @@ interface ISession { void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onContextChanged(in android.hardware.biometrics.common.OperationContext context); + void onPointerCancelWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void setIgnoreDisplayTouches(in boolean shouldIgnore); } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl index 3c40ad63bf..be18ffed1a 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @VintfStability interface ISessionCallback { void onChallengeGenerated(in long challenge); diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl index 43db6cfb51..d9bf0854ca 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -32,14 +32,15 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; -@VintfStability +/* @hide */ +@JavaDerive(equals=true) @VintfStability parcelable PointerContext { - int pointerId = -1; - float x = 0.000000f; - float y = 0.000000f; - float minor = 0.000000f; - float major = 0.000000f; - float orientation = 0.000000f; + int pointerId = (-1) /* -1 */; + float x = 0f; + float y = 0f; + float minor = 0f; + float major = 0f; + float orientation = 0f; boolean isAod = false; long time = 0; long gestureStart = 0; diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl index 295fde9f5f..965576e822 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -32,11 +32,16 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @VintfStability parcelable SensorLocation { + /** + * @deprecated use the display field instead. This field was never used. + */ int displayId; int sensorLocationX; int sensorLocationY; int sensorRadius; String display = ""; + android.hardware.biometrics.fingerprint.SensorShape sensorShape = android.hardware.biometrics.fingerprint.SensorShape.CIRCLE; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl index 782d2899d3..a97d819dba 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.fingerprint; +/* @hide */ @VintfStability parcelable SensorProps { android.hardware.biometrics.common.CommonProps commonProps; @@ -41,4 +42,5 @@ parcelable SensorProps { boolean supportsDetectInteraction; boolean halHandlesDisplayTouches; boolean halControlsIllumination; + @nullable android.hardware.biometrics.fingerprint.TouchDetectionParameters touchDetectionParameters; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..f673b1c806 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..2e3ec4f574 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +parcelable TouchDetectionParameters { + float targetSize = 1.0f; + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl index 8ec8574965..41b7c5e0bf 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.fingerprint; - +/** + * @hide + */ @VintfStability @Backing(type="byte") enum AcquiredInfo { @@ -96,4 +98,15 @@ enum AcquiredInfo { * However, RETRYING_CAPTURE must not be sent after ACQUIRED_GOOD is sent. */ RETRYING_CAPTURE, + + /** + * Fingerprint was lifted before the capture completed. + */ + LIFT_TOO_SOON, + + /** + * Indicates a power press event has occurred. This is typically sent by fingerprint + * sensors that have the sensor co-located with the power button. + */ + POWER_PRESS, } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl index e69859a442..39a5676fe1 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.fingerprint; - +/** + * @hide + */ @VintfStability @Backing(type="byte") enum Error { @@ -68,4 +70,10 @@ enum Error { * There's a problem with the sensor's calibration. */ BAD_CALIBRATION, + + /** + * Indicates a power press event has occurred. This is typically sent by fingerprint + * sensors that have the sensor co-located with the power button. + */ + POWER_PRESS, } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl index dbe71377a2..7caa1548da 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.fingerprint; - +/** + * @hide + */ @VintfStability @Backing(type="byte") enum FingerprintSensorType { diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl index 75f90a12ae..f4febad52e 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl @@ -19,7 +19,9 @@ package android.hardware.biometrics.fingerprint; import android.hardware.biometrics.fingerprint.ISession; import android.hardware.biometrics.fingerprint.ISessionCallback; import android.hardware.biometrics.fingerprint.SensorProps; - +/** + * @hide + */ @VintfStability interface IFingerprint { /** diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl index db0114514e..83e7bbc43f 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl @@ -45,6 +45,7 @@ import android.hardware.keymaster.HardwareAuthToken; * ISession only supports execution of one non-interrupting operation at a time, regardless of * whether it's cancellable. The framework must wait for a callback indicating the end of the * current non-interrupting operation before a new non-interrupting operation can be started. + * @hide */ @VintfStability interface ISession { @@ -419,6 +420,8 @@ interface ISession { * @param y The distance in pixels from the top edge of the display. * @param minor See android.view.MotionEvent#getTouchMinor * @param major See android.view.MotionEvent#getTouchMajor + * + * @deprecated use onPointerDownWithContext instead. */ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); @@ -433,6 +436,8 @@ interface ISession { * ISession#enroll, ISession#detectInteraction. * * @param pointerId See android.view.MotionEvent#getPointerId + * + * @deprecated use onPointerUpWithContext instead. */ void onPointerUp(in int pointerId); @@ -468,15 +473,77 @@ interface ISession { /** See ISession#detectInteraction() */ ICancellationSignal detectInteractionWithContext(in OperationContext context); - /** See ISession#onPointerDown(int, int, int, float, float) */ + /** + * onPointerDownWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked erroneously by the framework for sensors + * of other types, the HAL must treat this as a no-op and return immediately. + * + * Notifies the HAL that a finger entered the sensor area. This operation can be invoked + * regardless of the current state of the HAL. + * + * Note that for sensors which require illumination, for example + * FingerprintSensorType::UNDER_DISPLAY_OPTICAL, this is a good time to start illuminating. + * + * @param context See PointerContext + */ void onPointerDownWithContext(in PointerContext context); - /** See ISession#onPointerUp(int) */ + /** + * onPointerUpWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked for sensors of other types, the HAL must + * treat this as a no-op and return immediately. + * + * Notifies the HAL that a finger left the sensor area. This operation can be invoked regardless + * of the current state of the HAL. + * + * @param context See PointerContext + */ void onPointerUpWithContext(in PointerContext context); /** + * onContextChanged: + * * This may be called while an authenticate, detect interaction, or enrollment operation is * running when the context changes. */ void onContextChanged(in OperationContext context); + + /** + * onPointerCancelWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked for sensors of other types, the HAL must + * treat this as a no-op and return immediately. + * + * Notifies the HAL that if there were fingers within the sensor area, they are no longer being + * tracked. The fingers may or may not still be on the sensor. This operation can be invoked + * regardless of the current state of the HAL. + * + * @param context See PointerContext + */ + void onPointerCancelWithContext(in PointerContext context); + + /** + * setIgnoreDisplayTouches: + * + * This operation only applies to sensors that have SensorProps#halHandlesDisplayTouches + * set to true. For all other sensors this is a no-op. + * + * Instructs the HAL whether to ignore display touches. This can be useful to avoid unintended + * fingerprint captures during certain UI interactions. For example, when entering a lockscreen + * PIN, some of the touches might overlap with the fingerprint sensor. Those touches should be + * ignored to avoid unintended authentication attempts. + * + * This flag must default to false when the HAL starts. + * + * The framework is responsible for both setting the flag to true and resetting it to false + * whenever it's appropriate. + * + * @param shouldIgnore whether the display touches should be ignored. + */ + void setIgnoreDisplayTouches(in boolean shouldIgnore); } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl index f699966f59..24b169e3cb 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl @@ -19,7 +19,9 @@ package android.hardware.biometrics.fingerprint; import android.hardware.biometrics.fingerprint.AcquiredInfo; import android.hardware.biometrics.fingerprint.Error; import android.hardware.keymaster.HardwareAuthToken; - +/** + * @hide + */ @VintfStability interface ISessionCallback { /** diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl index e025d3440d..582e6cfc06 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -18,7 +18,9 @@ package android.hardware.biometrics.fingerprint; /** * Additional context associated with a pointer event. + * @hide */ +@JavaDerive(equals=true) @VintfStability parcelable PointerContext { /** @@ -64,7 +66,7 @@ parcelable PointerContext { boolean isAod = false; /** - * The time of the user interaction that produced this event, in milliseconds. + * The time when this event was created, in milliseconds. * * This is obtained from MotionEvent#getEventTime, which uses SystemClock.uptimeMillis() as * the clock. @@ -74,10 +76,10 @@ parcelable PointerContext { long time = 0; /** - * The time of the first user interaction in this gesture, in milliseconds. + * This event is part of some gesture. This is the time when MotionEvent#ACTION_DOWN was + * created for that gesture, in milliseconds. * - * If this event is MotionEvent#ACTION_DOWN, it means it's the first event in this gesture, - * and `gestureStart` will be equal to `time`. + * If this event is MotionEvent#ACTION_DOWN, then this value is equal to `time`. * * This is obtained from MotionEvent#getDownTime, which uses SystemClock.uptimeMillis() as * the clock. diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl index d12605c521..fd8c7fc2d5 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -16,10 +16,15 @@ package android.hardware.biometrics.fingerprint; +import android.hardware.biometrics.fingerprint.SensorShape; + +/** + * @hide + */ @VintfStability parcelable SensorLocation { /** - * Deprecated use the display field instead. This field was never used. + * @deprecated use the display field instead. This field was never used. */ int displayId; @@ -57,4 +62,10 @@ parcelable SensorLocation { * for each display from which the sensor is accessible from. */ String display = ""; + + /** + * The shape of the sensor if applicable. Most useful for the sensor of type + * SensorType::UNDER_DISPLAY_*. + */ + SensorShape sensorShape = SensorShape.CIRCLE; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl index fb516da51e..853aae48ad 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -19,7 +19,11 @@ package android.hardware.biometrics.fingerprint; import android.hardware.biometrics.common.CommonProps; import android.hardware.biometrics.fingerprint.FingerprintSensorType; import android.hardware.biometrics.fingerprint.SensorLocation; +import android.hardware.biometrics.fingerprint.TouchDetectionParameters; +/** + * @hide + */ @VintfStability parcelable SensorProps { /** @@ -70,4 +74,9 @@ parcelable SensorProps { * This value must be ignored for sensors that aren't optical UDFPS. */ boolean halControlsIllumination; + + /** + * Parameters used for fingerprint touch detection. + */ + @nullable TouchDetectionParameters touchDetectionParameters; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..1279332ce0 --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.fingerprint; +/** + * This is most useful for sensors configured as FingerprintSensorType::UNDER_DISPLAY_OPTICAL, + * as it's used to compute the on-screen sensor boundaries for the touch detection algorithm. + * + * @hide + */ +@VintfStability +@Backing(type="byte") +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..bf117a33e6 --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.fingerprint; + +/** + * @hide + */ +@VintfStability +parcelable TouchDetectionParameters { + /** + * The percentage of the sensor that is considered the target. Value is required to be within + * [0.0, 1.0]. The target area expands outwards from center matching the sensorShape. Some + * portion of the touch must be within the target to be considered a valid touch. + */ + float targetSize = 1.0f; + + /** + * The minimum percentage overlap needed on the sensor to be considered a valid touch. Value is + * required to be within [0.0, 1.0]. + */ + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp index 430bf3cd82..3bb3f3a944 100644 --- a/biometrics/fingerprint/aidl/default/Android.bp +++ b/biometrics/fingerprint/aidl/default/Android.bp @@ -11,33 +11,144 @@ cc_binary { name: "android.hardware.biometrics.fingerprint-service.example", vendor: true, relative_install_path: "hw", - init_rc: ["fingerprint-default.rc"], - vintf_fragments: ["fingerprint-default.xml"], + init_rc: [":fingerprint-example.rc"], + vintf_fragments: [":fingerprint-example.xml"], local_include_dirs: ["include"], srcs: [ - "CancellationSignal.cpp", + "FakeLockoutTracker.cpp", + "FakeFingerprintEngine.cpp", + "FakeFingerprintEngineRear.cpp", + "FakeFingerprintEngineUdfps.cpp", + "FakeFingerprintEngineSide.cpp", "Fingerprint.cpp", "Session.cpp", - "WorkerThread.cpp", "main.cpp", ], shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.biometrics.fingerprint-V2-ndk", - "android.hardware.biometrics.common-V2-ndk", + "android.hardware.biometrics.fingerprint-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.common.thread", + "android.hardware.biometrics.common.util", ], + static_libs: ["libandroid.hardware.biometrics.fingerprint.VirtualProps"], } -cc_test_host { - name: "android.hardware.biometrics.fingerprint.WorkerThreadTest", +cc_test { + name: "android.hardware.biometrics.fingerprint.FakeFingerprintEngineTest", local_include_dirs: ["include"], srcs: [ - "tests/WorkerThreadTest.cpp", - "WorkerThread.cpp", + "tests/FakeFingerprintEngineTest.cpp", + "FakeFingerprintEngine.cpp", + "FakeLockoutTracker.cpp", ], shared_libs: [ - "libcutils", + "libbase", + "libbinder_ndk", + "android.hardware.biometrics.common.thread", ], + static_libs: [ + "libandroid.hardware.biometrics.fingerprint.VirtualProps", + "android.hardware.biometrics.fingerprint-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.keymaster-V4-ndk", + "android.hardware.biometrics.common.util", + ], + vendor: true, test_suites: ["general-tests"], + require_root: true, +} + +cc_test { + name: "android.hardware.biometrics.fingerprint.FakeFingerprintEngineUdfpsTest", + local_include_dirs: ["include"], + srcs: [ + "tests/FakeFingerprintEngineUdfpsTest.cpp", + "FakeFingerprintEngineUdfps.cpp", + "FakeFingerprintEngine.cpp", + "FakeLockoutTracker.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.biometrics.common.thread", + ], + static_libs: [ + "libandroid.hardware.biometrics.fingerprint.VirtualProps", + "android.hardware.biometrics.fingerprint-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.keymaster-V4-ndk", + "android.hardware.biometrics.common.util", + ], + vendor: true, + test_suites: ["general-tests"], + require_root: true, +} + +cc_test { + name: "android.hardware.biometrics.fingerprint.FakeLockoutTrackerTest", + local_include_dirs: ["include"], + srcs: [ + "tests/FakeLockoutTrackerTest.cpp", + "FakeLockoutTracker.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.biometrics.common.thread", + ], + static_libs: [ + "libandroid.hardware.biometrics.fingerprint.VirtualProps", + "android.hardware.biometrics.fingerprint-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.keymaster-V4-ndk", + "android.hardware.biometrics.common.util", + ], + vendor: true, + test_suites: ["general-tests"], + require_root: true, +} + +cc_test { + name: "android.hardware.biometrics.fingerprint.SessionTest", + local_include_dirs: ["include"], + srcs: [ + "tests/SessionTest.cpp", + "Session.cpp", + "FakeFingerprintEngine.cpp", + "FakeLockoutTracker.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.biometrics.common.thread", + ], + static_libs: [ + "libandroid.hardware.biometrics.fingerprint.VirtualProps", + "android.hardware.biometrics.fingerprint-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.keymaster-V4-ndk", + "android.hardware.biometrics.common.util", + ], + vendor: true, + test_suites: ["general-tests"], + require_root: true, +} + +sysprop_library { + name: "android.hardware.biometrics.fingerprint.VirtualProps", + srcs: ["fingerprint.sysprop"], + property_owner: "Vendor", + vendor: true, +} + +filegroup { + name: "fingerprint-example.rc", + srcs: ["fingerprint-example.rc"], +} + +filegroup { + name: "fingerprint-example.xml", + srcs: ["fingerprint-example.xml"], } diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp new file mode 100644 index 0000000000..90ec8f26ee --- /dev/null +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp @@ -0,0 +1,516 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FakeFingerprintEngine.h" +#include +#include "Fingerprint.h" + +#include +#include + +#include + +#include "util/CancellationSignal.h" +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; +using ::android::base::ParseInt; + +namespace aidl::android::hardware::biometrics::fingerprint { + +void FakeFingerprintEngine::generateChallengeImpl(ISessionCallback* cb) { + BEGIN_OP(0); + std::uniform_int_distribution dist; + auto challenge = dist(mRandom); + FingerprintHalProperties::challenge(challenge); + cb->onChallengeGenerated(challenge); +} + +void FakeFingerprintEngine::revokeChallengeImpl(ISessionCallback* cb, int64_t challenge) { + BEGIN_OP(0); + FingerprintHalProperties::challenge({}); + cb->onChallengeRevoked(challenge); +} + +void FakeFingerprintEngine::enrollImpl(ISessionCallback* cb, + const keymaster::HardwareAuthToken& hat, + const std::future& cancel) { + BEGIN_OP(getLatency(FingerprintHalProperties::operation_enroll_latency())); + + // Do proper HAT verification in the real implementation. + if (hat.mac.empty()) { + LOG(ERROR) << "Fail: hat"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + // Force error-out + auto err = FingerprintHalProperties::operation_enroll_error().value_or(0); + if (err != 0) { + LOG(ERROR) << "Fail: operation_enroll_error"; + auto ec = convertError(err); + cb->onError(ec.first, ec.second); + return; + } + + // Format is ":,...: + auto nextEnroll = FingerprintHalProperties::next_enrollment().value_or(""); + auto parts = Util::split(nextEnroll, ":"); + if (parts.size() != 3) { + LOG(ERROR) << "Fail: invalid next_enrollment:" << nextEnroll; + cb->onError(Error::VENDOR, 0 /* vendorError */); + return; + } + auto enrollmentId = std::stoi(parts[0]); + auto progress = parseEnrollmentCapture(parts[1]); + for (size_t i = 0; i < progress.size(); i += 2) { + auto left = (progress.size() - i) / 2 - 1; + auto duration = progress[i][0]; + auto acquired = progress[i + 1]; + auto N = acquired.size(); + + for (int j = 0; j < N; j++) { + SLEEP_MS(duration / N); + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + auto ac = convertAcquiredInfo(acquired[j]); + cb->onAcquired(ac.first, ac.second); + } + + if (left == 0 && !IS_TRUE(parts[2])) { // end and failed + LOG(ERROR) << "Fail: requested by caller: " << nextEnroll; + FingerprintHalProperties::next_enrollment({}); + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); + } else { // progress and update props if last time + LOG(INFO) << "onEnroll: " << enrollmentId << " left: " << left; + if (left == 0) { + auto enrollments = FingerprintHalProperties::enrollments(); + enrollments.emplace_back(enrollmentId); + FingerprintHalProperties::enrollments(enrollments); + FingerprintHalProperties::next_enrollment({}); + // change authenticatorId after new enrollment + auto id = FingerprintHalProperties::authenticator_id().value_or(0); + auto newId = id + 1; + FingerprintHalProperties::authenticator_id(newId); + LOG(INFO) << "Enrolled: " << enrollmentId; + } + cb->onEnrollmentProgress(enrollmentId, left); + } + } +} + +void FakeFingerprintEngine::authenticateImpl(ISessionCallback* cb, int64_t /* operationId */, + const std::future& cancel) { + BEGIN_OP(getLatency(FingerprintHalProperties::operation_authenticate_latency())); + + int64_t now = Util::getSystemNanoTime(); + int64_t duration = FingerprintHalProperties::operation_authenticate_duration().value_or(10); + auto acquired = FingerprintHalProperties::operation_authenticate_acquired().value_or("1"); + auto acquiredInfos = parseIntSequence(acquired); + int N = acquiredInfos.size(); + + if (N == 0) { + LOG(ERROR) << "Fail to parse authentiate acquired info: " + acquired; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + // got lockout? + FakeLockoutTracker::LockoutMode lockoutMode = mLockoutTracker.getMode(); + if (lockoutMode == FakeLockoutTracker::LockoutMode::kPermanent) { + LOG(ERROR) << "Fail: lockout permanent"; + cb->onLockoutPermanent(); + return; + } else if (lockoutMode == FakeLockoutTracker::LockoutMode::kTimed) { + int64_t timeLeft = mLockoutTracker.getLockoutTimeLeft(); + LOG(ERROR) << "Fail: lockout timed " << timeLeft; + cb->onLockoutTimed(timeLeft); + } + + int i = 0; + do { + if (FingerprintHalProperties::operation_authenticate_fails().value_or(false)) { + LOG(ERROR) << "Fail: operation_authenticate_fails"; + mLockoutTracker.addFailedAttempt(); + cb->onAuthenticationFailed(); + return; + } + + auto err = FingerprintHalProperties::operation_authenticate_error().value_or(0); + if (err != 0) { + LOG(ERROR) << "Fail: operation_authenticate_error"; + auto ec = convertError(err); + cb->onError(ec.first, ec.second); + return; + } + + if (FingerprintHalProperties::lockout().value_or(false)) { + LOG(ERROR) << "Fail: lockout"; + cb->onLockoutPermanent(); + cb->onError(Error::HW_UNAVAILABLE, 0 /* vendorError */); + return; + } + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + + if (i < N) { + auto ac = convertAcquiredInfo(acquiredInfos[i]); + cb->onAcquired(ac.first, ac.second); + i++; + } + + SLEEP_MS(duration / N); + } while (!Util::hasElapsed(now, duration)); + + auto id = FingerprintHalProperties::enrollment_hit().value_or(0); + auto enrolls = FingerprintHalProperties::enrollments(); + auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); + if (id > 0 && isEnrolled) { + cb->onAuthenticationSucceeded(id, {} /* hat */); + mLockoutTracker.reset(); + return; + } else { + LOG(ERROR) << "Fail: fingerprint not enrolled"; + cb->onAuthenticationFailed(); + mLockoutTracker.addFailedAttempt(); + } +} + +void FakeFingerprintEngine::detectInteractionImpl(ISessionCallback* cb, + const std::future& cancel) { + BEGIN_OP(getLatency(FingerprintHalProperties::operation_detect_interaction_latency())); + + int64_t duration = + FingerprintHalProperties::operation_detect_interaction_duration().value_or(10); + + auto detectInteractionSupported = + FingerprintHalProperties::detect_interaction().value_or(false); + if (!detectInteractionSupported) { + LOG(ERROR) << "Detect interaction is not supported"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + auto acquired = FingerprintHalProperties::operation_detect_interaction_acquired().value_or("1"); + auto acquiredInfos = parseIntSequence(acquired); + int N = acquiredInfos.size(); + int64_t now = Util::getSystemNanoTime(); + + if (N == 0) { + LOG(ERROR) << "Fail to parse detect interaction acquired info: " + acquired; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + int i = 0; + do { + auto err = FingerprintHalProperties::operation_detect_interaction_error().value_or(0); + if (err != 0) { + LOG(ERROR) << "Fail: operation_detect_interaction_error"; + auto ec = convertError(err); + cb->onError(ec.first, ec.second); + return; + } + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + + if (i < N) { + auto ac = convertAcquiredInfo(acquiredInfos[i]); + cb->onAcquired(ac.first, ac.second); + i++; + } + SLEEP_MS(duration / N); + } while (!Util::hasElapsed(now, duration)); + + auto id = FingerprintHalProperties::enrollment_hit().value_or(0); + auto enrolls = FingerprintHalProperties::enrollments(); + auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); + if (id <= 0 || !isEnrolled) { + LOG(ERROR) << "Fail: not enrolled"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + + cb->onInteractionDetected(); +} + +void FakeFingerprintEngine::enumerateEnrollmentsImpl(ISessionCallback* cb) { + BEGIN_OP(0); + + std::vector ids; + // There are some enrollment sync issue with framework, which results in + // a single template removal during the very firt sync command after reboot. + // This is a workaround for now. TODO(b/243129174) + ids.push_back(-1); + + for (auto& enrollment : FingerprintHalProperties::enrollments()) { + auto id = enrollment.value_or(0); + if (id > 0) { + ids.push_back(id); + } + } + + cb->onEnrollmentsEnumerated(ids); +} + +void FakeFingerprintEngine::removeEnrollmentsImpl(ISessionCallback* cb, + const std::vector& enrollmentIds) { + BEGIN_OP(0); + + std::vector> newEnrollments; + std::vector removed; + for (auto& enrollment : FingerprintHalProperties::enrollments()) { + auto id = enrollment.value_or(0); + if (std::find(enrollmentIds.begin(), enrollmentIds.end(), id) != enrollmentIds.end()) { + removed.push_back(id); + } else if (id > 0) { + newEnrollments.emplace_back(id); + } + } + FingerprintHalProperties::enrollments(newEnrollments); + + cb->onEnrollmentsRemoved(enrollmentIds); +} + +void FakeFingerprintEngine::getAuthenticatorIdImpl(ISessionCallback* cb) { + BEGIN_OP(0); + int64_t authenticatorId; + if (FingerprintHalProperties::enrollments().size() == 0) { + authenticatorId = 0; + } else { + authenticatorId = FingerprintHalProperties::authenticator_id().value_or(0); + if (authenticatorId == 0) authenticatorId = 1; + } + cb->onAuthenticatorIdRetrieved(authenticatorId); +} + +void FakeFingerprintEngine::invalidateAuthenticatorIdImpl(ISessionCallback* cb) { + BEGIN_OP(0); + int64_t newId; + if (FingerprintHalProperties::enrollments().size() == 0) { + newId = 0; + } else { + auto id = FingerprintHalProperties::authenticator_id().value_or(0); + newId = id + 1; + } + FingerprintHalProperties::authenticator_id(newId); + cb->onAuthenticatorIdInvalidated(newId); +} + +void FakeFingerprintEngine::resetLockoutImpl(ISessionCallback* cb, + const keymaster::HardwareAuthToken& hat) { + BEGIN_OP(0); + if (hat.mac.empty()) { + LOG(ERROR) << "Fail: hat in resetLockout()"; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + return; + } + FingerprintHalProperties::lockout(false); + cb->onLockoutCleared(); + mLockoutTracker.reset(); +} + +ndk::ScopedAStatus FakeFingerprintEngine::onPointerDownImpl(int32_t /*pointerId*/, int32_t /*x*/, + int32_t /*y*/, float /*minor*/, + float /*major*/) { + BEGIN_OP(0); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus FakeFingerprintEngine::onPointerUpImpl(int32_t /*pointerId*/) { + BEGIN_OP(0); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus FakeFingerprintEngine::onUiReadyImpl() { + BEGIN_OP(0); + return ndk::ScopedAStatus::ok(); +} + +bool FakeFingerprintEngine::getSensorLocationConfig(SensorLocation& out) { + auto loc = FingerprintHalProperties::sensor_location().value_or(""); + auto isValidStr = false; + auto dim = Util::split(loc, ":"); + + if (dim.size() < 3 or dim.size() > 4) { + if (!loc.empty()) LOG(WARNING) << "Invalid sensor location input (x:y:radius):" + loc; + return false; + } else { + int32_t x, y, r; + std::string d = ""; + if (dim.size() >= 3) { + isValidStr = ParseInt(dim[0], &x) && ParseInt(dim[1], &y) && ParseInt(dim[2], &r); + } + if (dim.size() >= 4) { + d = dim[3]; + } + if (isValidStr) out = {0, x, y, r, d}; + + return isValidStr; + } +} +SensorLocation FakeFingerprintEngine::getSensorLocation() { + SensorLocation location; + + if (getSensorLocationConfig(location)) { + return location; + } else { + return defaultSensorLocation(); + } +} + +SensorLocation FakeFingerprintEngine::defaultSensorLocation() { + return {0 /* displayId (not used) */, 0 /* sensorLocationX */, 0 /* sensorLocationY */, + 0 /* sensorRadius */, "" /* display */}; +} + +std::vector FakeFingerprintEngine::parseIntSequence(const std::string& str, + const std::string& sep) { + std::vector seqs = Util::split(str, sep); + std::vector res; + + for (const auto& seq : seqs) { + int32_t val; + if (ParseInt(seq, &val)) { + res.push_back(val); + } else { + LOG(WARNING) << "Invalid int sequence:" + str; + res.clear(); + break; + } + } + + return res; +} + +bool FakeFingerprintEngine::parseEnrollmentCaptureSingle(const std::string& str, + std::vector>& res) { + std::vector defaultAcquiredInfo = {(int32_t)AcquiredInfo::GOOD}; + bool aborted = true; + + do { + std::smatch sms; + // Parses strings like "1000-[5,1]" or "500" + std::regex ex("((\\d+)(-\\[([\\d|,]+)\\])?)"); + if (!regex_match(str.cbegin(), str.cend(), sms, ex)) break; + int32_t duration; + if (!ParseInt(sms.str(2), &duration)) break; + res.push_back({duration}); + if (!sms.str(4).empty()) { + auto acqv = parseIntSequence(sms.str(4)); + if (acqv.empty()) break; + res.push_back(acqv); + } else + res.push_back(defaultAcquiredInfo); + aborted = false; + } while (0); + + return !aborted; +} + +std::vector> FakeFingerprintEngine::parseEnrollmentCapture( + const std::string& str) { + std::vector> res; + + std::string s(str); + s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end()); + bool aborted = false; + std::smatch sms; + // Parses strings like "1000-[5,1],500,800-[6,5,1]" + // ---------- --- ----------- + // into parts: A B C + while (regex_search(s, sms, std::regex("^(,)?(\\d+(-\\[[\\d|,]+\\])?)"))) { + if (!parseEnrollmentCaptureSingle(sms.str(2), res)) { + aborted = true; + break; + } + s = sms.suffix(); + } + if (aborted || s.length() != 0) { + res.clear(); + LOG(ERROR) << "Failed to parse enrollment captures:" + str; + } + + return res; +} + +std::pair FakeFingerprintEngine::convertAcquiredInfo(int32_t code) { + std::pair res; + if (code > FINGERPRINT_ACQUIRED_VENDOR_BASE) { + res.first = AcquiredInfo::VENDOR; + res.second = code - FINGERPRINT_ACQUIRED_VENDOR_BASE; + } else { + res.first = (AcquiredInfo)code; + res.second = 0; + } + return res; +} + +std::pair FakeFingerprintEngine::convertError(int32_t code) { + std::pair res; + if (code > FINGERPRINT_ERROR_VENDOR_BASE) { + res.first = Error::VENDOR; + res.second = code - FINGERPRINT_ERROR_VENDOR_BASE; + } else { + res.first = (Error)code; + res.second = 0; + } + return res; +} + +int32_t FakeFingerprintEngine::getLatency( + const std::vector>& latencyIn) { + int32_t res = DEFAULT_LATENCY; + + std::vector latency; + for (auto x : latencyIn) + if (x.has_value()) latency.push_back(*x); + + switch (latency.size()) { + case 0: + break; + case 1: + res = latency[0]; + break; + case 2: + res = getRandomInRange(latency[0], latency[1]); + break; + default: + LOG(ERROR) << "ERROR: unexpected input of size " << latency.size(); + break; + } + + return res; +} + +int32_t FakeFingerprintEngine::getRandomInRange(int32_t bound1, int32_t bound2) { + std::uniform_int_distribution dist(std::min(bound1, bound2), std::max(bound1, bound2)); + return dist(mRandom); +} + +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineRear.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineRear.cpp new file mode 100644 index 0000000000..eea80d5f99 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineRear.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FakeFingerprintEngineRear.h" + +#include +#include + +#include + +#include "util/CancellationSignal.h" +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; + +namespace aidl::android::hardware::biometrics::fingerprint {} diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp new file mode 100644 index 0000000000..9f736e7abf --- /dev/null +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FakeFingerprintEngineSide.h" + +#include + +#include + +#include "util/CancellationSignal.h" +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; + +namespace aidl::android::hardware::biometrics::fingerprint { + +SensorLocation FakeFingerprintEngineSide::defaultSensorLocation() { + SensorLocation location; + + return {0 /* displayId (not used) */, defaultSensorLocationX /* sensorLocationX */, + defaultSensorLocationY /* sensorLocationY */, defaultSensorRadius /* sensorRadius */, + "" /* display */}; +} +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineUdfps.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineUdfps.cpp new file mode 100644 index 0000000000..3cdfc70008 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineUdfps.cpp @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FakeFingerprintEngineUdfps.h" + +#include + +#include + +#include "util/CancellationSignal.h" +#include "util/Util.h" + +#undef LOG_TAG +#define LOG_TAG "FingerprintVirtualHalUdfps" + +using namespace ::android::fingerprint::virt; + +namespace aidl::android::hardware::biometrics::fingerprint { + +FakeFingerprintEngineUdfps::FakeFingerprintEngineUdfps() + : FakeFingerprintEngine(), mWorkMode(WorkMode::kIdle), mPointerDownTime(0), mUiReadyTime(0) {} + +SensorLocation FakeFingerprintEngineUdfps::defaultSensorLocation() { + return {0 /* displayId (not used) */, defaultSensorLocationX /* sensorLocationX */, + defaultSensorLocationY /* sensorLocationY */, defaultSensorRadius /* sensorRadius */, + "" /* display */}; +} + +ndk::ScopedAStatus FakeFingerprintEngineUdfps::onPointerDownImpl(int32_t /*pointerId*/, + int32_t /*x*/, int32_t /*y*/, + float /*minor*/, float /*major*/) { + BEGIN_OP(0); + // verify whetehr touch coordinates/area matching sensor location ? + mPointerDownTime = Util::getSystemNanoTime(); + if (FingerprintHalProperties::control_illumination().value_or(false)) { + fingerDownAction(); + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus FakeFingerprintEngineUdfps::onPointerUpImpl(int32_t /*pointerId*/) { + BEGIN_OP(0); + mUiReadyTime = 0; + mPointerDownTime = 0; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus FakeFingerprintEngineUdfps::onUiReadyImpl() { + BEGIN_OP(0); + + if (Util::hasElapsed(mPointerDownTime, uiReadyTimeoutInMs * 100)) { + LOG(ERROR) << "onUiReady() arrives too late after onPointerDown()"; + } else { + fingerDownAction(); + } + return ndk::ScopedAStatus::ok(); +} + +void FakeFingerprintEngineUdfps::fingerDownAction() { + switch (mWorkMode) { + case WorkMode::kAuthenticate: + onAuthenticateFingerDown(); + break; + case WorkMode::kEnroll: + onEnrollFingerDown(); + break; + case WorkMode::kDetectInteract: + onDetectInteractFingerDown(); + break; + default: + LOG(WARNING) << "unexpected call: onUiReady()"; + break; + } + + mUiReadyTime = 0; + mPointerDownTime = 0; +} + +void FakeFingerprintEngineUdfps::onAuthenticateFingerDown() { + FakeFingerprintEngine::authenticateImpl(mCb, mOperationId, mCancelVec[0]); +} + +void FakeFingerprintEngineUdfps::onEnrollFingerDown() { + // Any use case to emulate display touch for each capture during enrollment? + FakeFingerprintEngine::enrollImpl(mCb, mHat, mCancelVec[0]); +} + +void FakeFingerprintEngineUdfps::onDetectInteractFingerDown() { + FakeFingerprintEngine::detectInteractionImpl(mCb, mCancelVec[0]); +} + +void FakeFingerprintEngineUdfps::enrollImpl(ISessionCallback* cb, + const keymaster::HardwareAuthToken& hat, + const std::future& cancel) { + updateContext(WorkMode::kEnroll, cb, const_cast&>(cancel), 0, hat); +} + +void FakeFingerprintEngineUdfps::authenticateImpl(ISessionCallback* cb, int64_t operationId, + const std::future& cancel) { + updateContext(WorkMode::kAuthenticate, cb, const_cast&>(cancel), operationId, + keymaster::HardwareAuthToken()); +} + +void FakeFingerprintEngineUdfps::detectInteractionImpl(ISessionCallback* cb, + const std::future& cancel) { + updateContext(WorkMode::kDetectInteract, cb, const_cast&>(cancel), 0, + keymaster::HardwareAuthToken()); +} + +void FakeFingerprintEngineUdfps::updateContext(WorkMode mode, ISessionCallback* cb, + std::future& cancel, int64_t operationId, + const keymaster::HardwareAuthToken& hat) { + mPointerDownTime = 0; + mUiReadyTime = 0; + mCancelVec.clear(); + + mCancelVec.push_back(std::move(cancel)); + mWorkMode = mode; + mCb = cb; + mOperationId = operationId; + mHat = hat; +} + +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/FakeLockoutTracker.cpp b/biometrics/fingerprint/aidl/default/FakeLockoutTracker.cpp new file mode 100644 index 0000000000..5996406fd0 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/FakeLockoutTracker.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FakeLockoutTracker.h" +#include +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; + +namespace aidl::android::hardware::biometrics::fingerprint { + +void FakeLockoutTracker::reset() { + mFailedCount = 0; + mLockoutTimedStart = 0; + mCurrentMode = LockoutMode::kNone; +} + +void FakeLockoutTracker::addFailedAttempt() { + bool enabled = FingerprintHalProperties::lockout_enable().value_or(false); + if (enabled) { + mFailedCount++; + int32_t lockoutTimedThreshold = + FingerprintHalProperties::lockout_timed_threshold().value_or(5); + int32_t lockoutPermanetThreshold = + FingerprintHalProperties::lockout_permanent_threshold().value_or(20); + if (mFailedCount >= lockoutPermanetThreshold) { + mCurrentMode = LockoutMode::kPermanent; + FingerprintHalProperties::lockout(true); + } else if (mFailedCount >= lockoutTimedThreshold) { + if (mCurrentMode == LockoutMode::kNone) { + mCurrentMode = LockoutMode::kTimed; + mLockoutTimedStart = Util::getSystemNanoTime(); + } + } + } else { + reset(); + } +} + +FakeLockoutTracker::LockoutMode FakeLockoutTracker::getMode() { + if (mCurrentMode == LockoutMode::kTimed) { + int32_t lockoutTimedDuration = + FingerprintHalProperties::lockout_timed_duration().value_or(10 * 100); + if (Util::hasElapsed(mLockoutTimedStart, lockoutTimedDuration)) { + mCurrentMode = LockoutMode::kNone; + mLockoutTimedStart = 0; + } + } + + return mCurrentMode; +} + +int64_t FakeLockoutTracker::getLockoutTimeLeft() { + int64_t res = 0; + + if (mLockoutTimedStart > 0) { + auto now = Util::getSystemNanoTime(); + auto left = now - mLockoutTimedStart; + res = (left > 0) ? (left / 1000000LL) : 0; + } + + return res; +} +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.cpp b/biometrics/fingerprint/aidl/default/Fingerprint.cpp index 1f14de63ac..f00a49d26e 100644 --- a/biometrics/fingerprint/aidl/default/Fingerprint.cpp +++ b/biometrics/fingerprint/aidl/default/Fingerprint.cpp @@ -15,16 +15,22 @@ */ #include "Fingerprint.h" - #include "Session.h" +#include + +#include +#include +#include + +using namespace ::android::fingerprint::virt; + namespace aidl::android::hardware::biometrics::fingerprint { namespace { constexpr size_t MAX_WORKER_QUEUE_SIZE = 5; -constexpr int SENSOR_ID = 1; +constexpr int SENSOR_ID = 5; constexpr common::SensorStrength SENSOR_STRENGTH = common::SensorStrength::STRONG; constexpr int MAX_ENROLLMENTS_PER_USER = 5; -constexpr FingerprintSensorType SENSOR_TYPE = FingerprintSensorType::REAR; constexpr bool SUPPORTS_NAVIGATION_GESTURES = true; constexpr char HW_COMPONENT_ID[] = "fingerprintSensor"; constexpr char HW_VERSION[] = "vendor/model/revision"; @@ -35,27 +41,57 @@ constexpr char SW_VERSION[] = "vendor/version/revision"; } // namespace -Fingerprint::Fingerprint() - : mEngine(std::make_unique()), mWorker(MAX_WORKER_QUEUE_SIZE) {} +Fingerprint::Fingerprint() : mWorker(MAX_WORKER_QUEUE_SIZE) { + std::string sensorTypeProp = FingerprintHalProperties::type().value_or(""); + if (sensorTypeProp == "" || sensorTypeProp == "default" || sensorTypeProp == "rear") { + mSensorType = FingerprintSensorType::REAR; + mEngine = std::make_unique(); + } else if (sensorTypeProp == "udfps") { + mSensorType = FingerprintSensorType::UNDER_DISPLAY_OPTICAL; + mEngine = std::make_unique(); + } else if (sensorTypeProp == "side") { + mSensorType = FingerprintSensorType::POWER_BUTTON; + mEngine = std::make_unique(); + } else { + mSensorType = FingerprintSensorType::UNKNOWN; + mEngine = std::make_unique(); + UNIMPLEMENTED(FATAL) << "unrecognized or unimplemented fingerprint behavior: " + << sensorTypeProp; + } + LOG(INFO) << "sensorTypeProp:" << sensorTypeProp; +} ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector* out) { std::vector componentInfo = { {HW_COMPONENT_ID, HW_VERSION, FW_VERSION, SERIAL_NUMBER, "" /* softwareVersion */}, {SW_COMPONENT_ID, "" /* hardwareVersion */, "" /* firmwareVersion */, "" /* serialNumber */, SW_VERSION}}; + auto sensorId = FingerprintHalProperties::sensor_id().value_or(SENSOR_ID); + auto sensorStrength = + FingerprintHalProperties::sensor_strength().value_or((int)SENSOR_STRENGTH); + auto maxEnrollments = + FingerprintHalProperties::max_enrollments().value_or(MAX_ENROLLMENTS_PER_USER); + auto navigationGuesture = FingerprintHalProperties::navigation_guesture().value_or(false); + auto detectInteraction = FingerprintHalProperties::detect_interaction().value_or(false); + auto displayTouch = FingerprintHalProperties::display_touch().value_or(true); + auto controlIllumination = FingerprintHalProperties::control_illumination().value_or(false); - common::CommonProps commonProps = {SENSOR_ID, SENSOR_STRENGTH, MAX_ENROLLMENTS_PER_USER, - componentInfo}; + common::CommonProps commonProps = {sensorId, (common::SensorStrength)sensorStrength, + maxEnrollments, componentInfo}; - SensorLocation sensorLocation = {0 /* displayId (not used) */, 0 /* sensorLocationX */, - 0 /* sensorLocationY */, 0 /* sensorRadius */, - "" /* display */}; + SensorLocation sensorLocation = mEngine->getSensorLocation(); + + LOG(INFO) << "sensor type:" << ::android::internal::ToString(mSensorType) + << " location:" << sensorLocation.toString(); *out = {{commonProps, - SENSOR_TYPE, + mSensorType, {sensorLocation}, - SUPPORTS_NAVIGATION_GESTURES, - false /* supportsDetectInteraction */}}; + navigationGuesture, + detectInteraction, + displayTouch, + controlIllumination, + std::nullopt}}; return ndk::ScopedAStatus::ok(); } @@ -66,7 +102,103 @@ ndk::ScopedAStatus Fingerprint::createSession(int32_t sensorId, int32_t userId, mSession = SharedRefBase::make(sensorId, userId, cb, mEngine.get(), &mWorker); *out = mSession; + + mSession->linkToDeath(cb->asBinder().get()); + + LOG(INFO) << "createSession: sensorId:" << sensorId << " userId:" << userId; return ndk::ScopedAStatus::ok(); } +binder_status_t Fingerprint::dump(int fd, const char** /*args*/, uint32_t numArgs) { + if (fd < 0) { + LOG(ERROR) << "Fingerprint::dump fd invalid: " << fd; + return STATUS_BAD_VALUE; + } else { + LOG(INFO) << "Fingerprint::dump fd:" << fd << "numArgs:" << numArgs; + } + + dprintf(fd, "----- FingerprintVirtualHal::dump -----\n"); + std::vector sps(1); + getSensorProps(&sps); + for (auto& sp : sps) { + ::android::base::WriteStringToFd(sp.toString(), fd); + } + ::android::base::WriteStringToFd(mEngine->toString(), fd); + + fsync(fd); + return STATUS_OK; +} + +binder_status_t Fingerprint::handleShellCommand(int in, int out, int err, const char** args, + uint32_t numArgs) { + LOG(INFO) << "Fingerprint::handleShellCommand in:" << in << " out:" << out << " err:" << err + << " numArgs:" << numArgs; + + if (numArgs == 0) { + LOG(INFO) << "Fingerprint::handleShellCommand: available commands"; + onHelp(out); + return STATUS_OK; + } + + for (auto&& str : std::vector(args, args + numArgs)) { + std::string option = str.data(); + if (option.find("clearconfig") != std::string::npos || + option.find("resetconfig") != std::string::npos) { + resetConfigToDefault(); + } + if (option.find("help") != std::string::npos) { + onHelp(out); + } + } + + return STATUS_OK; +} + +void Fingerprint::onHelp(int fd) { + dprintf(fd, "Virtual HAL commands:\n"); + dprintf(fd, " help: print this help\n"); + dprintf(fd, " resetconfig: reset all configuration to default\n"); + dprintf(fd, "\n"); + fsync(fd); +} + +void Fingerprint::resetConfigToDefault() { + LOG(INFO) << "reset virtual HAL configuration to default"; +#define RESET_CONFIG_O(__NAME__) \ + if (FingerprintHalProperties::__NAME__()) FingerprintHalProperties::__NAME__(std::nullopt) +#define RESET_CONFIG_V(__NAME__) \ + if (!FingerprintHalProperties::__NAME__().empty()) \ + FingerprintHalProperties::__NAME__({std::nullopt}) + + RESET_CONFIG_O(type); + RESET_CONFIG_V(enrollments); + RESET_CONFIG_O(enrollment_hit); + RESET_CONFIG_O(authenticator_id); + RESET_CONFIG_O(challenge); + RESET_CONFIG_O(lockout); + RESET_CONFIG_O(operation_authenticate_fails); + RESET_CONFIG_O(operation_detect_interaction_error); + RESET_CONFIG_O(operation_enroll_error); + RESET_CONFIG_V(operation_authenticate_latency); + RESET_CONFIG_V(operation_detect_interaction_latency); + RESET_CONFIG_V(operation_enroll_latency); + RESET_CONFIG_O(operation_authenticate_duration); + RESET_CONFIG_O(operation_authenticate_error); + RESET_CONFIG_O(sensor_location); + RESET_CONFIG_O(operation_authenticate_acquired); + RESET_CONFIG_O(operation_detect_interaction_duration); + RESET_CONFIG_O(operation_detect_interaction_acquired); + RESET_CONFIG_O(sensor_id); + RESET_CONFIG_O(sensor_strength); + RESET_CONFIG_O(max_enrollments); + RESET_CONFIG_O(navigation_guesture); + RESET_CONFIG_O(detect_interaction); + RESET_CONFIG_O(display_touch); + RESET_CONFIG_O(control_illumination); + RESET_CONFIG_O(lockout_enable); + RESET_CONFIG_O(lockout_timed_threshold); + RESET_CONFIG_O(lockout_timed_duration); + RESET_CONFIG_O(lockout_permanent_threshold); +} + } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/README.md b/biometrics/fingerprint/aidl/default/README.md new file mode 100644 index 0000000000..823cd18f43 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/README.md @@ -0,0 +1,171 @@ +# Virtual Fingerprint HAL + +This is a virtual HAL implementation that is backed by system properties instead +of actual hardware. It's intended for testing and UI development on debuggable +builds to allow devices to masquerade as alternative device types and for +emulators. + +## Supported Devices + +This HAL can be used on emulators, like cuttlefish, or on real devices. Add the +following to your device's `.mk` file to include it: + +``` +PRODUCT_PACKAGES_DEBUG += android.hardware.biometrics.fingerprint-service.example +``` + +or add the following to include it as an apex: + +``` +PRODUCT_PACKAGES_DEBUG += com.android.hardware.biometrics.fingerprint.virtual +``` + +The virtual HAL will be ignored if a real HAL is also installed on the target +device. Set the `biometric_virtual_enabled` settings and reboot the device to +switch to the virtual HAL. Unset it and reboot again to switch back. + +## Getting Started + +First, set the type of sensor the device should use, enable the virtual +extensions in the framework, and reboot. + +```shell +$ adb root +$ adb shell settings put secure biometric_virtual_enabled 1 +$ adb shell setprop persist.vendor.fingerprint.virtual.type rear +$ adb reboot +``` + +### Enrollments + +Next, setup enrollments on the device. This can either be done through the UI, +or via adb directly. + +#### Direct Enrollment + +To set enrollment directly without the UI: + +```shell +$ adb root +$ adb shell locksettings set-pin 0000 +$ adb shell setprop persist.vendor.fingerprint.virtual.enrollments 1 +$ adb shell cmd fingerprint sync +``` + +#### UI Enrollment + +1. Set pin + ```shell + $ adb shell locksettings set-pin 0000 + ``` +2. Tee up the results of the enrollment before starting the process: + + ```shell + $ adb shell setprop vendor.fingerprint.virtual.next_enrollment 1:100,100,100:true + ``` + +3. Navigate to `Settings -> Security -> Fingerprint Unlock` and follow the + prompts. +4. Verify the enrollments in the UI: + + ```shell + $ adb shell getprop persist.vendor.fingerprint.virtual.enrollments + ``` + +## Authenticate + +To authenticate successfully set the enrolled id that should succeed. Unset it +or change the value to make authenticate operations fail: + +````shell +$ adb shell setprop vendor.fingerprint.virtual.enrollment_hit 1 +```` + +## Acquired Info Insertion + +Fingerprint image acquisition states at HAL are reported to framework via onAcquired() callback. The valid acquired state info for AIDL HAL include + +{UNKNOWN(0), GOOD(1), PARTIAL(2), INSUFFICIENT(3), SENSOR_DIRTY(4), TOO_SLOW(5), TOO_FAST(6), VENDOR(7), START(8), TOO_DARK(9), TOO_BRIGHT(10), IMMOBILE(11), RETRYING_CAPTURE(12)} + +Refer to [AcquiredInfo.aidl](../android/hardware/biometrics/fingerprint/AcquiredInfo.aidl) for details + + +The states can be specified in sequence for the HAL operations involving fingerprint image captures, namely authenticate, enrollment and detectInteraction + +```shell +$ adb shell setprop vendor.fingerprint.virtual.operation_authenticate_acquired 6,9,1 +$ adb shell setprop vendor.fingerprint.virtual.operation_detect_interaction_acquired 6,1 +$ adb shell setprop vendor.fingerprint.virtual.next_enrollment 2:1000-[5,1],500:true + +#next_enrollment format example: +.---------------------- enrollment id (2) +| .------------------ the image capture 1 duration (1000ms) +| | .-------------- acquired info first (TOO_SLOW) +| | | .------------ acquired info second (GOOD) +| | | | .-------- the image capture 2 duration (500ms) +| | | | | .---- enrollment end status (success) +| | | | | | +| | | | | | +| | | | | | +2:1000-[5,1],500:true +``` +For vendor specific acquired info, acquiredInfo = 1000 + vendorAcquiredInfo + +## Error Insertion +The valid error codes for AIDL HAL include + +{UNKNOWN(0), HW_UNAVAILABLE(1), UNABLE_TO_PROCESS(2), TIMEOUT(3), NO_SPACE(4), CANCELED(5), UNABLE_TO_REMOVE(6), VENDOR(7), BAD_CALIBRATION(8)} + +Refer to [Error.aidl](../android/hardware/biometrics/fingerprint/Error.aidl) for details + + +There are many HAL operations which can result in errors, refer to [here](fingerprint.sysprop) file for details. + +```shell +$ adb shell setprop vendor.fingerprint.virtual.operation_authenticate_error 8 +``` +For vendor specific error, errorCode = 1000 + vendorErrorCode + +## Latency Insertion +Three HAL operations (authenticate, enrollment and detect interaction) latency can be optionally specified in multiple ways +1. default latency is fixed at 400 ms if not specified via sysprop +2. specify authenticate operation latency to 900 ms + ```shell adb shell setprop vendor.fingerprint.virtual.operation_authenticate_latency 900``` +3. specify authenticate operation latency between 600 to 1200 ms in unifrom distribution + ```shelladb shell setprop vendor.fingerprint.virtual.operation_authenticate_latency 600,1200``` + +## Lockout +To force the device into lockout state +```shell +$ adb shell setprop persist.vendor.fingerprint.virtual.lockout true +``` +To test permanent lockout based on the failed authentication attempts (e.g. 7) +```shell +$ adb shell setprop persist.vendor.fingerprint.virtual.lockout_permanent_threshold 7 +$ adb shell setprop persist.vendor.fingerprint.virtual.lockout_enable true +``` +To test timed lockout based on the failed authentication attempts (e.g. 8 seconds on 5 attempts) +```shell +$ adb shell setprop persist.vendor.fingerprint.virtual.lockout_timed_duration 8000 +$ adb shell setprop persist.vendor.fingerprint.virtual.lockout_timed_threshold 5 +$ adb shell setprop persist.vendor.fingerprint.virtual.lockout_enable true +``` + +## Reset all configurations to default +The following command will reset virtual configurations (related system properties) to default value. +```shell +$ adb shell cmd android.hardware.biometrics.fingerprint.IFingerprint/virtual resetconfig +$ adb reboot +``` + +## View HAL State + +To view all the properties of the HAL (see `fingerprint.sysprop` file for the API): + +```shell +$ adb shell getprop | grep vendor.fingerprint.virtual +``` +To dump virtual HAL internal data +```shell +adb shell dumpsys android.hardware.biometrics.fingerprint.IFingerprint/virtual +``` diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp index 452ed12b95..c06c9317e8 100644 --- a/biometrics/fingerprint/aidl/default/Session.cpp +++ b/biometrics/fingerprint/aidl/default/Session.cpp @@ -18,10 +18,21 @@ #include -#include "CancellationSignal.h" +#include "util/CancellationSignal.h" + +#undef LOG_TAG +#define LOG_TAG "FingerprintVirtualHalSession" namespace aidl::android::hardware::biometrics::fingerprint { +void onClientDeath(void* cookie) { + LOG(INFO) << "FingerprintService has died"; + Session* session = static_cast(cookie); + if (session && !session->isClosed()) { + session->close(); + } +} + Session::Session(int sensorId, int userId, std::shared_ptr cb, FakeFingerprintEngine* engine, WorkerThread* worker) : mSensorId(sensorId), @@ -36,6 +47,12 @@ Session::Session(int sensorId, int userId, std::shared_ptr cb, CHECK(mEngine); CHECK(mWorker); CHECK(mCb); + + mDeathRecipient = AIBinder_DeathRecipient_new(onClientDeath); +} + +binder_status_t Session::linkToDeath(AIBinder* binder) { + return AIBinder_linkToDeath(binder, mDeathRecipient, this); } void Session::scheduleStateOrCrash(SessionState state) { @@ -101,7 +118,7 @@ ndk::ScopedAStatus Session::enroll(const keymaster::HardwareAuthToken& hat, if (shouldCancel(cancFuture)) { mCb->onError(Error::CANCELED, 0 /* vendorCode */); } else { - mEngine->enrollImpl(mCb.get(), hat); + mEngine->enrollImpl(mCb.get(), hat, cancFuture); } enterIdling(); })); @@ -123,7 +140,7 @@ ndk::ScopedAStatus Session::authenticate(int64_t operationId, if (shouldCancel(cancFuture)) { mCb->onError(Error::CANCELED, 0 /* vendorCode */); } else { - mEngine->authenticateImpl(mCb.get(), operationId); + mEngine->authenticateImpl(mCb.get(), operationId, cancFuture); } enterIdling(); })); @@ -144,7 +161,7 @@ ndk::ScopedAStatus Session::detectInteraction(std::shared_ptronError(Error::CANCELED, 0 /* vendorCode */); } else { - mEngine->detectInteractionImpl(mCb.get()); + mEngine->detectInteractionImpl(mCb.get(), cancFuture); } enterIdling(); })); @@ -167,7 +184,7 @@ ndk::ScopedAStatus Session::enumerateEnrollments() { } ndk::ScopedAStatus Session::removeEnrollments(const std::vector& enrollmentIds) { - LOG(INFO) << "removeEnrollments"; + LOG(INFO) << "removeEnrollments, size:" << enrollmentIds.size(); scheduleStateOrCrash(SessionState::REMOVING_ENROLLMENTS); mWorker->schedule(Callable::from([this, enrollmentIds] { @@ -225,22 +242,35 @@ ndk::ScopedAStatus Session::close() { // Crashing."; mCurrentState = SessionState::CLOSED; mCb->onSessionClosed(); + AIBinder_DeathRecipient_delete(mDeathRecipient); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::onPointerDown(int32_t /*pointerId*/, int32_t /*x*/, int32_t /*y*/, - float /*minor*/, float /*major*/) { +ndk::ScopedAStatus Session::onPointerDown(int32_t pointerId, int32_t x, int32_t y, float minor, + float major) { LOG(INFO) << "onPointerDown"; + mWorker->schedule(Callable::from([this, pointerId, x, y, minor, major] { + mEngine->onPointerDownImpl(pointerId, x, y, minor, major); + enterIdling(); + })); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Session::onPointerUp(int32_t /*pointerId*/) { +ndk::ScopedAStatus Session::onPointerUp(int32_t pointerId) { LOG(INFO) << "onPointerUp"; + mWorker->schedule(Callable::from([this, pointerId] { + mEngine->onPointerUpImpl(pointerId); + enterIdling(); + })); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Session::onUiReady() { LOG(INFO) << "onUiReady"; + mWorker->schedule(Callable::from([this] { + mEngine->onUiReadyImpl(); + enterIdling(); + })); return ndk::ScopedAStatus::ok(); } @@ -274,4 +304,12 @@ ndk::ScopedAStatus Session::onContextChanged(const common::OperationContext& /*c return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Session::onPointerCancelWithContext(const PointerContext& /*context*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Session::setIgnoreDisplayTouches(bool /*shouldIgnore*/) { + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/apex/Android.bp b/biometrics/fingerprint/aidl/default/apex/Android.bp new file mode 100644 index 0000000000..ad36ae2aad --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/Android.bp @@ -0,0 +1,73 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +apex_key { + name: "com.android.hardware.biometrics.fingerprint.virtual.key", + public_key: "com.android.hardware.biometrics.fingerprint.virtual.avbpubkey", + private_key: "com.android.hardware.biometrics.fingerprint.virtual.pem", +} + +android_app_certificate { + name: "com.android.hardware.biometrics.fingerprint.virtual.certificate", + certificate: "com.android.hardware.biometrics.fingerprint.virtual", +} + +apex { + name: "com.android.hardware.biometrics.fingerprint.virtual", + manifest: "manifest.json", + file_contexts: "file_contexts", + key: "com.android.hardware.biometrics.fingerprint.virtual.key", + certificate: ":com.android.hardware.biometrics.fingerprint.virtual.certificate", + updatable: false, + use_vndk_as_stable: true, + vendor: true, + + binaries: [ + "android.hardware.biometrics.fingerprint-service.example", + ], + prebuilts: [ + // init_rc + "fingerprint-example-apex.rc", + // vintf_fragment + "fingerprint-example-apex.xml", + ], + + overrides: [ + "android.hardware.biometrics.fingerprint-service.example", + ], +} + +genrule { + name: "gen-fingerprint-example-apex.rc", + srcs: [":fingerprint-example.rc"], + out: ["fingerprint-example-apex.rc"], + cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.biometrics.fingerprint.virtual/bin/@' $(in) > $(out)", +} + +prebuilt_etc { + name: "fingerprint-example-apex.rc", + src: ":gen-fingerprint-example-apex.rc", + installable: false, +} + +prebuilt_etc { + name: "fingerprint-example-apex.xml", + src: ":fingerprint-example.xml", + sub_dir: "vintf", + installable: false, +} diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.avbpubkey b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.avbpubkey new file mode 100644 index 0000000000..9f2334a9a2 Binary files /dev/null and b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.avbpubkey differ diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem new file mode 100644 index 0000000000..14eb288d39 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDwo6CxzAwmX46C +N1j8zr0qf6uy1rDkG5r1s4faDNX/ThYpd69DWbVGf22yFO3KY3B+TmqKU+B0SiqY +MHQjXc+UcTa0BKtPtQNSYFLK13/1rW69QrlLtcGyAp/CwksXYuuJ8Uzs28nQ5A+z +fh6Vfsla9tUWDeWtN4oehmOwZ0ZKPBAKKocB5W+YJoIkdVnzkiOnWawk8Wn7a1N0 +jN5wFDO/99De+rTzYgKvV3Xb68H2UrIei4TW4wEpMZuDRUfbPlrSkJpdf+hYKKLb +AkotUrwA1znYR3U9t0GIHwZ5sp+OQTCkTfJMg2c+Bpmkp3TAL24LdvkYVA2LZERB +p7xNeACH210Bb8QOAEaiLyVWuL6iapXI67TOkZ5yk7heb5zCxRcpOMA4FQ0hWYoX +AWstem9ADWvZgKe0BFGx7lhp5YmdBCzdNv0za3Va9EATJ0wgy4qMpZu3yjDPE9bq +gdb3BQL3kiDHdfR/LF9bCIP9QEHg+1mWOZDO1x8lXCuQrgp+gnh9bbfX5g6lA8IQ +dTfozjLQC3mVbl0P7/PIf9rnHjcqUh3/1RJH51tkgqBO8xn7D6AIOv665hI+O319 +PU4j26vLSfEu624IjEDK/gcgacuoYl3H3LMI5a2JIWFLOtpKRo9P2qFF702o8B97 +5slGDYnxpAAnEQQADuRYgDalDlFDNQIDAQABAoICABe7k4wleydHslbeXYzlWNu5 +prXnHaAJpvFHiQT00iAxU9c4IhVq4gl3ZNq03LTitMQIONK2rgLaE7RZxwJ77I6P +0dzUPw8H47F6pX+y3EBfH/ZTf9HbNaS4RIhhQCWo0GEU5sjPbmqHK5NAw4Rr8jDh ++icILNg2C42yJF/P96s3nD9cbV8/ARAI8DnnRv1SMuj825DzLEgrEBqFECUOoQH0 +T2nGYRVF28zuO8X6TPFdu4puqSXGUqV86oD6UrlpP2zX7Rl+lWwoadNeuPEaYUdV +8rMFbScujSx/HtTezISroj/6HgT0yrhfz0RhbY7MvrYrwCppk8JlG6Q8BkK/rJGI +lGw7nKIp43Tl8T2Rzw0I1dPwxCLMJuVErUclznN7lq25akG5XRwBAUQQE6nHO3GL +jh7eFW7rEcpUBEKYTK1ZA8QrWGUW3WittDqZ6VQU/ZudVoTcgbW3YpUYq5z76O4u +B6tqlmNtQfIi3LBh8CD19SIjV6KKVa0s++ArQEu/DWzmHWh/STZZk4b1DSdFYqm0 +zgylOVUfpcG10OxPOdvMEsA0VoXxxwl6Hx3DSEX6VxOQvBSkwhu+gw8u2keOsIYZ +Ha2OxtG5FiEQqSa8YNN/0NDdOp1eEyqvdvT7o51cqHHPvlyhk7XL0AguErCtGggn +TZ3rsUChlauG9GbJ4nOBAoIBAQD+ceJpOkMuw04dhIY5of3CcTTKGWdt2/9SP9PU +ZORC6ywBhRORQBhyVZIERmxfJUGsmePHeIEQ5L8IniUDRTCKrL+J2bR8NdYZfvCJ +9cYD2gjXmikFabKn6mkQz7JXjSr3Vamx2ueKuYqfo72aHVvhFv6Hi/ulbUPPZ15c +gVo0iU5GRt/1XNyTksSiSKRyxXJYWqg5GD2JQ92Zbo5a5LhulC7wFF39jyfTe7K2 +mfrCI7dr+A0WtiTpbRH9EIU8CseIBgIEDTgMAxbBdUZpF8pecIAy0MLFefLA+8CK +RN+8AI+HRHybjvuonOAfeEtQyyknzycxh20dyrd3FvBj40NBAoIBAQDyHCRuNwXA +twETiysx1XStaoODLQkPxSqdFIBD+tfVR+E/3blVXkdrFfrTcr8NGdcgsJgQgYWr +h9OENizcHg75gX6wdo3qYGQdZZxws/dQbNylObFYNkyFQrD1vkQzjZl5O4DaRJC7 +6YbJrrXZ44dgZoMo/M8nyNU5yaLvoOf4GV4bSiEfsx/MxWK7x6rCcpw9jpm+yQlB +9NblSgWzfg0hmcRBn6haC3q45walBYGTVJfzTOMgn5bUmMxKqKlCXvp20BPLdclQ +5Y14OqkqhnFeHpBSJ7iVI9BBy2nAsyk37NvYVg7mN8fGiWbCqurIrbPRGSCdohGr +wY7zOVd1hmb1AoIBAGPhVJ0177VlmT5hDUeGXVR8l9pVipJHb7xbrc2MJUZXhpi6 +Imo8HNyU1pKzCkt3Foaoig99MDzvbkX1vlXATUPCeBWmzgCMKZUsjUO6pJZSenIX +485qJWVg0Ql2Xm2bzqf0in50jbuZBd+QqRbcO3rqSdPvkULo11uNGi95320MERvp +KnTolPWhAWsq1NLwyuf//lUbPNyrNUvLaDop2nQd2ycG97ZXAa00u3yOiS64UoIh +hxHJQkgXNp5+Y66kFJtCsHvirIOams4qOQ979UaJJunLpQlby30R1gzw6FqmZbEV +o0x1HjicDCaOVBJNDcTAvoPkw2KUdtxattafGYECggEBAPICm4/oREHdLKBCjszj +mBv4yrkG/XXcGrql0YkiZzj0/v3+PtJMyYsLj4xpuPv5hodQvtBRCDLsNMyF8tWc +3k8d2GvANh/AdpLEDVrDKkYka3Jldxa8QEU84vLiW/5EXtNGXYjQ3PRZfLiBgZnp +zFraXeVMwC3+nNWE7vAloXrosJ8KvI2ZWgIwlH8sGU8BjZgiwSBqiGx7t4u/MG+5 +Yprhv8HxPDG2I9hMZuHx3RJOjw1PIAJuRDEDA8LlUTvdAPRfDkpk1PWeYIl76blu +Zkg0uQLGXcYG5JfAI1fSPzN9+kwHyiDqRTH6CtQwUTyEFajAO1AWvx82/hO2j+wU +izkCggEANyPfsBjEUIZjwBuaHajm/tkcQAo3F4EgIkb1XR/EnfaaJp4I9S6hJ0vv +5/fQtASn+JHjuIRk5l7g9N7lU+W+SiPvSxm1zZv8zLkqJpbKpMh7VIxT9joZ3E3/ +rzRLL60zYJ42hdulSFLoO1qCMErifBiTIwIZu7p6qKRH4+vqappb9QTPPlyAFFT6 +3UJfs49HGqd6gTyN7TSNxaya+ZBaLgSXhmExY/OtZazQn/iJl/dYpyYvmJdzNpd+ +XELU0IUcKivJaueCqK8NfEqfHz28GHdAkwHd0CzGnciF4tn9K2Sg8+X9jISk/Usx +qHAY4JU3ldxQzDUZCz5VCz372pgXkQ== +-----END PRIVATE KEY----- diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pk8 b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pk8 new file mode 100644 index 0000000000..ab5982030e Binary files /dev/null and b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pk8 differ diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.x509.pem b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.x509.pem new file mode 100644 index 0000000000..6d10157982 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.x509.pem @@ -0,0 +1,35 @@ +-----BEGIN CERTIFICATE----- +MIIGCzCCA/MCFFuIt0T1K9U92QfzZI3RpCyRp1ruMA0GCSqGSIb3DQEBCwUAMIHA +MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91 +bnRhaW4gVmlldzEQMA4GA1UECgwHQW5kcm9pZDEQMA4GA1UECwwHQW5kcm9pZDEi +MCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTE8MDoGA1UEAwwzY29t +LmFuZHJvaWQuaGFyZHdhcmUuYmlvbWV0cmljcy5maW5nZXJwcmludC52aXJ0dWFs +MCAXDTIzMDUxMDA3MDkwMloYDzQ3NjEwNDA1MDcwOTAyWjCBwDELMAkGA1UEBhMC +VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcx +EDAOBgNVBAoMB0FuZHJvaWQxEDAOBgNVBAsMB0FuZHJvaWQxIjAgBgkqhkiG9w0B +CQEWE2FuZHJvaWRAYW5kcm9pZC5jb20xPDA6BgNVBAMMM2NvbS5hbmRyb2lkLmhh +cmR3YXJlLmJpb21ldHJpY3MuZmluZ2VycHJpbnQudmlydHVhbDCCAiIwDQYJKoZI +hvcNAQEBBQADggIPADCCAgoCggIBAMKXBcAw2Cs68KUMt5Hw2LVwkgEDiwqaXkG9 +V0SBK9y/q+6JCoxs9+4NsDPAEzHB+UHpqJ2i07VW1YV9F+2V93KCy/0fUjXIWmu8 +P0ixb+t8wlHZM2zYXQe9PELUZ/ZlYjAxkVKJjDmsCM8yzpRk+g3KKswlYwzyBoat +qukrtvAaNKlRGJmjeStEo2o4qgQQUq96NAvSt3d6PsrNdFbXxqX61JT1dT8Kgxhk ++oSAkV2/C2knQp/8ME1oJrK/D+glynXVqVkvYYplxp+GCIZUs/DOJcHyb+ZrNLJP +f2zr4yDoB2pnV3G9VcjbdznWc661Wg+B2yZEvLVbOMiqaMRlpHzNczghowCy3xoq +42IUmp3HLak0DUmrrUZDnJAAT/KEZxh/PwLeAcmUrQCbUiG5lN/njuZ5LjJ8gdcg +v0RDPSIIszamrf2l+xlaI34iXS7xHf3OLTbgst2L7LhW5qmLsB1SZzAYGIUYnRWZ +aqzaFIAWt28S0yhpOt+qS7b1l+fvMb09jiKfxzkYQh2bB0HrpbTl2x390q2GW6yE +jmraC+nTiAVDCUnDjOVji7nXDloSmK+MDD/DaDQ47PoYE3hBqc0fsRr2aIlvMOvb +m+4VhO85gCuJAK02XuixLPo6ZqBAEFNwQ4NDcuOHuODaaJ/amTxQBXRpNXUSnhXy +ejpwspHrAgMBAAEwDQYJKoZIhvcNAQELBQADggIBAGl3KGKMAWpefnRSQWs0n8kD +eKYbzbe6mG0O5lqx5FKpJZpIki4RH1Yh5ZDR/NIeF2RNhlb/dqo99TKbCEGAoMB9 +R7EXDhyMcEXr5ATCA6iurhMKgkcLfOz6HkTI6k3wlPNuvx4iZGHD2KEvZiZGmae1 +dnK9iVtNs6ccyC0+V3y3Yt1fvjzp9SWcPpBXiO5QNf0sHxtzc32xXsBH0aLwLjDZ +BCytwfEvq2S25v0r9m0fKquDBoFnk68cqClpNQZ9Ky0k8fGgOiQ5/jnVmgPmTheG +mBcdPeUrhxGNs1vax/i/ysT4AVmDzIVW0uXVouhVeMQzykuy1+Ywa/Rn0jLxeNF2 +X3ooOE+EF8u9Pxf8ILRnfqok3VRuYLH6neNknTSKTx1aQAh9XbBpTUa/eCq3LDCP +L6hSXYWjk9e5txbn0cNw9WuKMUg+Z9Qms3aVRFcvBxZQySEvf8FhgSrQbqbCbzhf +dI0/ouW5w9iHUOh/FDvfETeZCeeTS+EOvGOqknzO8Y7PiChlgFsoMvC1GpHZ1ADy +3xKSh15G92JCiv89CK2VvM8QDFh8ErQmSLjhMl700CLYis+AAZhCKOhAo573zj2u +dZf29S+o3SEBhsl5snVGJW13Bu7BjxQtscCwKOv0g1cCkrqgcm2bMuNhpTK7rhMP +i4hGSvbdGC27BtXbsiVX +-----END CERTIFICATE----- diff --git a/biometrics/fingerprint/aidl/default/apex/file_contexts b/biometrics/fingerprint/aidl/default/apex/file_contexts new file mode 100644 index 0000000000..1c189fcc6c --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/file_contexts @@ -0,0 +1,3 @@ +(/.*)? u:object_r:vendor_file:s0 +/etc(/.*)? u:object_r:vendor_configs_file:s0 +/bin/hw/android\.hardware\.biometrics\.fingerprint-service\.example u:object_r:hal_fingerprint_default_exec:s0 \ No newline at end of file diff --git a/biometrics/fingerprint/aidl/default/apex/manifest.json b/biometrics/fingerprint/aidl/default/apex/manifest.json new file mode 100644 index 0000000000..bbd2c69f6c --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.biometrics.fingerprint.virtual", + "version": 1 +} diff --git a/biometrics/fingerprint/aidl/default/api/android.hardware.biometrics.fingerprint.VirtualProps-current.txt b/biometrics/fingerprint/aidl/default/api/android.hardware.biometrics.fingerprint.VirtualProps-current.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/biometrics/fingerprint/aidl/default/fingerprint-default.rc b/biometrics/fingerprint/aidl/default/fingerprint-default.rc deleted file mode 100644 index eb62c567fd..0000000000 --- a/biometrics/fingerprint/aidl/default/fingerprint-default.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.fingerprint-default /vendor/bin/hw/android.hardware.biometrics.fingerprint-service.example - class hal - user nobody - group nobody - diff --git a/biometrics/fingerprint/aidl/default/fingerprint-example.rc b/biometrics/fingerprint/aidl/default/fingerprint-example.rc new file mode 100644 index 0000000000..ee4713c158 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/fingerprint-example.rc @@ -0,0 +1,7 @@ +service vendor.fingerprint-example /vendor/bin/hw/android.hardware.biometrics.fingerprint-service.example + class hal + user nobody + group nobody + interface aidl android.hardware.biometrics.fingerprint.IFingerprint/virtual + oneshot + disabled diff --git a/biometrics/fingerprint/aidl/default/fingerprint-default.xml b/biometrics/fingerprint/aidl/default/fingerprint-example.xml similarity index 66% rename from biometrics/fingerprint/aidl/default/fingerprint-default.xml rename to biometrics/fingerprint/aidl/default/fingerprint-example.xml index d322eb65b3..e977b98a64 100644 --- a/biometrics/fingerprint/aidl/default/fingerprint-default.xml +++ b/biometrics/fingerprint/aidl/default/fingerprint-example.xml @@ -1,7 +1,7 @@ android.hardware.biometrics.fingerprint - 2 - IFingerprint/default + 3 + IFingerprint/virtual diff --git a/biometrics/fingerprint/aidl/default/fingerprint.sysprop b/biometrics/fingerprint/aidl/default/fingerprint.sysprop new file mode 100644 index 0000000000..6a6c29728b --- /dev/null +++ b/biometrics/fingerprint/aidl/default/fingerprint.sysprop @@ -0,0 +1,300 @@ +# fingerprint.sysprop +# module becomes static class (Java) / namespace (C++) for serving API +module: "android.fingerprint.virt.FingerprintHalProperties" +owner: Vendor + +# type of fingerprint sensor +prop { + prop_name: "persist.vendor.fingerprint.virtual.type" + type: String + scope: Internal + access: ReadWrite + enum_values: "default|rear|udfps|side" + api_name: "type" +} + +# ids of call current enrollments +prop { + prop_name: "persist.vendor.fingerprint.virtual.enrollments" + type: IntegerList + scope: Internal + access: ReadWrite + api_name: "enrollments" +} + +# authenticate and detectInteraction will succeed with this +# enrollment id, when present, otherwise they will error +prop { + prop_name: "vendor.fingerprint.virtual.enrollment_hit" + type: Integer + scope: Internal + access: ReadWrite + api_name: "enrollment_hit" +} + +# the next enrollment in the format of: +# ":,,...:" +# = +# [acquiredInfos] = [acquiredInfo1, acquiredInfo2, ...] +# (refer to README.md file for acquiredInfo values) +# e.g. "2:100,20:true", "2:100-[5,1],20:true" +# this property is reset after enroll completes +prop { + prop_name: "vendor.fingerprint.virtual.next_enrollment" + type: String + scope: Internal + access: ReadWrite + api_name: "next_enrollment" +} + +# value for getAuthenticatorId or 0 +prop { + prop_name: "persist.vendor.fingerprint.virtual.authenticator_id" + type: Long + scope: Internal + access: ReadWrite + api_name: "authenticator_id" +} + +# value for generateChallenge +prop { + prop_name: "vendor.fingerprint.virtual.challenge" + type: Long + scope: Internal + access: ReadWrite + api_name: "challenge" +} + +# force all authenticate operations to fail +prop { + prop_name: "vendor.fingerprint.virtual.operation_authenticate_fails" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_fails" +} + +# force all detectInteraction operations to error out +# error consists of errorCode and vendorErrorCode +# valid errorCodes are listed in README.md file +# vendorErrorCode = (error>1000) ? error-1000 : 0 +# e.g. error(1002) --> errorCode(7) and vendorErrorCode(2) +prop { + prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_error" + type: Integer + scope: Internal + access: ReadWrite + api_name: "operation_detect_interaction_error" +} + +# force all enroll operations to result in error +prop { + prop_name: "vendor.fingerprint.virtual.operation_enroll_error" + type: Integer + scope: Internal + access: ReadWrite + api_name: "operation_enroll_error" +} + +# add a latency to authentication operations +# default to 400ms +# [x] = x ms +# [x,y] = randomly between x and y ms +# others = invalid +prop { + prop_name: "vendor.fingerprint.virtual.operation_authenticate_latency" + type: IntegerList + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_latency" +} + +# add a latency to detectInteraction operations +# refer to `operation_authenticate_latency` above for usage +prop { + prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_latency" + type: IntegerList + scope: Internal + access: ReadWrite + api_name: "operation_detect_interaction_latency" +} + +# add a latency to enroll operations +# refer to `operation_authenticate_latency` above for usage +prop { + prop_name: "vendor.fingerprint.virtual.operation_enroll_latency" + type: IntegerList + scope: Internal + access: ReadWrite + api_name: "operation_enroll_latency" +} + +# millisecond duration for authenticate operations +# (waits for changes to enrollment_hit) +prop { + prop_name: "vendor.fingerprint.virtual.operation_authenticate_duration" + type: Integer + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_duration" +} + +# insert error for authenticate operations +prop { + prop_name: "vendor.fingerprint.virtual.operation_authenticate_error" + type: Integer + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_error" +} + +# sensor location +# :: in pixel +prop { + prop_name: "persist.vendor.fingerprint.virtual.sensor_location" + type: String + scope: Internal + access: ReadWrite + api_name: "sensor_location" +} + +# acquired info during authentication in format of sequence +prop { + prop_name: "vendor.fingerprint.virtual.operation_authenticate_acquired" + type: String + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_acquired" +} + +# millisecond duration for detect interaction operations +# (waits for changes to enrollment_hit) +prop { + prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_duration" + type: Integer + scope: Internal + access: ReadWrite + api_name: "operation_detect_interaction_duration" +} + +# acquired info during detect interaction operation in format of sequence +# e.g. 5,6,1 (TOO_SLOW, TOO_FAST, GOOD) +# onAcquired() callback will be invoked in sequence +# vendorAcquiredCode = (acquired>1000) ? acquired-1000 : 0 +prop { + prop_name: "vendor.fingerprint.virtual.operation_detect_interaction_acquired" + type: String + scope: Internal + access: ReadWrite + api_name: "operation_detect_interaction_acquired" +} + +# sensor id (default: 5) +prop { + prop_name: "persist.vendor.fingerprint.virtual.sensor_id" + type: Integer + scope: Internal + access: ReadWrite + api_name: "sensor_id" +} + +# sensor strength (default: 2) +# [0=CONVENECE, 1=WEAK, 2=STRONG] +prop { + prop_name: "persist.vendor.fingerprint.virtual.sensor_strength" + type: Integer + scope: Internal + access: ReadWrite + api_name: "sensor_strength" +} + +# max enrollments per user (default: 5) +# +prop { + prop_name: "persist.vendor.fingerprint.virtual.max_enrollments" + type: Integer + scope: Internal + access: ReadWrite + api_name: "max_enrollments" +} + +# whether support navigation guestures (default: false) +prop { + prop_name: "persist.vendor.fingerprint.virtual.navigation_guesture" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "navigation_guesture" +} + +# whether support detect interaction (default: false) +prop { + prop_name: "persist.vendor.fingerprint.virtual.detect_interaction" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "detect_interaction" +} + +# whether support display touch by hal (default: true) +prop { + prop_name: "persist.vendor.fingerprint.virtual.udfps.display_touch" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "display_touch" +} + +# whether support illumination control by hal (default: false) +prop { + prop_name: "persist.vendor.fingerprint.virtual.udfps.control_illumination" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "control_illumination" +} + +# force to be locked out (default: false) +prop { + prop_name: "persist.vendor.fingerprint.virtual.lockout" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "lockout" +} + +# whether support lockout based on the failed auth attempts (default: false) +prop { + prop_name: "persist.vendor.fingerprint.virtual.lockout_enable" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "lockout_enable" +} + +# temporarily lockout threshold in number of consecutive failed auth attempts (default: 5) +prop { + prop_name: "persist.vendor.fingerprint.virtual.lockout_timed_threshold" + type: Integer + scope: Internal + access: ReadWrite + api_name: "lockout_timed_threshold" +} + +# temporary lockout duration in ms (default: 10000ms) +prop { + prop_name: "persist.vendor.fingerprint.virtual.lockout_timed_duration" + type: Integer + scope: Internal + access: ReadWrite + api_name: "lockout_timed_duration" +} + +# permanently lockout threshold in number of consecutive failed auth attempts (default: 20) +prop { + prop_name: "persist.vendor.fingerprint.virtual.lockout_permanent_threshold" + type: Integer + scope: Internal + access: ReadWrite + api_name: "lockout_permanent_threshold" +} diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h index b92777068c..1279cd92a5 100644 --- a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h +++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,73 +16,83 @@ #pragma once -#include +#define LOG_TAG "FingerprintVirtualHal" + +#include +#include +#include +#include + #include +#include +#include +#include + +#include "FakeLockoutTracker.h" + +using namespace ::aidl::android::hardware::biometrics::common; + namespace aidl::android::hardware::biometrics::fingerprint { +// A fake engine that is backed by system properties instead of hardware. class FakeFingerprintEngine { public: FakeFingerprintEngine() : mRandom(std::mt19937::default_seed) {} + virtual ~FakeFingerprintEngine() {} - void generateChallengeImpl(ISessionCallback* cb) { - LOG(INFO) << "generateChallengeImpl"; - std::uniform_int_distribution dist; - auto challenge = dist(mRandom); - cb->onChallengeGenerated(challenge); - } + void generateChallengeImpl(ISessionCallback* cb); + void revokeChallengeImpl(ISessionCallback* cb, int64_t challenge); + virtual void enrollImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat, + const std::future& cancel); + virtual void authenticateImpl(ISessionCallback* cb, int64_t operationId, + const std::future& cancel); + virtual void detectInteractionImpl(ISessionCallback* cb, const std::future& cancel); + void enumerateEnrollmentsImpl(ISessionCallback* cb); + void removeEnrollmentsImpl(ISessionCallback* cb, const std::vector& enrollmentIds); + void getAuthenticatorIdImpl(ISessionCallback* cb); + void invalidateAuthenticatorIdImpl(ISessionCallback* cb); + void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/); + bool getSensorLocationConfig(SensorLocation& out); - void revokeChallengeImpl(ISessionCallback* cb, int64_t challenge) { - LOG(INFO) << "revokeChallengeImpl"; - cb->onChallengeRevoked(challenge); - } + virtual ndk::ScopedAStatus onPointerDownImpl(int32_t pointerId, int32_t x, int32_t y, + float minor, float major); - void enrollImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat) { - LOG(INFO) << "enrollImpl"; - // Do proper HAT verification in the real implementation. - if (hat.mac.empty()) { - cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); - return; - } - cb->onEnrollmentProgress(0 /* enrollmentId */, 0 /* remaining */); - } + virtual ndk::ScopedAStatus onPointerUpImpl(int32_t pointerId); - void authenticateImpl(ISessionCallback* cb, int64_t /* operationId */) { - LOG(INFO) << "authenticateImpl"; - cb->onAuthenticationSucceeded(0 /* enrollmentId */, {} /* hat */); - } + virtual ndk::ScopedAStatus onUiReadyImpl(); - void detectInteractionImpl(ISessionCallback* cb) { - LOG(INFO) << "detectInteractionImpl"; - cb->onInteractionDetected(); - } + virtual SensorLocation getSensorLocation(); - void enumerateEnrollmentsImpl(ISessionCallback* cb) { - LOG(INFO) << "enumerateEnrollmentsImpl"; - cb->onEnrollmentsEnumerated({} /* enrollmentIds */); - } + virtual SensorLocation defaultSensorLocation(); - void removeEnrollmentsImpl(ISessionCallback* cb, const std::vector& enrollmentIds) { - LOG(INFO) << "removeEnrollmentsImpl"; - cb->onEnrollmentsRemoved(enrollmentIds); - } + std::vector parseIntSequence(const std::string& str, const std::string& sep = ","); - void getAuthenticatorIdImpl(ISessionCallback* cb) { - LOG(INFO) << "getAuthenticatorIdImpl"; - cb->onAuthenticatorIdRetrieved(0 /* authenticatorId */); - } + std::vector> parseEnrollmentCapture(const std::string& str); - void invalidateAuthenticatorIdImpl(ISessionCallback* cb) { - LOG(INFO) << "invalidateAuthenticatorIdImpl"; - cb->onAuthenticatorIdInvalidated(0 /* newAuthenticatorId */); - } - - void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/) { - LOG(INFO) << "resetLockoutImpl"; - cb->onLockoutCleared(); - } + int32_t getLatency(const std::vector>& latencyVec); std::mt19937 mRandom; + + virtual std::string toString() const { + std::ostringstream os; + os << "----- FakeFingerprintEngine:: -----" << std::endl; + os << "acquiredVendorInfoBase:" << FINGERPRINT_ACQUIRED_VENDOR_BASE; + os << ", errorVendorBase:" << FINGERPRINT_ERROR_VENDOR_BASE << std::endl; + os << mLockoutTracker.toString(); + return os.str(); + } + + private: + static constexpr int32_t FINGERPRINT_ACQUIRED_VENDOR_BASE = 1000; + static constexpr int32_t FINGERPRINT_ERROR_VENDOR_BASE = 1000; + std::pair convertAcquiredInfo(int32_t code); + std::pair convertError(int32_t code); + bool parseEnrollmentCaptureSingle(const std::string& str, + std::vector>& res); + int32_t getRandomInRange(int32_t bound1, int32_t bound2); + + FakeLockoutTracker mLockoutTracker; }; } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineRear.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineRear.h new file mode 100644 index 0000000000..14d5399fa4 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineRear.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "FakeFingerprintEngine.h" + +using namespace ::aidl::android::hardware::biometrics::common; + +namespace aidl::android::hardware::biometrics::fingerprint { + +// A fake engine that is backed by system properties instead of hardware. +class FakeFingerprintEngineRear : public FakeFingerprintEngine { + public: + FakeFingerprintEngineRear() : FakeFingerprintEngine() {} + ~FakeFingerprintEngineRear() {} +}; + +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineSide.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineSide.h new file mode 100644 index 0000000000..c2fc005ffc --- /dev/null +++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineSide.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "FakeFingerprintEngine.h" + +using namespace ::aidl::android::hardware::biometrics::common; + +namespace aidl::android::hardware::biometrics::fingerprint { + +// A fake engine that is backed by system properties instead of hardware. +class FakeFingerprintEngineSide : public FakeFingerprintEngine { + public: + static constexpr int32_t defaultSensorLocationX = 0; + static constexpr int32_t defaultSensorLocationY = 600; + static constexpr int32_t defaultSensorRadius = 150; + + FakeFingerprintEngineSide() : FakeFingerprintEngine() {} + ~FakeFingerprintEngineSide() {} + + virtual SensorLocation defaultSensorLocation() override; +}; + +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineUdfps.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineUdfps.h new file mode 100644 index 0000000000..c5e93e72aa --- /dev/null +++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngineUdfps.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "FakeFingerprintEngine.h" + +using namespace ::aidl::android::hardware::biometrics::common; + +namespace aidl::android::hardware::biometrics::fingerprint { + +// A fake engine that is backed by system properties instead of hardware. +class FakeFingerprintEngineUdfps : public FakeFingerprintEngine { + public: + static constexpr int32_t defaultSensorLocationX = 400; + static constexpr int32_t defaultSensorLocationY = 1600; + static constexpr int32_t defaultSensorRadius = 150; + + static constexpr int32_t uiReadyTimeoutInMs = 5000; + + FakeFingerprintEngineUdfps(); + ~FakeFingerprintEngineUdfps() {} + + ndk::ScopedAStatus onPointerDownImpl(int32_t pointerId, int32_t x, int32_t y, float minor, + float major) override; + + ndk::ScopedAStatus onPointerUpImpl(int32_t pointerId) override; + + ndk::ScopedAStatus onUiReadyImpl() override; + + SensorLocation defaultSensorLocation() override; + + void enrollImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& hat, + const std::future& cancel); + void authenticateImpl(ISessionCallback* cb, int64_t operationId, + const std::future& cancel); + void detectInteractionImpl(ISessionCallback* cb, const std::future& cancel); + + enum class WorkMode : int8_t { kIdle = 0, kAuthenticate, kEnroll, kDetectInteract }; + + WorkMode getWorkMode() { return mWorkMode; } + + std::string toString() const { + std::ostringstream os; + os << FakeFingerprintEngine::toString(); + os << "----- FakeFingerprintEngineUdfps -----" << std::endl; + os << "mWorkMode:" << (int)mWorkMode; + os << ", mUiReadyTime:" << mUiReadyTime; + os << ", mPointerDownTime:" << mPointerDownTime << std::endl; + return os.str(); + } + + private: + void onAuthenticateFingerDown(); + void onEnrollFingerDown(); + void onDetectInteractFingerDown(); + void fingerDownAction(); + void updateContext(WorkMode mode, ISessionCallback* cb, std::future& cancel, + int64_t operationId, const keymaster::HardwareAuthToken& hat); + + WorkMode mWorkMode; + ISessionCallback* mCb; + keymaster::HardwareAuthToken mHat; + std::vector> mCancelVec; + int64_t mOperationId; + int64_t mPointerDownTime; + int64_t mUiReadyTime; +}; + +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/FakeLockoutTracker.h b/biometrics/fingerprint/aidl/default/include/FakeLockoutTracker.h new file mode 100644 index 0000000000..a1b6128a9e --- /dev/null +++ b/biometrics/fingerprint/aidl/default/include/FakeLockoutTracker.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace aidl::android::hardware::biometrics::fingerprint { + +class FakeLockoutTracker { + public: + FakeLockoutTracker() : mFailedCount(0) {} + ~FakeLockoutTracker() {} + + enum class LockoutMode : int8_t { kNone = 0, kTimed, kPermanent }; + + void reset(); + LockoutMode getMode(); + void addFailedAttempt(); + int64_t getLockoutTimeLeft(); + inline std::string toString() const { + std::ostringstream os; + os << "----- FakeLockoutTracker:: -----" << std::endl; + os << "FakeLockoutTracker::mFailedCount:" << mFailedCount; + os << ", FakeLockoutTracker::mCurrentMode:" << (int)mCurrentMode; + os << std::endl; + return os.str(); + } + + private: + int32_t mFailedCount; + int64_t mLockoutTimedStart; + LockoutMode mCurrentMode; +}; + +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/Fingerprint.h b/biometrics/fingerprint/aidl/default/include/Fingerprint.h index 7bd3d6ddfd..fc4fb8dbff 100644 --- a/biometrics/fingerprint/aidl/default/include/Fingerprint.h +++ b/biometrics/fingerprint/aidl/default/include/Fingerprint.h @@ -19,8 +19,12 @@ #include #include "FakeFingerprintEngine.h" +#include "FakeFingerprintEngineRear.h" +#include "FakeFingerprintEngineSide.h" +#include "FakeFingerprintEngineUdfps.h" + #include "Session.h" -#include "WorkerThread.h" +#include "thread/WorkerThread.h" namespace aidl::android::hardware::biometrics::fingerprint { @@ -33,11 +37,17 @@ class Fingerprint : public BnFingerprint { ndk::ScopedAStatus createSession(int32_t sensorId, int32_t userId, const std::shared_ptr& cb, std::shared_ptr* out) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs); + binder_status_t handleShellCommand(int in, int out, int err, const char** argv, uint32_t argc); private: + void resetConfigToDefault(); + void onHelp(int); + std::unique_ptr mEngine; WorkerThread mWorker; std::shared_ptr mSession; + FingerprintSensorType mSensorType; }; } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/Session.h b/biometrics/fingerprint/aidl/default/include/Session.h index acd5def832..526d5797cc 100644 --- a/biometrics/fingerprint/aidl/default/include/Session.h +++ b/biometrics/fingerprint/aidl/default/include/Session.h @@ -20,7 +20,7 @@ #include #include "FakeFingerprintEngine.h" -#include "WorkerThread.h" +#include "thread/WorkerThread.h" namespace aidl::android::hardware::biometrics::fingerprint { @@ -42,6 +42,8 @@ enum class SessionState { RESETTING_LOCKOUT, }; +void onClientDeath(void* cookie); + class Session : public BnSession { public: Session(int sensorId, int userId, std::shared_ptr cb, @@ -97,6 +99,12 @@ class Session : public BnSession { ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override; + ndk::ScopedAStatus onPointerCancelWithContext(const PointerContext& context) override; + + ndk::ScopedAStatus setIgnoreDisplayTouches(bool shouldIgnore) override; + + binder_status_t linkToDeath(AIBinder* binder); + bool isClosed(); private: @@ -135,6 +143,9 @@ class Session : public BnSession { // modified from both the main and the worker threads. std::atomic mScheduledState; std::atomic mCurrentState; + + // Binder death handler. + AIBinder_DeathRecipient* mDeathRecipient; }; } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/main.cpp b/biometrics/fingerprint/aidl/default/main.cpp index c985201d63..7df015b381 100644 --- a/biometrics/fingerprint/aidl/default/main.cpp +++ b/biometrics/fingerprint/aidl/default/main.cpp @@ -27,9 +27,11 @@ int main() { ABinderProcess_setThreadPoolMaxThreadCount(0); std::shared_ptr hal = ndk::SharedRefBase::make(); - const std::string instance = std::string(Fingerprint::descriptor) + "/default"; - binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str()); + const std::string instance = std::string(Fingerprint::descriptor) + "/virtual"; + binder_status_t status = + AServiceManager_registerLazyService(hal->asBinder().get(), instance.c_str()); CHECK_EQ(status, STATUS_OK); + AServiceManager_forceLazyServicesPersist(true); ABinderProcess_joinThreadPool(); return EXIT_FAILURE; // should not reach diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp new file mode 100644 index 0000000000..a200b39739 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp @@ -0,0 +1,476 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include + +#include "FakeFingerprintEngine.h" +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; +using namespace ::aidl::android::hardware::biometrics::fingerprint; +using namespace ::aidl::android::hardware::keymaster; + +namespace aidl::android::hardware::biometrics::fingerprint { + +class TestSessionCallback : public BnSessionCallback { + public: + ndk::ScopedAStatus onChallengeGenerated(int64_t challenge) override { + mLastChallenge = challenge; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onChallengeRevoked(int64_t challenge) override { + mLastChallengeRevoked = challenge; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onError(fingerprint::Error error, int32_t vendorCode) override { + mError = error; + mErrorVendorCode = vendorCode; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentProgress(int32_t enrollmentId, int32_t remaining) override { + if (remaining == 0) mLastEnrolled = enrollmentId; + return ndk::ScopedAStatus::ok(); + }; + + ::ndk::ScopedAStatus onAuthenticationSucceeded(int32_t enrollmentId, + const keymaster::HardwareAuthToken&) override { + mLastAuthenticated = enrollmentId; + mAuthenticateFailed = false; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationFailed() override { + mLastAuthenticated = 0; + mAuthenticateFailed = true; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onInteractionDetected() override { + mInteractionDetectedCount++; + return ndk::ScopedAStatus::ok(); + }; + ndk::ScopedAStatus onAcquired(AcquiredInfo info, int32_t vendorCode) override { + mLastAcquiredInfo = (int32_t)info; + mLastAcquiredVendorCode = vendorCode; + mLastAcquiredCount++; + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onEnrollmentsEnumerated( + const std::vector& enrollmentIds) override { + mLastEnrollmentEnumerated = enrollmentIds; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentsRemoved(const std::vector& enrollmentIds) override { + mLastEnrollmentRemoved = enrollmentIds; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t authenticatorId) override { + mLastAuthenticatorId = authenticatorId; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdInvalidated(int64_t authenticatorId) override { + mLastAuthenticatorId = authenticatorId; + mAuthenticatorIdInvalidated = true; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onLockoutPermanent() override { + mLockoutPermanent = true; + return ndk::ScopedAStatus::ok(); + }; + ndk::ScopedAStatus onLockoutTimed(int64_t /* timeout */) override { + return ndk::ScopedAStatus::ok(); + } + ndk::ScopedAStatus onLockoutCleared() override { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); } + + Error mError = Error::UNKNOWN; + int32_t mErrorVendorCode = 0; + int64_t mLastChallenge = -1; + int64_t mLastChallengeRevoked = -1; + int32_t mLastEnrolled = -1; + int32_t mLastAuthenticated = -1; + int64_t mLastAuthenticatorId = -1; + std::vector mLastEnrollmentEnumerated; + std::vector mLastEnrollmentRemoved; + bool mAuthenticateFailed = false; + bool mAuthenticatorIdInvalidated = false; + bool mLockoutPermanent = false; + int mInteractionDetectedCount = 0; + int32_t mLastAcquiredInfo = -1; + int32_t mLastAcquiredVendorCode = -1; + int32_t mLastAcquiredCount = 0; +}; + +class FakeFingerprintEngineTest : public ::testing::Test { + protected: + void SetUp() override { + FingerprintHalProperties::operation_enroll_latency({0}); + FingerprintHalProperties::operation_authenticate_latency({0}); + FingerprintHalProperties::operation_detect_interaction_latency({0}); + mCallback = ndk::SharedRefBase::make(); + } + + void TearDown() override { + FingerprintHalProperties::operation_authenticate_error(0); + FingerprintHalProperties::operation_detect_interaction_error(0); + FingerprintHalProperties::operation_authenticate_acquired(""); + FingerprintHalProperties::operation_enroll_latency({}); + FingerprintHalProperties::operation_authenticate_latency({}); + FingerprintHalProperties::operation_detect_interaction_latency({}); + } + + FakeFingerprintEngine mEngine; + std::shared_ptr mCallback; + std::promise mCancel; +}; + +TEST_F(FakeFingerprintEngineTest, GenerateChallenge) { + mEngine.generateChallengeImpl(mCallback.get()); + ASSERT_EQ(FingerprintHalProperties::challenge().value(), mCallback->mLastChallenge); +} + +TEST_F(FakeFingerprintEngineTest, RevokeChallenge) { + auto challenge = FingerprintHalProperties::challenge().value_or(10); + mEngine.revokeChallengeImpl(mCallback.get(), challenge); + ASSERT_FALSE(FingerprintHalProperties::challenge().has_value()); + ASSERT_EQ(challenge, mCallback->mLastChallengeRevoked); +} + +TEST_F(FakeFingerprintEngineTest, ResetLockout) { + FingerprintHalProperties::lockout(true); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.resetLockoutImpl(mCallback.get(), hat); + ASSERT_FALSE(FingerprintHalProperties::lockout().value_or(true)); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticatorId) { + FingerprintHalProperties::enrollments({1}); + FingerprintHalProperties::authenticator_id(50); + mEngine.getAuthenticatorIdImpl(mCallback.get()); + ASSERT_EQ(50, mCallback->mLastAuthenticatorId); + ASSERT_FALSE(mCallback->mAuthenticatorIdInvalidated); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticatorIdInvalidate) { + FingerprintHalProperties::authenticator_id(500); + mEngine.invalidateAuthenticatorIdImpl(mCallback.get()); + ASSERT_NE(500, FingerprintHalProperties::authenticator_id().value()); + ASSERT_TRUE(mCallback->mAuthenticatorIdInvalidated); +} + +TEST_F(FakeFingerprintEngineTest, Enroll) { + FingerprintHalProperties::enrollments({}); + FingerprintHalProperties::next_enrollment("4:0,0:true"); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future()); + ASSERT_FALSE(FingerprintHalProperties::next_enrollment().has_value()); + ASSERT_EQ(1, FingerprintHalProperties::enrollments().size()); + ASSERT_EQ(4, FingerprintHalProperties::enrollments()[0].value()); + ASSERT_EQ(4, mCallback->mLastEnrolled); + ASSERT_EQ(1, mCallback->mLastAcquiredInfo); +} + +TEST_F(FakeFingerprintEngineTest, EnrollCancel) { + FingerprintHalProperties::enrollments({}); + auto next = "4:0,0:true"; + FingerprintHalProperties::next_enrollment(next); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mCancel.set_value(); + mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future()); + ASSERT_EQ(Error::CANCELED, mCallback->mError); + ASSERT_EQ(-1, mCallback->mLastEnrolled); + ASSERT_EQ(0, FingerprintHalProperties::enrollments().size()); + ASSERT_EQ(next, FingerprintHalProperties::next_enrollment().value_or("")); +} + +TEST_F(FakeFingerprintEngineTest, EnrollFail) { + FingerprintHalProperties::enrollments({}); + auto next = "2:0,0:false"; + FingerprintHalProperties::next_enrollment(next); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future()); + ASSERT_EQ(Error::UNABLE_TO_PROCESS, mCallback->mError); + ASSERT_EQ(-1, mCallback->mLastEnrolled); + ASSERT_EQ(0, FingerprintHalProperties::enrollments().size()); + ASSERT_FALSE(FingerprintHalProperties::next_enrollment().has_value()); +} + +TEST_F(FakeFingerprintEngineTest, EnrollAcquired) { + FingerprintHalProperties::enrollments({}); + FingerprintHalProperties::next_enrollment("4:0,5-[12,1013]:true"); + keymaster::HardwareAuthToken hat{.mac = {2, 4}}; + int32_t prevCnt = mCallback->mLastAcquiredCount; + mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future()); + ASSERT_FALSE(FingerprintHalProperties::next_enrollment().has_value()); + ASSERT_EQ(1, FingerprintHalProperties::enrollments().size()); + ASSERT_EQ(4, FingerprintHalProperties::enrollments()[0].value()); + ASSERT_EQ(4, mCallback->mLastEnrolled); + ASSERT_EQ(prevCnt + 3, mCallback->mLastAcquiredCount); + ASSERT_EQ(7, mCallback->mLastAcquiredInfo); + ASSERT_EQ(13, mCallback->mLastAcquiredVendorCode); +} + +TEST_F(FakeFingerprintEngineTest, Authenticate) { + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(2); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_FALSE(mCallback->mAuthenticateFailed); + ASSERT_EQ(2, mCallback->mLastAuthenticated); + ASSERT_EQ(1, mCallback->mLastAcquiredInfo); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateCancel) { + FingerprintHalProperties::enrollments({2}); + FingerprintHalProperties::enrollment_hit(2); + mCancel.set_value(); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_EQ(Error::CANCELED, mCallback->mError); + ASSERT_EQ(-1, mCallback->mLastAuthenticated); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateNotSet) { + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit({}); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_TRUE(mCallback->mAuthenticateFailed); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateNotEnrolled) { + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(3); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_TRUE(mCallback->mAuthenticateFailed); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateLockout) { + FingerprintHalProperties::enrollments({22, 2}); + FingerprintHalProperties::enrollment_hit(2); + FingerprintHalProperties::lockout(true); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_TRUE(mCallback->mLockoutPermanent); + ASSERT_NE(mCallback->mError, Error::UNKNOWN); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateError8) { + FingerprintHalProperties::operation_authenticate_error(8); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_EQ(mCallback->mError, (Error)8); + ASSERT_EQ(mCallback->mErrorVendorCode, 0); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateError9) { + FingerprintHalProperties::operation_authenticate_error(1009); + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_EQ(mCallback->mError, (Error)7); + ASSERT_EQ(mCallback->mErrorVendorCode, 9); +} + +TEST_F(FakeFingerprintEngineTest, AuthenticateAcquired) { + FingerprintHalProperties::lockout(false); + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(2); + FingerprintHalProperties::operation_authenticate_acquired("4,1009"); + int32_t prevCount = mCallback->mLastAcquiredCount; + mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future()); + ASSERT_FALSE(mCallback->mAuthenticateFailed); + ASSERT_EQ(2, mCallback->mLastAuthenticated); + ASSERT_EQ(prevCount + 2, mCallback->mLastAcquiredCount); + ASSERT_EQ(7, mCallback->mLastAcquiredInfo); + ASSERT_EQ(9, mCallback->mLastAcquiredVendorCode); +} + +TEST_F(FakeFingerprintEngineTest, InteractionDetect) { + FingerprintHalProperties::detect_interaction(true); + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(2); + FingerprintHalProperties::operation_detect_interaction_acquired(""); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(1, mCallback->mInteractionDetectedCount); + ASSERT_EQ(1, mCallback->mLastAcquiredInfo); +} + +TEST_F(FakeFingerprintEngineTest, InteractionDetectCancel) { + FingerprintHalProperties::detect_interaction(true); + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(2); + mCancel.set_value(); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(Error::CANCELED, mCallback->mError); + ASSERT_EQ(0, mCallback->mInteractionDetectedCount); +} + +TEST_F(FakeFingerprintEngineTest, InteractionDetectNotSet) { + FingerprintHalProperties::detect_interaction(true); + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit({}); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(0, mCallback->mInteractionDetectedCount); +} + +TEST_F(FakeFingerprintEngineTest, InteractionDetectNotEnrolled) { + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(25); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(0, mCallback->mInteractionDetectedCount); +} + +TEST_F(FakeFingerprintEngineTest, InteractionDetectError) { + FingerprintHalProperties::detect_interaction(true); + FingerprintHalProperties::operation_detect_interaction_error(8); + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(0, mCallback->mInteractionDetectedCount); + ASSERT_EQ(mCallback->mError, (Error)8); + ASSERT_EQ(mCallback->mErrorVendorCode, 0); +} + +TEST_F(FakeFingerprintEngineTest, InteractionDetectAcquired) { + FingerprintHalProperties::detect_interaction(true); + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(2); + FingerprintHalProperties::operation_detect_interaction_acquired("4,1013"); + int32_t prevCount = mCallback->mLastAcquiredCount; + mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); + ASSERT_EQ(1, mCallback->mInteractionDetectedCount); + ASSERT_EQ(prevCount + 2, mCallback->mLastAcquiredCount); + ASSERT_EQ(7, mCallback->mLastAcquiredInfo); + ASSERT_EQ(13, mCallback->mLastAcquiredVendorCode); +} + +TEST_F(FakeFingerprintEngineTest, EnumerateEnrolled) { + FingerprintHalProperties::enrollments({2, 4, 8}); + mEngine.enumerateEnrollmentsImpl(mCallback.get()); + ASSERT_EQ( + 4, + mCallback->mLastEnrollmentEnumerated.size()); // Due to workaround. TODO (b/243129174) + for (auto id : FingerprintHalProperties::enrollments()) { + ASSERT_TRUE(std::find(mCallback->mLastEnrollmentEnumerated.begin(), + mCallback->mLastEnrollmentEnumerated.end(), + id) != mCallback->mLastEnrollmentEnumerated.end()); + } +} + +TEST_F(FakeFingerprintEngineTest, RemoveEnrolled) { + FingerprintHalProperties::enrollments({2, 4, 8, 1}); + mEngine.removeEnrollmentsImpl(mCallback.get(), {2, 8}); + auto enrolls = FingerprintHalProperties::enrollments(); + ASSERT_EQ(2, mCallback->mLastEnrollmentRemoved.size()); + for (auto id : {2, 8}) { + ASSERT_TRUE(std::find(mCallback->mLastEnrollmentRemoved.begin(), + mCallback->mLastEnrollmentRemoved.end(), + id) != mCallback->mLastEnrollmentRemoved.end()); + } + ASSERT_EQ(2, enrolls.size()); + for (auto id : {1, 4}) { + ASSERT_TRUE(std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end()); + } +} + +TEST_F(FakeFingerprintEngineTest, parseIntSequence) { + std::vector seqV; + seqV = mEngine.parseIntSequence(""); + ASSERT_EQ(0, seqV.size()); + seqV = mEngine.parseIntSequence("2"); + ASSERT_EQ(1, seqV.size()); + ASSERT_EQ(2, seqV[0]); + seqV = mEngine.parseIntSequence("2,3,4"); + std::vector expV{2, 3, 4}; + ASSERT_EQ(expV, seqV); + seqV = mEngine.parseIntSequence("2,3,a"); + ASSERT_EQ(0, seqV.size()); + seqV = mEngine.parseIntSequence("2, 3, 4"); + ASSERT_EQ(expV, seqV); + seqV = mEngine.parseIntSequence("123,456"); + ASSERT_EQ(2, seqV.size()); + std::vector expV1{123, 456}; + ASSERT_EQ(expV1, seqV); + seqV = mEngine.parseIntSequence("12f3,456"); + ASSERT_EQ(0, seqV.size()); +} + +TEST_F(FakeFingerprintEngineTest, parseEnrollmentCaptureOk) { + std::vector> ecV; + ecV = mEngine.parseEnrollmentCapture("100,200,300"); + ASSERT_EQ(6, ecV.size()); + std::vector> expE{{100}, {200}, {300}}; + std::vector defC{1}; + for (int i = 0; i < ecV.size(); i += 2) { + ASSERT_EQ(expE[i / 2], ecV[i]); + ASSERT_EQ(defC, ecV[i + 1]); + } + ecV = mEngine.parseEnrollmentCapture("100"); + ASSERT_EQ(2, ecV.size()); + ASSERT_EQ(expE[0], ecV[0]); + ASSERT_EQ(defC, ecV[1]); + + ecV = mEngine.parseEnrollmentCapture("100-[5,6,7]"); + std::vector expC{5, 6, 7}; + ASSERT_EQ(2, ecV.size()); + for (int i = 0; i < ecV.size(); i += 2) { + ASSERT_EQ(expE[i / 2], ecV[i]); + ASSERT_EQ(expC, ecV[i + 1]); + } + ecV = mEngine.parseEnrollmentCapture("100-[5,6,7], 200, 300-[9,10]"); + std::vector> expC1{{5, 6, 7}, {1}, {9, 10}}; + ASSERT_EQ(6, ecV.size()); + for (int i = 0; i < ecV.size(); i += 2) { + ASSERT_EQ(expE[i / 2], ecV[i]); + ASSERT_EQ(expC1[i / 2], ecV[i + 1]); + } + ecV = mEngine.parseEnrollmentCapture("100-[5,6,7], 200-[2,1], 300-[9]"); + std::vector> expC2{{5, 6, 7}, {2, 1}, {9}}; + ASSERT_EQ(ecV.size(), 6); + for (int i = 0; i < ecV.size(); i += 2) { + ASSERT_EQ(expE[i / 2], ecV[i]); + ASSERT_EQ(expC2[i / 2], ecV[i + 1]); + } +} + +TEST_F(FakeFingerprintEngineTest, parseEnrollmentCaptureFail) { + std::vector badStr{"10c", "100-5", "100-[5,6,7", "100-5,6,7]", + "100,2x0,300", "200-[f]", "a,b"}; + std::vector> ecV; + for (const auto& s : badStr) { + ecV = mEngine.parseEnrollmentCapture(s); + ASSERT_EQ(ecV.size(), 0); + } +} + +TEST_F(FakeFingerprintEngineTest, randomLatency) { + FingerprintHalProperties::operation_detect_interaction_latency({}); + ASSERT_EQ(DEFAULT_LATENCY, + mEngine.getLatency(FingerprintHalProperties::operation_detect_interaction_latency())); + FingerprintHalProperties::operation_detect_interaction_latency({10}); + ASSERT_EQ(10, + mEngine.getLatency(FingerprintHalProperties::operation_detect_interaction_latency())); + FingerprintHalProperties::operation_detect_interaction_latency({1, 1000}); + std::set latencySet; + for (int i = 0; i < 100; i++) { + latencySet.insert(mEngine.getLatency( + FingerprintHalProperties::operation_detect_interaction_latency())); + } + ASSERT_TRUE(latencySet.size() > 95); + FingerprintHalProperties::operation_detect_interaction_latency({}); +} + +} // namespace aidl::android::hardware::biometrics::fingerprint + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp new file mode 100644 index 0000000000..f551899260 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include + +#include "FakeFingerprintEngine.h" +#include "FakeFingerprintEngineUdfps.h" + +using namespace ::android::fingerprint::virt; +using namespace ::aidl::android::hardware::biometrics::fingerprint; +using namespace ::aidl::android::hardware::keymaster; + +namespace aidl::android::hardware::biometrics::fingerprint { + +class TestSessionCallback : public BnSessionCallback { + public: + ndk::ScopedAStatus onChallengeGenerated(int64_t /*challenge*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onChallengeRevoked(int64_t /*challenge*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onError(fingerprint::Error /*error*/, int32_t /*vendorCode*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentProgress(int32_t /*enrollmentId*/, + int32_t /*remaining*/) override { + mEnrollmentProgress++; + return ndk::ScopedAStatus::ok(); + }; + + ::ndk::ScopedAStatus onAuthenticationSucceeded(int32_t /*enrollmentId*/, + const keymaster::HardwareAuthToken&) override { + mAuthenticationSuccess++; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationFailed() override { + mAuthenticationFailure++; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onInteractionDetected() override { + mDetectInteraction++; + return ndk::ScopedAStatus::ok(); + }; + ndk::ScopedAStatus onAcquired(AcquiredInfo /*info*/, int32_t /*vendorCode*/) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onEnrollmentsEnumerated( + const std::vector& /*enrollmentIds*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentsRemoved( + const std::vector& /*enrollmentIds*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t /*authenticatorId*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdInvalidated(int64_t /*authenticatorId*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onLockoutPermanent() override { return ndk::ScopedAStatus::ok(); }; + ndk::ScopedAStatus onLockoutTimed(int64_t /* timeout */) override { + return ndk::ScopedAStatus::ok(); + } + ndk::ScopedAStatus onLockoutCleared() override { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); } + + int32_t getAuthenticationCount() { return mAuthenticationSuccess + mAuthenticationFailure; } + int32_t getDetectInteractionCount() { return mDetectInteraction; } + + int32_t mAuthenticationSuccess = 0; + int32_t mAuthenticationFailure = 0; + int32_t mEnrollmentProgress = 0; + int32_t mDetectInteraction = 0; +}; + +class FakeFingerprintEngineUdfpsTest : public ::testing::Test { + protected: + void SetUp() override {} + + void TearDown() override { + // reset to default + FingerprintHalProperties::sensor_location(""); + } + + FakeFingerprintEngineUdfps mEngine; +}; + +bool isDefaultLocation(SensorLocation& sc) { + return (sc.sensorLocationX == FakeFingerprintEngineUdfps::defaultSensorLocationX && + sc.sensorLocationY == FakeFingerprintEngineUdfps::defaultSensorLocationY && + sc.sensorRadius == FakeFingerprintEngineUdfps::defaultSensorRadius && sc.display == ""); +} + +TEST_F(FakeFingerprintEngineUdfpsTest, getSensorLocationOk) { + auto loc = "100:200:30"; + FingerprintHalProperties::sensor_location(loc); + SensorLocation sc = mEngine.getSensorLocation(); + ASSERT_TRUE(sc.sensorLocationX == 100); + ASSERT_TRUE(sc.sensorLocationY == 200); + ASSERT_TRUE(sc.sensorRadius == 30); + + loc = "100:200:30:screen1"; + FingerprintHalProperties::sensor_location(loc); + sc = mEngine.getSensorLocation(); + ASSERT_TRUE(sc.sensorLocationX == 100); + ASSERT_TRUE(sc.sensorLocationY == 200); + ASSERT_TRUE(sc.sensorRadius == 30); + ASSERT_TRUE(sc.display == "screen1"); +} + +TEST_F(FakeFingerprintEngineUdfpsTest, getSensorLocationBad) { + const std::vector badStr{"", "100", "10:20", "10,20,5", "a:b:c"}; + SensorLocation sc; + for (const auto& s : badStr) { + FingerprintHalProperties::sensor_location(s); + sc = mEngine.getSensorLocation(); + ASSERT_TRUE(isDefaultLocation(sc)); + } +} + +TEST_F(FakeFingerprintEngineUdfpsTest, initialization) { + ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kIdle); +} + +TEST_F(FakeFingerprintEngineUdfpsTest, authenticate) { + std::shared_ptr cb = ndk::SharedRefBase::make(); + std::promise cancel; + mEngine.authenticateImpl(cb.get(), 1, cancel.get_future()); + ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kAuthenticate); + mEngine.onPointerDownImpl(1, 2, 3, 4.0, 5.0); + ASSERT_EQ(cb->getAuthenticationCount(), 0); + mEngine.onUiReadyImpl(); + ASSERT_EQ(cb->getAuthenticationCount(), 1); +} + +TEST_F(FakeFingerprintEngineUdfpsTest, enroll) { + std::shared_ptr cb = ndk::SharedRefBase::make(); + std::promise cancel; + keymaster::HardwareAuthToken hat{.mac = {5, 6}}; + FingerprintHalProperties::next_enrollment("5:0,0:true"); + mEngine.enrollImpl(cb.get(), hat, cancel.get_future()); + ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kEnroll); + mEngine.onPointerDownImpl(1, 2, 3, 4.0, 5.0); + ASSERT_EQ(cb->mEnrollmentProgress, 0); + mEngine.onUiReadyImpl(); + ASSERT_TRUE(cb->mEnrollmentProgress > 0); +} + +TEST_F(FakeFingerprintEngineUdfpsTest, detectInteraction) { + FingerprintHalProperties::detect_interaction(true); + FingerprintHalProperties::enrollments({1, 2}); + FingerprintHalProperties::enrollment_hit(2); + FingerprintHalProperties::operation_detect_interaction_acquired(""); + std::shared_ptr cb = ndk::SharedRefBase::make(); + std::promise cancel; + mEngine.detectInteractionImpl(cb.get(), cancel.get_future()); + ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kDetectInteract); + mEngine.onPointerDownImpl(1, 2, 3, 4.0, 5.0); + ASSERT_EQ(cb->getDetectInteractionCount(), 0); + mEngine.onUiReadyImpl(); + ASSERT_EQ(cb->getDetectInteractionCount(), 1); +} +// More +} // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/tests/FakeLockoutTrackerTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeLockoutTrackerTest.cpp new file mode 100644 index 0000000000..1b071eecd2 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/tests/FakeLockoutTrackerTest.cpp @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include + +#include "FakeLockoutTracker.h" +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; +using namespace ::aidl::android::hardware::biometrics::fingerprint; + +namespace aidl::android::hardware::biometrics::fingerprint { + +class FakeLockoutTrackerTest : public ::testing::Test { + protected: + static constexpr int32_t LOCKOUT_TIMED_THRESHOLD = 3; + static constexpr int32_t LOCKOUT_PERMANENT_THRESHOLD = 5; + static constexpr int32_t LOCKOUT_TIMED_DURATION = 100; + + void SetUp() override { + FingerprintHalProperties::lockout_timed_threshold(LOCKOUT_TIMED_THRESHOLD); + FingerprintHalProperties::lockout_timed_duration(LOCKOUT_TIMED_DURATION); + FingerprintHalProperties::lockout_permanent_threshold(LOCKOUT_PERMANENT_THRESHOLD); + } + + void TearDown() override { + // reset to default + FingerprintHalProperties::lockout_timed_threshold(5); + FingerprintHalProperties::lockout_timed_duration(20); + FingerprintHalProperties::lockout_permanent_threshold(10000); + FingerprintHalProperties::lockout_enable(false); + FingerprintHalProperties::lockout(false); + } + + FakeLockoutTracker mLockoutTracker; +}; + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptDisable) { + FingerprintHalProperties::lockout_enable(false); + for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD + 1; i++) mLockoutTracker.addFailedAttempt(); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone); + mLockoutTracker.reset(); +} + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockoutTimed) { + FingerprintHalProperties::lockout_enable(true); + for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++) mLockoutTracker.addFailedAttempt(); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kTimed); + // time left + int N = 5; + int64_t prevTimeLeft = INT_MIN; + for (int i = 0; i < N; i++) { + SLEEP_MS(LOCKOUT_TIMED_DURATION / N + 1); + int64_t currTimeLeft = mLockoutTracker.getLockoutTimeLeft(); + ASSERT_TRUE(currTimeLeft > prevTimeLeft); + prevTimeLeft = currTimeLeft; + } + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone); + mLockoutTracker.reset(); +} + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptPermanent) { + FingerprintHalProperties::lockout_enable(true); + for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD - 1; i++) mLockoutTracker.addFailedAttempt(); + ASSERT_NE(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent); + mLockoutTracker.addFailedAttempt(); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent); + ASSERT_TRUE(FingerprintHalProperties::lockout()); + mLockoutTracker.reset(); +} + +} // namespace aidl::android::hardware::biometrics::fingerprint + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/biometrics/fingerprint/aidl/default/tests/SessionTest.cpp b/biometrics/fingerprint/aidl/default/tests/SessionTest.cpp new file mode 100644 index 0000000000..3b96d7f099 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/tests/SessionTest.cpp @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include + +#include + +#include "Session.h" +#include "thread/WorkerThread.h" +#include "util/Util.h" + +using namespace ::android::fingerprint::virt; +using namespace ::aidl::android::hardware::biometrics::fingerprint; + +namespace aidl::android::hardware::biometrics::fingerprint { + +class TestSessionCallback : public BnSessionCallback { + public: + ndk::ScopedAStatus onChallengeGenerated(int64_t /*challenge*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onChallengeRevoked(int64_t /*challenge*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onError(fingerprint::Error /*error*/, int32_t /*vendorCode*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentProgress(int32_t /*enrollmentId*/, + int32_t /*remaining*/) override { + return ndk::ScopedAStatus::ok(); + }; + + ::ndk::ScopedAStatus onAuthenticationSucceeded(int32_t /*enrollmentId*/, + const keymaster::HardwareAuthToken&) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationFailed() override { return ndk::ScopedAStatus::ok(); }; + ::ndk::ScopedAStatus onInteractionDetected() override { return ndk::ScopedAStatus::ok(); }; + ndk::ScopedAStatus onAcquired(AcquiredInfo /*info*/, int32_t /*vendorCode*/) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onEnrollmentsEnumerated( + const std::vector& /*enrollmentIds*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentsRemoved( + const std::vector& /*enrollmentIds*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t /*authenticatorId*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdInvalidated(int64_t /*authenticatorId*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onLockoutPermanent() override { return ndk::ScopedAStatus::ok(); }; + ndk::ScopedAStatus onLockoutTimed(int64_t /* timeout */) override { + return ndk::ScopedAStatus::ok(); + } + ndk::ScopedAStatus onLockoutCleared() override { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus onSessionClosed() override { + mIsClosed = true; + return ndk::ScopedAStatus::ok(); + } + + bool mIsClosed = false; +}; + +class SessionTest : public ::testing::Test { + public: + SessionTest() : mWorker(2) {} + + protected: + void SetUp() override { + mCb = ndk::SharedRefBase::make(); + mSession = ndk::SharedRefBase::make(1, 2, mCb, &mFakeFingerprintEngine, &mWorker); + ASSERT_TRUE(mSession != nullptr); + mSession->linkToDeath(mCb->asBinder().get()); + } + + void TearDown() override {} + + std::shared_ptr mSession; + std::shared_ptr mCb; + + private: + FakeFingerprintEngine mFakeFingerprintEngine; + WorkerThread mWorker; +}; + +TEST_F(SessionTest, close) { + ASSERT_TRUE(!mSession->isClosed()); + ASSERT_TRUE(!mCb->mIsClosed); + onClientDeath(nullptr); + ASSERT_TRUE(!mSession->isClosed()); + ASSERT_TRUE(!mCb->mIsClosed); + onClientDeath(static_cast(mSession.get())); + ASSERT_TRUE(mSession->isClosed()); + ASSERT_TRUE(mCb->mIsClosed); +} + +} // namespace aidl::android::hardware::biometrics::fingerprint + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/biometrics/fingerprint/aidl/vts/Android.bp b/biometrics/fingerprint/aidl/vts/Android.bp index 30d5624144..1652905380 100644 --- a/biometrics/fingerprint/aidl/vts/Android.bp +++ b/biometrics/fingerprint/aidl/vts/Android.bp @@ -15,9 +15,9 @@ cc_test { ], srcs: ["VtsHalBiometricsFingerprintTargetTest.cpp"], static_libs: [ - "android.hardware.biometrics.common-V1-ndk", - "android.hardware.biometrics.fingerprint-V1-ndk", - "android.hardware.keymaster-V3-ndk", + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V3-ndk", + "android.hardware.keymaster-V4-ndk", ], shared_libs: [ "libbinder_ndk", diff --git a/bluetooth/aidl/Android.bp b/bluetooth/aidl/Android.bp index 1788ed372c..c6a592f5dc 100644 --- a/bluetooth/aidl/Android.bp +++ b/bluetooth/aidl/Android.bp @@ -34,4 +34,12 @@ aidl_interface { min_sdk_version: "33", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/.hash b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/.hash new file mode 100644 index 0000000000..e5ef0bff26 --- /dev/null +++ b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/.hash @@ -0,0 +1 @@ +f0eb2eb6d3b970cef8fb1b6e22c4ec39a4da5119 diff --git a/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/IBluetoothHci.aidl b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/IBluetoothHci.aidl new file mode 100644 index 0000000000..8b1cad2775 --- /dev/null +++ b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/IBluetoothHci.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth; +@VintfStability +interface IBluetoothHci { + void close(); + void initialize(in android.hardware.bluetooth.IBluetoothHciCallbacks callback); + void sendAclData(in byte[] data); + void sendHciCommand(in byte[] command); + void sendIsoData(in byte[] data); + void sendScoData(in byte[] data); +} diff --git a/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/IBluetoothHciCallbacks.aidl b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/IBluetoothHciCallbacks.aidl new file mode 100644 index 0000000000..aecff7f2e3 --- /dev/null +++ b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/IBluetoothHciCallbacks.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth; +@VintfStability +interface IBluetoothHciCallbacks { + void aclDataReceived(in byte[] data); + void hciEventReceived(in byte[] event); + void initializationComplete(in android.hardware.bluetooth.Status status); + void isoDataReceived(in byte[] data); + void scoDataReceived(in byte[] data); +} diff --git a/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/Status.aidl b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/Status.aidl new file mode 100644 index 0000000000..227224c7ac --- /dev/null +++ b/bluetooth/aidl/aidl_api/android.hardware.bluetooth/1/android/hardware/bluetooth/Status.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth; +@Backing(type="int") @VintfStability +enum Status { + SUCCESS, + ALREADY_INITIALIZED, + UNABLE_TO_OPEN_INTERFACE, + HARDWARE_INITIALIZATION_ERROR, + UNKNOWN, +} diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp index 1777f7793d..0bcafa334f 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp @@ -61,14 +61,12 @@ void BluetoothAudioSession::OnSessionStarted( LOG(ERROR) << __func__ << " - SessionType=" << toString(session_type_) << " MqDescriptor Invalid"; audio_config_ = nullptr; - leaudio_connection_map_ = nullptr; } else { stack_iface_ = stack_iface; latency_modes_ = latency_modes; LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_) << ", AudioConfiguration=" << audio_config.toString(); ReportSessionStatus(); - is_streaming_ = false; } } @@ -77,13 +75,11 @@ void BluetoothAudioSession::OnSessionEnded() { bool toggled = IsSessionReady(); LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_); audio_config_ = nullptr; - leaudio_connection_map_ = nullptr; stack_iface_ = nullptr; UpdateDataPath(nullptr); if (toggled) { ReportSessionStatus(); } - is_streaming_ = false; } /*** @@ -111,14 +107,6 @@ const AudioConfiguration BluetoothAudioSession::GetAudioConfig() { return *audio_config_; } -const AudioConfiguration BluetoothAudioSession::GetLeAudioConnectionMap() { - std::lock_guard guard(mutex_); - if (!IsSessionReady()) { - return AudioConfiguration(LeAudioConfiguration{}); - } - return *leaudio_connection_map_; -} - void BluetoothAudioSession::ReportAudioConfigChanged( const AudioConfiguration& audio_config) { if (session_type_ != @@ -135,47 +123,7 @@ void BluetoothAudioSession::ReportAudioConfigChanged( return; } - if (is_streaming_) { - if (audio_config_ == nullptr) { - LOG(ERROR) << __func__ << " for SessionType=" << toString(session_type_) - << " audio_config_ is nullptr during streaming. It shouldn't " - "be happened"; - return; - } - - auto new_leaudio_config = - audio_config.get(); - auto current_leaudio_config = - (*audio_config_).get(); - if (new_leaudio_config.codecType != current_leaudio_config.codecType) { - LOG(ERROR) - << __func__ << " for SessionType=" << toString(session_type_) - << " codec type changed during streaming. It shouldn't be happened "; - } - auto new_lc3_config = new_leaudio_config.leAudioCodecConfig - .get(); - auto current_lc3_config = current_leaudio_config.leAudioCodecConfig - .get(); - if ((new_lc3_config.pcmBitDepth != current_lc3_config.pcmBitDepth) || - (new_lc3_config.samplingFrequencyHz != - current_lc3_config.samplingFrequencyHz) || - (new_lc3_config.frameDurationUs != - current_lc3_config.frameDurationUs) || - (new_lc3_config.octetsPerFrame != current_lc3_config.octetsPerFrame) || - (new_lc3_config.blocksPerSdu != current_lc3_config.blocksPerSdu)) { - LOG(ERROR) - << __func__ << " for SessionType=" << toString(session_type_) - << " lc3 config changed during streaming. It shouldn't be happened"; - return; - } - - leaudio_connection_map_ = - std::make_unique(audio_config); - } else { - audio_config_ = std::make_unique(audio_config); - leaudio_connection_map_ = - std::make_unique(audio_config); - } + audio_config_ = std::make_unique(audio_config); if (observers_.empty()) { LOG(WARNING) << __func__ << " - SessionType=" << toString(session_type_) @@ -188,11 +136,7 @@ void BluetoothAudioSession::ReportAudioConfigChanged( LOG(INFO) << __func__ << " for SessionType=" << toString(session_type_) << ", bluetooth_audio=0x" << ::android::base::StringPrintf("%04x", cookie); - if (is_streaming_) { - if (cb->soft_audio_configuration_changed_cb_ != nullptr) { - cb->soft_audio_configuration_changed_cb_(cookie); - } - } else if (cb->audio_configuration_changed_cb_ != nullptr) { + if (cb->audio_configuration_changed_cb_ != nullptr) { cb->audio_configuration_changed_cb_(cookie); } } @@ -482,12 +426,6 @@ void BluetoothAudioSession::ReportControlStatus(bool start_resp, << " has NO port state observer"; return; } - if (start_resp && status == BluetoothAudioStatus::SUCCESS) { - is_streaming_ = true; - } else if (!start_resp && (status == BluetoothAudioStatus::SUCCESS || - status == BluetoothAudioStatus::RECONFIGURATION)) { - is_streaming_ = false; - } for (auto& observer : observers_) { uint16_t cookie = observer.first; std::shared_ptr callback = observer.second; diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h index 25c676a3ac..103a9ea61b 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h @@ -105,13 +105,6 @@ struct PortStatusCallbacks { ***/ std::function low_latency_mode_allowed_cb_; - /*** - * soft_audio_configuration_changed_cb_ - when the Bluetooth stack change - * the streamMap during the streaming, the BluetoothAudioProvider will invoke - * this callback to report to the bluetooth_audio module. - * @param: cookie - indicates which bluetooth_audio output should handle - ***/ - std::function soft_audio_configuration_changed_cb_; }; class BluetoothAudioSession { @@ -168,12 +161,6 @@ class BluetoothAudioSession { ***/ const AudioConfiguration GetAudioConfig(); - /*** - * The control function is for the bluetooth_audio module to get the current - * LE audio connection map - ***/ - const AudioConfiguration GetLeAudioConnectionMap(); - /*** * The report function is used to report that the Bluetooth stack has notified * the audio configuration changed, and will invoke @@ -225,11 +212,8 @@ class BluetoothAudioSession { std::unique_ptr data_mq_; // audio data configuration for both software and offloading std::unique_ptr audio_config_; - std::unique_ptr leaudio_connection_map_; std::vector latency_modes_; bool low_latency_allowed_ = true; - // saving those steaming state based on the session_type - bool is_streaming_ = false; // saving those registered bluetooth_audio's callbacks std::unordered_map> diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h index 6c60a3b5bf..7ae0353641 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h @@ -94,25 +94,6 @@ class BluetoothAudioSessionControl { } } - /*** - * The control API for the bluetooth_audio module to get current - * LE audio connection map - ***/ - static const AudioConfiguration GetLeAudioConnectionMap( - const SessionType& session_type) { - std::shared_ptr session_ptr = - BluetoothAudioSessionInstance::GetSessionInstance(session_type); - if ((session_type == - SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH || - session_type == - SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) && - session_ptr != nullptr) { - return session_ptr->GetLeAudioConnectionMap(); - } - - return AudioConfiguration(LeAudioConfiguration{}); - } - /*** * Those control APIs for the bluetooth_audio module to start / suspend / stop diff --git a/boot/aidl/Android.bp b/boot/aidl/Android.bp index be382451f1..c2ba1b6272 100644 --- a/boot/aidl/Android.bp +++ b/boot/aidl/Android.bp @@ -37,4 +37,12 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/boot/aidl/aidl_api/android.hardware.boot/1/.hash b/boot/aidl/aidl_api/android.hardware.boot/1/.hash new file mode 100644 index 0000000000..b6f1cb28f6 --- /dev/null +++ b/boot/aidl/aidl_api/android.hardware.boot/1/.hash @@ -0,0 +1 @@ +2400346954240a5de495a1debc81429dd012d7b7 diff --git a/boot/aidl/aidl_api/android.hardware.boot/1/android/hardware/boot/IBootControl.aidl b/boot/aidl/aidl_api/android.hardware.boot/1/android/hardware/boot/IBootControl.aidl new file mode 100644 index 0000000000..0c083f6e36 --- /dev/null +++ b/boot/aidl/aidl_api/android.hardware.boot/1/android/hardware/boot/IBootControl.aidl @@ -0,0 +1,50 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.boot; +@VintfStability +interface IBootControl { + int getActiveBootSlot(); + int getCurrentSlot(); + int getNumberSlots(); + android.hardware.boot.MergeStatus getSnapshotMergeStatus(); + String getSuffix(in int slot); + boolean isSlotBootable(in int slot); + boolean isSlotMarkedSuccessful(in int slot); + void markBootSuccessful(); + void setActiveBootSlot(in int slot); + void setSlotAsUnbootable(in int slot); + void setSnapshotMergeStatus(in android.hardware.boot.MergeStatus status); + const int INVALID_SLOT = (-1) /* -1 */; + const int COMMAND_FAILED = (-2) /* -2 */; +} diff --git a/boot/aidl/aidl_api/android.hardware.boot/1/android/hardware/boot/MergeStatus.aidl b/boot/aidl/aidl_api/android.hardware.boot/1/android/hardware/boot/MergeStatus.aidl new file mode 100644 index 0000000000..cdf3f349b1 --- /dev/null +++ b/boot/aidl/aidl_api/android.hardware.boot/1/android/hardware/boot/MergeStatus.aidl @@ -0,0 +1,42 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.boot; +@Backing(type="int") @VintfStability +enum MergeStatus { + NONE = 0, + UNKNOWN, + SNAPSHOTTED, + MERGING, + CANCELLED, +} diff --git a/broadcastradio/2.0/default/TunerSession.cpp b/broadcastradio/2.0/default/TunerSession.cpp index 2ba4d02092..cc2f1a5b15 100644 --- a/broadcastradio/2.0/default/TunerSession.cpp +++ b/broadcastradio/2.0/default/TunerSession.cpp @@ -241,13 +241,13 @@ Return TunerSession::startProgramListUpdates(const ProgramFilter& filter }; std::copy_if(list.begin(), list.end(), std::back_inserter(filteredList), filterCb); - auto task = [this, list]() { + auto task = [this, filteredList]() { lock_guard lk(mMut); ProgramListChunk chunk = {}; chunk.purge = true; chunk.complete = true; - chunk.modified = hidl_vec(list.begin(), list.end()); + chunk.modified = hidl_vec(filteredList.begin(), filteredList.end()); mCallback->onProgramListUpdated(chunk); }; diff --git a/broadcastradio/2.0/default/VirtualRadio.cpp b/broadcastradio/2.0/default/VirtualRadio.cpp index c59fd8ff4b..e6b1017808 100644 --- a/broadcastradio/2.0/default/VirtualRadio.cpp +++ b/broadcastradio/2.0/default/VirtualRadio.cpp @@ -46,9 +46,9 @@ VirtualRadio gAmFmRadio( VirtualRadio gDabRadio( "DAB radio mock", { - {make_selector_dab(12345, 225648), "BBC Radio 1", "Khalid", "Talk"}, // 12B - {make_selector_dab(22345, 222064), "Classic FM", "Jean Sibelius", "Andante Festivo"}, // 11D - {make_selector_dab(32345, 222064), "Absolute Radio", "Coldplay", "Clocks"}, // 11D + {make_selector_dab(0xA00001u, 0x0001u), "BBC Radio 1", "Khalid", "Talk"}, + {make_selector_dab(0xB00001u, 0x1001u), "Classic FM", "Jean Sibelius", "Andante Festivo"}, + {make_selector_dab(0xB00002u, 0x1001u), "Absolute Radio", "Coldplay", "Clocks"}, }); // clang-format on diff --git a/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp b/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp index 615fde0343..5e8a5cfa45 100644 --- a/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp +++ b/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp @@ -108,6 +108,7 @@ class BroadcastRadioHalTest : public ::testing::TestWithParam { bool openSession(); bool getAmFmRegionConfig(bool full, AmFmRegionConfig* config); std::optional getProgramList(); + std::optional getProgramList(const ProgramFilter& filter); sp mModule; Properties mProperties; @@ -239,9 +240,15 @@ bool BroadcastRadioHalTest::getAmFmRegionConfig(bool full, AmFmRegionConfig* con } std::optional BroadcastRadioHalTest::getProgramList() { + ProgramFilter emptyFilter = {}; + return getProgramList(emptyFilter); +} + +std::optional BroadcastRadioHalTest::getProgramList( + const ProgramFilter& filter) { EXPECT_TIMEOUT_CALL(*mCallback, onProgramListReady).Times(AnyNumber()); - auto startResult = mSession->startProgramListUpdates({}); + auto startResult = mSession->startProgramListUpdates(filter); if (startResult == Result::NOT_SUPPORTED) { printSkipped("Program list not supported"); return std::nullopt; @@ -810,19 +817,97 @@ TEST_P(BroadcastRadioHalTest, SetConfigFlags) { } /** - * Test getting program list. + * Test getting program list using empty program filter. * * Verifies that: * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; * - the complete list is fetched within timeout::programListScan; * - stopProgramListUpdates does not crash. */ -TEST_P(BroadcastRadioHalTest, GetProgramList) { +TEST_P(BroadcastRadioHalTest, GetProgramListFromEmptyFilter) { ASSERT_TRUE(openSession()); getProgramList(); } +/** + * Test getting program list using AMFM frequency program filter. + * + * Verifies that: + * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; + * - the complete list is fetched within timeout::programListScan; + * - stopProgramListUpdates does not crash; + * - result for startProgramListUpdates using a filter with AMFM_FREQUENCY value of the first AMFM + * program matches the expected result. + */ +TEST_P(BroadcastRadioHalTest, GetProgramListFromAmFmFilter) { + ASSERT_TRUE(openSession()); + + auto completeList = getProgramList(); + if (!completeList) return; + + ProgramFilter amfmFilter = {}; + int expectedResultSize = 0; + uint64_t expectedFreq = 0; + for (auto&& program : *completeList) { + auto amfmIds = utils::getAllIds(program.selector, IdentifierType::AMFM_FREQUENCY); + EXPECT_LE(amfmIds.size(), 1u); + if (amfmIds.size() == 0) continue; + + if (expectedResultSize == 0) { + expectedFreq = amfmIds[0]; + amfmFilter.identifiers = { + make_identifier(IdentifierType::AMFM_FREQUENCY, expectedFreq)}; + expectedResultSize = 1; + } else if (amfmIds[0] == expectedFreq) { + expectedResultSize++; + } + } + + if (expectedResultSize == 0) return; + auto amfmList = getProgramList(amfmFilter); + ASSERT_EQ(expectedResultSize, amfmList->size()) << "amfm filter result size is wrong"; +} + +/** + * Test getting program list using DAB ensemble program filter. + * + * Verifies that: + * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; + * - the complete list is fetched within timeout::programListScan; + * - stopProgramListUpdates does not crash; + * - result for startProgramListUpdates using a filter with DAB_ENSEMBLE value of the first DAB + * program matches the expected result. + */ +TEST_P(BroadcastRadioHalTest, GetProgramListFromDabFilter) { + ASSERT_TRUE(openSession()); + + auto completeList = getProgramList(); + if (!completeList) return; + + ProgramFilter dabFilter = {}; + int expectedResultSize = 0; + uint64_t expectedEnsemble = 0; + for (auto&& program : *completeList) { + auto dabEnsembles = utils::getAllIds(program.selector, IdentifierType::DAB_ENSEMBLE); + EXPECT_LE(dabEnsembles.size(), 1u); + if (dabEnsembles.size() == 0) continue; + + if (expectedResultSize == 0) { + expectedEnsemble = dabEnsembles[0]; + dabFilter.identifiers = { + make_identifier(IdentifierType::DAB_ENSEMBLE, expectedEnsemble)}; + expectedResultSize = 1; + } else if (dabEnsembles[0] == expectedEnsemble) { + expectedResultSize++; + } + } + + if (expectedResultSize == 0) return; + auto dabList = getProgramList(dabFilter); + ASSERT_EQ(expectedResultSize, dabList->size()) << "dab filter result size is wrong"; +} + /** * Test HD_STATION_NAME correctness. * diff --git a/broadcastradio/aidl/Android.bp b/broadcastradio/aidl/Android.bp new file mode 100644 index 0000000000..3f89029232 --- /dev/null +++ b/broadcastradio/aidl/Android.bp @@ -0,0 +1,48 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +aidl_interface { + name: "android.hardware.broadcastradio", + vendor_available: true, + srcs: ["android/hardware/broadcastradio/*.aidl"], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + min_sdk_version: "Tiramisu", + }, + }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + +} diff --git a/broadcastradio/aidl/OWNERS b/broadcastradio/aidl/OWNERS new file mode 100644 index 0000000000..302fdd73cc --- /dev/null +++ b/broadcastradio/aidl/OWNERS @@ -0,0 +1,4 @@ +xuweilin@google.com +oscarazu@google.com +ericjeong@google.com +keunyoung@google.com diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/.hash b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/.hash new file mode 100644 index 0000000000..41917fe3b3 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/.hash @@ -0,0 +1 @@ +3c864ddf392d28cfbf95849bedf0b753b81cc013 diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AmFmBandRange.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AmFmBandRange.aidl new file mode 100644 index 0000000000..ca511aa13a --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AmFmBandRange.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable AmFmBandRange { + int lowerBound; + int upperBound; + int spacing; + int seekSpacing; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AmFmRegionConfig.aidl new file mode 100644 index 0000000000..b96def32f8 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AmFmRegionConfig.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable AmFmRegionConfig { + android.hardware.broadcastradio.AmFmBandRange[] ranges; + int fmDeemphasis; + int fmRds; + const int DEEMPHASIS_D50 = (1 << 0) /* 1 */; + const int DEEMPHASIS_D75 = (1 << 1) /* 2 */; + const int RDS = (1 << 0) /* 1 */; + const int RBDS = (1 << 1) /* 2 */; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Announcement.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Announcement.aidl new file mode 100644 index 0000000000..bbdd86f7dc --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Announcement.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable Announcement { + android.hardware.broadcastradio.ProgramSelector selector; + android.hardware.broadcastradio.AnnouncementType type = android.hardware.broadcastradio.AnnouncementType.INVALID; + android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AnnouncementType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AnnouncementType.aidl new file mode 100644 index 0000000000..1d187fe0b2 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/AnnouncementType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="byte") @JavaDerive(equals=true, toString=true) @VintfStability +enum AnnouncementType { + INVALID = 0, + EMERGENCY = 1, + WARNING, + TRAFFIC, + WEATHER, + NEWS, + EVENT, + SPORT, + MISC, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ConfigFlag.aidl new file mode 100644 index 0000000000..98af437266 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ConfigFlag.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum ConfigFlag { + FORCE_MONO = 1, + FORCE_ANALOG, + FORCE_DIGITAL, + RDS_AF, + RDS_REG, + DAB_DAB_LINKING, + DAB_FM_LINKING, + DAB_DAB_SOFT_LINKING, + DAB_FM_SOFT_LINKING, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/DabTableEntry.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/DabTableEntry.aidl new file mode 100644 index 0000000000..162f4abd62 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/DabTableEntry.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable DabTableEntry { + String label; + int frequencyKhz; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IAnnouncementListener.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IAnnouncementListener.aidl new file mode 100644 index 0000000000..346af5807d --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IAnnouncementListener.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface IAnnouncementListener { + oneway void onListUpdated(in android.hardware.broadcastradio.Announcement[] announcements); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IBroadcastRadio.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IBroadcastRadio.aidl new file mode 100644 index 0000000000..39eb04c105 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IBroadcastRadio.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface IBroadcastRadio { + android.hardware.broadcastradio.Properties getProperties(); + android.hardware.broadcastradio.AmFmRegionConfig getAmFmRegionConfig(in boolean full); + android.hardware.broadcastradio.DabTableEntry[] getDabRegionConfig(); + void setTunerCallback(in android.hardware.broadcastradio.ITunerCallback callback); + void unsetTunerCallback(); + void tune(in android.hardware.broadcastradio.ProgramSelector program); + void seek(in boolean directionUp, in boolean skipSubChannel); + void step(in boolean directionUp); + void cancel(); + void startProgramListUpdates(in android.hardware.broadcastradio.ProgramFilter filter); + void stopProgramListUpdates(); + boolean isConfigFlagSet(in android.hardware.broadcastradio.ConfigFlag flag); + void setConfigFlag(in android.hardware.broadcastradio.ConfigFlag flag, in boolean value); + android.hardware.broadcastradio.VendorKeyValue[] setParameters(in android.hardware.broadcastradio.VendorKeyValue[] parameters); + android.hardware.broadcastradio.VendorKeyValue[] getParameters(in String[] keys); + byte[] getImage(in int id); + android.hardware.broadcastradio.ICloseHandle registerAnnouncementListener(in android.hardware.broadcastradio.IAnnouncementListener listener, in android.hardware.broadcastradio.AnnouncementType[] enabled); + const int INVALID_IMAGE = 0; + const int ANTENNA_STATE_CHANGE_TIMEOUT_MS = 100; + const int LIST_COMPLETE_TIMEOUT_MS = 300000; + const int TUNER_TIMEOUT_MS = 30000; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ICloseHandle.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ICloseHandle.aidl new file mode 100644 index 0000000000..75e7f2a4c0 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ICloseHandle.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface ICloseHandle { + void close(); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ITunerCallback.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ITunerCallback.aidl new file mode 100644 index 0000000000..f5badade46 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ITunerCallback.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface ITunerCallback { + oneway void onTuneFailed(in android.hardware.broadcastradio.Result result, in android.hardware.broadcastradio.ProgramSelector selector); + oneway void onCurrentProgramInfoChanged(in android.hardware.broadcastradio.ProgramInfo info); + oneway void onProgramListUpdated(in android.hardware.broadcastradio.ProgramListChunk chunk); + oneway void onAntennaStateChange(in boolean connected); + oneway void onConfigFlagUpdated(in android.hardware.broadcastradio.ConfigFlag flag, in boolean value); + oneway void onParametersUpdated(in android.hardware.broadcastradio.VendorKeyValue[] parameters); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IdentifierType.aidl new file mode 100644 index 0000000000..63a0efd506 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/IdentifierType.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum IdentifierType { + VENDOR_START = 1000, + VENDOR_END = 1999, + INVALID = 0, + AMFM_FREQUENCY_KHZ, + RDS_PI, + HD_STATION_ID_EXT, + HD_STATION_NAME, + DAB_SID_EXT, + DAB_ENSEMBLE, + DAB_SCID, + DAB_FREQUENCY_KHZ, + DRMO_SERVICE_ID, + DRMO_FREQUENCY_KHZ, + SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2) /* 12 */, + SXM_CHANNEL, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Metadata.aidl new file mode 100644 index 0000000000..e02b6b1bd0 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Metadata.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +union Metadata { + String rdsPs; + int rdsPty; + int rbdsPty; + String rdsRt; + String songTitle; + String songArtist; + String songAlbum; + int stationIcon; + int albumArt; + String programName; + String dabEnsembleName; + String dabEnsembleNameShort; + String dabServiceName; + String dabServiceNameShort; + String dabComponentName; + String dabComponentNameShort; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramFilter.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramFilter.aidl new file mode 100644 index 0000000000..9edeb8d5c6 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramFilter.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramFilter { + android.hardware.broadcastradio.IdentifierType[] identifierTypes; + android.hardware.broadcastradio.ProgramIdentifier[] identifiers; + boolean includeCategories; + boolean excludeModifications; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramIdentifier.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramIdentifier.aidl new file mode 100644 index 0000000000..66763508ad --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramIdentifier.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramIdentifier { + android.hardware.broadcastradio.IdentifierType type = android.hardware.broadcastradio.IdentifierType.INVALID; + long value; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramInfo.aidl new file mode 100644 index 0000000000..335f060049 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramInfo.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramInfo { + android.hardware.broadcastradio.ProgramSelector selector; + android.hardware.broadcastradio.ProgramIdentifier logicallyTunedTo; + android.hardware.broadcastradio.ProgramIdentifier physicallyTunedTo; + @nullable android.hardware.broadcastradio.ProgramIdentifier[] relatedContent; + int infoFlags; + int signalQuality; + android.hardware.broadcastradio.Metadata[] metadata; + android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; + const int FLAG_LIVE = (1 << 0) /* 1 */; + const int FLAG_MUTED = (1 << 1) /* 2 */; + const int FLAG_TRAFFIC_PROGRAM = (1 << 2) /* 4 */; + const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3) /* 8 */; + const int FLAG_TUNABLE = (1 << 4) /* 16 */; + const int FLAG_STEREO = (1 << 5) /* 32 */; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramListChunk.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramListChunk.aidl new file mode 100644 index 0000000000..5d53b99302 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramListChunk.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramListChunk { + boolean purge; + boolean complete; + android.hardware.broadcastradio.ProgramInfo[] modified; + @nullable android.hardware.broadcastradio.ProgramIdentifier[] removed; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramSelector.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramSelector.aidl new file mode 100644 index 0000000000..9af1dc8880 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/ProgramSelector.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramSelector { + android.hardware.broadcastradio.ProgramIdentifier primaryId; + android.hardware.broadcastradio.ProgramIdentifier[] secondaryIds; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Properties.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Properties.aidl new file mode 100644 index 0000000000..643b819d8a --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Properties.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable Properties { + String maker; + String product; + String version; + String serial; + android.hardware.broadcastradio.IdentifierType[] supportedIdentifierTypes; + android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Result.aidl new file mode 100644 index 0000000000..b0fc018cb7 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum Result { + OK = 0, + INTERNAL_ERROR, + INVALID_ARGUMENTS, + INVALID_STATE, + NOT_SUPPORTED, + TIMEOUT, + CANCELED, + UNKNOWN_ERROR, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/VendorKeyValue.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/VendorKeyValue.aidl new file mode 100644 index 0000000000..3c6b19438f --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/1/android/hardware/broadcastradio/VendorKeyValue.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VendorKeyValue { + String key; + String value; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmBandRange.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmBandRange.aidl new file mode 100644 index 0000000000..ca511aa13a --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmBandRange.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable AmFmBandRange { + int lowerBound; + int upperBound; + int spacing; + int seekSpacing; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl new file mode 100644 index 0000000000..fe8489c69d --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable AmFmRegionConfig { + android.hardware.broadcastradio.AmFmBandRange[] ranges; + int fmDeemphasis; + int fmRds; + const int DEEMPHASIS_D50 = (1 << 0); + const int DEEMPHASIS_D75 = (1 << 1); + const int RDS = (1 << 0); + const int RBDS = (1 << 1); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Announcement.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Announcement.aidl new file mode 100644 index 0000000000..bbdd86f7dc --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Announcement.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable Announcement { + android.hardware.broadcastradio.ProgramSelector selector; + android.hardware.broadcastradio.AnnouncementType type = android.hardware.broadcastradio.AnnouncementType.INVALID; + android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl new file mode 100644 index 0000000000..1d187fe0b2 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AnnouncementType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="byte") @JavaDerive(equals=true, toString=true) @VintfStability +enum AnnouncementType { + INVALID = 0, + EMERGENCY = 1, + WARNING, + TRAFFIC, + WEATHER, + NEWS, + EVENT, + SPORT, + MISC, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl new file mode 100644 index 0000000000..98af437266 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum ConfigFlag { + FORCE_MONO = 1, + FORCE_ANALOG, + FORCE_DIGITAL, + RDS_AF, + RDS_REG, + DAB_DAB_LINKING, + DAB_FM_LINKING, + DAB_DAB_SOFT_LINKING, + DAB_FM_SOFT_LINKING, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/DabTableEntry.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/DabTableEntry.aidl new file mode 100644 index 0000000000..162f4abd62 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/DabTableEntry.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable DabTableEntry { + String label; + int frequencyKhz; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IAnnouncementListener.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IAnnouncementListener.aidl new file mode 100644 index 0000000000..346af5807d --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IAnnouncementListener.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface IAnnouncementListener { + oneway void onListUpdated(in android.hardware.broadcastradio.Announcement[] announcements); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IBroadcastRadio.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IBroadcastRadio.aidl new file mode 100644 index 0000000000..39eb04c105 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IBroadcastRadio.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface IBroadcastRadio { + android.hardware.broadcastradio.Properties getProperties(); + android.hardware.broadcastradio.AmFmRegionConfig getAmFmRegionConfig(in boolean full); + android.hardware.broadcastradio.DabTableEntry[] getDabRegionConfig(); + void setTunerCallback(in android.hardware.broadcastradio.ITunerCallback callback); + void unsetTunerCallback(); + void tune(in android.hardware.broadcastradio.ProgramSelector program); + void seek(in boolean directionUp, in boolean skipSubChannel); + void step(in boolean directionUp); + void cancel(); + void startProgramListUpdates(in android.hardware.broadcastradio.ProgramFilter filter); + void stopProgramListUpdates(); + boolean isConfigFlagSet(in android.hardware.broadcastradio.ConfigFlag flag); + void setConfigFlag(in android.hardware.broadcastradio.ConfigFlag flag, in boolean value); + android.hardware.broadcastradio.VendorKeyValue[] setParameters(in android.hardware.broadcastradio.VendorKeyValue[] parameters); + android.hardware.broadcastradio.VendorKeyValue[] getParameters(in String[] keys); + byte[] getImage(in int id); + android.hardware.broadcastradio.ICloseHandle registerAnnouncementListener(in android.hardware.broadcastradio.IAnnouncementListener listener, in android.hardware.broadcastradio.AnnouncementType[] enabled); + const int INVALID_IMAGE = 0; + const int ANTENNA_STATE_CHANGE_TIMEOUT_MS = 100; + const int LIST_COMPLETE_TIMEOUT_MS = 300000; + const int TUNER_TIMEOUT_MS = 30000; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ICloseHandle.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ICloseHandle.aidl new file mode 100644 index 0000000000..75e7f2a4c0 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ICloseHandle.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface ICloseHandle { + void close(); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ITunerCallback.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ITunerCallback.aidl new file mode 100644 index 0000000000..f5badade46 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ITunerCallback.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@VintfStability +interface ITunerCallback { + oneway void onTuneFailed(in android.hardware.broadcastradio.Result result, in android.hardware.broadcastradio.ProgramSelector selector); + oneway void onCurrentProgramInfoChanged(in android.hardware.broadcastradio.ProgramInfo info); + oneway void onProgramListUpdated(in android.hardware.broadcastradio.ProgramListChunk chunk); + oneway void onAntennaStateChange(in boolean connected); + oneway void onConfigFlagUpdated(in android.hardware.broadcastradio.ConfigFlag flag, in boolean value); + oneway void onParametersUpdated(in android.hardware.broadcastradio.VendorKeyValue[] parameters); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl new file mode 100644 index 0000000000..4df272c3c3 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum IdentifierType { + VENDOR_START = 1000, + VENDOR_END = 1999, + INVALID = 0, + AMFM_FREQUENCY_KHZ, + RDS_PI, + HD_STATION_ID_EXT, + HD_STATION_NAME, + DAB_SID_EXT, + DAB_ENSEMBLE, + DAB_SCID, + DAB_FREQUENCY_KHZ, + DRMO_SERVICE_ID, + DRMO_FREQUENCY_KHZ, + SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2), + SXM_CHANNEL, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl new file mode 100644 index 0000000000..e02b6b1bd0 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +union Metadata { + String rdsPs; + int rdsPty; + int rbdsPty; + String rdsRt; + String songTitle; + String songArtist; + String songAlbum; + int stationIcon; + int albumArt; + String programName; + String dabEnsembleName; + String dabEnsembleNameShort; + String dabServiceName; + String dabServiceNameShort; + String dabComponentName; + String dabComponentNameShort; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramFilter.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramFilter.aidl new file mode 100644 index 0000000000..9edeb8d5c6 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramFilter.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramFilter { + android.hardware.broadcastradio.IdentifierType[] identifierTypes; + android.hardware.broadcastradio.ProgramIdentifier[] identifiers; + boolean includeCategories; + boolean excludeModifications; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramIdentifier.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramIdentifier.aidl new file mode 100644 index 0000000000..66763508ad --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramIdentifier.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramIdentifier { + android.hardware.broadcastradio.IdentifierType type = android.hardware.broadcastradio.IdentifierType.INVALID; + long value; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl new file mode 100644 index 0000000000..b14023a3c0 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramInfo { + android.hardware.broadcastradio.ProgramSelector selector; + android.hardware.broadcastradio.ProgramIdentifier logicallyTunedTo; + android.hardware.broadcastradio.ProgramIdentifier physicallyTunedTo; + @nullable android.hardware.broadcastradio.ProgramIdentifier[] relatedContent; + int infoFlags; + int signalQuality; + android.hardware.broadcastradio.Metadata[] metadata; + android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; + const int FLAG_LIVE = (1 << 0); + const int FLAG_MUTED = (1 << 1); + const int FLAG_TRAFFIC_PROGRAM = (1 << 2); + const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3); + const int FLAG_TUNABLE = (1 << 4); + const int FLAG_STEREO = (1 << 5); +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramListChunk.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramListChunk.aidl new file mode 100644 index 0000000000..5d53b99302 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramListChunk.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramListChunk { + boolean purge; + boolean complete; + android.hardware.broadcastradio.ProgramInfo[] modified; + @nullable android.hardware.broadcastradio.ProgramIdentifier[] removed; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramSelector.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramSelector.aidl new file mode 100644 index 0000000000..9af1dc8880 --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramSelector.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ProgramSelector { + android.hardware.broadcastradio.ProgramIdentifier primaryId; + android.hardware.broadcastradio.ProgramIdentifier[] secondaryIds; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Properties.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Properties.aidl new file mode 100644 index 0000000000..643b819d8a --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Properties.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable Properties { + String maker; + String product; + String version; + String serial; + android.hardware.broadcastradio.IdentifierType[] supportedIdentifierTypes; + android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl new file mode 100644 index 0000000000..8af74c74fb --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum Result { + OK, + INTERNAL_ERROR, + INVALID_ARGUMENTS, + INVALID_STATE, + NOT_SUPPORTED, + TIMEOUT, + CANCELED, + UNKNOWN_ERROR, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/VendorKeyValue.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/VendorKeyValue.aidl new file mode 100644 index 0000000000..3c6b19438f --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/VendorKeyValue.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VendorKeyValue { + String key; + String value; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/AmFmBandRange.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/AmFmBandRange.aidl new file mode 100644 index 0000000000..562631f0c7 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/AmFmBandRange.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Defines the AM/FM band range for configuring different regions. + * + *

Channel grid is defined as: each possible channel is set at + * lowerBound + channelNumber * spacing, up to upperBound. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable AmFmBandRange { + /** + * The frequency (in kHz) of the first channel within the range. + * + * Lower bound must be a tunable frequency. + */ + int lowerBound; + + /** + * The frequency (in kHz) of the last channel within the range. + */ + int upperBound; + + /** + * Channel grid resolution (in kHz), telling how far the channels are apart. + */ + int spacing; + + /** + * Channel spacing (in kHz) used to speed up seeking to the next station + * via the {@link IBroadcastRadio#seek} operation. + * + * It must be a multiple of channel grid resolution. + * + * Tuner may first quickly check every n-th channel and if it detects echo + * from a station, it fine-tunes to find the exact frequency. + * + * It's ignored for capabilities check (with full=true when calling + * getAmFmRegionConfig). + */ + int seekSpacing; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/AmFmRegionConfig.aidl new file mode 100644 index 0000000000..f4c6fd3f29 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/AmFmRegionConfig.aidl @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.AmFmBandRange; + +/** + * Regional configuration for AM/FM. + * + *

For hardware capabilities check (with full=true when calling + * {@link IBroadcastRadio#getAmFmRegionConfig}), HAL implementation fills + * entire supported range of frequencies and features. + * + * When checking current configuration, at most one bit in each bitset + * can be set. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable AmFmRegionConfig { + /** + * Noth D50 and D75 are FM de-emphasis filter supported or configured. + * + * Both might be set for hardware capabilities check (with full={@code true} + * when calling getAmFmRegionConfig), but exactly one for specific region + * settings. + */ + const int DEEMPHASIS_D50 = 1 << 0; + + const int DEEMPHASIS_D75 = 1 << 1; + + /** + * Both RDS and RBDS are supported or configured RDS variants. + * + * Both might be set for hardware capabilities check (with full={@code true} + * when calling getAmFmRegionConfig), but only one (or none) for specific + * region settings. + * + * RDS is Standard variant, used everywhere except North America. + */ + const int RDS = 1 << 0; + + /** + * Variant used in North America (see RDS). + */ + const int RBDS = 1 << 1; + + /** + * All supported or configured AM/FM bands. + * + * AM/FM bands are identified by frequency value + * (see {@link IdentifierType#AMFM_FREQUENCY_KHZ}). + * + * With typical configuration, it's expected to have two frequency ranges + * for capabilities check (AM and FM) and four ranges for specific region + * configuration (AM LW, AM MW, AM SW, FM). + */ + AmFmBandRange[] ranges; + + /** + * De-emphasis filter supported/configured. + * + * It can be a combination of de-emphasis values ({@link #DEEMPHASIS_D50} and + * {@link #DEEMPHASIS_D75}). + */ + int fmDeemphasis; + + /** + * RDS/RBDS variant supported/configured. + * + * It can be a combination of RDS values ({@link #RDS} and {@link #RBDS}). + */ + int fmRds; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Announcement.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Announcement.aidl new file mode 100644 index 0000000000..a972d4d49a --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/Announcement.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.AnnouncementType; +import android.hardware.broadcastradio.ProgramSelector; +import android.hardware.broadcastradio.VendorKeyValue; + +/** + * Station broadcasting active announcement. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable Announcement { + /** + * Program selector to tune to the announcement. + */ + ProgramSelector selector; + + /** + * Announcement type. + */ + AnnouncementType type = AnnouncementType.INVALID; + + /** + * Vendor-specific information. + * + * It may be used for extra features, not supported by the platform, + * for example: com.me.hdradio.urgency=100; com.me.hdradio.certainity=50. + */ + VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/AnnouncementType.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/AnnouncementType.aidl new file mode 100644 index 0000000000..8df80252e8 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/AnnouncementType.aidl @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Type of an announcement. + * + *

It maps to different announcement types for each radio technology. + */ +@VintfStability +@Backing(type="byte") +@JavaDerive(equals=true, toString=true) +enum AnnouncementType { + /** + * Undefined announcement type + */ + INVALID = 0, + + /** + * DAB alarm, RDS emergency program type (PTY 31). + */ + EMERGENCY = 1, + + /** + * DAB warning. + */ + WARNING, + + /** + * DAB road traffic, RDS TA, HD Radio transportation. + */ + TRAFFIC, + + /** + * Weather. + */ + WEATHER, + + /** + * News. + */ + NEWS, + + /** + * DAB event, special event. + */ + EVENT, + + /** + * DAB sport report, RDS sports. + */ + SPORT, + + /** + * All others. + */ + MISC, +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl new file mode 100644 index 0000000000..11da39c02b --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Configuration flags to be used with isConfigFlagSet and setConfigFlag methods + * of IBroadcastRadio. + */ +@VintfStability +@Backing(type="int") +@JavaDerive(equals=true, toString=true) +enum ConfigFlag { + /** + * Forces mono audio stream reception. + * + * Analog broadcasts can recover poor reception conditions by jointing + * stereo channels into one. Mainly for, but not limited to AM/FM. + */ + FORCE_MONO = 1, + + /** + * Forces the analog playback for the supporting radio technology. + * + * User may disable digital playback for FM HD Radio or hybrid FM/DAB with + * this option. This is purely user choice, ie. does not reflect digital- + * analog handover state managed from the HAL implementation side. + * + * Some radio technologies may not support this, ie. DAB. + */ + FORCE_ANALOG, + + /** + * Forces the digital playback for the supporting radio technology. + * + * User may disable digital-analog handover that happens with poor + * reception conditions. With digital forced, the radio will remain silent + * instead of switching to analog channel if it's available. This is purely + * user choice, it does not reflect the actual state of handover. + */ + FORCE_DIGITAL, + + /** + * RDS Alternative Frequencies. + * + * If set and the currently tuned RDS station broadcasts on multiple + * channels, radio tuner automatically switches to the best available + * alternative. + */ + RDS_AF, + + /** + * RDS region-specific program lock-down. + * + * Allows user to lock to the current region as they move into the + * other region. + */ + RDS_REG, + + /** + * Enables DAB-DAB hard- and implicit-linking (the same content). + */ + DAB_DAB_LINKING, + + /** + * Enables DAB-FM hard- and implicit-linking (the same content). + */ + DAB_FM_LINKING, + + /** + * Enables DAB-DAB soft-linking (related content). + */ + DAB_DAB_SOFT_LINKING, + + /** + * Enables DAB-FM soft-linking (related content). + */ + DAB_FM_SOFT_LINKING, +} diff --git a/wifi/offload/1.0/IOffloadCallback.hal b/broadcastradio/aidl/android/hardware/broadcastradio/DabTableEntry.aidl similarity index 50% rename from wifi/offload/1.0/IOffloadCallback.hal rename to broadcastradio/aidl/android/hardware/broadcastradio/DabTableEntry.aidl index 4888125d4e..13c20b0619 100644 --- a/wifi/offload/1.0/IOffloadCallback.hal +++ b/broadcastradio/aidl/android/hardware/broadcastradio/DabTableEntry.aidl @@ -1,5 +1,5 @@ /* - * Copyright 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,20 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.hardware.wifi.offload@1.0; -interface IOffloadCallback { +package android.hardware.broadcastradio; + +/** + * An entry in regional configuration for DAB. + * + *

This defines a frequency table row for ensembles. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable DabTableEntry { /** - * Interface for the Offload HAL to return scan events to the client + * Channel name, i.e. 5A, 7B. * - * @param scanResult a vector of scan result objects + * It must match the following regular expression: + * /^[A-Z0-9][A-Z0-9 ]{0,5}[A-Z0-9]$/ (2-7 uppercase alphanumeric characters + * without spaces allowed at the beginning nor end). */ - oneway onScanResult(vec scanResult); + String label; + /** - * Interface for the Offload HAL to inform the client of error conditions - * see OffloadStatus for the error conditions to be reported - * - * @param status OffloadStatus + * Frequency, in kHz. */ - oneway onError(OffloadStatus status); -}; + int frequencyKhz; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/IAnnouncementListener.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/IAnnouncementListener.aidl new file mode 100644 index 0000000000..f6021c130c --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/IAnnouncementListener.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.Announcement; + +/** + * Callback interface for announcement listener. + * + * For typical configuration, the listener is a broadcast radio service. + */ +@VintfStability +interface IAnnouncementListener { + /** + * Called whenever announcement list has changed. + * + * @param announcements The complete list of currently active announcements. + */ + oneway void onListUpdated(in Announcement[] announcements); +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/IBroadcastRadio.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/IBroadcastRadio.aidl new file mode 100644 index 0000000000..0f88fc0dde --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/IBroadcastRadio.aidl @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.AmFmRegionConfig; +import android.hardware.broadcastradio.AnnouncementType; +import android.hardware.broadcastradio.ConfigFlag; +import android.hardware.broadcastradio.DabTableEntry; +import android.hardware.broadcastradio.IAnnouncementListener; +import android.hardware.broadcastradio.ICloseHandle; +import android.hardware.broadcastradio.ITunerCallback; +import android.hardware.broadcastradio.ProgramFilter; +import android.hardware.broadcastradio.ProgramSelector; +import android.hardware.broadcastradio.Properties; +import android.hardware.broadcastradio.VendorKeyValue; + +/** + * Represents a hardware broadcast radio module. A single module may contain + * multiple hardware tuners (i.e. with an additional background tuner), but the + * layers above the HAL see them as a single logical unit. + */ +@VintfStability +interface IBroadcastRadio { + /** + * Invalid identifier for {@link IBroadcastRadio#getImage}. + */ + const int INVALID_IMAGE = 0; + + /** + * If the antenna is disconnected from the beginning, the + * {@link ITunerCallback#onAntennaStateChange} callback must be + * called within this time. + */ + const int ANTENNA_STATE_CHANGE_TIMEOUT_MS = 100; + + /** + * All chunks of a signal program list update must be transmitted + * within this time. + */ + const int LIST_COMPLETE_TIMEOUT_MS = 300000; + + /** + * All tune, seek and step operations must be completed within + * this time. + */ + const int TUNER_TIMEOUT_MS = 30000; + + /** + * Returns module properties: a description of a module and its + * capabilities. This method must not fail. + * + * @return Module description. + */ + Properties getProperties(); + + /** + * Fetches current or possible AM/FM region configuration. + * + * If the tuner doesn't support AM/FM, a service-specific error + * {@link Result#NOT_SUPPORTED} will be returned. + * + * @param full If {@code true}, returns full hardware capabilities. + * If {@code false}, returns current regional configuration. + * @return config Hardware capabilities (full={@code true}) or current configuration + * (full={@code false}). + */ + AmFmRegionConfig getAmFmRegionConfig(in boolean full); + + /** + * Fetches current DAB region configuration. + * + * If tuner doesn't support DAB, a service-specific error + * {@link Result#NOT_SUPPORTED} wiil be returned. + * + * @return config Current configuration. + */ + DabTableEntry[] getDabRegionConfig(); + + /** + * Sets callback interface. + * + * It is expected that there will only ever be a single callback set. + * If called when a callback is already set, the existing one should be + * replaced with the new callback. + * + * If the callback to be set is null, a service-specific error + * {@link Result#INVALID_ARGUMENTS} will be returned; if the callback + * is not set successfully, a service-specific error + * {@link Result#NOT_SUPPORTED} should be returned. + * + * @param callback The callback interface used for BroadcastRadio HAL. + */ + void setTunerCallback(in ITunerCallback callback); + + /** + * Unsets callback interface. + * + * The existing callback is set to null. + */ + void unsetTunerCallback(); + + /** + * Tunes to a specified program. + * + * Automatically cancels pending tune(), seek() or step(). + * The method should first check whether tune can be processed by the status + * of tuner and inputs, schedule tune task, and then return status + * immediately. If a non-null callback is not set, a service-specific + * error {@link Result#INVALID_STATE} will be returned; if the program + * selector doesn't contain any supported identifier, a service-specific error + * {@link Result#NOT_SUPPORTED} will be returned; if the program selector + * contains identifiers in invalid format (i.e. out of range), a + * service-specific error {@link Result#INVALID_ARGUMENTS} will be returned; + * otherwise, OK will be returned as status. Tune task should be processed + * asynchronously after the method returns status. If the method returns OK, + * {@link ITunerCallback#tuneFailed} or + * {@link ITunerCallback#currentProgramInfoChanged} callback must be called + * after the tune task completes. + * + * @param program Program to tune to. + */ + void tune(in ProgramSelector program); + + /** + * Seeks the next valid program on the "air". + * + * Advance to the next detected program and stay there. + * + * Automatically cancels pending tune(), seek() or step(). + * The method should first check whether seek can be processed by the status + * of tuner and inputs, schedule seek task, and then return status + * immediately. If a non-null callback is not set, a service-specific + * error {@link Result#INVALID_STATE} will be returned; otherwise, OK will + * be returned as status. Seek task should be processed asynchronously + * after the method returns status. If the method returns OK, + * {@link ITunerCallback#tuneFailed} or + * {@link ITunerCallback#currentProgramInfoChanged} callback must be called + * after the seek task completes. + * + * The skipSubChannel parameter is used to skip digital radio subchannels: + * - HD Radio SPS; + * - DAB secondary service. + * + * As an implementation detail, the HAL has the option to perform an actual + * seek or select the next program from the list retrieved in the + * background. + * + * @param directionUp {@code true} to change towards higher numeric values + * (frequency, channel number), {@code false} towards + * lower. + * @param skipSubChannel Don't tune to subchannels. + */ + void seek(in boolean directionUp, in boolean skipSubChannel); + + /** + * Steps to the adjacent channel, which may not be occupied by any program. + * + * Automatically cancels pending tune(), seek() or step(). + * The method should first check whether step can be processed by the status + * of tuner and inputs, schedule step task, and then return status + * immediately. If a non-null callback is not set, service-specific + * error {@link Result#INVALID_STATE} will be returned; if tuning to an + * unoccupied channel is not supported (i.e. for satellite radio), a + * service-specific error {@link Result#NOT_SUPPORTED} will be returned; + * otherwise, OK should be returned as status. Step task should be + * processed asynchronously after the method returns status. If the + * method returns OK, {@link ITunerCallback#tuneFailed} or + * {@link currentProgramInfoChanged} callback must be called after the + * step task completes. + * + * @param directionUp {@code true} to change towards higher numeric values + * (frequency, channel number), {@code false} towards lower. + */ + void step(in boolean directionUp); + + /** + * Cancels pending tune(), seek() or step(). + * + * If there is no such operation running, the call can be ignored. + * If cancel is called after the HAL completes an operation (tune, seek, and step) + * and before the callback completions, the cancel can be ignored and the callback + * should complete. + */ + void cancel(); + + /** + * Applies a filter to the program list and starts sending program list + * update over {@link ITunerCallback#onProgramListUpdated} callback. + * + * There may be only one updates stream active at the moment. Calling this + * method again must result in cancelling the pending update request. + * + * This call clears the program list on the client side, the HAL must send + * the whole list again. + * + * If the program list scanning hardware (i.e. background tuner) is + * unavailable at the moment, the call must succeed and start updates + * when it becomes available. + * + * If the program list scanning is not supported by the hardware, a + * service-specific error {@link Result#NOT_SUPPORTED} will be returned. + * + * @param filter Filter to apply on the fetched program list. + */ + void startProgramListUpdates(in ProgramFilter filter); + + /** + * Stops sending program list updates. + * + * If stopProgramListUpdates is called after the HAL completes a program list update + * and before the onCurrentProgramInfoChanged callback completions, + * stopProgramListUpdates can be ignored and the callback should complete. + */ + void stopProgramListUpdates(); + + /** + * Fetches the current setting of a given config flag. + * + * The success/failure result must be consistent with setConfigFlag. + * + * If the flag is not applicable, a service-specific error + * {@link Result#INVALID_STATE} will be returned. If the flag is not + * supported at all, a service-specific error {@link Result#NOT_SUPPORTED} + * will be returned. + * + * @return the current value of the flag, if succeed. + */ + boolean isConfigFlagSet(in ConfigFlag flag); + + /** + * Sets the config flag. + * + * The success/failure result must be consistent with isConfigFlagSet. + * + * If the flag is not applicable, a service-specific error + * {@link Result#INVALID_STATE} will be returned. If the flag is not + * supported at all, a service-specific error {@link Result#NOT_SUPPORTED} + * will be returned. + * + * @param flag Flag to set. + * @param value The new value of a given flag. + */ + void setConfigFlag(in ConfigFlag flag, in boolean value); + + /** + * Generic method for setting vendor-specific parameter values. + * The framework does not interpret the parameters, they are passed + * in an opaque manner between a vendor application and HAL. + * + * Framework does not make any assumptions on the keys or values, other than + * ones stated in VendorKeyValue documentation (a requirement of key + * prefixes). + * + * For each pair in the result array, the key must be one of the keys + * contained in the input (possibly with wildcards expanded), and the value + * must be a vendor-specific result status (i.e. the string "OK" or an error + * code). The implementation may choose to return an empty array, or only + * return a status for a subset of the provided inputs, at its discretion. + * + * Application and HAL must not use keys with unknown prefix. In particular, + * it must not place a key-value pair in results array for unknown key from + * parameters array - instead, an unknown key should simply be ignored. + * In other words, results array may contain a subset of parameter keys + * (however, the framework doesn't enforce a strict subset - the only + * formal requirement is vendor domain prefix for keys). + * + * @param parameters Vendor-specific key-value pairs. + * @return Operation completion status for parameters being set. + */ + VendorKeyValue[] setParameters(in VendorKeyValue[] parameters); + + /** + * Generic method for retrieving vendor-specific parameter values. + * The framework does not interpret the parameters, they are passed + * in an opaque manner between a vendor application and HAL. + * + * Framework does not cache set/get requests, so it's allowed for + * getParameter to return a different value than previous setParameter call. + * + * The syntax and semantics of keys are up to the vendor (as long as prefix + * rules are obeyed). For instance, vendors may include some form of + * wildcard support. In such case, result array may be of different size + * than requested keys array. However, wildcards are not recognized by + * framework and they are passed as-is to the HAL implementation. + * + * Unknown keys must be ignored and not placed into results array. + * + * @param keys Parameter keys to fetch. + * @return Vendor-specific key-value pairs. + */ + VendorKeyValue[] getParameters(in String[] keys); + + /** + * Fetches image from radio module cache. + * + * This is out-of-band transport mechanism for images carried with metadata. + * The metadata array only passes the identifier, so the client may cache + * images or even not fetch them. + * + * The identifier may be any arbitrary number (i.e. sha256 prefix) selected + * by the vendor. It must be stable so the application may cache it. + * + * The data must be a valid PNG, JPEG, GIF or BMP file, and must be less + * than 1MB, due to hard limit on binder transaction buffer. + * + * Image data with an invalid format must be handled gracefully in the same + * way as a missing image. + * + * The image identifier may become invalid after some time from passing it + * with metadata struct (due to resource cleanup at the HAL implementation). + * However, it must remain valid for a currently tuned program at least + * until onCurrentProgramInfoChanged is called. + * + * @param id Identifier of an image (value of {@link IBroadcastRadio#INVALID_IMAGE} + * is reserved and must be treated as invalid image). + * @return A binary blob with image data + * or a zero-length array if identifier doesn't exist. + */ + byte[] getImage(in int id); + + /** + * Registers announcement listener. + * + * If there is at least one observer registered, HAL implementation must + * notify about announcements. + * + * If the observer dies, the HAL implementation must unregister observer + * automatically. + * + * If the tuner doesn't support announcements, a service-specific error + * {@link Result#NOT_SUPPORTED} will be returned. + * + * @param listener The listener interface. + * @param enabled The list of announcement types to watch for. + * @return a handle to unregister observer. + */ + ICloseHandle registerAnnouncementListener( + in IAnnouncementListener listener, in AnnouncementType[] enabled); +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ICloseHandle.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ICloseHandle.aidl new file mode 100644 index 0000000000..4a3240b9e2 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ICloseHandle.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Represents a generic close handle to remove a callback that doesn't need + * active interface. + */ +@VintfStability +interface ICloseHandle { + /** + * Closes the handle. + * + * The call must not fail and must only be issued once. + * + * After the close call is executed, no other calls to this interface + * are allowed. If the call is issued second time, a service-specific + * error {@link Result#INVALID_STATE} will be returned. + */ + void close(); +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ITunerCallback.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ITunerCallback.aidl new file mode 100644 index 0000000000..8de12c844d --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ITunerCallback.aidl @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.ConfigFlag; +import android.hardware.broadcastradio.ProgramInfo; +import android.hardware.broadcastradio.ProgramListChunk; +import android.hardware.broadcastradio.ProgramSelector; +import android.hardware.broadcastradio.Result; +import android.hardware.broadcastradio.VendorKeyValue; + +@VintfStability +oneway interface ITunerCallback { + /** + * Method called by the HAL when a tuning operation fails asynchronously + * following {@link IBroadcastRadio#tune}, {@link IBroadcastRadio#seek} + * or {@link IBroadcastRadio#step}. + * + * This callback is only called when the tune(), seek() or step() command + * succeeds without returning any error at first. + * + * @param result {@link Result#TIMEOUT} in case that tune(), seek() or + * step() is not completed within + * @link IBroadcastRadio#TUNER_TIMEOUT_MS} + * or {@link Result#CANCELED} if the command was canceled. + * @param selector A ProgramSelector structure passed from tune() call; + * empty for step() and seek(). + */ + void onTuneFailed(in Result result, in ProgramSelector selector); + + /** + * Method called by the HAL when current program information (including + * metadata) is updated. It must be called when {@link IBroadcastRadio#tune} + * {@link IBroadcastRadio#seek} or {@link IBroadcastRadio#step} command + * succeeds. + * + * This is also called when the radio tuned to the static (not a valid + * station), see {@link ProgramInfo#FLAG_TUNABLE} flag. + * + * @param info Current program information. + */ + void onCurrentProgramInfoChanged(in ProgramInfo info); + + /** + * A delta update of the program list, called whenever there's a change in + * the list. + * + * If there are frequent changes, HAL implementation must throttle the rate + * of the updates. + * + * There is a hard limit on binder transaction buffer, and the list must + * not exceed it. For large lists, HAL implementation must split them to + * multiple chunks, no larger than 500kiB each, and call this program list + * update callback method separately. + * + * @param chunk A chunk of the program list update. + */ + void onProgramListUpdated(in ProgramListChunk chunk); + + /** + * Method called by the HAL when the antenna gets connected or disconnected. + * + * For broadcast radio service, client must assume the antenna is connected. + * If it's not, then antennaStateChange must be called within + * {@link IBroadcastRadio#ANTENNA_STATE_CHANGE_TIMEOUT_MS} to indicate that. + * + * @param connected {@code true} if the antenna is now connected, {@code false} + * otherwise. + */ + void onAntennaStateChange(in boolean connected); + + /** + * Generic callback for passing updates to config flags. + * + * It's up to the HAL implementation if and how to implement this callback, + * as long as it obeys the prefix rule. However, setConfigFlag must not + * trigger this callback, while an internal event can change config flag + * asynchronously at the HAL layer. + * + * @param flag Flag that has changed. + * @param value The new value of the given flag. + */ + void onConfigFlagUpdated(in ConfigFlag flag, in boolean value); + + /** + * Generic callback for passing updates to vendor-specific parameter values. + * The framework does not interpret the parameters, they are passed + * in an opaque manner between a vendor application and HAL. + * + * It's up to the HAL implementation if and how to implement this callback, + * as long as it obeys the prefix rule. In particular, only selected keys + * may be notified this way. However, setParameters must not trigger + * this callback, while an internal event can change parameters + * asynchronously at the HAL layer. + * + * @param parameters Vendor-specific key-value pairs, + * opaque to Android framework. + */ + void onParametersUpdated(in VendorKeyValue[] parameters); +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl new file mode 100644 index 0000000000..646c502660 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Type of program identifier component. + * + * Each identifier type corresponds to exactly one radio technology, + * i.e. DAB_ENSEMBLE is specifically for DAB. + * + * VENDOR identifier types must be opaque to the framework. + * + * The value format for each (but VENDOR_*) identifier is strictly defined + * to maintain interoperability between devices made by different vendors. + * + * All other values are reserved for future use. + * Values not matching any enumerated constant must be ignored. + */ +@VintfStability +@Backing(type="int") +@JavaDerive(equals=true, toString=true) +enum IdentifierType { + /** + * Primary/secondary identifier for vendor-specific radio technology. + * The value format is determined by a vendor. + * + * The vendor identifiers have limited serialization capabilities - see + * ProgramSelector description. + */ + VENDOR_START = 1000, + + /** + * See VENDOR_START + */ + VENDOR_END = 1999, + + /** + * Undefined identifier type. + */ + INVALID = 0, + + /** + * Primary identifier for analogue (without RDS) AM/FM stations: + * frequency in kHz. + * + * This identifier also contains band information: + * - <500kHz: AM LW; + * - 500kHz - 1705kHz: AM MW; + * - 1.71MHz - 30MHz: AM SW; + * - >60MHz: FM. + */ + AMFM_FREQUENCY_KHZ, + + /** + * 16bit primary identifier for FM RDS station. + */ + RDS_PI, + + /** + * 64bit compound primary identifier for HD Radio. + * + * Consists of (from the LSB): + * - 32bit: Station ID number; + * - 4bit: HD Radio subchannel; + * - 18bit: AMFM_FREQUENCY_KHZ. + * + * While station ID number should be unique globally, it sometimes get + * abused by broadcasters (i.e. not being set at all). To ensure local + * uniqueness, AMFM_FREQUENCY_KHZ was added here. Global uniqueness is + * a best-effort - see HD_STATION_NAME. + * + * HD Radio subchannel is a value in range 0-7. + * This index is 0-based (where 0 is MPS and 1..7 are SPS), + * as opposed to HD Radio standard (where it's 1-based). + * + * The remaining bits should be set to zeros when writing on the chip side + * and ignored when read. + */ + + HD_STATION_ID_EXT, + + /** + * 64bit additional identifier for HD Radio. + * + * Due to Station ID abuse, some HD_STATION_ID_EXT identifiers may be not + * globally unique. To provide a best-effort solution, a short version of + * station name may be carried as additional identifier and may be used + * by the tuner hardware to double-check tuning. + * + * The name is limited to the first 8 A-Z0-9 characters (lowercase letters + * must be converted to uppercase). Encoded in little-endian ASCII: + * the first character of the name is the LSB. + * + * For example: "Abc" is encoded as 0x434241. + */ + HD_STATION_NAME, + + /** + * 44bit compound primary identifier for Digital Audio Broadcasting and + * Digital Multimeida Broadcasting. + * + * Consists of (from the LSB): + * - 32bit: SId; + * - 8bit: ECC code; + * - 4bit: SCIdS. + * + * SCIdS (Service Component Identifier within the Service) value + * of 0 represents the main service, while 1 and above represents + * secondary services. + * + * The remaining bits should be set to zeros when writing on the chip side + * and ignored when read. + */ + DAB_SID_EXT, + + /** + * 16bit + */ + DAB_ENSEMBLE, + + /** + * 12bit + */ + DAB_SCID, + + /** + * kHz (see AMFM_FREQUENCY_KHZ) + */ + DAB_FREQUENCY_KHZ, + + /** + * 24bit primary identifier for Digital Radio Mondiale. + */ + DRMO_SERVICE_ID, + + /** + * kHz (see AMFM_FREQUENCY_KHZ) + */ + DRMO_FREQUENCY_KHZ, + + /** + * 32bit primary identifier for SiriusXM Satellite Radio. + */ + SXM_SERVICE_ID = DRMO_FREQUENCY_KHZ + 2, + + /** + * 0-999 range + */ + SXM_CHANNEL, +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl new file mode 100644 index 0000000000..3298cac969 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * An element of metadata array. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +union Metadata { + /** + * RDS PS (string) + */ + String rdsPs; + + /** + * RDS PTY (uint8_t) + */ + int rdsPty; + + /** + * RBDS PTY (uint8_t) + */ + int rbdsPty; + + /** + * RDS RT (string) + */ + String rdsRt; + + /** + * Song title (string) + */ + String songTitle; + + /** + * Artist name (string) + */ + String songArtist; + + /** + * Album name (string) + */ + String songAlbum; + + /** + * Station icon (uint32_t, see {@link IBroadcastRadio#getImage}) + */ + int stationIcon; + + /** + * Album art (uint32_t, see {@link IBroadcastRadio#getImage}) + */ + int albumArt; + + /** + * Station name. + * + * This is a generic field to cover any radio technology. + * + * If the PROGRAM_NAME has the same content as DAB_*_NAME or RDS_PS, + * it may not be present, to preserve space - framework must repopulate + * it on the client side. + */ + String programName; + + /** + * DAB ensemble name (string) + */ + String dabEnsembleName; + + /** + * DAB ensemble name abbreviated (string). + * + * The string must be up to 8 characters long. + * + * If the short variant is present, the long (DAB_ENSEMBLE_NAME) one must be + * present as well. + */ + String dabEnsembleNameShort; + + /** + * DAB service name (string) + */ + String dabServiceName; + + /** + * DAB service name abbreviated (see DAB_ENSEMBLE_NAME_SHORT) (string) + */ + String dabServiceNameShort; + + /** + * DAB component name (string) + */ + String dabComponentName; + + /** + * DAB component name abbreviated (see DAB_ENSEMBLE_NAME_SHORT) (string) + */ + String dabComponentNameShort; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramFilter.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramFilter.aidl new file mode 100644 index 0000000000..3dd10eb81d --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramFilter.aidl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.IdentifierType; +import android.hardware.broadcastradio.ProgramIdentifier; + +/** + * Large-grain filter to the program list. + * + * This is meant to reduce binder transaction bandwidth, not for fine-grained + * filtering user might expect. + * + * The filter is designed as conjunctive normal form: the entry that passes the + * filter must satisfy all the clauses (members of this struct). Vector clauses + * are disjunctions of literals. In other words, there is AND between each + * high-level group and OR inside it. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable ProgramFilter { + /** + * List of identifier types that are filtered by the filter. + * + * If the program list entry contains at least one identifier of the type + * listed, it satisfies this condition. + * + * Empty list means no filtering on identifier type. + */ + IdentifierType[] identifierTypes; + + /** + * List of identifiers that are filtered by the filter. + * + * If the program list entry contains at least one listed identifier, + * it satisfies this condition. + * + * Empty list means no filtering on identifier. + */ + ProgramIdentifier[] identifiers; + + /** + * Includes non-tunable entries that define tree structure on the + * program list (i.e. DAB ensembles). + */ + boolean includeCategories; + + /** + * Disables updates on entry modifications. + * + * If {@code true}, 'modified' vector of {@link ProgramListChunk} must contain + * list additions only. Once the program is added to the list, it's not + * updated anymore. + */ + boolean excludeModifications; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl new file mode 100644 index 0000000000..2057d97eb0 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.IdentifierType; + +/** + * A single program identifier component, i.e. frequency or channel ID. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable ProgramIdentifier { + /** + * Maps to IdentifierType enum. + */ + IdentifierType type = IdentifierType.INVALID; + + /** + * The uint64_t value field holds the value in format described in comments + * for IdentifierType enum. + */ + long value; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl new file mode 100644 index 0000000000..7632c81e1d --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.Metadata; +import android.hardware.broadcastradio.ProgramIdentifier; +import android.hardware.broadcastradio.ProgramSelector; +import android.hardware.broadcastradio.VendorKeyValue; + +/** + * Program (channel, station) information. + * + * Carries both user-visible information (like station name) and technical + * details (tuning selector). + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable ProgramInfo { + /** + * Set when the program is currently playing live stream. + * This may result in a slightly altered reception parameters, + * usually targeted at reduced latency. + */ + const int FLAG_LIVE = 1 << 0; + + /** + * Radio stream is not playing, ie. due to bad reception conditions or + * buffering. In this state volume knob MAY be disabled to prevent user + * increasing volume too much. + */ + const int FLAG_MUTED = 1 << 1; + + /** + * Station broadcasts traffic information regularly, + * but not necessarily right now. + */ + const int FLAG_TRAFFIC_PROGRAM = 1 << 2; + + /** + * Station is broadcasting traffic information at the very moment. + */ + const int FLAG_TRAFFIC_ANNOUNCEMENT = 1 << 3; + + /** + * Station can be tuned to (not playing static). + * + * It's the same condition that would stop a seek operation + * (i.e. {@link IBroadcastRadio#seek}). + * + * By definition, this flag must be set for all items on the program list. + */ + const int FLAG_TUNABLE = 1 << 4; + + /** + * Audio stream is MONO if this bit is not set. + */ + const int FLAG_STEREO = 1 << 5; + + /** + * An identifier used to point at the program (primarily to tune to it). + * + * This field is required - its type field must not be set to + * {@link IdentifierType#INVALID}. + */ + ProgramSelector selector; + + /** + * Identifier currently used for program selection. + * + * It allows to determine which technology is currently used for reception. + * + * Some program selectors contain tuning information for different radio + * technologies (i.e. FM RDS and DAB). For example, user may tune using + * a ProgramSelector with RDS_PI primary identifier, but the tuner hardware + * may choose to use DAB technology to make actual tuning. This identifier + * must reflect that. + * + * This field is required for currently tuned program only. + * For all other items on the program list, its type field must be + * initialized to {@link IdentifierType#INVALID}. + * + * Only primary identifiers for a given radio technology are valid: + * - AMFM_FREQUENCY_KHZ for analog AM/FM; + * - RDS_PI for FM RDS; + * - HD_STATION_ID_EXT; + * - DAB_SID_EXT; + * - DRMO_SERVICE_ID; + * - SXM_SERVICE_ID; + * - VENDOR_*; + * - more might come in next minor versions of this HAL. + */ + ProgramIdentifier logicallyTunedTo; + + /** + * Identifier currently used by hardware to physically tune to a channel. + * + * Some radio technologies broadcast the same program on multiple channels, + * i.e. with RDS AF the same program may be broadcasted on multiple + * alternative frequencies; the same DAB program may be broadcast on + * multiple ensembles. This identifier points to the channel to which the + * radio hardware is physically tuned to. + * + * This field is required for currently tuned program only. + * For all other items on the program list, its type field must be + * initialized to {@link IdentifierType#INVALID}. + * + * Only physical identifiers are valid: + * - AMFM_FREQUENCY_KHZ; + * - DAB_FREQUENCY_KHZ; + * - DRMO_FREQUENCY_KHZ; + * - SXM_CHANNEL; + * - VENDOR_*; + * - more might come in next minor versions of this HAL. + */ + ProgramIdentifier physicallyTunedTo; + + /** + * Primary identifiers of related contents. + * + * Some radio technologies provide pointers to other programs that carry + * related content (i.e. DAB soft-links). This field is a list of pointers + * to other programs on the program list. + * + * This is not a list of programs that carry the same content (i.e. + * DAB hard-links, RDS AF). Switching to programs from this list usually + * require user action. + * + * Please note, that these identifiers do not have to exist on the program + * list - i.e. DAB tuner may provide information on FM RDS alternatives + * despite not supporting FM RDS. If the system has multiple tuners, another + * one may have it on its list. + * + * This field is optional. + */ + @nullable ProgramIdentifier[] relatedContent; + + /** + * Program flags. + * + * It can be a combination of {@link #FLAG_LIVE}, {@link #FLAG_MUTED}, + * {@link #FLAG_TRAFFIC_PROGRAM}, {@link #FLAG_TRAFFIC_ANNOUNCEMENT}, + * {@link #FLAG_TUNABLE}, and {@link #FLAG_STEREO}. + */ + int infoFlags; + + /** + * Signal quality measured in 0% to 100% range to be shown in the UI. + */ + int signalQuality; + + /** + * Program metadata (station name, PTY, song title). + */ + Metadata[] metadata; + + /** + * Vendor-specific information. + * + * It may be used for extra features, not supported by the platform, + * for example: paid-service=true; bitrate=320kbps. + */ + VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramListChunk.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramListChunk.aidl new file mode 100644 index 0000000000..a62d461475 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramListChunk.aidl @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.ProgramIdentifier; +import android.hardware.broadcastradio.ProgramInfo; + +/** + * An update packet of the program list. + * + * The order of entries in the arrays is unspecified. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable ProgramListChunk { + /** + * Treats all previously added entries as removed. + * + * This is meant to save binder transaction bandwidth on 'removed' array + * and provide a clear empty state. + * + * If set, 'removed' array must be null. + * + * The client may wait with taking action on this until it received the + * chunk with complete flag set (to avoid part of stations temporarily + * disappearing from the list). + */ + boolean purge; + + /** + * If false, it means there are still programs not transmitted, + * due for transmission in following updates. + * + * Used by UIs that wait for complete list instead of displaying + * programs while scanning. + * + * After the whole channel range was scanned and all discovered programs + * were transmitted, the last chunk must have set this flag to {@code true}. + * This must happen within {@link IBroadcastRadio#LIST_COMPLETE_TIMEOUT_MS} + * from the startProgramListUpdates call. If it doesn't, client may assume + * the tuner came into a bad state and display error message. + */ + boolean complete; + + /** + * Added or modified program list entries. + * + * Two entries with the same primaryId (ProgramSelector member) + * are considered the same. + */ + ProgramInfo[] modified; + + /** + * Removed program list entries. + * + * Contains primaryId (ProgramSelector member) of a program to remove. + */ + @nullable ProgramIdentifier[] removed; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramSelector.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramSelector.aidl new file mode 100644 index 0000000000..71b824b8e9 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramSelector.aidl @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.ProgramIdentifier; + +/** + * A set of identifiers necessary to tune to a given station. + * + * This can hold a combination of various identifiers, like: + * - AM/FM frequency, + * - HD Radio subchannel, + * - DAB service ID. + * + * The type of radio technology is determined by the primary identifier - if the + * primary identifier is for DAB, the program is DAB. However, a program of a + * specific radio technology may have additional secondary identifiers for other + * technologies, i.e. a satellite program may have FM fallback frequency, + * if a station broadcasts both via satellite and FM. + * + * The identifiers from VENDOR_START..VENDOR_END range have limited + * serialization capabilities: they are serialized locally, but ignored by the + * cloud services. If a program has primary id from vendor range, it's not + * synchronized with other devices at all. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable ProgramSelector { + /** + * Primary program identifier. + * + * This identifier uniquely identifies a station and can be used for + * equality check. + * + * It can hold only a subset of identifier types, one per each + * radio technology: + * - analogue AM/FM: AMFM_FREQUENCY_KHZ; + * - FM RDS: RDS_PI; + * - HD Radio: HD_STATION_ID_EXT; + * - DAB/DMB: DAB_SID_EXT; + * - Digital Radio Mondiale: DRMO_SERVICE_ID; + * - SiriusXM: SXM_SERVICE_ID; + * - vendor-specific: VENDOR_START..VENDOR_END. + */ + ProgramIdentifier primaryId; + + /** + * Secondary program identifiers. + * + * These identifiers are supplementary and can speed up tuning process, + * but the primary ID should be sufficient (i.e. RDS PI is enough to select + * a station from the list after a full band scan). + * + * Two selectors with different secondary IDs, but the same primary ID are + * considered equal. In particular, secondary IDs array may get updated for + * an entry on the program list (ie. when a better frequency for a given + * station is found). + * + * If DAB_SID_EXT is used as primaryId, using DAB_ENSEMBLE or DAB_FREQUENCY_KHZ + * as secondray identifiers can uniquely identify the DAB station. + */ + ProgramIdentifier[] secondaryIds; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Properties.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Properties.aidl new file mode 100644 index 0000000000..36cbaffafb --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/Properties.aidl @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +import android.hardware.broadcastradio.IdentifierType; +import android.hardware.broadcastradio.VendorKeyValue; + +/** + * Properties of a given broadcast radio module. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable Properties { + /** + * A company name who made the radio module. Must be a valid, registered + * name of the company itself. + * + * It must be opaque to the Android framework. + */ + String maker; + + /** + * A product name. Must be unique within the company. + * + * It must be opaque to the Android framework. + */ + String product; + + /** + * Version of the hardware module. + * + * It must be opaque to the Android framework. + */ + String version; + + /** + * Hardware serial number (for subscription services). + * + * It must be opaque to the Android framework. + */ + String serial; + + /** + * A list of supported {@link IdentifierType} values. + * + * If an identifier is supported by radio module, it means it can use it for + * tuning to ProgramSelector with either primary or secondary Identifier of + * a given type. + * + * Support for VENDOR identifier type does not guarantee compatibility, as + * other module properties (implementor, product, version) must be checked. + */ + IdentifierType[] supportedIdentifierTypes; + + /** + * Vendor-specific information. + * + * It may be used for extra features, not supported by the platform, + * for example: com.me.preset-slots=6; com.me.ultra-hd-capable={@code false}. + */ + VendorKeyValue[] vendorInfo; +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl new file mode 100644 index 0000000000..f775bd04ee --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/Result.aidl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Result for methods of BroadcastRadio AIDL HAL interfaces. + */ +@VintfStability +@Backing(type="int") +@JavaDerive(equals=true, toString=true) +enum Result { + /** + * Methods run without error. + */ + OK = 0, + + /** + * Internal error in HAL. + */ + INTERNAL_ERROR, + + /** + * Error used when the input argument for the method is invalid. + */ + INVALID_ARGUMENTS, + + /** + * Error used when the service is on invalid state (i.e. callback + * is not registered for IBroadcastRadio). + */ + INVALID_STATE, + + /** + * Error used when an operation is not supported. + */ + NOT_SUPPORTED, + + /** + * Error used when a tune, seek, or step operation is not completed + * within {@link IBroadcastRadio#TUNER_TIMEOUT_MS}. + */ + TIMEOUT, + + /** + * Error used when a tune, seek, or step operation is canceled before + * being processed. + */ + CANCELED, + + /** + * Error that does not follow into the error categories above. + */ + UNKNOWN_ERROR, +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/VendorKeyValue.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/VendorKeyValue.aidl new file mode 100644 index 0000000000..c923e926f8 --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/VendorKeyValue.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * A key-value pair for vendor-specific information to be passed as-is through + * Android framework to the front-end application. + */ +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable VendorKeyValue { + /** + * Key must start with unique vendor Java-style namespace, + * eg. 'com.somecompany.parameter1'. + */ + String key; + + /** + * Value must be passed through the framework without any changes. + * Format of this string can vary across vendors. + */ + String value; +} diff --git a/broadcastradio/aidl/default/Android.bp b/broadcastradio/aidl/default/Android.bp new file mode 100644 index 0000000000..720aa8a6fd --- /dev/null +++ b/broadcastradio/aidl/default/Android.bp @@ -0,0 +1,54 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_binary { + name: "android.hardware.broadcastradio-service.default", + relative_install_path: "hw", + init_rc: ["broadcastradio-default.rc"], + vintf_fragments: ["broadcastradio-default.xml"], + vendor: true, + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + ], + srcs: [ + "BroadcastRadio.cpp", + "main.cpp", + "VirtualProgram.cpp", + "VirtualRadio.cpp", + ], + static_libs: [ + "android.hardware.broadcastradio@common-utils-aidl-lib", + "android.hardware.broadcastradio@common-utils-lib", + ], + shared_libs: [ + "android.hardware.broadcastradio-V1-ndk", + "libbase", + "libbinder_ndk", + "liblog", + "libcutils", + ], +} diff --git a/broadcastradio/aidl/default/BroadcastRadio.cpp b/broadcastradio/aidl/default/BroadcastRadio.cpp new file mode 100644 index 0000000000..c0c475a532 --- /dev/null +++ b/broadcastradio/aidl/default/BroadcastRadio.cpp @@ -0,0 +1,802 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BroadcastRadio.h" +#include +#include "resources.h" + +#include +#include + +#include +#include + +#include + +namespace aidl::android::hardware::broadcastradio { + +using ::aidl::android::hardware::broadcastradio::utils::resultToInt; +using ::aidl::android::hardware::broadcastradio::utils::tunesTo; +using ::android::base::EqualsIgnoreCase; +using ::ndk::ScopedAStatus; +using ::std::literals::chrono_literals::operator""ms; +using ::std::literals::chrono_literals::operator""s; +using ::std::lock_guard; +using ::std::mutex; +using ::std::string; +using ::std::vector; + +namespace { + +inline constexpr std::chrono::milliseconds kSeekDelayTimeMs = 200ms; +inline constexpr std::chrono::milliseconds kStepDelayTimeMs = 100ms; +inline constexpr std::chrono::milliseconds kTuneDelayTimeMs = 150ms; +inline constexpr std::chrono::seconds kListDelayTimeS = 1s; + +// clang-format off +const AmFmRegionConfig kDefaultAmFmConfig = { + { + {87500, 108000, 100, 100}, // FM + {153, 282, 3, 9}, // AM LW + {531, 1620, 9, 9}, // AM MW + {1600, 30000, 1, 5}, // AM SW + }, + AmFmRegionConfig::DEEMPHASIS_D50, + AmFmRegionConfig::RDS}; +// clang-format on + +Properties initProperties(const VirtualRadio& virtualRadio) { + Properties prop = {}; + + prop.maker = "Android"; + prop.product = virtualRadio.getName(); + prop.supportedIdentifierTypes = vector({ + IdentifierType::AMFM_FREQUENCY_KHZ, + IdentifierType::RDS_PI, + IdentifierType::HD_STATION_ID_EXT, + IdentifierType::DAB_SID_EXT, + }); + prop.vendorInfo = vector({ + {"com.android.sample", "sample"}, + }); + + return prop; +} + +// Makes ProgramInfo that does not point to any particular program +ProgramInfo makeSampleProgramInfo(const ProgramSelector& selector) { + ProgramInfo info = {}; + info.selector = selector; + info.logicallyTunedTo = + utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, + utils::getId(selector, IdentifierType::AMFM_FREQUENCY_KHZ)); + info.physicallyTunedTo = info.logicallyTunedTo; + return info; +} + +static bool checkDumpCallerHasWritePermissions(int fd) { + uid_t uid = AIBinder_getCallingUid(); + if (uid == AID_ROOT || uid == AID_SHELL || uid == AID_SYSTEM) { + return true; + } + dprintf(fd, "BroadcastRadio HAL dump must be root, shell or system\n"); + return false; +} + +} // namespace + +BroadcastRadio::BroadcastRadio(const VirtualRadio& virtualRadio) + : mVirtualRadio(virtualRadio), + mAmFmConfig(kDefaultAmFmConfig), + mProperties(initProperties(virtualRadio)) { + const auto& ranges = kDefaultAmFmConfig.ranges; + if (ranges.size() > 0) { + ProgramSelector sel = utils::makeSelectorAmfm(ranges[0].lowerBound); + VirtualProgram virtualProgram = {}; + if (mVirtualRadio.getProgram(sel, &virtualProgram)) { + mCurrentProgram = virtualProgram.selector; + } else { + mCurrentProgram = sel; + } + } +} + +BroadcastRadio::~BroadcastRadio() { + mThread.reset(); +} + +ScopedAStatus BroadcastRadio::getAmFmRegionConfig(bool full, AmFmRegionConfig* returnConfigs) { + if (full) { + *returnConfigs = {}; + returnConfigs->ranges = vector({ + {65000, 108000, 10, 0}, // FM + {150, 30000, 1, 0}, // AM + }); + returnConfigs->fmDeemphasis = + AmFmRegionConfig::DEEMPHASIS_D50 | AmFmRegionConfig::DEEMPHASIS_D75; + returnConfigs->fmRds = AmFmRegionConfig::RDS | AmFmRegionConfig::RBDS; + return ScopedAStatus::ok(); + } + lock_guard lk(mMutex); + *returnConfigs = mAmFmConfig; + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::getDabRegionConfig(vector* returnConfigs) { + *returnConfigs = { + {"5A", 174928}, {"7D", 194064}, {"8A", 195936}, {"8B", 197648}, {"9A", 202928}, + {"9B", 204640}, {"9C", 206352}, {"10B", 211648}, {"10C", 213360}, {"10D", 215072}, + {"11A", 216928}, {"11B", 218640}, {"11C", 220352}, {"11D", 222064}, {"12A", 223936}, + {"12B", 225648}, {"12C", 227360}, {"12D", 229072}, + }; + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::getImage(int32_t id, vector* returnImage) { + LOG(DEBUG) << __func__ << ": fetching image " << std::hex << id; + + if (id == resources::kDemoPngId) { + *returnImage = vector(resources::kDemoPng, std::end(resources::kDemoPng)); + return ScopedAStatus::ok(); + } + + LOG(WARNING) << __func__ << ": image of id " << std::hex << id << " doesn't exist"; + *returnImage = {}; + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::getProperties(Properties* returnProperties) { + lock_guard lk(mMutex); + *returnProperties = mProperties; + return ScopedAStatus::ok(); +} + +ProgramInfo BroadcastRadio::tuneInternalLocked(const ProgramSelector& sel) { + LOG(DEBUG) << __func__ << ": tune (internal) to " << sel.toString(); + + VirtualProgram virtualProgram = {}; + ProgramInfo programInfo; + if (mVirtualRadio.getProgram(sel, &virtualProgram)) { + mCurrentProgram = virtualProgram.selector; + programInfo = virtualProgram; + } else { + mCurrentProgram = sel; + programInfo = makeSampleProgramInfo(sel); + } + mIsTuneCompleted = true; + + return programInfo; +} + +ScopedAStatus BroadcastRadio::setTunerCallback(const std::shared_ptr& callback) { + LOG(DEBUG) << __func__ << ": setTunerCallback"; + + if (callback == nullptr) { + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::INVALID_ARGUMENTS), "cannot set tuner callback to null"); + } + + lock_guard lk(mMutex); + mCallback = callback; + + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::unsetTunerCallback() { + LOG(DEBUG) << __func__ << ": unsetTunerCallback"; + + lock_guard lk(mMutex); + mCallback = nullptr; + + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::tune(const ProgramSelector& program) { + LOG(DEBUG) << __func__ << ": tune to " << program.toString() << "..."; + + lock_guard lk(mMutex); + if (mCallback == nullptr) { + LOG(ERROR) << __func__ << ": callback is not registered."; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::INVALID_STATE), "callback is not registered"); + } + + if (!utils::isSupported(mProperties, program)) { + LOG(WARNING) << __func__ << ": selector not supported: " << program.toString(); + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::NOT_SUPPORTED), "selector is not supported"); + } + + if (!utils::isValid(program)) { + LOG(ERROR) << __func__ << ": selector is not valid: " << program.toString(); + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::INVALID_ARGUMENTS), "selector is not valid"); + } + + cancelLocked(); + + mIsTuneCompleted = false; + std::shared_ptr callback = mCallback; + auto task = [this, program, callback]() { + ProgramInfo programInfo = {}; + { + lock_guard lk(mMutex); + programInfo = tuneInternalLocked(program); + } + callback->onCurrentProgramInfoChanged(programInfo); + }; + auto cancelTask = [program, callback]() { callback->onTuneFailed(Result::CANCELED, program); }; + mThread->schedule(task, cancelTask, kTuneDelayTimeMs); + + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::seek(bool directionUp, bool skipSubChannel) { + LOG(DEBUG) << __func__ << ": seek " << (directionUp ? "up" : "down") << " with skipSubChannel? " + << (skipSubChannel ? "yes" : "no") << "..."; + + lock_guard lk(mMutex); + if (mCallback == nullptr) { + LOG(ERROR) << __func__ << ": callback is not registered."; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::INVALID_STATE), "callback is not registered"); + } + + cancelLocked(); + + const auto& list = mVirtualRadio.getProgramList(); + std::shared_ptr callback = mCallback; + auto cancelTask = [callback]() { callback->onTuneFailed(Result::CANCELED, {}); }; + if (list.empty()) { + mIsTuneCompleted = false; + auto task = [callback]() { + LOG(DEBUG) << "seek: program list is empty, seek couldn't stop"; + + callback->onTuneFailed(Result::TIMEOUT, {}); + }; + mThread->schedule(task, cancelTask, kSeekDelayTimeMs); + + return ScopedAStatus::ok(); + } + + // The list is not sorted here since it has already stored in VirtualRadio. + // If the list is not sorted in advance, it should be sorted here. + const auto& current = mCurrentProgram; + auto found = std::lower_bound(list.begin(), list.end(), VirtualProgram({current})); + if (directionUp) { + if (found < list.end() - 1) { + if (tunesTo(current, found->selector)) found++; + } else { + found = list.begin(); + } + } else { + if (found > list.begin() && found != list.end()) { + found--; + } else { + found = list.end() - 1; + } + } + const ProgramSelector tuneTo = found->selector; + + mIsTuneCompleted = false; + auto task = [this, tuneTo, callback]() { + ProgramInfo programInfo = {}; + { + lock_guard lk(mMutex); + programInfo = tuneInternalLocked(tuneTo); + } + callback->onCurrentProgramInfoChanged(programInfo); + }; + mThread->schedule(task, cancelTask, kSeekDelayTimeMs); + + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::step(bool directionUp) { + LOG(DEBUG) << __func__ << ": step " << (directionUp ? "up" : "down") << "..."; + + lock_guard lk(mMutex); + if (mCallback == nullptr) { + LOG(ERROR) << __func__ << ": callback is not registered."; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::INVALID_STATE), "callback is not registered"); + } + + cancelLocked(); + + if (!utils::hasId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ)) { + LOG(WARNING) << __func__ << ": can't step in anything else than AM/FM"; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::NOT_SUPPORTED), "cannot step in anything else than AM/FM"); + } + + int64_t stepTo = utils::getId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ); + std::optional range = getAmFmRangeLocked(); + if (!range) { + LOG(ERROR) << __func__ << ": can't find current band or tune operation is in process"; + ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::INTERNAL_ERROR), + "can't find current band or tune operation is in process"); + } + + if (directionUp) { + stepTo += range->spacing; + } else { + stepTo -= range->spacing; + } + if (stepTo > range->upperBound) { + stepTo = range->lowerBound; + } + if (stepTo < range->lowerBound) { + stepTo = range->upperBound; + } + + mIsTuneCompleted = false; + std::shared_ptr callback = mCallback; + auto task = [this, stepTo, callback]() { + ProgramInfo programInfo; + { + lock_guard lk(mMutex); + programInfo = tuneInternalLocked(utils::makeSelectorAmfm(stepTo)); + } + callback->onCurrentProgramInfoChanged(programInfo); + }; + auto cancelTask = [callback]() { callback->onTuneFailed(Result::CANCELED, {}); }; + mThread->schedule(task, cancelTask, kStepDelayTimeMs); + + return ScopedAStatus::ok(); +} + +void BroadcastRadio::cancelLocked() { + LOG(DEBUG) << __func__ << ": cancelling current operations..."; + + mThread->cancelAll(); + if (mCurrentProgram.primaryId.type != IdentifierType::INVALID) { + mIsTuneCompleted = true; + } +} + +ScopedAStatus BroadcastRadio::cancel() { + LOG(DEBUG) << __func__ << ": cancel pending tune, seek and step..."; + + lock_guard lk(mMutex); + cancelLocked(); + + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::startProgramListUpdates(const ProgramFilter& filter) { + LOG(DEBUG) << __func__ << ": requested program list updates, filter = " << filter.toString() + << "..."; + + auto filterCb = [&filter](const VirtualProgram& program) { + return utils::satisfies(filter, program.selector); + }; + + lock_guard lk(mMutex); + + const auto& list = mVirtualRadio.getProgramList(); + vector filteredList; + std::copy_if(list.begin(), list.end(), std::back_inserter(filteredList), filterCb); + + auto task = [this, filteredList]() { + std::shared_ptr callback; + { + lock_guard lk(mMutex); + if (mCallback == nullptr) { + LOG(WARNING) << "Callback is null when updating program List"; + return; + } + callback = mCallback; + } + + ProgramListChunk chunk = {}; + chunk.purge = true; + chunk.complete = true; + chunk.modified = vector(filteredList.begin(), filteredList.end()); + + callback->onProgramListUpdated(chunk); + }; + mThread->schedule(task, kListDelayTimeS); + + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::stopProgramListUpdates() { + LOG(DEBUG) << __func__ << ": requested program list updates to stop..."; + // TODO(b/243681584) Implement stop program list updates method + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::isConfigFlagSet(ConfigFlag flag, [[maybe_unused]] bool* returnIsSet) { + LOG(DEBUG) << __func__ << ": flag = " << toString(flag); + + LOG(INFO) << __func__ << ": getting ConfigFlag is not supported"; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::NOT_SUPPORTED), "getting ConfigFlag is not supported"); +} + +ScopedAStatus BroadcastRadio::setConfigFlag(ConfigFlag flag, bool value) { + LOG(DEBUG) << __func__ << ": flag = " << toString(flag) << ", value = " << value; + + LOG(INFO) << __func__ << ": setting ConfigFlag is not supported"; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::NOT_SUPPORTED), "setting ConfigFlag is not supported"); +} + +ScopedAStatus BroadcastRadio::setParameters( + [[maybe_unused]] const vector& parameters, + vector* returnParameters) { + // TODO(b/243682330) Support vendor parameter functionality + *returnParameters = {}; + return ScopedAStatus::ok(); +} + +ScopedAStatus BroadcastRadio::getParameters([[maybe_unused]] const vector& keys, + vector* returnParameters) { + // TODO(b/243682330) Support vendor parameter functionality + *returnParameters = {}; + return ScopedAStatus::ok(); +} + +std::optional BroadcastRadio::getAmFmRangeLocked() const { + if (!mIsTuneCompleted) { + LOG(WARNING) << __func__ << ": tune operation is in process"; + return {}; + } + if (!utils::hasId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ)) { + LOG(WARNING) << __func__ << ": current program does not has AMFM_FREQUENCY_KHZ identifier"; + return {}; + } + + int64_t freq = utils::getId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ); + for (const auto& range : mAmFmConfig.ranges) { + if (range.lowerBound <= freq && range.upperBound >= freq) { + return range; + } + } + + return {}; +} + +ScopedAStatus BroadcastRadio::registerAnnouncementListener( + [[maybe_unused]] const std::shared_ptr& listener, + const vector& enabled, std::shared_ptr* returnCloseHandle) { + LOG(DEBUG) << __func__ << ": registering announcement listener for " + << utils::vectorToString(enabled); + + // TODO(b/243683842) Support announcement listener + *returnCloseHandle = nullptr; + LOG(INFO) << __func__ << ": registering announcementListener is not supported"; + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + resultToInt(Result::NOT_SUPPORTED), + "registering announcementListener is not supported"); +} + +binder_status_t BroadcastRadio::dump(int fd, const char** args, uint32_t numArgs) { + if (numArgs == 0) { + return dumpsys(fd); + } + + string option = string(args[0]); + if (EqualsIgnoreCase(option, "--help")) { + return cmdHelp(fd); + } else if (EqualsIgnoreCase(option, "--tune")) { + return cmdTune(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--seek")) { + return cmdSeek(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--step")) { + return cmdStep(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--cancel")) { + return cmdCancel(fd, numArgs); + } else if (EqualsIgnoreCase(option, "--startProgramListUpdates")) { + return cmdStartProgramListUpdates(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--stopProgramListUpdates")) { + return cmdStopProgramListUpdates(fd, numArgs); + } + dprintf(fd, "Invalid option: %s\n", option.c_str()); + return STATUS_BAD_VALUE; +} + +binder_status_t BroadcastRadio::dumpsys(int fd) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + lock_guard lk(mMutex); + dprintf(fd, "AmFmRegionConfig: %s\n", mAmFmConfig.toString().c_str()); + dprintf(fd, "Properties: %s \n", mProperties.toString().c_str()); + if (mIsTuneCompleted) { + dprintf(fd, "Tune completed\n"); + } else { + dprintf(fd, "Tune not completed\n"); + } + if (mCallback == nullptr) { + dprintf(fd, "No ITunerCallback registered\n"); + } else { + dprintf(fd, "ITunerCallback registered\n"); + } + dprintf(fd, "CurrentProgram: %s \n", mCurrentProgram.toString().c_str()); + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdHelp(int fd) const { + dprintf(fd, "Usage: \n\n"); + dprintf(fd, "[no args]: dumps focus listener / gain callback registered status\n"); + dprintf(fd, "--help: shows this help\n"); + dprintf(fd, + "--tune amfm : tunes amfm radio to frequency (in Hz) specified: " + "frequency (int) \n" + "--tune dab : tunes dab radio to sid and ensemble specified: " + "sidExt (int), ensemble (int) \n"); + dprintf(fd, + "--seek [up|down] : seek with direction (up or down) and " + "option whether skipping sub channel: " + "skipSubChannel (string, should be either \"true\" or \"false\")\n"); + dprintf(fd, "--step [up|down]: step in direction (up or down) specified\n"); + dprintf(fd, "--cancel: cancel current pending tune, step, and seek\n"); + dprintf(fd, + "--startProgramListUpdates " + ": start update program list with the filter specified: " + "identifier types (string, in format ,,..., or \"null\" (if empty), " + "where TYPE is int), " + "program identifiers (string, in format " + ":,:,...,: or \"null\" (if empty), " + "where TYPE is int and VALUE is long), " + "includeCategories (string, should be either \"true\" or \"false\"), " + "excludeModifications (string, should be either \"true\" or \"false\")\n"); + dprintf(fd, "--stopProgramListUpdates: stop current pending program list updates\n"); + dprintf(fd, + "Note on for --startProgramList command: it is int for identifier type. " + "Please see broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl " + "for its definition.\n"); + dprintf(fd, + "Note on for --startProgramList command: it is long type for identifier value. " + "Please see broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl " + "for its value.\n"); + + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdTune(int fd, const char** args, uint32_t numArgs) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 3 && numArgs != 4) { + dprintf(fd, + "Invalid number of arguments: please provide --tune amfm " + "or --tune dab \n"); + return STATUS_BAD_VALUE; + } + bool isDab = false; + if (EqualsIgnoreCase(string(args[1]), "dab")) { + isDab = true; + } else if (!EqualsIgnoreCase(string(args[1]), "amfm")) { + dprintf(fd, "Unknown radio type provided with tune: %s\n", args[1]); + return STATUS_BAD_VALUE; + } + ProgramSelector sel = {}; + if (isDab) { + if (numArgs != 5 && numArgs != 3) { + dprintf(fd, + "Invalid number of arguments: please provide " + "--tune dab or " + "--tune dab \n"); + return STATUS_BAD_VALUE; + } + int sid; + if (!utils::parseArgInt(string(args[2]), &sid)) { + dprintf(fd, "Non-integer sid provided with tune: %s\n", args[2]); + return STATUS_BAD_VALUE; + } + if (numArgs == 3) { + sel = utils::makeSelectorDab(sid); + } else { + int ensemble; + if (!utils::parseArgInt(string(args[3]), &ensemble)) { + dprintf(fd, "Non-integer ensemble provided with tune: %s\n", args[3]); + return STATUS_BAD_VALUE; + } + int freq; + if (!utils::parseArgInt(string(args[4]), &freq)) { + dprintf(fd, "Non-integer frequency provided with tune: %s\n", args[4]); + return STATUS_BAD_VALUE; + } + sel = utils::makeSelectorDab(sid, ensemble, freq); + } + } else { + if (numArgs != 3) { + dprintf(fd, "Invalid number of arguments: please provide --tune amfm \n"); + return STATUS_BAD_VALUE; + } + int freq; + if (!utils::parseArgInt(string(args[2]), &freq)) { + dprintf(fd, "Non-integer frequency provided with tune: %s\n", args[2]); + return STATUS_BAD_VALUE; + } + sel = utils::makeSelectorAmfm(freq); + } + + auto tuneResult = tune(sel); + if (!tuneResult.isOk()) { + dprintf(fd, "Unable to tune %s radio to %s\n", args[1], sel.toString().c_str()); + return STATUS_BAD_VALUE; + } + dprintf(fd, "Tune %s radio to %s \n", args[1], sel.toString().c_str()); + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdSeek(int fd, const char** args, uint32_t numArgs) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 3) { + dprintf(fd, + "Invalid number of arguments: please provide --seek " + "\n"); + return STATUS_BAD_VALUE; + } + string seekDirectionIn = string(args[1]); + bool seekDirectionUp; + if (!utils::parseArgDirection(seekDirectionIn, &seekDirectionUp)) { + dprintf(fd, "Invalid direction (\"up\" or \"down\") provided with seek: %s\n", + seekDirectionIn.c_str()); + return STATUS_BAD_VALUE; + } + string skipSubChannelIn = string(args[2]); + bool skipSubChannel; + if (!utils::parseArgBool(skipSubChannelIn, &skipSubChannel)) { + dprintf(fd, "Invalid skipSubChannel (\"true\" or \"false\") provided with seek: %s\n", + skipSubChannelIn.c_str()); + return STATUS_BAD_VALUE; + } + + auto seekResult = seek(seekDirectionUp, skipSubChannel); + if (!seekResult.isOk()) { + dprintf(fd, "Unable to seek in %s direction\n", seekDirectionIn.c_str()); + return STATUS_BAD_VALUE; + } + dprintf(fd, "Seek in %s direction\n", seekDirectionIn.c_str()); + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdStep(int fd, const char** args, uint32_t numArgs) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 2) { + dprintf(fd, "Invalid number of arguments: please provide --step \n"); + return STATUS_BAD_VALUE; + } + string stepDirectionIn = string(args[1]); + bool stepDirectionUp; + if (!utils::parseArgDirection(stepDirectionIn, &stepDirectionUp)) { + dprintf(fd, "Invalid direction (\"up\" or \"down\") provided with step: %s\n", + stepDirectionIn.c_str()); + return STATUS_BAD_VALUE; + } + + auto stepResult = step(stepDirectionUp); + if (!stepResult.isOk()) { + dprintf(fd, "Unable to step in %s direction\n", stepDirectionIn.c_str()); + return STATUS_BAD_VALUE; + } + dprintf(fd, "Step in %s direction\n", stepDirectionIn.c_str()); + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdCancel(int fd, uint32_t numArgs) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 1) { + dprintf(fd, + "Invalid number of arguments: please provide --cancel " + "only and no more arguments\n"); + return STATUS_BAD_VALUE; + } + + auto cancelResult = cancel(); + if (!cancelResult.isOk()) { + dprintf(fd, "Unable to cancel pending tune, seek, and step\n"); + return STATUS_BAD_VALUE; + } + dprintf(fd, "Canceled pending tune, seek, and step\n"); + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdStartProgramListUpdates(int fd, const char** args, + uint32_t numArgs) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 5) { + dprintf(fd, + "Invalid number of arguments: please provide --startProgramListUpdates " + " " + "\n"); + return STATUS_BAD_VALUE; + } + string filterTypesStr = string(args[1]); + std::vector filterTypeList; + if (!EqualsIgnoreCase(filterTypesStr, "null") && + !utils::parseArgIdentifierTypeArray(filterTypesStr, &filterTypeList)) { + dprintf(fd, + "Invalid identifier types provided with startProgramListUpdates: %s, " + "should be: ,,...,\n", + filterTypesStr.c_str()); + return STATUS_BAD_VALUE; + } + string filtersStr = string(args[2]); + std::vector filterList; + if (!EqualsIgnoreCase(filtersStr, "null") && + !utils::parseProgramIdentifierList(filtersStr, &filterList)) { + dprintf(fd, + "Invalid program identifiers provided with startProgramListUpdates: %s, " + "should be: :,:,...,:\n", + filtersStr.c_str()); + return STATUS_BAD_VALUE; + } + string includeCategoriesStr = string(args[3]); + bool includeCategories; + if (!utils::parseArgBool(includeCategoriesStr, &includeCategories)) { + dprintf(fd, + "Invalid includeCategories (\"true\" or \"false\") " + "provided with startProgramListUpdates : %s\n", + includeCategoriesStr.c_str()); + return STATUS_BAD_VALUE; + } + string excludeModificationsStr = string(args[4]); + bool excludeModifications; + if (!utils::parseArgBool(excludeModificationsStr, &excludeModifications)) { + dprintf(fd, + "Invalid excludeModifications(\"true\" or \"false\") " + "provided with startProgramListUpdates : %s\n", + excludeModificationsStr.c_str()); + return STATUS_BAD_VALUE; + } + ProgramFilter filter = {filterTypeList, filterList, includeCategories, excludeModifications}; + + auto updateResult = startProgramListUpdates(filter); + if (!updateResult.isOk()) { + dprintf(fd, "Unable to start program list update for filter %s \n", + filter.toString().c_str()); + return STATUS_BAD_VALUE; + } + dprintf(fd, "Start program list update for filter %s\n", filter.toString().c_str()); + return STATUS_OK; +} + +binder_status_t BroadcastRadio::cmdStopProgramListUpdates(int fd, uint32_t numArgs) { + if (!checkDumpCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 1) { + dprintf(fd, + "Invalid number of arguments: please provide --stopProgramListUpdates " + "only and no more arguments\n"); + return STATUS_BAD_VALUE; + } + + auto stopResult = stopProgramListUpdates(); + if (!stopResult.isOk()) { + dprintf(fd, "Unable to stop pending program list update\n"); + return STATUS_BAD_VALUE; + } + dprintf(fd, "Stop pending program list update\n"); + return STATUS_OK; +} + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/aidl/default/BroadcastRadio.h b/broadcastradio/aidl/default/BroadcastRadio.h new file mode 100644 index 0000000000..1c85ddc51d --- /dev/null +++ b/broadcastradio/aidl/default/BroadcastRadio.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "VirtualRadio.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace aidl::android::hardware::broadcastradio { + +class BroadcastRadio final : public BnBroadcastRadio { + public: + explicit BroadcastRadio(const VirtualRadio& virtualRadio); + ~BroadcastRadio(); + ndk::ScopedAStatus getAmFmRegionConfig(bool full, AmFmRegionConfig* returnConfigs) override; + ndk::ScopedAStatus getDabRegionConfig(std::vector* returnConfigs) override; + ndk::ScopedAStatus getImage(int32_t id, std::vector* returnImage) override; + ndk::ScopedAStatus getProperties(Properties* returnProperties) override; + + ndk::ScopedAStatus setTunerCallback(const std::shared_ptr& callback) override; + ndk::ScopedAStatus unsetTunerCallback() override; + ndk::ScopedAStatus tune(const ProgramSelector& program) override; + ndk::ScopedAStatus seek(bool directionUp, bool skipSubChannel) override; + ndk::ScopedAStatus step(bool directionUp) override; + ndk::ScopedAStatus cancel() override; + ndk::ScopedAStatus startProgramListUpdates(const ProgramFilter& filter) override; + ndk::ScopedAStatus stopProgramListUpdates() override; + ndk::ScopedAStatus isConfigFlagSet(ConfigFlag flag, bool* returnIsSet) override; + ndk::ScopedAStatus setConfigFlag(ConfigFlag flag, bool in_value) override; + ndk::ScopedAStatus setParameters(const std::vector& parameters, + std::vector* returnParameters) override; + ndk::ScopedAStatus getParameters(const std::vector& keys, + std::vector* returnParameters) override; + ndk::ScopedAStatus registerAnnouncementListener( + const std::shared_ptr& listener, + const std::vector& enabled, + std::shared_ptr* returnCloseHandle) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + + private: + const VirtualRadio& mVirtualRadio; + std::mutex mMutex; + AmFmRegionConfig mAmFmConfig GUARDED_BY(mMutex); + std::unique_ptr<::android::WorkerThread> mThread GUARDED_BY(mMutex) = + std::unique_ptr<::android::WorkerThread>(new ::android::WorkerThread()); + bool mIsTuneCompleted GUARDED_BY(mMutex) = true; + Properties mProperties GUARDED_BY(mMutex); + ProgramSelector mCurrentProgram GUARDED_BY(mMutex) = {}; + std::shared_ptr mCallback GUARDED_BY(mMutex); + + std::optional getAmFmRangeLocked() const; + void cancelLocked(); + ProgramInfo tuneInternalLocked(const ProgramSelector& sel); + + binder_status_t cmdHelp(int fd) const; + binder_status_t cmdTune(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdSeek(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdStep(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdCancel(int fd, uint32_t numArgs); + binder_status_t cmdStartProgramListUpdates(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdStopProgramListUpdates(int fd, uint32_t numArgs); + + binder_status_t dumpsys(int fd); +}; + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/aidl/default/VirtualProgram.cpp b/broadcastradio/aidl/default/VirtualProgram.cpp new file mode 100644 index 0000000000..4fe6567d17 --- /dev/null +++ b/broadcastradio/aidl/default/VirtualProgram.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VirtualProgram.h" + +#include +#include "resources.h" + +#include + +namespace aidl::android::hardware::broadcastradio { + +using ::std::vector; + +VirtualProgram::operator ProgramInfo() const { + ProgramInfo info = {}; + + info.selector = selector; + + IdentifierType programType = selector.primaryId.type; + bool isDigital = (programType != IdentifierType::AMFM_FREQUENCY_KHZ && + programType != IdentifierType::RDS_PI); + + auto selectId = [&info](const IdentifierType& type) { + return utils::makeIdentifier(type, utils::getId(info.selector, type)); + }; + + switch (programType) { + case IdentifierType::AMFM_FREQUENCY_KHZ: + info.logicallyTunedTo = info.physicallyTunedTo = + selectId(IdentifierType::AMFM_FREQUENCY_KHZ); + break; + case IdentifierType::RDS_PI: + info.logicallyTunedTo = selectId(IdentifierType::RDS_PI); + info.physicallyTunedTo = selectId(IdentifierType::AMFM_FREQUENCY_KHZ); + break; + case IdentifierType::HD_STATION_ID_EXT: + info.logicallyTunedTo = selectId(IdentifierType::HD_STATION_ID_EXT); + info.physicallyTunedTo = selectId(IdentifierType::AMFM_FREQUENCY_KHZ); + break; + case IdentifierType::DAB_SID_EXT: + info.logicallyTunedTo = selectId(IdentifierType::DAB_SID_EXT); + info.physicallyTunedTo = selectId(IdentifierType::DAB_FREQUENCY_KHZ); + break; + case IdentifierType::DRMO_SERVICE_ID: + info.logicallyTunedTo = selectId(IdentifierType::DRMO_SERVICE_ID); + info.physicallyTunedTo = selectId(IdentifierType::DRMO_FREQUENCY_KHZ); + break; + case IdentifierType::SXM_SERVICE_ID: + info.logicallyTunedTo = selectId(IdentifierType::SXM_SERVICE_ID); + info.physicallyTunedTo = selectId(IdentifierType::SXM_CHANNEL); + break; + default: + LOG(FATAL) << "unsupported program type: " << toString(programType); + return {}; + } + + info.infoFlags |= (ProgramInfo::FLAG_TUNABLE | ProgramInfo::FLAG_STEREO); + info.signalQuality = isDigital ? kSignalQualityDigital : kSignalQualityNonDigital; + + info.metadata = vector({ + Metadata::make(programName), + Metadata::make(songTitle), + Metadata::make(songArtist), + Metadata::make(resources::kDemoPngId), + Metadata::make(resources::kDemoPngId), + }); + + info.vendorInfo = vector({ + {"com.android.sample", "sample"}, + {"com.android.sample.VirtualProgram", "VirtualProgram"}, + }); + + return info; +} + +bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs) { + auto& l = lhs.selector; + auto& r = rhs.selector; + + // Two programs with the same primaryId are considered the same. + if (l.primaryId.type != r.primaryId.type) return l.primaryId.type < r.primaryId.type; + + return l.primaryId.value < r.primaryId.value; +} + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/aidl/default/VirtualProgram.h b/broadcastradio/aidl/default/VirtualProgram.h new file mode 100644 index 0000000000..0c20721bf2 --- /dev/null +++ b/broadcastradio/aidl/default/VirtualProgram.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace aidl::android::hardware::broadcastradio { + +constexpr int kSignalQualityDigital = 100; +constexpr int kSignalQualityNonDigital = 80; +/** + * A radio program mock. + * + * This represents broadcast waves flying over the air, + * not an entry for a captured station in the radio tuner memory. + */ +struct VirtualProgram { + ProgramSelector selector; + + std::string programName = ""; + std::string songArtist = ""; + std::string songTitle = ""; + + operator ProgramInfo() const; + + /** + * Defines order in which virtual programs appear on the "air" with + * ITunerSession::scan(). + * + * It's for default implementation purposes, may not be complete or correct. + */ + friend bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs); +}; + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/aidl/default/VirtualRadio.cpp b/broadcastradio/aidl/default/VirtualRadio.cpp new file mode 100644 index 0000000000..126bcff621 --- /dev/null +++ b/broadcastradio/aidl/default/VirtualRadio.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VirtualRadio.h" +#include + +namespace aidl::android::hardware::broadcastradio { + +using ::aidl::android::hardware::broadcastradio::utils::makeSelectorAmfm; +using ::aidl::android::hardware::broadcastradio::utils::makeSelectorDab; +using ::std::string; +using ::std::vector; + +VirtualRadio::VirtualRadio(const string& name, const vector& initialList) + : mName(name), mPrograms(initialList) { + sort(mPrograms.begin(), mPrograms.end()); +} + +string VirtualRadio::getName() const { + return mName; +} + +const vector& VirtualRadio::getProgramList() const { + return mPrograms; +} + +bool VirtualRadio::getProgram(const ProgramSelector& selector, VirtualProgram* programOut) const { + for (const auto& program : mPrograms) { + if (utils::tunesTo(selector, program.selector)) { + *programOut = program; + return true; + } + } + return false; +} + +// get singleton of AMFM Virtual Radio +const VirtualRadio& VirtualRadio::getAmFmRadio() { + // clang-format off + static VirtualRadio amFmRadioMock( + "AM/FM radio mock", + { + {makeSelectorAmfm(/* frequency= */ 94900), "Wild 94.9", "Drake ft. Rihanna", + "Too Good"}, + {makeSelectorAmfm(/* frequency= */ 96500), "KOIT", "Celine Dion", "All By Myself"}, + {makeSelectorAmfm(/* frequency= */ 97300), "Alice@97.3", "Drops of Jupiter", "Train"}, + {makeSelectorAmfm(/* frequency= */ 99700), "99.7 Now!", "The Chainsmokers", "Closer"}, + {makeSelectorAmfm(/* frequency= */ 101300), "101-3 KISS-FM", "Justin Timberlake", + "Rock Your Body"}, + {makeSelectorAmfm(/* frequency= */ 103700), "iHeart80s @ 103.7", "Michael Jackson", + "Billie Jean"}, + {makeSelectorAmfm(/* frequency= */ 106100), "106 KMEL", "Drake", "Marvins Room"}, + {makeSelectorAmfm(/* frequency= */ 700), "700 AM", "Artist700", "Title700"}, + {makeSelectorAmfm(/* frequency= */ 1700), "1700 AM", "Artist1700", "Title1700"}, + }); + // clang-format on + return amFmRadioMock; +} + +// get singleton of DAB Virtual Radio +const VirtualRadio& VirtualRadio::getDabRadio() { + // clang-format off + static VirtualRadio dabRadioMock( + "DAB radio mock", + { + {makeSelectorDab(/* sidExt= */ 0xA000000001u, /* ensemble= */ 0x0001u, + /* freq= */ 225648), "BBC Radio 1", "Khalid", "Talk"}, + {makeSelectorDab(/* sidExt= */ 0xB000000001u, /* ensemble= */ 0x1001u, + /* freq= */ 222064), "Classic FM", "Jean Sibelius", "Andante Festivo"}, + {makeSelectorDab(/* sidExt= */ 0xB000000002u, /* ensemble= */ 0x1002u, + /* freq= */ 227360), "Absolute Radio", "Coldplay", "Clocks"}, + {makeSelectorDab(/* sidExt= */ 0xB000000002u, /* ensemble= */ 0x1002u, + /* freq= */ 222064), "Absolute Radio", "Coldplay", "Clocks"}, + }); + // clang-format on + return dabRadioMock; +} + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/aidl/default/VirtualRadio.h b/broadcastradio/aidl/default/VirtualRadio.h new file mode 100644 index 0000000000..ae039c463c --- /dev/null +++ b/broadcastradio/aidl/default/VirtualRadio.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "VirtualProgram.h" + +#include + +namespace aidl::android::hardware::broadcastradio { + +/** + * A radio frequency space mock. + * + * This represents all broadcast waves in the air for a given radio technology, + * not a captured station list in the radio tuner memory. + * + * It's meant to abstract out radio content from default tuner implementation. + */ +class VirtualRadio final { + public: + VirtualRadio(const std::string& name, const std::vector& initialList); + std::string getName() const; + const std::vector& getProgramList() const; + bool getProgram(const ProgramSelector& selector, VirtualProgram* program) const; + + static const VirtualRadio& getAmFmRadio(); + static const VirtualRadio& getDabRadio(); + + private: + const std::string mName; + std::vector mPrograms; +}; + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/aidl/default/broadcastradio-default.rc b/broadcastradio/aidl/default/broadcastradio-default.rc new file mode 100644 index 0000000000..49389e64c9 --- /dev/null +++ b/broadcastradio/aidl/default/broadcastradio-default.rc @@ -0,0 +1,6 @@ +service vendor.broadcastradio-default /vendor/bin/hw/android.hardware.broadcastradio-service.default + interface aidl android.hardware.broadcastradio.IBroadcastRadio/amfm + interface aidl android.hardware.broadcastradio.IBroadcastRadio/dab + class hal + user audioserver + group audio diff --git a/broadcastradio/aidl/default/broadcastradio-default.xml b/broadcastradio/aidl/default/broadcastradio-default.xml new file mode 100644 index 0000000000..1555822e07 --- /dev/null +++ b/broadcastradio/aidl/default/broadcastradio-default.xml @@ -0,0 +1,7 @@ + + + android.hardware.broadcastradio + IBroadcastRadio/amfm + IBroadcastRadio/dab + + diff --git a/broadcastradio/aidl/default/main.cpp b/broadcastradio/aidl/default/main.cpp new file mode 100644 index 0000000000..6bf20d5dbb --- /dev/null +++ b/broadcastradio/aidl/default/main.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BroadcastRadio.h" +#include "VirtualRadio.h" + +#include +#include +#include + +using ::aidl::android::hardware::broadcastradio::BroadcastRadio; +using ::aidl::android::hardware::broadcastradio::VirtualRadio; + +int main() { + android::base::SetDefaultTag("BcRadioAidlDef"); + ABinderProcess_setThreadPoolMaxThreadCount(4); + ABinderProcess_startThreadPool(); + + const VirtualRadio& amFmRadioMock = VirtualRadio::getAmFmRadio(); + std::shared_ptr broadcastRadio = + ::ndk::SharedRefBase::make(amFmRadioMock); + const std::string instanceAmFm = std::string() + BroadcastRadio::descriptor + "/amfm"; + binder_status_t statusAmFm = + AServiceManager_addService(broadcastRadio->asBinder().get(), instanceAmFm.c_str()); + CHECK_EQ(statusAmFm, STATUS_OK) + << "Failed to register Broadcast Radio AM/FM HAL implementation"; + + const VirtualRadio& dabRadioMock = VirtualRadio::getDabRadio(); + std::shared_ptr dabRadio = + ::ndk::SharedRefBase::make(dabRadioMock); + const std::string instanceDab = std::string() + BroadcastRadio::descriptor + "/dab"; + binder_status_t statusDab = + AServiceManager_addService(dabRadio->asBinder().get(), instanceDab.c_str()); + CHECK_EQ(statusDab, STATUS_OK) << "Failed to register Broadcast Radio DAB HAL implementation"; + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} diff --git a/broadcastradio/aidl/default/resources.h b/broadcastradio/aidl/default/resources.h new file mode 100644 index 0000000000..beffc76bb9 --- /dev/null +++ b/broadcastradio/aidl/default/resources.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace aidl::android::hardware::broadcastradio::resources { + +constexpr int32_t kDemoPngId = 123456; +constexpr uint8_t kDemoPng[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, + 0x52, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x08, 0x02, 0x00, 0x00, 0x00, 0x25, + 0x0b, 0xe6, 0x89, 0x00, 0x00, 0x00, 0x5d, 0x49, 0x44, 0x41, 0x54, 0x68, 0xde, 0xed, 0xd9, + 0xc1, 0x09, 0x00, 0x30, 0x08, 0x04, 0xc1, 0x33, 0xfd, 0xf7, 0x6c, 0x6a, 0xc8, 0x23, 0x04, + 0xc9, 0x6c, 0x01, 0xc2, 0x20, 0xbe, 0x4c, 0x86, 0x57, 0x49, 0xba, 0xfb, 0xd6, 0xf4, 0xba, + 0x3e, 0x7f, 0x4d, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x8f, 0x00, 0xbd, 0xce, 0x7f, + 0xc0, 0x11, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xb8, 0x0d, 0x32, 0xd4, 0x0c, 0x77, 0xbd, + 0xfb, 0xc1, 0xce, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82}; + +} // namespace aidl::android::hardware::broadcastradio::resources diff --git a/broadcastradio/aidl/vts/Android.bp b/broadcastradio/aidl/vts/Android.bp new file mode 100644 index 0000000000..b60387ef49 --- /dev/null +++ b/broadcastradio/aidl/vts/Android.bp @@ -0,0 +1,47 @@ +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_test { + name: "VtsHalBroadcastradioAidlTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + tidy_timeout_srcs: ["src/*.cpp"], + srcs: ["src/*.cpp"], + shared_libs: [ + "libbinder_ndk", + "libbase", + "libxml2", + ], + static_libs: [ + "android.hardware.broadcastradio-V1-ndk", + "android.hardware.broadcastradio@common-utils-aidl-lib", + "android.hardware.broadcastradio@vts-utils-lib", + "libgmock", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/broadcastradio/aidl/vts/OWNERS b/broadcastradio/aidl/vts/OWNERS new file mode 100644 index 0000000000..302fdd73cc --- /dev/null +++ b/broadcastradio/aidl/vts/OWNERS @@ -0,0 +1,4 @@ +xuweilin@google.com +oscarazu@google.com +ericjeong@google.com +keunyoung@google.com diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp new file mode 100644 index 0000000000..356673f715 --- /dev/null +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -0,0 +1,1141 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define EGMOCK_VERBOSE 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace aidl::android::hardware::broadcastradio::vts { + +namespace { + +using ::aidl::android::hardware::broadcastradio::utils::makeIdentifier; +using ::aidl::android::hardware::broadcastradio::utils::makeSelectorAmfm; +using ::aidl::android::hardware::broadcastradio::utils::makeSelectorDab; +using ::aidl::android::hardware::broadcastradio::utils::resultToInt; +using ::ndk::ScopedAStatus; +using ::ndk::SharedRefBase; +using ::std::string; +using ::std::vector; +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::ByMove; +using ::testing::DoAll; +using ::testing::Invoke; +using ::testing::SaveArg; + +namespace bcutils = ::aidl::android::hardware::broadcastradio::utils; + +inline constexpr std::chrono::seconds kTuneTimeoutSec = + std::chrono::seconds(IBroadcastRadio::TUNER_TIMEOUT_MS * 1000); +inline constexpr std::chrono::seconds kProgramListScanTimeoutSec = + std::chrono::seconds(IBroadcastRadio::LIST_COMPLETE_TIMEOUT_MS * 1000); + +const ConfigFlag kConfigFlagValues[] = { + ConfigFlag::FORCE_MONO, + ConfigFlag::FORCE_ANALOG, + ConfigFlag::FORCE_DIGITAL, + ConfigFlag::RDS_AF, + ConfigFlag::RDS_REG, + ConfigFlag::DAB_DAB_LINKING, + ConfigFlag::DAB_FM_LINKING, + ConfigFlag::DAB_DAB_SOFT_LINKING, + ConfigFlag::DAB_FM_SOFT_LINKING, +}; + +void printSkipped(const string& msg) { + const auto testInfo = testing::UnitTest::GetInstance()->current_test_info(); + LOG(INFO) << "[ SKIPPED ] " << testInfo->test_case_name() << "." << testInfo->name() + << " with message: " << msg; +} + +bool isValidAmFmFreq(int64_t freq) { + ProgramIdentifier id = bcutils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, freq); + return bcutils::isValid(id); +} + +void validateRange(const AmFmBandRange& range) { + EXPECT_TRUE(isValidAmFmFreq(range.lowerBound)); + EXPECT_TRUE(isValidAmFmFreq(range.upperBound)); + EXPECT_LT(range.lowerBound, range.upperBound); + EXPECT_GT(range.spacing, 0u); + EXPECT_EQ((range.upperBound - range.lowerBound) % range.spacing, 0u); +} + +bool supportsFM(const AmFmRegionConfig& config) { + for (const auto& range : config.ranges) { + if (bcutils::getBand(range.lowerBound) == bcutils::FrequencyBand::FM) { + return true; + } + } + return false; +} + +} // namespace + +class TunerCallbackMock : public BnTunerCallback { + public: + TunerCallbackMock(); + ScopedAStatus onTuneFailed(Result result, const ProgramSelector& selector) override; + MOCK_TIMEOUT_METHOD1(onCurrentProgramInfoChangedMock, ScopedAStatus(const ProgramInfo&)); + ScopedAStatus onCurrentProgramInfoChanged(const ProgramInfo& info) override; + ScopedAStatus onProgramListUpdated(const ProgramListChunk& chunk) override; + MOCK_METHOD1(onAntennaStateChange, ScopedAStatus(bool connected)); + MOCK_METHOD1(onParametersUpdated, ScopedAStatus(const vector& parameters)); + MOCK_METHOD2(onConfigFlagUpdated, ScopedAStatus(ConfigFlag in_flag, bool in_value)); + MOCK_TIMEOUT_METHOD0(onProgramListReady, void()); + + std::mutex mLock; + bcutils::ProgramInfoSet mProgramList GUARDED_BY(mLock); +}; + +struct AnnouncementListenerMock : public BnAnnouncementListener { + MOCK_METHOD1(onListUpdated, ScopedAStatus(const vector&)); +}; + +class BroadcastRadioHalTest : public testing::TestWithParam { + protected: + void SetUp() override; + void TearDown() override; + + bool getAmFmRegionConfig(bool full, AmFmRegionConfig* config); + std::optional getProgramList(); + std::optional getProgramList(const ProgramFilter& filter); + + std::shared_ptr mModule; + Properties mProperties; + std::shared_ptr mCallback = SharedRefBase::make(); +}; + +MATCHER_P(InfoHasId, id, string(negation ? "does not contain" : "contains") + " " + id.toString()) { + vector ids = bcutils::getAllIds(arg.selector, id.type); + return ids.end() != find(ids.begin(), ids.end(), id.value); +} + +TunerCallbackMock::TunerCallbackMock() { + EXPECT_TIMEOUT_CALL(*this, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + + // we expect the antenna is connected through the whole test + EXPECT_CALL(*this, onAntennaStateChange(false)).Times(0); +} + +ScopedAStatus TunerCallbackMock::onTuneFailed(Result result, const ProgramSelector& selector) { + LOG(DEBUG) << "Tune failed for selector" << selector.toString(); + EXPECT_TRUE(result == Result::CANCELED); + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus TunerCallbackMock::onCurrentProgramInfoChanged(const ProgramInfo& info) { + for (const auto& id : info.selector) { + EXPECT_NE(id.type, IdentifierType::INVALID); + } + + IdentifierType logically = info.logicallyTunedTo.type; + // This field is required for currently tuned program and should be INVALID + // for entries from the program list. + EXPECT_TRUE(logically == IdentifierType::AMFM_FREQUENCY_KHZ || + logically == IdentifierType::RDS_PI || + logically == IdentifierType::HD_STATION_ID_EXT || + logically == IdentifierType::DAB_SID_EXT || + logically == IdentifierType::DRMO_SERVICE_ID || + logically == IdentifierType::SXM_SERVICE_ID || + (logically >= IdentifierType::VENDOR_START && + logically <= IdentifierType::VENDOR_END) || + logically > IdentifierType::SXM_CHANNEL); + + IdentifierType physically = info.physicallyTunedTo.type; + // ditto (see "logically" above) + EXPECT_TRUE(physically == IdentifierType::AMFM_FREQUENCY_KHZ || + physically == IdentifierType::DAB_FREQUENCY_KHZ || + physically == IdentifierType::DRMO_FREQUENCY_KHZ || + physically == IdentifierType::SXM_CHANNEL || + (physically >= IdentifierType::VENDOR_START && + physically <= IdentifierType::VENDOR_END) || + physically > IdentifierType::SXM_CHANNEL); + + if (logically == IdentifierType::AMFM_FREQUENCY_KHZ) { + std::optional ps = bcutils::getMetadataString(info, Metadata::rdsPs); + if (ps.has_value()) { + EXPECT_NE(::android::base::Trim(*ps), "") + << "Don't use empty RDS_PS as an indicator of missing RSD PS data."; + } + } + + return onCurrentProgramInfoChangedMock(info); +} + +ScopedAStatus TunerCallbackMock::onProgramListUpdated(const ProgramListChunk& chunk) { + std::lock_guard lk(mLock); + + updateProgramList(chunk, &mProgramList); + + if (chunk.complete) { + onProgramListReady(); + } + + return ndk::ScopedAStatus::ok(); +} + +void BroadcastRadioHalTest::SetUp() { + EXPECT_EQ(mModule.get(), nullptr) << "Module is already open"; + + // lookup AIDL service (radio module) + AIBinder* binder = AServiceManager_waitForService(GetParam().c_str()); + ASSERT_NE(binder, nullptr); + mModule = IBroadcastRadio::fromBinder(ndk::SpAIBinder(binder)); + ASSERT_NE(mModule, nullptr) << "Couldn't find broadcast radio HAL implementation"; + + // get module properties + auto propResult = mModule->getProperties(&mProperties); + + ASSERT_TRUE(propResult.isOk()); + EXPECT_FALSE(mProperties.maker.empty()); + EXPECT_FALSE(mProperties.product.empty()); + EXPECT_GT(mProperties.supportedIdentifierTypes.size(), 0u); + + // set callback + EXPECT_TRUE(mModule->setTunerCallback(mCallback).isOk()); +} + +void BroadcastRadioHalTest::TearDown() { + if (mModule) { + ASSERT_TRUE(mModule->unsetTunerCallback().isOk()); + } +} + +bool BroadcastRadioHalTest::getAmFmRegionConfig(bool full, AmFmRegionConfig* config) { + auto halResult = mModule->getAmFmRegionConfig(full, config); + + if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + return false; + } + + EXPECT_TRUE(halResult.isOk()); + return halResult.isOk(); +} + +std::optional BroadcastRadioHalTest::getProgramList() { + ProgramFilter emptyFilter = {}; + return getProgramList(emptyFilter); +} + +std::optional BroadcastRadioHalTest::getProgramList( + const ProgramFilter& filter) { + EXPECT_TIMEOUT_CALL(*mCallback, onProgramListReady).Times(AnyNumber()); + + auto startResult = mModule->startProgramListUpdates(filter); + + if (startResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + printSkipped("Program list not supported"); + return std::nullopt; + } + EXPECT_TRUE(startResult.isOk()); + if (!startResult.isOk()) { + return std::nullopt; + } + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onProgramListReady, kProgramListScanTimeoutSec); + + auto stopResult = mModule->stopProgramListUpdates(); + + EXPECT_TRUE(stopResult.isOk()); + + return mCallback->mProgramList; +} + +/** + * Test setting tuner callback to null. + * + * Verifies that: + * - Setting to a null tuner callback results with INVALID_ARGUMENTS. + */ +TEST_P(BroadcastRadioHalTest, TunerCallbackFailsWithNull) { + LOG(DEBUG) << "TunerCallbackFailsWithNull Test"; + + auto halResult = mModule->setTunerCallback(nullptr); + + EXPECT_EQ(halResult.getServiceSpecificError(), resultToInt(Result::INVALID_ARGUMENTS)); +} + +/** + * Test fetching AM/FM regional configuration. + * + * Verifies that: + * - AM/FM regional configuration is either set at startup or not supported at all by the hardware; + * - FM Deemphasis and RDS are correctly configured for FM-capable radio; + */ +TEST_P(BroadcastRadioHalTest, GetAmFmRegionConfig) { + LOG(DEBUG) << "GetAmFmRegionConfig Test"; + + AmFmRegionConfig config; + + bool supported = getAmFmRegionConfig(/* full= */ false, &config); + + if (!supported) { + printSkipped("AM/FM not supported"); + return; + } + + EXPECT_LE(popcountll(static_cast(config.fmDeemphasis)), 1); + EXPECT_LE(popcountll(static_cast(config.fmRds)), 1); + + if (supportsFM(config)) { + EXPECT_EQ(popcountll(static_cast(config.fmDeemphasis)), 1); + } +} + +/** + * Test fetching ranges of AM/FM regional configuration. + * + * Verifies that: + * - AM/FM regional configuration is either set at startup or not supported at all by the hardware; + * - there is at least one AM/FM band configured; + * - all channel grids (frequency ranges and spacings) are valid; + * - seek spacing is a multiple of the manual spacing value. + */ +TEST_P(BroadcastRadioHalTest, GetAmFmRegionConfigRanges) { + LOG(DEBUG) << "GetAmFmRegionConfigRanges Test"; + + AmFmRegionConfig config; + + bool supported = getAmFmRegionConfig(/* full= */ false, &config); + + if (!supported) { + printSkipped("AM/FM not supported"); + return; + } + + EXPECT_GT(config.ranges.size(), 0u); + for (const auto& range : config.ranges) { + validateRange(range); + EXPECT_EQ(range.seekSpacing % range.spacing, 0u); + EXPECT_GE(range.seekSpacing, range.spacing); + } +} + +/** + * Test fetching FM regional capabilities. + * + * Verifies that: + * - AM/FM regional capabilities are either available or not supported at all by the hardware; + * - there is at least one de-emphasis filter mode supported for FM-capable radio; + */ +TEST_P(BroadcastRadioHalTest, GetAmFmRegionConfigCapabilitiesForFM) { + LOG(DEBUG) << "GetAmFmRegionConfigCapabilitiesForFM Test"; + + AmFmRegionConfig config; + + bool supported = getAmFmRegionConfig(/* full= */ true, &config); + + if (supported && supportsFM(config)) { + EXPECT_GE(popcountll(static_cast(config.fmDeemphasis)), 1); + } else { + printSkipped("FM not supported"); + } +} + +/** + * Test fetching the ranges of AM/FM regional capabilities. + * + * Verifies that: + * - AM/FM regional capabilities are either available or not supported at all by the hardware; + * - there is at least one AM/FM range supported; + * - all channel grids (frequency ranges and spacings) are valid; + * - seek spacing is not set. + */ +TEST_P(BroadcastRadioHalTest, GetAmFmRegionConfigCapabilitiesRanges) { + LOG(DEBUG) << "GetAmFmRegionConfigCapabilitiesRanges Test"; + + AmFmRegionConfig config; + + bool supported = getAmFmRegionConfig(/* full= */ true, &config); + + if (!supported) { + printSkipped("AM/FM not supported"); + return; + } + + EXPECT_GT(config.ranges.size(), 0u); + + for (const auto& range : config.ranges) { + validateRange(range); + EXPECT_EQ(range.seekSpacing, 0u); + } +} + +/** + * Test fetching DAB regional configuration. + * + * Verifies that: + * - DAB regional configuration is either set at startup or not supported at all by the hardware; + * - all channel labels match correct format; + * - all channel frequencies are in correct range. + */ +TEST_P(BroadcastRadioHalTest, GetDabRegionConfig) { + LOG(DEBUG) << "GetDabRegionConfig Test"; + vector config; + + auto halResult = mModule->getDabRegionConfig(&config); + + if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + printSkipped("DAB not supported"); + return; + } + ASSERT_TRUE(halResult.isOk()); + + std::regex re("^[A-Z0-9][A-Z0-9 ]{0,5}[A-Z0-9]$"); + + for (const auto& entry : config) { + EXPECT_TRUE(std::regex_match(string(entry.label), re)); + + ProgramIdentifier id = + bcutils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, entry.frequencyKhz); + EXPECT_TRUE(bcutils::isValid(id)); + } +} + +/** + * Test tuning without tuner callback set. + * + * Verifies that: + * - No tuner callback set results in INVALID_STATE, regardless of whether the selector is + * supported. + */ +TEST_P(BroadcastRadioHalTest, TuneFailsWithoutTunerCallback) { + LOG(DEBUG) << "TuneFailsWithoutTunerCallback Test"; + + mModule->unsetTunerCallback(); + int64_t freq = 90900; // 90.9 FM + ProgramSelector sel = makeSelectorAmfm(freq); + + auto result = mModule->tune(sel); + + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::INVALID_STATE)); +} + +/** + * Test tuning with selectors that can be not supported. + * + * Verifies that: + * - if the selector is not supported, an invalid value results with NOT_SUPPORTED, regardless of + * whether it is valid; + * - if it is supported, the test is ignored; + */ +TEST_P(BroadcastRadioHalTest, TuneFailsWithNotSupported) { + LOG(DEBUG) << "TuneFailsWithInvalid Test"; + + vector supportTestId = { + makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 0), // invalid + makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 94900), // valid + makeIdentifier(IdentifierType::RDS_PI, 0x10000), // invalid + makeIdentifier(IdentifierType::RDS_PI, 0x1001), // valid + makeIdentifier(IdentifierType::HD_STATION_ID_EXT, 0x100000000), // invalid + makeIdentifier(IdentifierType::HD_STATION_ID_EXT, 0x10000001), // valid + makeIdentifier(IdentifierType::DAB_SID_EXT, 0), // invalid + makeIdentifier(IdentifierType::DAB_SID_EXT, 0xA00001), // valid + makeIdentifier(IdentifierType::DRMO_SERVICE_ID, 0x100000000), // invalid + makeIdentifier(IdentifierType::DRMO_SERVICE_ID, 0x10000001), // valid + makeIdentifier(IdentifierType::SXM_SERVICE_ID, 0x100000000), // invalid + makeIdentifier(IdentifierType::SXM_SERVICE_ID, 0x10000001), // valid + }; + + auto notSupportedError = resultToInt(Result::NOT_SUPPORTED); + for (const auto& id : supportTestId) { + ProgramSelector sel{id, {}}; + + auto result = mModule->tune(sel); + + if (!bcutils::isSupported(mProperties, sel)) { + EXPECT_EQ(result.getServiceSpecificError(), notSupportedError); + } + } +} + +/** + * Test tuning with invalid selectors. + * + * Verifies that: + * - if the selector is not supported, it's ignored; + * - if it is supported, an invalid value results with INVALID_ARGUMENTS; + */ +TEST_P(BroadcastRadioHalTest, TuneFailsWithInvalid) { + LOG(DEBUG) << "TuneFailsWithInvalid Test"; + + vector invalidId = { + makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 0), + makeIdentifier(IdentifierType::RDS_PI, 0x10000), + makeIdentifier(IdentifierType::HD_STATION_ID_EXT, 0x100000000), + makeIdentifier(IdentifierType::DAB_SID_EXT, 0), + makeIdentifier(IdentifierType::DRMO_SERVICE_ID, 0x100000000), + makeIdentifier(IdentifierType::SXM_SERVICE_ID, 0x100000000), + }; + + auto invalidArgumentsError = resultToInt(Result::INVALID_ARGUMENTS); + for (const auto& id : invalidId) { + ProgramSelector sel{id, {}}; + + auto result = mModule->tune(sel); + + if (bcutils::isSupported(mProperties, sel)) { + EXPECT_EQ(result.getServiceSpecificError(), invalidArgumentsError); + } + } +} + +/** + * Test tuning with empty program selector. + * + * Verifies that: + * - tune fails with NOT_SUPPORTED when program selector is not initialized. + */ +TEST_P(BroadcastRadioHalTest, TuneFailsWithEmpty) { + LOG(DEBUG) << "TuneFailsWithEmpty Test"; + + // Program type is 1-based, so 0 will always be invalid. + ProgramSelector sel = {}; + + auto result = mModule->tune(sel); + + ASSERT_EQ(result.getServiceSpecificError(), resultToInt(Result::NOT_SUPPORTED)); +} + +/** + * Test tuning with FM selector. + * + * Verifies that: + * - if AM/FM selector is not supported, the method returns NOT_SUPPORTED; + * - if it is supported, the method succeeds; + * - after a successful tune call, onCurrentProgramInfoChanged callback is + * invoked carrying a proper selector; + * - program changes exactly to what was requested. + */ +TEST_P(BroadcastRadioHalTest, FmTune) { + LOG(DEBUG) << "FmTune Test"; + + int64_t freq = 90900; // 90.9 FM + ProgramSelector sel = makeSelectorAmfm(freq); + // try tuning + ProgramInfo infoCb = {}; + EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, + InfoHasId(makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, freq))) + .Times(AnyNumber()) + .WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(ndk::ScopedAStatus::ok())))) + .WillRepeatedly(testing::InvokeWithoutArgs([] { return ndk::ScopedAStatus::ok(); })); + + auto result = mModule->tune(sel); + + // expect a failure if it's not supported + if (!bcutils::isSupported(mProperties, sel)) { + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::NOT_SUPPORTED)); + return; + } + + // expect a callback if it succeeds + EXPECT_TRUE(result.isOk()); + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + + LOG(DEBUG) << "Current program info: " << infoCb.toString(); + + // it should tune exactly to what was requested + vector freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::AMFM_FREQUENCY_KHZ); + EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq)) + << "FM freq " << freq << " kHz is not sent back by callback."; +} + +/** + * Test tuning with DAB selector. + * + * Verifies that: + * - if DAB selector is not supported, the method returns NOT_SUPPORTED; + * - if it is supported, the method succeeds; + * - after a successful tune call, onCurrentProgramInfoChanged callback is + * invoked carrying a proper selector; + * - program changes exactly to what was requested. + */ +TEST_P(BroadcastRadioHalTest, DabTune) { + LOG(DEBUG) << "DabTune Test"; + vector config; + + auto halResult = mModule->getDabRegionConfig(&config); + + if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + printSkipped("DAB not supported"); + return; + } + ASSERT_TRUE(halResult.isOk()); + ASSERT_NE(config.size(), 0U); + + auto programList = getProgramList(); + + if (!programList) { + printSkipped("Empty DAB station list, tune cannot be performed"); + return; + } + + ProgramSelector sel = {}; + uint64_t freq = 0; + bool dabStationPresent = false; + for (auto&& programInfo : *programList) { + if (!utils::hasId(programInfo.selector, IdentifierType::DAB_FREQUENCY_KHZ)) { + continue; + } + for (auto&& config_entry : config) { + if (config_entry.frequencyKhz == + utils::getId(programInfo.selector, IdentifierType::DAB_FREQUENCY_KHZ, 0)) { + freq = config_entry.frequencyKhz; + break; + } + } + // Do not trigger a tune request if the programList entry does not contain + // a valid DAB frequency. + if (freq == 0) { + continue; + } + int64_t dabSidExt = utils::getId(programInfo.selector, IdentifierType::DAB_SID_EXT, 0); + int64_t dabEns = utils::getId(programInfo.selector, IdentifierType::DAB_ENSEMBLE, 0); + sel = makeSelectorDab(dabSidExt, (int32_t)dabEns, freq); + dabStationPresent = true; + break; + } + + if (!dabStationPresent) { + printSkipped("No DAB stations in the list, tune cannot be performed"); + return; + } + + // try tuning + ProgramInfo infoCb = {}; + EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, + InfoHasId(makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, freq))) + .Times(AnyNumber()) + .WillOnce( + DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(ndk::ScopedAStatus::ok())))); + + auto result = mModule->tune(sel); + + // expect a failure if it's not supported + if (!bcutils::isSupported(mProperties, sel)) { + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::NOT_SUPPORTED)); + return; + } + + // expect a callback if it succeeds + EXPECT_TRUE(result.isOk()); + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + LOG(DEBUG) << "Current program info: " << infoCb.toString(); + + // it should tune exactly to what was requested + vector freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY_KHZ); + EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq)) + << "DAB freq " << freq << " kHz is not sent back by callback."; +} + +/** + * Test seeking to next/prev station via IBroadcastRadio::seek(). + * + * Verifies that: + * - the method succeeds; + * - the program info is changed within kTuneTimeoutSec; + * - works both directions and with or without skipping sub-channel. + */ +TEST_P(BroadcastRadioHalTest, Seek) { + LOG(DEBUG) << "Seek Test"; + + EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + + auto result = mModule->seek(/* in_directionUp= */ true, /* in_skipSubChannel= */ true); + + if (result.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + printSkipped("Seek not supported"); + return; + } + + EXPECT_TRUE(result.isOk()); + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + + EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + + result = mModule->seek(/* in_directionUp= */ false, /* in_skipSubChannel= */ false); + + EXPECT_TRUE(result.isOk()); + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); +} + +/** + * Test seeking without tuner callback set. + * + * Verifies that: + * - No tuner callback set results in INVALID_STATE. + */ +TEST_P(BroadcastRadioHalTest, SeekFailsWithoutTunerCallback) { + LOG(DEBUG) << "SeekFailsWithoutTunerCallback Test"; + + mModule->unsetTunerCallback(); + + auto result = mModule->seek(/* in_directionUp= */ true, /* in_skipSubChannel= */ true); + + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::INVALID_STATE)); + + result = mModule->seek(/* in_directionUp= */ false, /* in_skipSubChannel= */ false); + + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::INVALID_STATE)); +} + +/** + * Test step operation. + * + * Verifies that: + * - the method succeeds or returns NOT_SUPPORTED; + * - the program info is changed within kTuneTimeoutSec if the method succeeded; + * - works both directions. + */ +TEST_P(BroadcastRadioHalTest, Step) { + LOG(DEBUG) << "Step Test"; + + EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + + auto result = mModule->step(/* in_directionUp= */ true); + + if (result.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + printSkipped("Step not supported"); + return; + } + EXPECT_TRUE(result.isOk()); + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + + EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + + result = mModule->step(/* in_directionUp= */ false); + + EXPECT_TRUE(result.isOk()); + EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); +} + +/** + * Test step operation without tuner callback set. + * + * Verifies that: + * - No tuner callback set results in INVALID_STATE. + */ +TEST_P(BroadcastRadioHalTest, StepFailsWithoutTunerCallback) { + LOG(DEBUG) << "StepFailsWithoutTunerCallback Test"; + + mModule->unsetTunerCallback(); + + auto result = mModule->step(/* in_directionUp= */ true); + + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::INVALID_STATE)); + + result = mModule->step(/* in_directionUp= */ false); + + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::INVALID_STATE)); +} + +/** + * Test tune cancellation. + * + * Verifies that: + * - the method does not crash after being invoked multiple times. + * + * Since cancel() might be called after the HAL completes an operation (tune, seek, and step) + * and before the callback completions, the operation might not be actually canceled and the + * effect of cancel() is not deterministic to be tested here. + */ +TEST_P(BroadcastRadioHalTest, Cancel) { + LOG(DEBUG) << "Cancel Test"; + + auto notSupportedError = resultToInt(Result::NOT_SUPPORTED); + for (int i = 0; i < 10; i++) { + auto result = mModule->seek(/* in_directionUp= */ true, /* in_skipSubChannel= */ true); + + if (result.getServiceSpecificError() == notSupportedError) { + printSkipped("Cancel is skipped because of seek not supported"); + return; + } + EXPECT_TRUE(result.isOk()); + + auto cancelResult = mModule->cancel(); + + ASSERT_TRUE(cancelResult.isOk()); + } +} + +/** + * Test IBroadcastRadio::get|setParameters() methods called with no parameters. + * + * Verifies that: + * - callback is called for empty parameters set. + */ +TEST_P(BroadcastRadioHalTest, NoParameters) { + LOG(DEBUG) << "NoParameters Test"; + + vector parametersResults = {}; + + auto halResult = mModule->setParameters({}, ¶metersResults); + + ASSERT_TRUE(halResult.isOk()); + ASSERT_EQ(parametersResults.size(), 0u); + + parametersResults.clear(); + + halResult = mModule->getParameters({}, ¶metersResults); + + ASSERT_TRUE(halResult.isOk()); + ASSERT_EQ(parametersResults.size(), 0u); +} + +/** + * Test IBroadcastRadio::get|setParameters() methods called with unknown parameters. + * + * Verifies that: + * - unknown parameters are ignored; + * - callback is called also for empty results set. + */ +TEST_P(BroadcastRadioHalTest, UnknownParameters) { + LOG(DEBUG) << "UnknownParameters Test"; + + vector parametersResults = {}; + + auto halResult = + mModule->setParameters({{"com.android.unknown", "sample"}}, ¶metersResults); + + ASSERT_TRUE(halResult.isOk()); + ASSERT_EQ(parametersResults.size(), 0u); + + parametersResults.clear(); + + halResult = mModule->getParameters({"com.android.unknown*", "sample"}, ¶metersResults); + + ASSERT_TRUE(halResult.isOk()); + ASSERT_EQ(parametersResults.size(), 0u); +} + +/** + * Test geting image of invalid ID. + * + * Verifies that: + * - getImage call handles argument 0 gracefully. + */ +TEST_P(BroadcastRadioHalTest, GetNoImage) { + LOG(DEBUG) << "GetNoImage Test"; + vector rawImage; + + auto result = mModule->getImage(IBroadcastRadio::INVALID_IMAGE, &rawImage); + + ASSERT_TRUE(result.isOk()); + ASSERT_EQ(rawImage.size(), 0u); +} + +/** + * Test getting config flags. + * + * Verifies that: + * - isConfigFlagSet either succeeds or ends with NOT_SUPPORTED or INVALID_STATE; + * - call success or failure is consistent with setConfigFlag. + */ +TEST_P(BroadcastRadioHalTest, FetchConfigFlags) { + LOG(DEBUG) << "FetchConfigFlags Test"; + + for (const auto& flag : kConfigFlagValues) { + bool gotValue = false; + + auto halResult = mModule->isConfigFlagSet(flag, &gotValue); + + if (halResult.getServiceSpecificError() != resultToInt(Result::NOT_SUPPORTED) && + halResult.getServiceSpecificError() != resultToInt(Result::INVALID_STATE)) { + ASSERT_TRUE(halResult.isOk()); + } + + // set must fail or succeed the same way as get + auto setResult = mModule->setConfigFlag(flag, /* value= */ false); + + EXPECT_TRUE((halResult.isOk() && setResult.isOk()) || + (halResult.getServiceSpecificError()) == setResult.getServiceSpecificError()); + + setResult = mModule->setConfigFlag(flag, /* value= */ true); + + EXPECT_TRUE((halResult.isOk() && setResult.isOk()) || + (halResult.getServiceSpecificError()) == setResult.getServiceSpecificError()); + } +} + +/** + * Test setting config flags. + * + * Verifies that: + * - setConfigFlag either succeeds or ends with NOT_SUPPORTED or INVALID_STATE; + * - isConfigFlagSet reflects the state requested immediately after the set call. + */ +TEST_P(BroadcastRadioHalTest, SetConfigFlags) { + LOG(DEBUG) << "SetConfigFlags Test"; + + auto get = [&](ConfigFlag flag) -> bool { + bool* gotValue = nullptr; + + auto halResult = mModule->isConfigFlagSet(flag, gotValue); + + EXPECT_FALSE(gotValue == nullptr); + EXPECT_TRUE(halResult.isOk()); + return *gotValue; + }; + + auto notSupportedError = resultToInt(Result::NOT_SUPPORTED); + auto invalidStateError = resultToInt(Result::INVALID_STATE); + for (const auto& flag : kConfigFlagValues) { + auto result = mModule->setConfigFlag(flag, /* value= */ false); + + if (result.getServiceSpecificError() == notSupportedError || + result.getServiceSpecificError() == invalidStateError) { + // setting to true must result in the same error as false + auto secondResult = mModule->setConfigFlag(flag, /* value= */ true); + + EXPECT_TRUE((result.isOk() && secondResult.isOk()) || + result.getServiceSpecificError() == secondResult.getServiceSpecificError()); + continue; + } else { + ASSERT_TRUE(result.isOk()); + } + + // verify false is set + bool value = get(flag); + EXPECT_FALSE(value); + + // try setting true this time + result = mModule->setConfigFlag(flag, /* value= */ true); + + ASSERT_TRUE(result.isOk()); + value = get(flag); + EXPECT_TRUE(value); + + // false again + result = mModule->setConfigFlag(flag, /* value= */ false); + + ASSERT_TRUE(result.isOk()); + value = get(flag); + EXPECT_FALSE(value); + } +} + +/** + * Test getting program list using empty program filter. + * + * Verifies that: + * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; + * - the complete list is fetched within kProgramListScanTimeoutSec; + * - stopProgramListUpdates does not crash. + */ +TEST_P(BroadcastRadioHalTest, GetProgramListFromEmptyFilter) { + LOG(DEBUG) << "GetProgramListFromEmptyFilter Test"; + + getProgramList(); +} + +/** + * Test getting program list using AMFM frequency program filter. + * + * Verifies that: + * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; + * - the complete list is fetched within kProgramListScanTimeoutSec; + * - stopProgramListUpdates does not crash; + * - result for startProgramListUpdates using a filter with AMFM_FREQUENCY_KHZ value of the first + * AMFM program matches the expected result. + */ +TEST_P(BroadcastRadioHalTest, GetProgramListFromAmFmFilter) { + LOG(DEBUG) << "GetProgramListFromAmFmFilter Test"; + + std::optional completeList = getProgramList(); + if (!completeList) { + printSkipped("No program list available"); + return; + } + + ProgramFilter amfmFilter = {}; + int expectedResultSize = 0; + uint64_t expectedFreq = 0; + for (const auto& program : *completeList) { + vector amfmIds = + bcutils::getAllIds(program.selector, IdentifierType::AMFM_FREQUENCY_KHZ); + EXPECT_LE(amfmIds.size(), 1u); + if (amfmIds.size() == 0) { + continue; + } + + if (expectedResultSize == 0) { + expectedFreq = amfmIds[0]; + amfmFilter.identifiers = { + makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, expectedFreq)}; + expectedResultSize = 1; + } else if (amfmIds[0] == expectedFreq) { + expectedResultSize++; + } + } + + if (expectedResultSize == 0) { + printSkipped("No Am/FM programs available"); + return; + } + std::optional amfmList = getProgramList(amfmFilter); + ASSERT_EQ(amfmList->size(), expectedResultSize) << "amfm filter result size is wrong"; +} + +/** + * Test getting program list using DAB ensemble program filter. + * + * Verifies that: + * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; + * - the complete list is fetched within kProgramListScanTimeoutSec; + * - stopProgramListUpdates does not crash; + * - result for startProgramListUpdates using a filter with DAB_ENSEMBLE value of the first DAB + * program matches the expected result. + */ +TEST_P(BroadcastRadioHalTest, GetProgramListFromDabFilter) { + LOG(DEBUG) << "GetProgramListFromDabFilter Test"; + + std::optional completeList = getProgramList(); + if (!completeList) { + printSkipped("No program list available"); + return; + } + + ProgramFilter dabFilter = {}; + int expectedResultSize = 0; + uint64_t expectedEnsemble = 0; + for (const auto& program : *completeList) { + auto dabEnsembles = bcutils::getAllIds(program.selector, IdentifierType::DAB_ENSEMBLE); + EXPECT_LE(dabEnsembles.size(), 1u); + if (dabEnsembles.size() == 0) { + continue; + } + + if (expectedResultSize == 0) { + expectedEnsemble = dabEnsembles[0]; + dabFilter.identifiers = { + makeIdentifier(IdentifierType::DAB_ENSEMBLE, expectedEnsemble)}; + expectedResultSize = 1; + } else if (dabEnsembles[0] == expectedEnsemble) { + expectedResultSize++; + } + } + + if (expectedResultSize == 0) { + printSkipped("No DAB programs available"); + return; + } + std::optional dabList = getProgramList(dabFilter); + ASSERT_EQ(dabList->size(), expectedResultSize) << "dab filter result size is wrong"; +} + +/** + * Test HD_STATION_NAME correctness. + * + * Verifies that if a program on the list contains HD_STATION_NAME identifier: + * - the program provides station name in its metadata; + * - the identifier matches the name; + * - there is only one identifier of that type. + */ +TEST_P(BroadcastRadioHalTest, HdRadioStationNameId) { + LOG(DEBUG) << "HdRadioStationNameId Test"; + + std::optional list = getProgramList(); + if (!list) { + printSkipped("No program list"); + return; + } + + for (const auto& program : *list) { + vector nameIds = bcutils::getAllIds(program.selector, IdentifierType::HD_STATION_NAME); + EXPECT_LE(nameIds.size(), 1u); + if (nameIds.size() == 0) { + continue; + } + + std::optional name = bcutils::getMetadataString(program, Metadata::programName); + if (!name) { + name = bcutils::getMetadataString(program, Metadata::rdsPs); + } + ASSERT_TRUE(name.has_value()); + + ProgramIdentifier expectedId = bcutils::makeHdRadioStationName(*name); + EXPECT_EQ(nameIds[0], expectedId.value); + } +} + +/** + * Test announcement listener registration. + * + * Verifies that: + * - registerAnnouncementListener either succeeds or returns NOT_SUPPORTED; + * - if it succeeds, it returns a valid close handle (which is a nullptr otherwise); + * - closing handle does not crash. + */ +TEST_P(BroadcastRadioHalTest, AnnouncementListenerRegistration) { + LOG(DEBUG) << "AnnouncementListenerRegistration Test"; + std::shared_ptr listener = + SharedRefBase::make(); + std::shared_ptr closeHandle = nullptr; + + auto halResult = mModule->registerAnnouncementListener(listener, {AnnouncementType::EMERGENCY}, + &closeHandle); + + if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) { + ASSERT_EQ(closeHandle.get(), nullptr); + printSkipped("Announcements not supported"); + return; + } + + ASSERT_TRUE(halResult.isOk()); + ASSERT_NE(closeHandle.get(), nullptr); + + closeHandle->close(); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BroadcastRadioHalTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, BroadcastRadioHalTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IBroadcastRadio::descriptor)), + ::android::PrintInstanceNameToString); + +} // namespace aidl::android::hardware::broadcastradio::vts + +int main(int argc, char** argv) { + android::base::SetDefaultTag("BcRadio.vts"); + android::base::SetMinimumLogSeverity(android::base::VERBOSE); + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(4); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/broadcastradio/common/utils/WorkerThread.cpp b/broadcastradio/common/utils/WorkerThread.cpp index 31f4d3f83e..43fd04a89a 100644 --- a/broadcastradio/common/utils/WorkerThread.cpp +++ b/broadcastradio/common/utils/WorkerThread.cpp @@ -18,20 +18,23 @@ namespace android { -using std::chrono::milliseconds; -using std::chrono::steady_clock; using std::function; using std::lock_guard; using std::mutex; -using std::priority_queue; -using std::this_thread::sleep_for; using std::unique_lock; +using std::chrono::milliseconds; +using std::chrono::steady_clock; +using std::this_thread::sleep_for; bool operator<(const WorkerThread::Task& lhs, const WorkerThread::Task& rhs) { return lhs.when > rhs.when; } -WorkerThread::WorkerThread() : mIsTerminating(false), mThread(&WorkerThread::threadLoop, this) {} +WorkerThread::WorkerThread() : mIsTerminating(false) { + // putting mThread in constructor instead of initializer list + // to ensure all class members are init before mThread starts + mThread = std::thread(&WorkerThread::threadLoop, this); +} WorkerThread::~WorkerThread() { { @@ -43,16 +46,26 @@ WorkerThread::~WorkerThread() { } void WorkerThread::schedule(function task, milliseconds delay) { + auto cancelTask = []() {}; + schedule(std::move(task), cancelTask, delay); +} + +void WorkerThread::schedule(function task, function cancelTask, + milliseconds delay) { auto when = steady_clock::now() + delay; lock_guard lk(mMut); - mTasks.push(Task({when, task})); + mTasks.push(Task({when, std::move(task), std::move(cancelTask)})); mCond.notify_one(); } void WorkerThread::cancelAll() { lock_guard lk(mMut); - priority_queue().swap(mTasks); // empty queue + while (!mTasks.empty()) { + auto task = mTasks.top(); + task.onCanceled(); + mTasks.pop(); + } } void WorkerThread::threadLoop() { diff --git a/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h b/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h index 62bede6ca0..457b57e403 100644 --- a/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h +++ b/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h @@ -28,12 +28,15 @@ class WorkerThread { virtual ~WorkerThread(); void schedule(std::function task, std::chrono::milliseconds delay); + void schedule(std::function task, std::function cancelTask, + std::chrono::milliseconds delay); void cancelAll(); private: struct Task { std::chrono::time_point when; std::function what; + std::function onCanceled; }; friend bool operator<(const Task& lhs, const Task& rhs); diff --git a/broadcastradio/common/utilsaidl/Android.bp b/broadcastradio/common/utilsaidl/Android.bp new file mode 100644 index 0000000000..fa6de19363 --- /dev/null +++ b/broadcastradio/common/utilsaidl/Android.bp @@ -0,0 +1,50 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_library_static { + name: "android.hardware.broadcastradio@common-utils-aidl-lib", + vendor_available: true, + relative_install_path: "hw", + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + "-Wno-error=implicit-fallthrough", + ], + cppflags: [ + "-std=c++1z", + ], + srcs: [ + "Utils.cpp", + ], + export_include_dirs: ["include"], + shared_libs: [ + "android.hardware.broadcastradio-V1-ndk", + "libbase", + ], + static_libs: [ + "libmath", + ], +} diff --git a/broadcastradio/common/utilsaidl/Utils.cpp b/broadcastradio/common/utilsaidl/Utils.cpp new file mode 100644 index 0000000000..0551badc45 --- /dev/null +++ b/broadcastradio/common/utilsaidl/Utils.cpp @@ -0,0 +1,558 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "BcRadioAidlDef.utils" + +#include "broadcastradio-utils-aidl/Utils.h" + +#include +#include +#include + +#include + +namespace aidl::android::hardware::broadcastradio { + +namespace utils { + +namespace { + +using ::android::base::EqualsIgnoreCase; +using ::std::string; +using ::std::vector; + +const int64_t kValueForNotFoundIdentifier = 0; + +bool bothHaveId(const ProgramSelector& a, const ProgramSelector& b, const IdentifierType& type) { + return hasId(a, type) && hasId(b, type); +} + +bool haveEqualIds(const ProgramSelector& a, const ProgramSelector& b, const IdentifierType& type) { + if (!bothHaveId(a, b, type)) { + return false; + } + /* We should check all Ids of a given type (ie. other AF), + * but it doesn't matter for default implementation. + */ + return getId(a, type) == getId(b, type); +} + +int getHdSubchannel(const ProgramSelector& sel) { + int64_t hdSidExt = getId(sel, IdentifierType::HD_STATION_ID_EXT, /* defaultValue */ 0); + hdSidExt >>= 32; // Station ID number + return hdSidExt & 0xF; // HD Radio subchannel +} + +bool maybeGetId(const ProgramSelector& sel, const IdentifierType& type, int64_t* val) { + // iterate through primaryId and secondaryIds + for (auto it = begin(sel); it != end(sel); it++) { + if (it->type == type) { + if (val != nullptr) { + *val = it->value; + } + return true; + } + } + + return false; +} + +} // namespace + +IdentifierIterator::IdentifierIterator(const ProgramSelector& sel) : IdentifierIterator(sel, 0) {} + +IdentifierIterator::IdentifierIterator(const ProgramSelector& sel, size_t pos) + : mSel(sel), mPos(pos) {} + +const IdentifierIterator IdentifierIterator::operator++(int) { + IdentifierIterator i = *this; + mPos++; + return i; +} + +IdentifierIterator& IdentifierIterator::operator++() { + ++mPos; + return *this; +} + +IdentifierIterator::refType IdentifierIterator::operator*() const { + if (mPos == 0) { + return getSelector().primaryId; + } + + // mPos is 1-based for secondary identifiers + DCHECK(mPos <= getSelector().secondaryIds.size()); + return getSelector().secondaryIds[mPos - 1]; +} + +bool IdentifierIterator::operator==(const IdentifierIterator& rhs) const { + // Check, if both iterators points at the same selector. + if (reinterpret_cast(&getSelector()) != + reinterpret_cast(&rhs.getSelector())) { + return false; + } + + return mPos == rhs.mPos; +} + +int32_t resultToInt(Result result) { + return static_cast(result); +} + +FrequencyBand getBand(int64_t freq) { + // keep in sync with + // frameworks/base/services/core/java/com/android/server/broadcastradio/aidl/Utils.java + if (freq < 30) return FrequencyBand::UNKNOWN; + if (freq < 500) return FrequencyBand::AM_LW; + if (freq < 1705) return FrequencyBand::AM_MW; + if (freq < 30000) return FrequencyBand::AM_SW; + if (freq < 60000) return FrequencyBand::UNKNOWN; + if (freq < 110000) return FrequencyBand::FM; + return FrequencyBand::UNKNOWN; +} + +bool tunesTo(const ProgramSelector& a, const ProgramSelector& b) { + IdentifierType type = b.primaryId.type; + + switch (type) { + case IdentifierType::HD_STATION_ID_EXT: + case IdentifierType::RDS_PI: + case IdentifierType::AMFM_FREQUENCY_KHZ: + if (haveEqualIds(a, b, IdentifierType::HD_STATION_ID_EXT)) return true; + if (haveEqualIds(a, b, IdentifierType::RDS_PI)) return true; + return getHdSubchannel(b) == 0 && + haveEqualIds(a, b, IdentifierType::AMFM_FREQUENCY_KHZ); + case IdentifierType::DAB_SID_EXT: + if (!haveEqualIds(a, b, IdentifierType::DAB_SID_EXT)) { + return false; + } + if (hasId(a, IdentifierType::DAB_ENSEMBLE) && + !haveEqualIds(a, b, IdentifierType::DAB_ENSEMBLE)) { + return false; + } + if (hasId(a, IdentifierType::DAB_FREQUENCY_KHZ) && + !haveEqualIds(a, b, IdentifierType::DAB_FREQUENCY_KHZ)) { + return false; + } + return true; + case IdentifierType::DRMO_SERVICE_ID: + return haveEqualIds(a, b, IdentifierType::DRMO_SERVICE_ID); + case IdentifierType::SXM_SERVICE_ID: + return haveEqualIds(a, b, IdentifierType::SXM_SERVICE_ID); + default: // includes all vendor types + LOG(WARNING) << "unsupported program type: " << toString(type); + return false; + } +} + +bool hasId(const ProgramSelector& sel, const IdentifierType& type) { + return maybeGetId(sel, type, /* val */ nullptr); +} + +int64_t getId(const ProgramSelector& sel, const IdentifierType& type) { + int64_t val; + + if (maybeGetId(sel, type, &val)) { + return val; + } + + LOG(WARNING) << "identifier not found: " << toString(type); + return kValueForNotFoundIdentifier; +} + +int64_t getId(const ProgramSelector& sel, const IdentifierType& type, int64_t defaultValue) { + if (!hasId(sel, type)) { + return defaultValue; + } + return getId(sel, type); +} + +vector getAllIds(const ProgramSelector& sel, const IdentifierType& type) { + vector ret; + + // iterate through primaryId and secondaryIds + for (auto it = begin(sel); it != end(sel); it++) { + if (it->type == type) { + ret.push_back(it->value); + } + } + + return ret; +} + +bool isSupported(const Properties& prop, const ProgramSelector& sel) { + for (auto it = prop.supportedIdentifierTypes.begin(); it != prop.supportedIdentifierTypes.end(); + it++) { + if (hasId(sel, *it)) { + return true; + } + } + return false; +} + +bool isValid(const ProgramIdentifier& id) { + int64_t val = id.value; + bool valid = true; + + auto expect = [&valid](bool condition, const string& message) { + if (!condition) { + valid = false; + LOG(ERROR) << "identifier not valid, expected " << message; + } + }; + + switch (id.type) { + case IdentifierType::INVALID: + expect(false, "IdentifierType::INVALID"); + break; + case IdentifierType::DAB_FREQUENCY_KHZ: + expect(val > 100000u, "f > 100MHz"); + [[fallthrough]]; + case IdentifierType::AMFM_FREQUENCY_KHZ: + case IdentifierType::DRMO_FREQUENCY_KHZ: + expect(val > 100u, "f > 100kHz"); + expect(val < 10000000u, "f < 10GHz"); + break; + case IdentifierType::RDS_PI: + expect(val != 0u, "RDS PI != 0"); + expect(val <= 0xFFFFu, "16bit id"); + break; + case IdentifierType::HD_STATION_ID_EXT: { + int64_t stationId = val & 0xFFFFFFFF; // 32bit + val >>= 32; + int64_t subchannel = val & 0xF; // 4bit + val >>= 4; + int64_t freq = val & 0x3FFFF; // 18bit + expect(stationId != 0u, "HD station id != 0"); + expect(subchannel < 8u, "HD subch < 8"); + expect(freq > 100u, "f > 100kHz"); + expect(freq < 10000000u, "f < 10GHz"); + break; + } + case IdentifierType::HD_STATION_NAME: { + while (val > 0) { + char ch = static_cast(val & 0xFF); + val >>= 8; + expect((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z'), + "HD_STATION_NAME does not match [A-Z0-9]+"); + } + break; + } + case IdentifierType::DAB_SID_EXT: { + int64_t sid = val & 0xFFFFFFFF; // 32bit + val >>= 32; + int64_t ecc = val & 0xFF; // 8bit + expect(sid != 0u, "DAB SId != 0"); + expect(ecc >= 0xA0u && ecc <= 0xF6u, "Invalid ECC, see ETSI TS 101 756 V2.1.1"); + break; + } + case IdentifierType::DAB_ENSEMBLE: + expect(val != 0u, "DAB ensemble != 0"); + expect(val <= 0xFFFFu, "16bit id"); + break; + case IdentifierType::DAB_SCID: + expect(val > 0xFu, "12bit SCId (not 4bit SCIdS)"); + expect(val <= 0xFFFu, "12bit id"); + break; + case IdentifierType::DRMO_SERVICE_ID: + expect(val != 0u, "DRM SId != 0"); + expect(val <= 0xFFFFFFu, "24bit id"); + break; + case IdentifierType::SXM_SERVICE_ID: + expect(val != 0u, "SXM SId != 0"); + expect(val <= 0xFFFFFFFFu, "32bit id"); + break; + case IdentifierType::SXM_CHANNEL: + expect(val < 1000u, "SXM channel < 1000"); + break; + case IdentifierType::VENDOR_START: + case IdentifierType::VENDOR_END: + // skip + break; + } + + return valid; +} + +bool isValid(const ProgramSelector& sel) { + if (sel.primaryId.type != IdentifierType::AMFM_FREQUENCY_KHZ && + sel.primaryId.type != IdentifierType::RDS_PI && + sel.primaryId.type != IdentifierType::HD_STATION_ID_EXT && + sel.primaryId.type != IdentifierType::DAB_SID_EXT && + sel.primaryId.type != IdentifierType::DRMO_SERVICE_ID && + sel.primaryId.type != IdentifierType::SXM_SERVICE_ID && + (sel.primaryId.type < IdentifierType::VENDOR_START || + sel.primaryId.type > IdentifierType::VENDOR_END)) { + return false; + } + return isValid(sel.primaryId); +} + +ProgramIdentifier makeIdentifier(IdentifierType type, int64_t value) { + return {type, value}; +} + +ProgramSelector makeSelectorAmfm(int32_t frequency) { + ProgramSelector sel = {}; + sel.primaryId = makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, frequency); + return sel; +} + +ProgramSelector makeSelectorDab(int64_t sidExt) { + ProgramSelector sel = {}; + sel.primaryId = makeIdentifier(IdentifierType::DAB_SID_EXT, sidExt); + return sel; +} + +ProgramSelector makeSelectorDab(int64_t sidExt, int32_t ensemble, int64_t freq) { + ProgramSelector sel = {}; + sel.primaryId = makeIdentifier(IdentifierType::DAB_SID_EXT, sidExt); + vector secondaryIds = { + makeIdentifier(IdentifierType::DAB_ENSEMBLE, ensemble), + makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, freq)}; + sel.secondaryIds = std::move(secondaryIds); + return sel; +} + +bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel) { + if (filter.identifierTypes.size() > 0) { + auto typeEquals = [](const ProgramIdentifier& id, IdentifierType type) { + return id.type == type; + }; + auto it = std::find_first_of(begin(sel), end(sel), filter.identifierTypes.begin(), + filter.identifierTypes.end(), typeEquals); + if (it == end(sel)) { + return false; + } + } + + if (filter.identifiers.size() > 0) { + auto it = std::find_first_of(begin(sel), end(sel), filter.identifiers.begin(), + filter.identifiers.end()); + if (it == end(sel)) { + return false; + } + } + + return true; +} + +size_t ProgramInfoHasher::operator()(const ProgramInfo& info) const { + const ProgramIdentifier& id = info.selector.primaryId; + + // This is not the best hash implementation, but good enough for default HAL + // implementation and tests. + size_t h = 0; + ::android::hashCombineSingle(h, id.type); + ::android::hashCombineSingle(h, id.value); + return h; +} + +bool ProgramInfoKeyEqual::operator()(const ProgramInfo& info1, const ProgramInfo& info2) const { + const ProgramIdentifier& id1 = info1.selector.primaryId; + const ProgramIdentifier& id2 = info2.selector.primaryId; + return id1.type == id2.type && id1.value == id2.value; +} + +void updateProgramList(const ProgramListChunk& chunk, ProgramInfoSet* list) { + if (chunk.purge) { + list->clear(); + } + + list->insert(chunk.modified.begin(), chunk.modified.end()); + + if (!chunk.removed.has_value()) { + return; + } + + for (auto& id : chunk.removed.value()) { + if (id.has_value()) { + ProgramInfo info = {}; + info.selector.primaryId = id.value(); + list->erase(info); + } + } +} + +std::optional getMetadataString(const ProgramInfo& info, const Metadata::Tag& tag) { + auto isRdsPs = [tag](const Metadata& item) { return item.getTag() == tag; }; + + auto it = std::find_if(info.metadata.begin(), info.metadata.end(), isRdsPs); + if (it == info.metadata.end()) { + return std::nullopt; + } + + std::string metadataString; + switch (it->getTag()) { + case Metadata::rdsPs: + metadataString = it->get(); + break; + case Metadata::rdsPty: + metadataString = std::to_string(it->get()); + break; + case Metadata::rbdsPty: + metadataString = std::to_string(it->get()); + break; + case Metadata::rdsRt: + metadataString = it->get(); + break; + case Metadata::songTitle: + metadataString = it->get(); + break; + case Metadata::songArtist: + metadataString = it->get(); + break; + case Metadata::songAlbum: + metadataString = it->get(); + break; + case Metadata::stationIcon: + metadataString = std::to_string(it->get()); + break; + case Metadata::albumArt: + metadataString = std::to_string(it->get()); + break; + case Metadata::programName: + metadataString = it->get(); + break; + case Metadata::dabEnsembleName: + metadataString = it->get(); + break; + case Metadata::dabEnsembleNameShort: + metadataString = it->get(); + break; + case Metadata::dabServiceName: + metadataString = it->get(); + break; + case Metadata::dabServiceNameShort: + metadataString = it->get(); + break; + case Metadata::dabComponentName: + metadataString = it->get(); + break; + case Metadata::dabComponentNameShort: + metadataString = it->get(); + break; + default: + LOG(ERROR) << "Metadata " << it->toString() << " is not converted."; + return std::nullopt; + } + return metadataString; +} + +ProgramIdentifier makeHdRadioStationName(const string& name) { + constexpr size_t maxlen = 8; + + string shortName; + shortName.reserve(maxlen); + + const auto& loc = std::locale::classic(); + for (const char& ch : name) { + if (!std::isalnum(ch, loc)) { + continue; + } + shortName.push_back(std::toupper(ch, loc)); + if (shortName.length() >= maxlen) { + break; + } + } + + // Short name is converted to HD_STATION_NAME by encoding each char into its ASCII value in + // in little-endian order. For example, "Abc" is converted to 0x434241. + int64_t val = 0; + for (auto rit = shortName.rbegin(); rit != shortName.rend(); ++rit) { + val <<= 8; + val |= static_cast(*rit); + } + + return makeIdentifier(IdentifierType::HD_STATION_NAME, val); +} + +IdentifierType getType(int typeAsInt) { + return static_cast(typeAsInt); +} + +bool parseArgInt(const string& s, int* out) { + return ::android::base::ParseInt(s, out); +} + +bool parseArgLong(const std::string& s, long* out) { + return ::android::base::ParseInt(s, out); +} + +bool parseArgBool(const string& s, bool* out) { + if (EqualsIgnoreCase(s, "true")) { + *out = true; + } else if (EqualsIgnoreCase(s, "false")) { + *out = false; + } else { + return false; + } + return true; +} + +bool parseArgDirection(const string& s, bool* out) { + if (EqualsIgnoreCase(s, "up")) { + *out = true; + } else if (EqualsIgnoreCase(s, "down")) { + *out = false; + } else { + return false; + } + return true; +} + +bool parseArgIdentifierTypeArray(const string& s, vector* out) { + for (const string& val : ::android::base::Split(s, ",")) { + int outInt; + if (!parseArgInt(val, &outInt)) { + return false; + } + out->push_back(getType(outInt)); + } + return true; +} + +bool parseProgramIdentifierList(const std::string& s, vector* out) { + for (const string& idStr : ::android::base::Split(s, ",")) { + const vector idStrPair = ::android::base::Split(idStr, ":"); + if (idStrPair.size() != 2) { + return false; + } + int idType; + if (!parseArgInt(idStrPair[0], &idType)) { + return false; + } + long idVal; + if (!parseArgLong(idStrPair[1], &idVal)) { + return false; + } + ProgramIdentifier id = {getType(idType), idVal}; + out->push_back(id); + } + return true; +} + +} // namespace utils + +utils::IdentifierIterator begin(const ProgramSelector& sel) { + return utils::IdentifierIterator(sel); +} + +utils::IdentifierIterator end(const ProgramSelector& sel) { + return utils::IdentifierIterator(sel) + 1 /* primary id */ + sel.secondaryIds.size(); +} + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h new file mode 100644 index 0000000000..ad075f2943 --- /dev/null +++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h @@ -0,0 +1,189 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace aidl::android::hardware::broadcastradio { + +namespace utils { + +enum class FrequencyBand { + UNKNOWN, + FM, + AM_LW, + AM_MW, + AM_SW, +}; + +class IdentifierIterator final + : public std::iterator { + using ptrType = typename std::iterator_traits::pointer; + using refType = typename std::iterator_traits::reference; + using diffType = typename std::iterator_traits::difference_type; + + public: + explicit IdentifierIterator(const ProgramSelector& sel); + + const IdentifierIterator operator++(int); + IdentifierIterator& operator++(); + refType operator*() const; + inline ptrType operator->() const { return &operator*(); } + IdentifierIterator operator+(diffType v) const { return IdentifierIterator(mSel, mPos + v); } + bool operator==(const IdentifierIterator& rhs) const; + inline bool operator!=(const IdentifierIterator& rhs) const { return !operator==(rhs); }; + + private: + explicit IdentifierIterator(const ProgramSelector& sel, size_t pos); + + std::reference_wrapper mSel; + + const ProgramSelector& getSelector() const { return mSel.get(); } + + /** 0 is the primary identifier, 1-n are secondary identifiers. */ + size_t mPos = 0; +}; + +/** + * Convert Result to int + */ +int32_t resultToInt(Result result); + +/** + * Guesses band from the frequency value. + * + * The band bounds are not exact to cover multiple regions. + * The function is biased towards success, i.e. it never returns + * FrequencyBand::UNKNOWN for correct frequency, but a result for + * incorrect one is undefined (it doesn't have to return UNKNOWN). + */ +FrequencyBand getBand(int64_t frequency); + +/** + * Checks, if {@code pointer} tunes to {@channel}. + * + * For example, having a channel {AMFM_FREQUENCY_KHZ = 103.3}: + * - selector {AMFM_FREQUENCY_KHZ = 103.3, HD_SUBCHANNEL = 0} can tune to this channel; + * - selector {AMFM_FREQUENCY_KHZ = 103.3, HD_SUBCHANNEL = 1} can't. + * + * @param pointer selector we're trying to match against channel. + * @param channel existing channel. + */ +bool tunesTo(const ProgramSelector& pointer, const ProgramSelector& channel); + +/** + * Checks whether a given program selector has the given ID (either primary or secondary). + */ +bool hasId(const ProgramSelector& sel, const IdentifierType& type); + +/** + * Returns ID (either primary or secondary) for a given program selector. + * + * If the selector does not contain given type, returns kValueForNotFoundIdentifier + * and emits a warning. + */ +int64_t getId(const ProgramSelector& sel, const IdentifierType& type); + +/** + * Returns ID (either primary or secondary) for a given program selector. + * + * If the selector does not contain given type, returns default value. + */ +int64_t getId(const ProgramSelector& sel, const IdentifierType& type, int64_t defaultValue); + +/** + * Returns all IDs of a given type. + */ +std::vector getAllIds(const ProgramSelector& sel, const IdentifierType& type); + +/** + * Checks, if a given selector is supported by the radio module. + * + * @param prop Module description. + * @param sel The selector to check. + * @return True, if the selector is supported, false otherwise. + */ +bool isSupported(const Properties& prop, const ProgramSelector& sel); + +bool isValid(const ProgramIdentifier& id); +bool isValid(const ProgramSelector& sel); + +ProgramIdentifier makeIdentifier(IdentifierType type, int64_t value); +ProgramSelector makeSelectorAmfm(int32_t frequency); +ProgramSelector makeSelectorDab(int64_t sidExt); +ProgramSelector makeSelectorDab(int64_t sidExt, int32_t ensemble, int64_t freq); + +bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel); + +struct ProgramInfoHasher { + size_t operator()(const ProgramInfo& info) const; +}; + +struct ProgramInfoKeyEqual { + bool operator()(const ProgramInfo& info1, const ProgramInfo& info2) const; +}; + +typedef std::unordered_set ProgramInfoSet; + +void updateProgramList(const ProgramListChunk& chunk, ProgramInfoSet* list); + +std::optional getMetadataString(const ProgramInfo& info, const Metadata::Tag& tag); + +ProgramIdentifier makeHdRadioStationName(const std::string& name); + +template +inline std::string vectorToString(const std::vector& in_values) { + return std::accumulate(std::begin(in_values), std::end(in_values), std::string{}, + [](const std::string& ls, const aidl_type& rs) { + return ls + (ls.empty() ? "" : ",") + toString(rs); + }); +} + +IdentifierType getType(int typeAsInt); + +bool parseArgInt(const std::string& s, int* out); + +bool parseArgLong(const std::string& s, long* out); + +bool parseArgBool(const std::string& s, bool* out); + +bool parseArgDirection(const std::string& s, bool* out); + +bool parseArgIdentifierTypeArray(const std::string& s, std::vector* out); + +bool parseProgramIdentifierList(const std::string& s, std::vector* out); + +} // namespace utils + +utils::IdentifierIterator begin(const ProgramSelector& sel); +utils::IdentifierIterator end(const ProgramSelector& sel); + +} // namespace aidl::android::hardware::broadcastradio diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp index fa7439229b..4ffcfd97f3 100644 --- a/camera/common/aidl/Android.bp +++ b/camera/common/aidl/Android.bp @@ -20,6 +20,9 @@ aidl_interface { java: { enabled: false, }, + rust: { + enabled: true, + } }, versions_with_info: [ { diff --git a/camera/common/1.0/default/Android.bp b/camera/common/default/Android.bp similarity index 78% rename from camera/common/1.0/default/Android.bp rename to camera/common/default/Android.bp index 4a5ca83803..e8c8f9dba0 100644 --- a/camera/common/1.0/default/Android.bp +++ b/camera/common/default/Android.bp @@ -8,7 +8,7 @@ package { } cc_library_static { - name: "android.hardware.camera.common@1.0-helper", + name: "android.hardware.camera.common-helper", vendor_available: true, defaults: ["hidl_defaults"], srcs: [ @@ -18,6 +18,7 @@ cc_library_static { "VendorTagDescriptor.cpp", "HandleImporter.cpp", "Exif.cpp", + "SimpleThread.cpp", ], cflags: [ "-Werror", @@ -37,3 +38,11 @@ cc_library_static { include_dirs: ["system/media/private/camera/include"], export_include_dirs: ["include"], } + +// NOTE: Deprecated module kept for compatibility reasons. +// Depend on "android.hardware.camera.common-helper" instead +cc_library_static { + name: "android.hardware.camera.common@1.0-helper", + vendor_available: true, + whole_static_libs: ["android.hardware.camera.common-helper"], +} diff --git a/camera/common/1.0/default/CameraMetadata.cpp b/camera/common/default/CameraMetadata.cpp similarity index 75% rename from camera/common/1.0/default/CameraMetadata.cpp rename to camera/common/default/CameraMetadata.cpp index 1da88ec6e4..3252e3ca47 100644 --- a/camera/common/1.0/default/CameraMetadata.cpp +++ b/camera/common/default/CameraMetadata.cpp @@ -27,44 +27,36 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { -#define ALIGN_TO(val, alignment) \ - (((uintptr_t)(val) + ((alignment) - 1)) & ~((alignment) - 1)) +#define ALIGN_TO(val, alignment) (((uintptr_t)(val) + ((alignment)-1)) & ~((alignment)-1)) -CameraMetadata::CameraMetadata() : - mBuffer(NULL), mLocked(false) { -} +CameraMetadata::CameraMetadata() : mBuffer(NULL), mLocked(false) {} -CameraMetadata::CameraMetadata(size_t entryCapacity, size_t dataCapacity) : - mLocked(false) -{ +CameraMetadata::CameraMetadata(size_t entryCapacity, size_t dataCapacity) : mLocked(false) { mBuffer = allocate_camera_metadata(entryCapacity, dataCapacity); } -CameraMetadata::CameraMetadata(const CameraMetadata &other) : - mLocked(false) { +CameraMetadata::CameraMetadata(const CameraMetadata& other) : mLocked(false) { mBuffer = clone_camera_metadata(other.mBuffer); } -CameraMetadata::CameraMetadata(camera_metadata_t *buffer) : - mBuffer(NULL), mLocked(false) { +CameraMetadata::CameraMetadata(camera_metadata_t* buffer) : mBuffer(NULL), mLocked(false) { acquire(buffer); } -CameraMetadata &CameraMetadata::operator=(const CameraMetadata &other) { +CameraMetadata& CameraMetadata::operator=(const CameraMetadata& other) { return operator=(other.mBuffer); } -CameraMetadata &CameraMetadata::operator=(const camera_metadata_t *buffer) { +CameraMetadata& CameraMetadata::operator=(const camera_metadata_t* buffer) { if (mLocked) { ALOGE("%s: Assignment to a locked CameraMetadata!", __FUNCTION__); return *this; } if (CC_LIKELY(buffer != mBuffer)) { - camera_metadata_t *newBuffer = clone_camera_metadata(buffer); + camera_metadata_t* newBuffer = clone_camera_metadata(buffer); clear(); mBuffer = newBuffer; } @@ -81,14 +73,13 @@ const camera_metadata_t* CameraMetadata::getAndLock() const { return mBuffer; } -status_t CameraMetadata::unlock(const camera_metadata_t *buffer) const { +status_t CameraMetadata::unlock(const camera_metadata_t* buffer) const { if (!mLocked) { ALOGE("%s: Can't unlock a non-locked CameraMetadata!", __FUNCTION__); return INVALID_OPERATION; } if (buffer != mBuffer) { - ALOGE("%s: Can't unlock CameraMetadata with wrong pointer!", - __FUNCTION__); + ALOGE("%s: Can't unlock CameraMetadata with wrong pointer!", __FUNCTION__); return BAD_VALUE; } mLocked = false; @@ -100,7 +91,7 @@ camera_metadata_t* CameraMetadata::release() { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return NULL; } - camera_metadata_t *released = mBuffer; + camera_metadata_t* released = mBuffer; mBuffer = NULL; return released; } @@ -116,7 +107,7 @@ void CameraMetadata::clear() { } } -void CameraMetadata::acquire(camera_metadata_t *buffer) { +void CameraMetadata::acquire(camera_metadata_t* buffer) { if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return; @@ -124,12 +115,11 @@ void CameraMetadata::acquire(camera_metadata_t *buffer) { clear(); mBuffer = buffer; - ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/NULL) != OK, - "%s: Failed to validate metadata structure %p", - __FUNCTION__, buffer); + ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/ NULL) != OK, + "%s: Failed to validate metadata structure %p", __FUNCTION__, buffer); } -void CameraMetadata::acquire(CameraMetadata &other) { +void CameraMetadata::acquire(CameraMetadata& other) { if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return; @@ -137,7 +127,7 @@ void CameraMetadata::acquire(CameraMetadata &other) { acquire(other.release()); } -status_t CameraMetadata::append(const CameraMetadata &other) { +status_t CameraMetadata::append(const CameraMetadata& other) { return append(other.mBuffer); } @@ -154,8 +144,7 @@ status_t CameraMetadata::append(const camera_metadata_t* other) { } size_t CameraMetadata::entryCount() const { - return (mBuffer == NULL) ? 0 : - get_camera_metadata_entry_count(mBuffer); + return (mBuffer == NULL) ? 0 : get_camera_metadata_entry_count(mBuffer); } bool CameraMetadata::isEmpty() const { @@ -172,11 +161,11 @@ status_t CameraMetadata::sort() { status_t CameraMetadata::checkType(uint32_t tag, uint8_t expectedType) { int tagType = get_local_camera_metadata_tag_type(tag, mBuffer); - if ( CC_UNLIKELY(tagType == -1)) { + if (CC_UNLIKELY(tagType == -1)) { ALOGE("Update metadata entry: Unknown tag %d", tag); return INVALID_OPERATION; } - if ( CC_UNLIKELY(tagType != expectedType) ) { + if (CC_UNLIKELY(tagType != expectedType)) { ALOGE("Mismatched tag type when updating entry %s (%d) of type %s; " "got type %s data instead ", get_local_camera_metadata_tag_name(tag, mBuffer), tag, @@ -186,112 +175,105 @@ status_t CameraMetadata::checkType(uint32_t tag, uint8_t expectedType) { return OK; } -status_t CameraMetadata::update(uint32_t tag, - const int32_t *data, size_t data_count) { +status_t CameraMetadata::update(uint32_t tag, const int32_t* data, size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_INT32)) != OK) { + if ((res = checkType(tag, TYPE_INT32)) != OK) { return res; } return updateImpl(tag, (const void*)data, data_count); } -status_t CameraMetadata::update(uint32_t tag, - const uint8_t *data, size_t data_count) { +status_t CameraMetadata::update(uint32_t tag, const uint8_t* data, size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_BYTE)) != OK) { + if ((res = checkType(tag, TYPE_BYTE)) != OK) { return res; } return updateImpl(tag, (const void*)data, data_count); } -status_t CameraMetadata::update(uint32_t tag, - const float *data, size_t data_count) { +status_t CameraMetadata::update(uint32_t tag, const float* data, size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_FLOAT)) != OK) { + if ((res = checkType(tag, TYPE_FLOAT)) != OK) { return res; } return updateImpl(tag, (const void*)data, data_count); } -status_t CameraMetadata::update(uint32_t tag, - const int64_t *data, size_t data_count) { +status_t CameraMetadata::update(uint32_t tag, const int64_t* data, size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_INT64)) != OK) { + if ((res = checkType(tag, TYPE_INT64)) != OK) { return res; } return updateImpl(tag, (const void*)data, data_count); } -status_t CameraMetadata::update(uint32_t tag, - const double *data, size_t data_count) { +status_t CameraMetadata::update(uint32_t tag, const double* data, size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_DOUBLE)) != OK) { + if ((res = checkType(tag, TYPE_DOUBLE)) != OK) { return res; } return updateImpl(tag, (const void*)data, data_count); } -status_t CameraMetadata::update(uint32_t tag, - const camera_metadata_rational_t *data, size_t data_count) { +status_t CameraMetadata::update(uint32_t tag, const camera_metadata_rational_t* data, + size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_RATIONAL)) != OK) { + if ((res = checkType(tag, TYPE_RATIONAL)) != OK) { return res; } return updateImpl(tag, (const void*)data, data_count); } -status_t CameraMetadata::update(uint32_t tag, - const String8 &string) { +status_t CameraMetadata::update(uint32_t tag, const String8& string) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(tag, TYPE_BYTE)) != OK) { + if ((res = checkType(tag, TYPE_BYTE)) != OK) { return res; } // string.size() doesn't count the null termination character. return updateImpl(tag, (const void*)string.c_str(), string.size() + 1); } -status_t CameraMetadata::update(const camera_metadata_ro_entry &entry) { +status_t CameraMetadata::update(const camera_metadata_ro_entry& entry) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); return INVALID_OPERATION; } - if ( (res = checkType(entry.tag, entry.type)) != OK) { + if ((res = checkType(entry.tag, entry.type)) != OK) { return res; } return updateImpl(entry.tag, (const void*)entry.data.u8, entry.count); } -status_t CameraMetadata::updateImpl(uint32_t tag, const void *data, - size_t data_count) { +status_t CameraMetadata::updateImpl(uint32_t tag, const void* data, size_t data_count) { status_t res; if (mLocked) { ALOGE("%s: CameraMetadata is locked", __FUNCTION__); @@ -308,13 +290,11 @@ status_t CameraMetadata::updateImpl(uint32_t tag, const void *data, uintptr_t bufAddr = reinterpret_cast(mBuffer); uintptr_t dataAddr = reinterpret_cast(data); if (dataAddr > bufAddr && dataAddr < (bufAddr + bufferSize)) { - ALOGE("%s: Update attempted with data from the same metadata buffer!", - __FUNCTION__); + ALOGE("%s: Update attempted with data from the same metadata buffer!", __FUNCTION__); return INVALID_OPERATION; } - size_t data_size = calculate_camera_metadata_entry_data_size(type, - data_count); + size_t data_size = calculate_camera_metadata_entry_data_size(type, data_count); res = resizeIfNeeded(1, data_size); @@ -322,11 +302,9 @@ status_t CameraMetadata::updateImpl(uint32_t tag, const void *data, camera_metadata_entry_t entry; res = find_camera_metadata_entry(mBuffer, tag, &entry); if (res == NAME_NOT_FOUND) { - res = add_camera_metadata_entry(mBuffer, - tag, data, data_count); + res = add_camera_metadata_entry(mBuffer, tag, data, data_count); } else if (res == OK) { - res = update_camera_metadata_entry(mBuffer, - entry.index, data, data_count, NULL); + res = update_camera_metadata_entry(mBuffer, entry.index, data, data_count, NULL); } } @@ -337,11 +315,10 @@ status_t CameraMetadata::updateImpl(uint32_t tag, const void *data, } IF_ALOGV() { - ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/NULL) != - OK, + ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/ NULL) != OK, - "%s: Failed to validate metadata structure after update %p", - __FUNCTION__, mBuffer); + "%s: Failed to validate metadata structure after update %p", __FUNCTION__, + mBuffer); } return res; @@ -361,7 +338,7 @@ camera_metadata_entry_t CameraMetadata::find(uint32_t tag) { return entry; } res = find_camera_metadata_entry(mBuffer, tag, &entry); - if (CC_UNLIKELY( res != OK )) { + if (CC_UNLIKELY(res != OK)) { entry.count = 0; entry.data.u8 = NULL; } @@ -372,7 +349,7 @@ camera_metadata_ro_entry_t CameraMetadata::find(uint32_t tag) const { status_t res; camera_metadata_ro_entry entry; res = find_camera_metadata_ro_entry(mBuffer, tag, &entry); - if (CC_UNLIKELY( res != OK )) { + if (CC_UNLIKELY(res != OK)) { entry.count = 0; entry.data.u8 = NULL; } @@ -418,23 +395,17 @@ status_t CameraMetadata::resizeIfNeeded(size_t extraEntries, size_t extraData) { } else { size_t currentEntryCount = get_camera_metadata_entry_count(mBuffer); size_t currentEntryCap = get_camera_metadata_entry_capacity(mBuffer); - size_t newEntryCount = currentEntryCount + - extraEntries; - newEntryCount = (newEntryCount > currentEntryCap) ? - newEntryCount * 2 : currentEntryCap; + size_t newEntryCount = currentEntryCount + extraEntries; + newEntryCount = (newEntryCount > currentEntryCap) ? newEntryCount * 2 : currentEntryCap; size_t currentDataCount = get_camera_metadata_data_count(mBuffer); size_t currentDataCap = get_camera_metadata_data_capacity(mBuffer); - size_t newDataCount = currentDataCount + - extraData; - newDataCount = (newDataCount > currentDataCap) ? - newDataCount * 2 : currentDataCap; + size_t newDataCount = currentDataCount + extraData; + newDataCount = (newDataCount > currentDataCap) ? newDataCount * 2 : currentDataCap; - if (newEntryCount > currentEntryCap || - newDataCount > currentDataCap) { - camera_metadata_t *oldBuffer = mBuffer; - mBuffer = allocate_camera_metadata(newEntryCount, - newDataCount); + if (newEntryCount > currentEntryCap || newDataCount > currentDataCap) { + camera_metadata_t* oldBuffer = mBuffer; + mBuffer = allocate_camera_metadata(newEntryCount, newDataCount); if (mBuffer == NULL) { ALOGE("%s: Can't allocate larger metadata buffer", __FUNCTION__); return NO_MEMORY; @@ -462,14 +433,13 @@ void CameraMetadata::swap(CameraMetadata& other) { mBuffer = otherBuf; } -status_t CameraMetadata::getTagFromName(const char *name, - const VendorTagDescriptor* vTags, uint32_t *tag) { - +status_t CameraMetadata::getTagFromName(const char* name, const VendorTagDescriptor* vTags, + uint32_t* tag) { if (name == nullptr || tag == nullptr) return BAD_VALUE; size_t nameLength = strlen(name); - const SortedVector *vendorSections; + const SortedVector* vendorSections; size_t vendorSectionCount = 0; if (vTags != NULL) { @@ -478,7 +448,7 @@ status_t CameraMetadata::getTagFromName(const char *name, } // First, find the section by the longest string match - const char *section = NULL; + const char* section = NULL; size_t sectionIndex = 0; size_t sectionLength = 0; size_t totalSectionCount = ANDROID_SECTION_COUNT + vendorSectionCount; @@ -489,7 +459,7 @@ status_t CameraMetadata::getTagFromName(const char *name, ALOGV("%s: Trying to match against section '%s'", __FUNCTION__, str); - if (strstr(name, str) == name) { // name begins with the section name + if (strstr(name, str) == name) { // name begins with the section name size_t strLength = strlen(str); ALOGV("%s: Name begins with section name", __FUNCTION__); @@ -508,12 +478,11 @@ status_t CameraMetadata::getTagFromName(const char *name, if (section == NULL) { return NAME_NOT_FOUND; } else { - ALOGV("%s: Found matched section '%s' (%zu)", - __FUNCTION__, section, sectionIndex); + ALOGV("%s: Found matched section '%s' (%zu)", __FUNCTION__, section, sectionIndex); } // Get the tag name component of the name - const char *nameTagName = name + sectionLength + 1; // x.y.z -> z + const char* nameTagName = name + sectionLength + 1; // x.y.z -> z if (sectionLength + 1 >= nameLength) { return BAD_VALUE; } @@ -522,16 +491,15 @@ status_t CameraMetadata::getTagFromName(const char *name, uint32_t candidateTag = 0; if (sectionIndex < ANDROID_SECTION_COUNT) { // Match built-in tags (typically android.*) - uint32_t tagBegin, tagEnd; // [tagBegin, tagEnd) + uint32_t tagBegin, tagEnd; // [tagBegin, tagEnd) tagBegin = camera_metadata_section_bounds[sectionIndex][0]; tagEnd = camera_metadata_section_bounds[sectionIndex][1]; for (candidateTag = tagBegin; candidateTag < tagEnd; ++candidateTag) { - const char *tagName = get_camera_metadata_tag_name(candidateTag); + const char* tagName = get_camera_metadata_tag_name(candidateTag); if (strcmp(nameTagName, tagName) == 0) { - ALOGV("%s: Found matched tag '%s' (%d)", - __FUNCTION__, tagName, candidateTag); + ALOGV("%s: Found matched tag '%s' (%d)", __FUNCTION__, tagName, candidateTag); break; } } @@ -554,10 +522,8 @@ status_t CameraMetadata::getTagFromName(const char *name, return OK; } - -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/common/1.0/default/CameraModule.cpp b/camera/common/default/CameraModule.cpp similarity index 84% rename from camera/common/1.0/default/CameraModule.cpp rename to camera/common/default/CameraModule.cpp index 16fb85cc64..9960842ead 100644 --- a/camera/common/1.0/default/CameraModule.cpp +++ b/camera/common/default/CameraModule.cpp @@ -16,7 +16,7 @@ #define LOG_TAG "CamComm1.0-CamModule" #define ATRACE_TAG ATRACE_TAG_CAMERA -//#define LOG_NDEBUG 0 +// #define LOG_NDEBUG 0 #include @@ -26,11 +26,9 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { -void CameraModule::deriveCameraCharacteristicsKeys( - uint32_t deviceVersion, CameraMetadata &chars) { +void CameraModule::deriveCameraCharacteristicsKeys(uint32_t deviceVersion, CameraMetadata& chars) { ATRACE_CALL(); Vector derivedCharKeys; @@ -40,9 +38,9 @@ void CameraModule::deriveCameraCharacteristicsKeys( if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_3) { Vector controlModes; uint8_t data = ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE; - chars.update(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &data, /*count*/1); + chars.update(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &data, /*count*/ 1); data = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE; - chars.update(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &data, /*count*/1); + chars.update(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &data, /*count*/ 1); controlModes.push(ANDROID_CONTROL_MODE_AUTO); camera_metadata_entry entry = chars.find(ANDROID_CONTROL_AVAILABLE_SCENE_MODES); if (entry.count > 1 || entry.data.u8[0] != ANDROID_CONTROL_SCENE_MODE_DISABLED) { @@ -121,14 +119,14 @@ void CameraModule::deriveCameraCharacteristicsKeys( if (entry.count > 0) { Vector highSpeedConfig; for (size_t i = 0; i < entry.count; i += 4) { - highSpeedConfig.add(entry.data.i32[i]); // width - highSpeedConfig.add(entry.data.i32[i + 1]); // height - highSpeedConfig.add(entry.data.i32[i + 2]); // fps_min - highSpeedConfig.add(entry.data.i32[i + 3]); // fps_max - highSpeedConfig.add(1); // batchSize_max. default to 1 for HAL3.2 + highSpeedConfig.add(entry.data.i32[i]); // width + highSpeedConfig.add(entry.data.i32[i + 1]); // height + highSpeedConfig.add(entry.data.i32[i + 2]); // fps_min + highSpeedConfig.add(entry.data.i32[i + 3]); // fps_max + highSpeedConfig.add(1); // batchSize_max. default to 1 for HAL3.2 } chars.update(ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, - highSpeedConfig); + highSpeedConfig); } } @@ -145,25 +143,23 @@ void CameraModule::deriveCameraCharacteristicsKeys( const int STREAM_IS_INPUT_OFFSET = 3; Vector rawOpaqueSizes; - for (size_t i=0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) { + for (size_t i = 0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) { int32_t format = entry.data.i32[i + STREAM_FORMAT_OFFSET]; int32_t width = entry.data.i32[i + STREAM_WIDTH_OFFSET]; int32_t height = entry.data.i32[i + STREAM_HEIGHT_OFFSET]; int32_t isInput = entry.data.i32[i + STREAM_IS_INPUT_OFFSET]; if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - format == HAL_PIXEL_FORMAT_RAW_OPAQUE) { + format == HAL_PIXEL_FORMAT_RAW_OPAQUE) { supportRawOpaque = true; rawOpaqueSizes.push(width); rawOpaqueSizes.push(height); // 2 bytes per pixel. This rough estimation is only used when // HAL does not fill in the opaque raw size - rawOpaqueSizes.push(width * height *2); + rawOpaqueSizes.push(width * height * 2); } if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - (format == HAL_PIXEL_FORMAT_RAW16 || - format == HAL_PIXEL_FORMAT_RAW10 || - format == HAL_PIXEL_FORMAT_RAW12 || - format == HAL_PIXEL_FORMAT_RAW_OPAQUE)) { + (format == HAL_PIXEL_FORMAT_RAW16 || format == HAL_PIXEL_FORMAT_RAW10 || + format == HAL_PIXEL_FORMAT_RAW12 || format == HAL_PIXEL_FORMAT_RAW_OPAQUE)) { supportAnyRaw = true; } } @@ -183,9 +179,7 @@ void CameraModule::deriveCameraCharacteristicsKeys( entry = chars.find(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE); if (entry.count == 0) { // Fill in default value (100, 100) - chars.update( - ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE, - defaultRange, 2); + chars.update(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE, defaultRange, 2); derivedCharKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE); // Actual request/results will be derived by camera device. derivedRequestKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST); @@ -197,22 +191,19 @@ void CameraModule::deriveCameraCharacteristicsKeys( // Add those newly added keys to AVAILABLE_CHARACTERISTICS_KEYS // This has to be done at this end of this function. if (derivedCharKeys.size() > 0) { - appendAvailableKeys( - chars, ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, derivedCharKeys); + appendAvailableKeys(chars, ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, derivedCharKeys); } if (derivedRequestKeys.size() > 0) { - appendAvailableKeys( - chars, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, derivedRequestKeys); + appendAvailableKeys(chars, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, derivedRequestKeys); } if (derivedResultKeys.size() > 0) { - appendAvailableKeys( - chars, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, derivedResultKeys); + appendAvailableKeys(chars, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, derivedResultKeys); } return; } -void CameraModule::appendAvailableKeys(CameraMetadata &chars, - int32_t keyTag, const Vector& appendKeys) { +void CameraModule::appendAvailableKeys(CameraMetadata& chars, int32_t keyTag, + const Vector& appendKeys) { camera_metadata_entry entry = chars.find(keyTag); Vector availableKeys; availableKeys.setCapacity(entry.count + appendKeys.size()); @@ -225,7 +216,7 @@ void CameraModule::appendAvailableKeys(CameraMetadata &chars, chars.update(keyTag, availableKeys); } -CameraModule::CameraModule(camera_module_t *module) : mNumberOfCameras(0) { +CameraModule::CameraModule(camera_module_t* module) : mNumberOfCameras(0) { if (module == NULL) { ALOGE("%s: camera hardware module must not be null", __FUNCTION__); assert(0); @@ -233,8 +224,7 @@ CameraModule::CameraModule(camera_module_t *module) : mNumberOfCameras(0) { mModule = module; } -CameraModule::~CameraModule() -{ +CameraModule::~CameraModule() { while (mCameraInfoMap.size() > 0) { camera_info cameraInfo = mCameraInfoMap.editValueAt(0); if (cameraInfo.static_camera_characteristics != NULL) { @@ -256,8 +246,7 @@ CameraModule::~CameraModule() int CameraModule::init() { ATRACE_CALL(); int res = OK; - if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4 && - mModule->init != NULL) { + if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4 && mModule->init != NULL) { ATRACE_BEGIN("camera_module->init"); res = mModule->init(); ATRACE_END(); @@ -267,7 +256,7 @@ int CameraModule::init() { return res; } -int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) { +int CameraModule::getCameraInfo(int cameraId, struct camera_info* info) { ATRACE_CALL(); Mutex::Autolock lock(mCameraInfoLock); if (cameraId < 0) { @@ -318,7 +307,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) { return OK; } -int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t **physicalInfo) { +int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t** physicalInfo) { ATRACE_CALL(); Mutex::Autolock lock(mCameraInfoLock); if (physicalCameraId < mNumberOfCameras) { @@ -330,7 +319,7 @@ int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t int apiVersion = mModule->common.module_api_version; if (apiVersion < CAMERA_MODULE_API_VERSION_2_5) { ALOGE("%s: Module version must be at least 2.5 to handle getPhysicalCameraInfo", - __FUNCTION__); + __FUNCTION__); return -ENODEV; } if (mModule->get_physical_camera_info == nullptr) { @@ -341,7 +330,7 @@ int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t ssize_t index = mPhysicalCameraInfoMap.indexOfKey(physicalCameraId); if (index == NAME_NOT_FOUND) { // Get physical camera characteristics, and cache it - camera_metadata_t *info = nullptr; + camera_metadata_t* info = nullptr; ATRACE_BEGIN("camera_module->get_physical_camera_info"); int ret = mModule->get_physical_camera_info(physicalCameraId, &info); ATRACE_END(); @@ -396,8 +385,7 @@ bool CameraModule::isOpenLegacyDefined() const { return mModule->open_legacy != NULL; } -int CameraModule::openLegacy( - const char* id, uint32_t halVersion, struct hw_device_t** device) { +int CameraModule::openLegacy(const char* id, uint32_t halVersion, struct hw_device_t** device) { int res; ATRACE_BEGIN("camera_module->open_legacy"); res = mModule->open_legacy(&mModule->common, id, halVersion, device); @@ -413,7 +401,7 @@ int CameraModule::getNumberOfCameras() { return numCameras; } -int CameraModule::setCallbacks(const camera_module_callbacks_t *callbacks) { +int CameraModule::setCallbacks(const camera_module_callbacks_t* callbacks) { int res = OK; ATRACE_BEGIN("camera_module->set_callbacks"); if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_1) { @@ -438,8 +426,7 @@ void CameraModule::getVendorTagOps(vendor_tag_ops_t* ops) { bool CameraModule::isSetTorchModeSupported() const { if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4) { if (mModule->set_torch_mode == NULL) { - ALOGE("%s: Module 2.4 device must support set torch API!", - __FUNCTION__); + ALOGE("%s: Module 2.4 device must support set torch API!", __FUNCTION__); return false; } return true; @@ -457,7 +444,7 @@ int CameraModule::setTorchMode(const char* camera_id, bool enable) { return res; } -int CameraModule::isStreamCombinationSupported(int cameraId, camera_stream_combination_t *streams) { +int CameraModule::isStreamCombinationSupported(int cameraId, camera_stream_combination_t* streams) { int res = INVALID_OPERATION; if (mModule->is_stream_combination_supported != NULL) { ATRACE_BEGIN("camera_module->is_stream_combination_supported"); @@ -468,44 +455,41 @@ int CameraModule::isStreamCombinationSupported(int cameraId, camera_stream_combi } void CameraModule::notifyDeviceStateChange(uint64_t deviceState) { - if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_5 && - mModule->notify_device_state_change != NULL) { - ATRACE_BEGIN("camera_module->notify_device_state_change"); - ALOGI("%s: calling notify_device_state_change with state %" PRId64, __FUNCTION__, - deviceState); - mModule->notify_device_state_change(deviceState); - ATRACE_END(); - } + if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_5 && + mModule->notify_device_state_change != NULL) { + ATRACE_BEGIN("camera_module->notify_device_state_change"); + ALOGI("%s: calling notify_device_state_change with state %" PRId64, __FUNCTION__, + deviceState); + mModule->notify_device_state_change(deviceState); + ATRACE_END(); + } } -bool CameraModule::isLogicalMultiCamera( - const common::V1_0::helper::CameraMetadata& metadata, - std::unordered_set* physicalCameraIds) { +bool CameraModule::isLogicalMultiCamera(const common::helper::CameraMetadata& metadata, + std::unordered_set* physicalCameraIds) { if (physicalCameraIds == nullptr) { ALOGE("%s: physicalCameraIds must not be null", __FUNCTION__); return false; } bool isLogicalMultiCamera = false; - camera_metadata_ro_entry_t capabilities = - metadata.find(ANDROID_REQUEST_AVAILABLE_CAPABILITIES); + camera_metadata_ro_entry_t capabilities = metadata.find(ANDROID_REQUEST_AVAILABLE_CAPABILITIES); for (size_t i = 0; i < capabilities.count; i++) { if (capabilities.data.u8[i] == - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA) { + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA) { isLogicalMultiCamera = true; break; } } if (isLogicalMultiCamera) { - camera_metadata_ro_entry_t entry = - metadata.find(ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS); + camera_metadata_ro_entry_t entry = metadata.find(ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS); const uint8_t* ids = entry.data.u8; size_t start = 0; for (size_t i = 0; i < entry.count; ++i) { if (ids[i] == '\0') { if (start != i) { - const char* physicalId = reinterpret_cast(ids+start); + const char* physicalId = reinterpret_cast(ids + start); physicalCameraIds->emplace(physicalId); } start = i + 1; @@ -516,7 +500,7 @@ bool CameraModule::isLogicalMultiCamera( } status_t CameraModule::filterOpenErrorCode(status_t err) { - switch(err) { + switch (err) { case NO_ERROR: case -EBUSY: case -EINVAL: @@ -533,9 +517,9 @@ void CameraModule::removeCamera(int cameraId) { // static_camera_characteristics if (getDeviceVersion(cameraId) >= CAMERA_DEVICE_API_VERSION_3_0) { std::unordered_set physicalIds; - camera_metadata_t *metadata = const_cast( + camera_metadata_t* metadata = const_cast( mCameraInfoMap.valueFor(cameraId).static_camera_characteristics); - common::V1_0::helper::CameraMetadata hidlMetadata(metadata); + common::helper::CameraMetadata hidlMetadata(metadata); if (isLogicalMultiCamera(hidlMetadata, &physicalIds)) { for (const auto& id : physicalIds) { @@ -545,7 +529,7 @@ void CameraModule::removeCamera(int cameraId) { mPhysicalCameraInfoMap.removeItem(idInt); } else { ALOGE("%s: Cannot find corresponding static metadata for physical id %s", - __FUNCTION__, id.c_str()); + __FUNCTION__, id.c_str()); } } } @@ -575,9 +559,8 @@ void* CameraModule::getDso() { return mModule->common.dso; } -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/common/1.0/default/CameraParameters.cpp b/camera/common/default/CameraParameters.cpp similarity index 77% rename from camera/common/1.0/default/CameraParameters.cpp rename to camera/common/default/CameraParameters.cpp index a31b80742e..3689c900ed 100644 --- a/camera/common/1.0/default/CameraParameters.cpp +++ b/camera/common/default/CameraParameters.cpp @@ -18,17 +18,16 @@ #define LOG_TAG "CameraParams" #include -#include #include +#include +#include #include #include "CameraParameters.h" -#include namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { // Parameter keys to communicate between camera application and driver. @@ -79,7 +78,8 @@ const char CameraParameters::KEY_EXPOSURE_COMPENSATION_STEP[] = "exposure-compen const char CameraParameters::KEY_AUTO_EXPOSURE_LOCK[] = "auto-exposure-lock"; const char CameraParameters::KEY_AUTO_EXPOSURE_LOCK_SUPPORTED[] = "auto-exposure-lock-supported"; const char CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK[] = "auto-whitebalance-lock"; -const char CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED[] = "auto-whitebalance-lock-supported"; +const char CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED[] = + "auto-whitebalance-lock-supported"; const char CameraParameters::KEY_MAX_NUM_METERING_AREAS[] = "max-num-metering-areas"; const char CameraParameters::KEY_METERING_AREAS[] = "metering-areas"; const char CameraParameters::KEY_ZOOM[] = "zoom"; @@ -91,7 +91,8 @@ const char CameraParameters::KEY_FOCUS_DISTANCES[] = "focus-distances"; const char CameraParameters::KEY_VIDEO_FRAME_FORMAT[] = "video-frame-format"; const char CameraParameters::KEY_VIDEO_SIZE[] = "video-size"; const char CameraParameters::KEY_SUPPORTED_VIDEO_SIZES[] = "video-size-values"; -const char CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO[] = "preferred-preview-size-for-video"; +const char CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO[] = + "preferred-preview-size-for-video"; const char CameraParameters::KEY_MAX_NUM_DETECTED_FACES_HW[] = "max-num-detected-faces-hw"; const char CameraParameters::KEY_MAX_NUM_DETECTED_FACES_SW[] = "max-num-detected-faces-sw"; const char CameraParameters::KEY_RECORDING_HINT[] = "recording-hint"; @@ -160,7 +161,7 @@ const char CameraParameters::SCENE_MODE_HDR[] = "hdr"; const char CameraParameters::PIXEL_FORMAT_YUV422SP[] = "yuv422sp"; const char CameraParameters::PIXEL_FORMAT_YUV420SP[] = "yuv420sp"; const char CameraParameters::PIXEL_FORMAT_YUV422I[] = "yuv422i-yuyv"; -const char CameraParameters::PIXEL_FORMAT_YUV420P[] = "yuv420p"; +const char CameraParameters::PIXEL_FORMAT_YUV420P[] = "yuv420p"; const char CameraParameters::PIXEL_FORMAT_RGB565[] = "rgb565"; const char CameraParameters::PIXEL_FORMAT_RGBA8888[] = "rgba8888"; const char CameraParameters::PIXEL_FORMAT_JPEG[] = "jpeg"; @@ -180,17 +181,11 @@ const char CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE[] = "continuous-pictu const char CameraParameters::LIGHTFX_LOWLIGHT[] = "low-light"; const char CameraParameters::LIGHTFX_HDR[] = "high-dynamic-range"; -CameraParameters::CameraParameters() - : mMap() -{ -} +CameraParameters::CameraParameters() : mMap() {} -CameraParameters::~CameraParameters() -{ -} +CameraParameters::~CameraParameters() {} -String8 CameraParameters::flatten() const -{ +String8 CameraParameters::flatten() const { String8 flattened(""); size_t size = mMap.size(); @@ -202,31 +197,28 @@ String8 CameraParameters::flatten() const flattened += k; flattened += "="; flattened += v; - if (i != size-1) - flattened += ";"; + if (i != size - 1) flattened += ";"; } return flattened; } -void CameraParameters::unflatten(const String8 ¶ms) -{ +void CameraParameters::unflatten(const String8& params) { const char* a = params.c_str(); - const char *b; + const char* b; mMap.clear(); for (;;) { // Find the bounds of the key name. b = strchr(a, '='); - if (b == 0) - break; + if (b == 0) break; // Create the key string. - String8 k(a, (size_t)(b-a)); + String8 k(a, (size_t)(b - a)); // Find the value. - a = b+1; + a = b + 1; b = strchr(a, ';'); if (b == 0) { // If there's no semicolon, this is the last item. @@ -235,15 +227,13 @@ void CameraParameters::unflatten(const String8 ¶ms) break; } - String8 v(a, (size_t)(b-a)); + String8 v(a, (size_t)(b - a)); mMap.add(k, v); - a = b+1; + a = b + 1; } } - -void CameraParameters::set(const char *key, const char *value) -{ +void CameraParameters::set(const char* key, const char* value) { // i think i can do this with strspn() if (strchr(key, '=') || strchr(key, ';')) { // ALOGE("Key \"%s\"contains invalid character (= or ;)", key); @@ -258,54 +248,44 @@ void CameraParameters::set(const char *key, const char *value) mMap.replaceValueFor(String8(key), String8(value)); } -void CameraParameters::set(const char *key, int value) -{ +void CameraParameters::set(const char* key, int value) { char str[16]; sprintf(str, "%d", value); set(key, str); } -void CameraParameters::setFloat(const char *key, float value) -{ +void CameraParameters::setFloat(const char* key, float value) { char str[16]; // 14 should be enough. We overestimate to be safe. snprintf(str, sizeof(str), "%g", value); set(key, str); } -const char *CameraParameters::get(const char *key) const -{ +const char* CameraParameters::get(const char* key) const { String8 v = mMap.valueFor(String8(key)); - if (v.length() == 0) - return 0; + if (v.length() == 0) return 0; return v.c_str(); } -int CameraParameters::getInt(const char *key) const -{ - const char *v = get(key); - if (v == 0) - return -1; +int CameraParameters::getInt(const char* key) const { + const char* v = get(key); + if (v == 0) return -1; return strtol(v, 0, 0); } -float CameraParameters::getFloat(const char *key) const -{ - const char *v = get(key); +float CameraParameters::getFloat(const char* key) const { + const char* v = get(key); if (v == 0) return -1; return strtof(v, 0); } -void CameraParameters::remove(const char *key) -{ +void CameraParameters::remove(const char* key) { mMap.removeItem(String8(key)); } // Parse string like "640x480" or "10000,20000" -static int parse_pair(const char *str, int *first, int *second, char delim, - char **endptr = NULL) -{ +static int parse_pair(const char* str, int* first, int* second, char delim, char** endptr = NULL) { // Find the first integer. - char *end; + char* end; int w = (int)strtol(str, &end, 10); // If a delimeter does not immediately follow, give up. if (*end != delim) { @@ -314,7 +294,7 @@ static int parse_pair(const char *str, int *first, int *second, char delim, } // Find the second integer, immediately after the delimeter. - int h = (int)strtol(end+1, &end, 10); + int h = (int)strtol(end + 1, &end, 10); *first = w; *second = h; @@ -326,18 +306,16 @@ static int parse_pair(const char *str, int *first, int *second, char delim, return 0; } -static void parseSizesList(const char *sizesStr, Vector &sizes) -{ +static void parseSizesList(const char* sizesStr, Vector& sizes) { if (sizesStr == 0) { return; } - char *sizeStartPtr = (char *)sizesStr; + char* sizeStartPtr = (char*)sizesStr; while (true) { int width, height; - int success = parse_pair(sizeStartPtr, &width, &height, 'x', - &sizeStartPtr); + int success = parse_pair(sizeStartPtr, &width, &height, 'x', &sizeStartPtr); if (success == -1 || (*sizeStartPtr != ',' && *sizeStartPtr != '\0')) { ALOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr); return; @@ -351,119 +329,101 @@ static void parseSizesList(const char *sizesStr, Vector &sizes) } } -void CameraParameters::setPreviewSize(int width, int height) -{ +void CameraParameters::setPreviewSize(int width, int height) { char str[32]; sprintf(str, "%dx%d", width, height); set(KEY_PREVIEW_SIZE, str); } -void CameraParameters::getPreviewSize(int *width, int *height) const -{ +void CameraParameters::getPreviewSize(int* width, int* height) const { *width = *height = -1; // Get the current string, if it doesn't exist, leave the -1x-1 - const char *p = get(KEY_PREVIEW_SIZE); - if (p == 0) return; + const char* p = get(KEY_PREVIEW_SIZE); + if (p == 0) return; parse_pair(p, width, height, 'x'); } -void CameraParameters::getPreferredPreviewSizeForVideo(int *width, int *height) const -{ +void CameraParameters::getPreferredPreviewSizeForVideo(int* width, int* height) const { *width = *height = -1; - const char *p = get(KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO); - if (p == 0) return; + const char* p = get(KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO); + if (p == 0) return; parse_pair(p, width, height, 'x'); } -void CameraParameters::getSupportedPreviewSizes(Vector &sizes) const -{ - const char *previewSizesStr = get(KEY_SUPPORTED_PREVIEW_SIZES); +void CameraParameters::getSupportedPreviewSizes(Vector& sizes) const { + const char* previewSizesStr = get(KEY_SUPPORTED_PREVIEW_SIZES); parseSizesList(previewSizesStr, sizes); } -void CameraParameters::setVideoSize(int width, int height) -{ +void CameraParameters::setVideoSize(int width, int height) { char str[32]; sprintf(str, "%dx%d", width, height); set(KEY_VIDEO_SIZE, str); } -void CameraParameters::getVideoSize(int *width, int *height) const -{ +void CameraParameters::getVideoSize(int* width, int* height) const { *width = *height = -1; - const char *p = get(KEY_VIDEO_SIZE); + const char* p = get(KEY_VIDEO_SIZE); if (p == 0) return; parse_pair(p, width, height, 'x'); } -void CameraParameters::getSupportedVideoSizes(Vector &sizes) const -{ - const char *videoSizesStr = get(KEY_SUPPORTED_VIDEO_SIZES); +void CameraParameters::getSupportedVideoSizes(Vector& sizes) const { + const char* videoSizesStr = get(KEY_SUPPORTED_VIDEO_SIZES); parseSizesList(videoSizesStr, sizes); } -void CameraParameters::setPreviewFrameRate(int fps) -{ +void CameraParameters::setPreviewFrameRate(int fps) { set(KEY_PREVIEW_FRAME_RATE, fps); } -int CameraParameters::getPreviewFrameRate() const -{ +int CameraParameters::getPreviewFrameRate() const { return getInt(KEY_PREVIEW_FRAME_RATE); } -void CameraParameters::getPreviewFpsRange(int *min_fps, int *max_fps) const -{ +void CameraParameters::getPreviewFpsRange(int* min_fps, int* max_fps) const { *min_fps = *max_fps = -1; - const char *p = get(KEY_PREVIEW_FPS_RANGE); + const char* p = get(KEY_PREVIEW_FPS_RANGE); if (p == 0) return; parse_pair(p, min_fps, max_fps, ','); } -void CameraParameters::setPreviewFormat(const char *format) -{ +void CameraParameters::setPreviewFormat(const char* format) { set(KEY_PREVIEW_FORMAT, format); } -const char *CameraParameters::getPreviewFormat() const -{ +const char* CameraParameters::getPreviewFormat() const { return get(KEY_PREVIEW_FORMAT); } -void CameraParameters::setPictureSize(int width, int height) -{ +void CameraParameters::setPictureSize(int width, int height) { char str[32]; sprintf(str, "%dx%d", width, height); set(KEY_PICTURE_SIZE, str); } -void CameraParameters::getPictureSize(int *width, int *height) const -{ +void CameraParameters::getPictureSize(int* width, int* height) const { *width = *height = -1; // Get the current string, if it doesn't exist, leave the -1x-1 - const char *p = get(KEY_PICTURE_SIZE); + const char* p = get(KEY_PICTURE_SIZE); if (p == 0) return; parse_pair(p, width, height, 'x'); } -void CameraParameters::getSupportedPictureSizes(Vector &sizes) const -{ - const char *pictureSizesStr = get(KEY_SUPPORTED_PICTURE_SIZES); +void CameraParameters::getSupportedPictureSizes(Vector& sizes) const { + const char* pictureSizesStr = get(KEY_SUPPORTED_PICTURE_SIZES); parseSizesList(pictureSizesStr, sizes); } -void CameraParameters::setPictureFormat(const char *format) -{ +void CameraParameters::setPictureFormat(const char* format) { set(KEY_PICTURE_FORMAT, format); } -const char *CameraParameters::getPictureFormat() const -{ +const char* CameraParameters::getPictureFormat() const { return get(KEY_PICTURE_FORMAT); } -void CameraParameters::dump() const -{ +void CameraParameters::dump() const { ALOGD("dump: mMap.size = %zu", mMap.size()); for (size_t i = 0; i < mMap.size(); i++) { String8 k, v; @@ -473,8 +433,7 @@ void CameraParameters::dump() const } } -status_t CameraParameters::dump(int fd, const Vector& /*args*/) const -{ +status_t CameraParameters::dump(int fd, const Vector& /*args*/) const { const size_t SIZE = 256; char buffer[SIZE]; String8 result; @@ -492,8 +451,7 @@ status_t CameraParameters::dump(int fd, const Vector& /*args*/) const } void CameraParameters::getSupportedPreviewFormats(Vector& formats) const { - const char* supportedPreviewFormats = - get(CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS); + const char* supportedPreviewFormats = get(CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS); if (supportedPreviewFormats == NULL) { ALOGW("%s: No supported preview formats.", __FUNCTION__); @@ -515,35 +473,31 @@ void CameraParameters::getSupportedPreviewFormats(Vector& formats) const { fmtStr.unlockBuffer(fmtStr.size()); } - int CameraParameters::previewFormatToEnum(const char* format) { - return - !format ? - HAL_PIXEL_FORMAT_YCrCb_420_SP : - !strcmp(format, PIXEL_FORMAT_YUV422SP) ? - HAL_PIXEL_FORMAT_YCbCr_422_SP : // NV16 - !strcmp(format, PIXEL_FORMAT_YUV420SP) ? - HAL_PIXEL_FORMAT_YCrCb_420_SP : // NV21 - !strcmp(format, PIXEL_FORMAT_YUV422I) ? - HAL_PIXEL_FORMAT_YCbCr_422_I : // YUY2 - !strcmp(format, PIXEL_FORMAT_YUV420P) ? - HAL_PIXEL_FORMAT_YV12 : // YV12 - !strcmp(format, PIXEL_FORMAT_RGB565) ? - HAL_PIXEL_FORMAT_RGB_565 : // RGB565 - !strcmp(format, PIXEL_FORMAT_RGBA8888) ? - HAL_PIXEL_FORMAT_RGBA_8888 : // RGB8888 - !strcmp(format, PIXEL_FORMAT_BAYER_RGGB) ? - HAL_PIXEL_FORMAT_RAW16 : // Raw sensor data - -1; + return !format ? HAL_PIXEL_FORMAT_YCrCb_420_SP + : !strcmp(format, PIXEL_FORMAT_YUV422SP) ? HAL_PIXEL_FORMAT_YCbCr_422_SP + : // NV16 + !strcmp(format, PIXEL_FORMAT_YUV420SP) ? HAL_PIXEL_FORMAT_YCrCb_420_SP + : // NV21 + !strcmp(format, PIXEL_FORMAT_YUV422I) ? HAL_PIXEL_FORMAT_YCbCr_422_I + : // YUY2 + !strcmp(format, PIXEL_FORMAT_YUV420P) ? HAL_PIXEL_FORMAT_YV12 + : // YV12 + !strcmp(format, PIXEL_FORMAT_RGB565) ? HAL_PIXEL_FORMAT_RGB_565 + : // RGB565 + !strcmp(format, PIXEL_FORMAT_RGBA8888) ? HAL_PIXEL_FORMAT_RGBA_8888 + : // RGB8888 + !strcmp(format, PIXEL_FORMAT_BAYER_RGGB) ? HAL_PIXEL_FORMAT_RAW16 + : // Raw sensor data + -1; } bool CameraParameters::isEmpty() const { return mMap.isEmpty(); } -}; -}; -}; -}; -}; -}; // namespace android +}; // namespace helper +}; // namespace common +}; // namespace camera +}; // namespace hardware +}; // namespace android diff --git a/camera/common/1.0/default/Exif.cpp b/camera/common/default/Exif.cpp similarity index 83% rename from camera/common/1.0/default/Exif.cpp rename to camera/common/default/Exif.cpp index 413b6bb975..f4b2a3189e 100644 --- a/camera/common/1.0/default/Exif.cpp +++ b/camera/common/default/Exif.cpp @@ -16,7 +16,7 @@ #define LOG_TAG "CamComm1.0-Exif" #define ATRACE_TAG ATRACE_TAG_CAMERA -//#define LOG_NDEBUG 0 +// #define LOG_NDEBUG 0 #include @@ -41,15 +41,12 @@ struct default_delete { } // namespace std - namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { - class ExifUtilsImpl : public ExifUtils { public: ExifUtilsImpl(); @@ -61,8 +58,7 @@ class ExifUtilsImpl : public ExifUtils { virtual bool initialize(); // set all known fields from a metadata structure - virtual bool setFromMetadata(const CameraMetadata& metadata, - const size_t imageWidth, + virtual bool setFromMetadata(const CameraMetadata& metadata, const size_t imageWidth, const size_t imageHeight); // sets the len aperture. @@ -254,7 +250,6 @@ class ExifUtilsImpl : public ExifUtils { // Returns false if memory allocation fails. virtual bool setExifVersion(const std::string& exif_version); - // Resets the pointers and memories. virtual void reset(); @@ -262,8 +257,7 @@ class ExifUtilsImpl : public ExifUtils { // if the tag exists. // Returns the entry of the tag. The reference count of returned ExifEntry is // two. - virtual std::unique_ptr addVariableLengthEntry(ExifIfd ifd, - ExifTag tag, + virtual std::unique_ptr addVariableLengthEntry(ExifIfd ifd, ExifTag tag, ExifFormat format, uint64_t components, unsigned int size); @@ -275,32 +269,17 @@ class ExifUtilsImpl : public ExifUtils { virtual std::unique_ptr addEntry(ExifIfd ifd, ExifTag tag); // Helpe functions to add exif data with different types. - virtual bool setShort(ExifIfd ifd, - ExifTag tag, - uint16_t value, - const std::string& msg); + virtual bool setShort(ExifIfd ifd, ExifTag tag, uint16_t value, const std::string& msg); - virtual bool setLong(ExifIfd ifd, - ExifTag tag, - uint32_t value, - const std::string& msg); + virtual bool setLong(ExifIfd ifd, ExifTag tag, uint32_t value, const std::string& msg); - virtual bool setRational(ExifIfd ifd, - ExifTag tag, - uint32_t numerator, - uint32_t denominator, + virtual bool setRational(ExifIfd ifd, ExifTag tag, uint32_t numerator, uint32_t denominator, const std::string& msg); - virtual bool setSRational(ExifIfd ifd, - ExifTag tag, - int32_t numerator, - int32_t denominator, + virtual bool setSRational(ExifIfd ifd, ExifTag tag, int32_t numerator, int32_t denominator, const std::string& msg); - virtual bool setString(ExifIfd ifd, - ExifTag tag, - ExifFormat format, - const std::string& buffer, + virtual bool setString(ExifIfd ifd, ExifTag tag, ExifFormat format, const std::string& buffer, const std::string& msg); // Destroys the buffer of APP1 segment if exists. @@ -313,37 +292,31 @@ class ExifUtilsImpl : public ExifUtils { uint8_t* app1_buffer_; // The length of |app1_buffer_|. unsigned int app1_length_; - }; -#define SET_SHORT(ifd, tag, value) \ - do { \ - if (setShort(ifd, tag, value, #tag) == false) \ - return false; \ +#define SET_SHORT(ifd, tag, value) \ + do { \ + if (setShort(ifd, tag, value, #tag) == false) return false; \ } while (0); -#define SET_LONG(ifd, tag, value) \ - do { \ - if (setLong(ifd, tag, value, #tag) == false) \ - return false; \ +#define SET_LONG(ifd, tag, value) \ + do { \ + if (setLong(ifd, tag, value, #tag) == false) return false; \ } while (0); -#define SET_RATIONAL(ifd, tag, numerator, denominator) \ - do { \ - if (setRational(ifd, tag, numerator, denominator, #tag) == false) \ - return false; \ +#define SET_RATIONAL(ifd, tag, numerator, denominator) \ + do { \ + if (setRational(ifd, tag, numerator, denominator, #tag) == false) return false; \ } while (0); -#define SET_SRATIONAL(ifd, tag, numerator, denominator) \ - do { \ - if (setSRational(ifd, tag, numerator, denominator, #tag) == false) \ - return false; \ +#define SET_SRATIONAL(ifd, tag, numerator, denominator) \ + do { \ + if (setSRational(ifd, tag, numerator, denominator, #tag) == false) return false; \ } while (0); #define SET_STRING(ifd, tag, format, buffer) \ do { \ - if (setString(ifd, tag, format, buffer, #tag) == false) \ - return false; \ + if (setString(ifd, tag, format, buffer, #tag) == false) return false; \ } while (0); // This comes from the Exif Version 2.2 standard table 6. @@ -353,30 +326,25 @@ static void setLatitudeOrLongitudeData(unsigned char* data, double num) { // Take the integer part of |num|. ExifLong degrees = static_cast(num); ExifLong minutes = static_cast(60 * (num - degrees)); - ExifLong microseconds = - static_cast(3600000000u * (num - degrees - minutes / 60.0)); + ExifLong microseconds = static_cast(3600000000u * (num - degrees - minutes / 60.0)); exif_set_rational(data, EXIF_BYTE_ORDER_INTEL, {degrees, 1}); - exif_set_rational(data + sizeof(ExifRational), EXIF_BYTE_ORDER_INTEL, - {minutes, 1}); + exif_set_rational(data + sizeof(ExifRational), EXIF_BYTE_ORDER_INTEL, {minutes, 1}); exif_set_rational(data + 2 * sizeof(ExifRational), EXIF_BYTE_ORDER_INTEL, - {microseconds, 1000000}); + {microseconds, 1000000}); } -ExifUtils *ExifUtils::create() { +ExifUtils* ExifUtils::create() { return new ExifUtilsImpl(); } -ExifUtils::~ExifUtils() { -} +ExifUtils::~ExifUtils() {} -ExifUtilsImpl::ExifUtilsImpl() - : exif_data_(nullptr), app1_buffer_(nullptr), app1_length_(0) {} +ExifUtilsImpl::ExifUtilsImpl() : exif_data_(nullptr), app1_buffer_(nullptr), app1_length_(0) {} ExifUtilsImpl::~ExifUtilsImpl() { reset(); } - bool ExifUtilsImpl::initialize() { reset(); exif_data_ = exif_data_new(); @@ -403,8 +371,7 @@ bool ExifUtilsImpl::setAperture(uint32_t numerator, uint32_t denominator) { } bool ExifUtilsImpl::setBrightness(int32_t numerator, int32_t denominator) { - SET_SRATIONAL(EXIF_IFD_EXIF, EXIF_TAG_BRIGHTNESS_VALUE, numerator, - denominator); + SET_SRATIONAL(EXIF_IFD_EXIF, EXIF_TAG_BRIGHTNESS_VALUE, numerator, denominator); return true; } @@ -413,10 +380,9 @@ bool ExifUtilsImpl::setColorSpace(uint16_t color_space) { return true; } -bool ExifUtilsImpl::setComponentsConfiguration( - const std::string& components_configuration) { - SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_COMPONENTS_CONFIGURATION, - EXIF_FORMAT_UNDEFINED, components_configuration); +bool ExifUtilsImpl::setComponentsConfiguration(const std::string& components_configuration) { + SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_COMPONENTS_CONFIGURATION, EXIF_FORMAT_UNDEFINED, + components_configuration); return true; } @@ -433,37 +399,31 @@ bool ExifUtilsImpl::setContrast(uint16_t contrast) { bool ExifUtilsImpl::setDateTime(const struct tm& t) { // The length is 20 bytes including NULL for termination in Exif standard. char str[20]; - int result = snprintf(str, sizeof(str), "%04i:%02i:%02i %02i:%02i:%02i", - t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, - t.tm_min, t.tm_sec); + int result = snprintf(str, sizeof(str), "%04i:%02i:%02i %02i:%02i:%02i", t.tm_year + 1900, + t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec); if (result != sizeof(str) - 1) { ALOGW("%s: Input time is invalid", __FUNCTION__); return false; } std::string buffer(str); SET_STRING(EXIF_IFD_0, EXIF_TAG_DATE_TIME, EXIF_FORMAT_ASCII, buffer); - SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_DATE_TIME_ORIGINAL, EXIF_FORMAT_ASCII, - buffer); - SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_DATE_TIME_DIGITIZED, EXIF_FORMAT_ASCII, - buffer); + SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_DATE_TIME_ORIGINAL, EXIF_FORMAT_ASCII, buffer); + SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_DATE_TIME_DIGITIZED, EXIF_FORMAT_ASCII, buffer); return true; } bool ExifUtilsImpl::setDescription(const std::string& description) { - SET_STRING(EXIF_IFD_0, EXIF_TAG_IMAGE_DESCRIPTION, EXIF_FORMAT_ASCII, - description); + SET_STRING(EXIF_IFD_0, EXIF_TAG_IMAGE_DESCRIPTION, EXIF_FORMAT_ASCII, description); return true; } bool ExifUtilsImpl::setDigitalZoomRatio(uint32_t numerator, uint32_t denominator) { - SET_RATIONAL(EXIF_IFD_EXIF, EXIF_TAG_DIGITAL_ZOOM_RATIO, numerator, - denominator); + SET_RATIONAL(EXIF_IFD_EXIF, EXIF_TAG_DIGITAL_ZOOM_RATIO, numerator, denominator); return true; } bool ExifUtilsImpl::setExposureBias(int32_t numerator, int32_t denominator) { - SET_SRATIONAL(EXIF_IFD_EXIF, EXIF_TAG_EXPOSURE_BIAS_VALUE, numerator, - denominator); + SET_SRATIONAL(EXIF_IFD_EXIF, EXIF_TAG_EXPOSURE_BIAS_VALUE, numerator, denominator); return true; } @@ -526,7 +486,7 @@ bool ExifUtilsImpl::setGpsAltitude(double altitude) { return false; } exif_set_rational(entry->data, EXIF_BYTE_ORDER_INTEL, - {static_cast(altitude * 1000), 1000}); + {static_cast(altitude * 1000), 1000}); return true; } @@ -588,26 +548,23 @@ bool ExifUtilsImpl::setGpsLongitude(double longitude) { } bool ExifUtilsImpl::setGpsProcessingMethod(const std::string& method) { - std::string buffer = - std::string(gExifAsciiPrefix, sizeof(gExifAsciiPrefix)) + method; + std::string buffer = std::string(gExifAsciiPrefix, sizeof(gExifAsciiPrefix)) + method; SET_STRING(EXIF_IFD_GPS, static_cast(EXIF_TAG_GPS_PROCESSING_METHOD), - EXIF_FORMAT_UNDEFINED, buffer); + EXIF_FORMAT_UNDEFINED, buffer); return true; } bool ExifUtilsImpl::setGpsTimestamp(const struct tm& t) { const ExifTag dateTag = static_cast(EXIF_TAG_GPS_DATE_STAMP); const size_t kGpsDateStampSize = 11; - std::unique_ptr entry = - addVariableLengthEntry(EXIF_IFD_GPS, dateTag, EXIF_FORMAT_ASCII, - kGpsDateStampSize, kGpsDateStampSize); + std::unique_ptr entry = addVariableLengthEntry( + EXIF_IFD_GPS, dateTag, EXIF_FORMAT_ASCII, kGpsDateStampSize, kGpsDateStampSize); if (!entry) { ALOGE("%s: Adding GPSDateStamp exif entry failed", __FUNCTION__); return false; } - int result = - snprintf(reinterpret_cast(entry->data), kGpsDateStampSize, - "%04i:%02i:%02i", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday); + int result = snprintf(reinterpret_cast(entry->data), kGpsDateStampSize, "%04i:%02i:%02i", + t.tm_year + 1900, t.tm_mon + 1, t.tm_mday); if (result != kGpsDateStampSize - 1) { ALOGW("%s: Input time is invalid", __FUNCTION__); return false; @@ -615,18 +572,16 @@ bool ExifUtilsImpl::setGpsTimestamp(const struct tm& t) { const ExifTag timeTag = static_cast(EXIF_TAG_GPS_TIME_STAMP); entry = addVariableLengthEntry(EXIF_IFD_GPS, timeTag, EXIF_FORMAT_RATIONAL, 3, - 3 * sizeof(ExifRational)); + 3 * sizeof(ExifRational)); if (!entry) { ALOGE("%s: Adding GPSTimeStamp exif entry failed", __FUNCTION__); return false; } - exif_set_rational(entry->data, EXIF_BYTE_ORDER_INTEL, - {static_cast(t.tm_hour), 1}); + exif_set_rational(entry->data, EXIF_BYTE_ORDER_INTEL, {static_cast(t.tm_hour), 1}); exif_set_rational(entry->data + sizeof(ExifRational), EXIF_BYTE_ORDER_INTEL, - {static_cast(t.tm_min), 1}); - exif_set_rational(entry->data + 2 * sizeof(ExifRational), - EXIF_BYTE_ORDER_INTEL, - {static_cast(t.tm_sec), 1}); + {static_cast(t.tm_min), 1}); + exif_set_rational(entry->data + 2 * sizeof(ExifRational), EXIF_BYTE_ORDER_INTEL, + {static_cast(t.tm_sec), 1}); return true; } @@ -654,8 +609,7 @@ bool ExifUtilsImpl::setLightSource(uint16_t light_source) { } bool ExifUtilsImpl::setMaxAperture(uint32_t numerator, uint32_t denominator) { - SET_RATIONAL(EXIF_IFD_EXIF, EXIF_TAG_MAX_APERTURE_VALUE, numerator, - denominator); + SET_RATIONAL(EXIF_IFD_EXIF, EXIF_TAG_MAX_APERTURE_VALUE, numerator, denominator); return true; } @@ -714,24 +668,19 @@ bool ExifUtilsImpl::setSharpness(uint16_t sharpness) { } bool ExifUtilsImpl::setShutterSpeed(int32_t numerator, int32_t denominator) { - SET_SRATIONAL(EXIF_IFD_EXIF, EXIF_TAG_SHUTTER_SPEED_VALUE, numerator, - denominator); + SET_SRATIONAL(EXIF_IFD_EXIF, EXIF_TAG_SHUTTER_SPEED_VALUE, numerator, denominator); return true; } bool ExifUtilsImpl::setSubjectDistance(uint32_t numerator, uint32_t denominator) { - SET_RATIONAL(EXIF_IFD_EXIF, EXIF_TAG_SUBJECT_DISTANCE, numerator, - denominator); + SET_RATIONAL(EXIF_IFD_EXIF, EXIF_TAG_SUBJECT_DISTANCE, numerator, denominator); return true; } bool ExifUtilsImpl::setSubsecTime(const std::string& subsec_time) { - SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_SUB_SEC_TIME, EXIF_FORMAT_ASCII, - subsec_time); - SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_SUB_SEC_TIME_ORIGINAL, EXIF_FORMAT_ASCII, - subsec_time); - SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_SUB_SEC_TIME_DIGITIZED, EXIF_FORMAT_ASCII, - subsec_time); + SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_SUB_SEC_TIME, EXIF_FORMAT_ASCII, subsec_time); + SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_SUB_SEC_TIME_ORIGINAL, EXIF_FORMAT_ASCII, subsec_time); + SET_STRING(EXIF_IFD_EXIF, EXIF_TAG_SUB_SEC_TIME_DIGITIZED, EXIF_FORMAT_ASCII, subsec_time); return true; } @@ -816,8 +765,7 @@ void ExifUtilsImpl::reset() { } } -std::unique_ptr ExifUtilsImpl::addVariableLengthEntry(ExifIfd ifd, - ExifTag tag, +std::unique_ptr ExifUtilsImpl::addVariableLengthEntry(ExifIfd ifd, ExifTag tag, ExifFormat format, uint64_t components, unsigned int size) { @@ -872,10 +820,7 @@ std::unique_ptr ExifUtilsImpl::addEntry(ExifIfd ifd, ExifTag tag) { return entry; } -bool ExifUtilsImpl::setShort(ExifIfd ifd, - ExifTag tag, - uint16_t value, - const std::string& msg) { +bool ExifUtilsImpl::setShort(ExifIfd ifd, ExifTag tag, uint16_t value, const std::string& msg) { std::unique_ptr entry = addEntry(ifd, tag); if (!entry) { ALOGE("%s: Adding '%s' entry failed", __FUNCTION__, msg.c_str()); @@ -885,10 +830,7 @@ bool ExifUtilsImpl::setShort(ExifIfd ifd, return true; } -bool ExifUtilsImpl::setLong(ExifIfd ifd, - ExifTag tag, - uint32_t value, - const std::string& msg) { +bool ExifUtilsImpl::setLong(ExifIfd ifd, ExifTag tag, uint32_t value, const std::string& msg) { std::unique_ptr entry = addEntry(ifd, tag); if (!entry) { ALOGE("%s: Adding '%s' entry failed", __FUNCTION__, msg.c_str()); @@ -898,41 +840,30 @@ bool ExifUtilsImpl::setLong(ExifIfd ifd, return true; } -bool ExifUtilsImpl::setRational(ExifIfd ifd, - ExifTag tag, - uint32_t numerator, - uint32_t denominator, +bool ExifUtilsImpl::setRational(ExifIfd ifd, ExifTag tag, uint32_t numerator, uint32_t denominator, const std::string& msg) { std::unique_ptr entry = addEntry(ifd, tag); if (!entry) { ALOGE("%s: Adding '%s' entry failed", __FUNCTION__, msg.c_str()); return false; } - exif_set_rational(entry->data, EXIF_BYTE_ORDER_INTEL, - {numerator, denominator}); + exif_set_rational(entry->data, EXIF_BYTE_ORDER_INTEL, {numerator, denominator}); return true; } -bool ExifUtilsImpl::setSRational(ExifIfd ifd, - ExifTag tag, - int32_t numerator, - int32_t denominator, +bool ExifUtilsImpl::setSRational(ExifIfd ifd, ExifTag tag, int32_t numerator, int32_t denominator, const std::string& msg) { std::unique_ptr entry = addEntry(ifd, tag); if (!entry) { ALOGE("%s: Adding '%s' entry failed", __FUNCTION__, msg.c_str()); return false; } - exif_set_srational(entry->data, EXIF_BYTE_ORDER_INTEL, - {numerator, denominator}); + exif_set_srational(entry->data, EXIF_BYTE_ORDER_INTEL, {numerator, denominator}); return true; } -bool ExifUtilsImpl::setString(ExifIfd ifd, - ExifTag tag, - ExifFormat format, - const std::string& buffer, - const std::string& msg) { +bool ExifUtilsImpl::setString(ExifIfd ifd, ExifTag tag, ExifFormat format, + const std::string& buffer, const std::string& msg) { size_t entry_size = buffer.length(); // Since the exif format is undefined, NULL termination is not necessary. if (format == EXIF_FORMAT_ASCII) { @@ -959,13 +890,11 @@ void ExifUtilsImpl::destroyApp1() { app1_length_ = 0; } -bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, - const size_t imageWidth, +bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, const size_t imageWidth, const size_t imageHeight) { // How precise the float-to-rational conversion for EXIF tags would be. constexpr int kRationalPrecision = 10000; - if (!setImageWidth(imageWidth) || - !setImageHeight(imageHeight)) { + if (!setImageWidth(imageWidth) || !setImageHeight(imageHeight)) { ALOGE("%s: setting image resolution failed.", __FUNCTION__); return false; } @@ -984,9 +913,8 @@ bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, if (entry.count) { focal_length = entry.data.f[0]; - if (!setFocalLength( - static_cast(focal_length * kRationalPrecision), - kRationalPrecision)) { + if (!setFocalLength(static_cast(focal_length * kRationalPrecision), + kRationalPrecision)) { ALOGE("%s: setting focal length failed.", __FUNCTION__); return false; } @@ -1048,7 +976,7 @@ bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, if (metadata.exists(ANDROID_SENSOR_EXPOSURE_TIME)) { entry = metadata.find(ANDROID_SENSOR_EXPOSURE_TIME); // int64_t of nanoseconds - if (!setExposureTime(entry.data.i64[0],1000000000u)) { + if (!setExposureTime(entry.data.i64[0], 1000000000u)) { ALOGE("%s: setting exposure time failed.", __FUNCTION__); return false; } @@ -1057,8 +985,7 @@ bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, if (metadata.exists(ANDROID_LENS_APERTURE)) { const int kAperturePrecision = 10000; entry = metadata.find(ANDROID_LENS_APERTURE); - if (!setFNumber(entry.data.f[0] * kAperturePrecision, - kAperturePrecision)) { + if (!setFNumber(entry.data.f[0] * kAperturePrecision, kAperturePrecision)) { ALOGE("%s: setting F number failed.", __FUNCTION__); return false; } @@ -1073,7 +1000,7 @@ bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, return false; } } else { - ALOGE("%s: Unsupported flash info: %d",__FUNCTION__, entry.data.u8[0]); + ALOGE("%s: Unsupported flash info: %d", __FUNCTION__, entry.data.u8[0]); return false; } } @@ -1107,9 +1034,8 @@ bool ExifUtilsImpl::setFromMetadata(const CameraMetadata& metadata, return true; } -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/common/1.0/default/HandleImporter.cpp b/camera/common/default/HandleImporter.cpp similarity index 74% rename from camera/common/1.0/default/HandleImporter.cpp rename to camera/common/default/HandleImporter.cpp index d2fdf02457..1145baa5f1 100644 --- a/camera/common/1.0/default/HandleImporter.cpp +++ b/camera/common/default/HandleImporter.cpp @@ -18,14 +18,13 @@ #include "HandleImporter.h" #include -#include "aidl/android/hardware/graphics/common/Smpte2086.h" #include +#include "aidl/android/hardware/graphics/common/Smpte2086.h" namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { using aidl::android::hardware::graphics::common::PlaneLayout; @@ -75,20 +74,18 @@ void HandleImporter::cleanup() { mInitialized = false; } -template +template bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& handle) { E error; buffer_handle_t importedHandle; auto ret = mapper->importBuffer( - hidl_handle(handle), - [&](const auto& tmpError, const auto& tmpBufferHandle) { - error = tmpError; - importedHandle = static_cast(tmpBufferHandle); - }); + hidl_handle(handle), [&](const auto& tmpError, const auto& tmpBufferHandle) { + error = tmpError; + importedHandle = static_cast(tmpBufferHandle); + }); if (!ret.isOk()) { - ALOGE("%s: mapper importBuffer failed: %s", - __FUNCTION__, ret.description().c_str()); + ALOGE("%s: mapper importBuffer failed: %s", __FUNCTION__, ret.description().c_str()); return false; } @@ -100,61 +97,62 @@ bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& h return true; } -template +template YCbCrLayout HandleImporter::lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, - uint64_t cpuUsage, const IMapper::Rect& accessRegion) { + uint64_t cpuUsage, + const IMapper::Rect& accessRegion) { hidl_handle acquireFenceHandle; auto buffer = const_cast(buf); YCbCrLayout layout = {}; - typename M::Rect accessRegionCopy = {accessRegion.left, accessRegion.top, - accessRegion.width, accessRegion.height}; + typename M::Rect accessRegionCopy = {accessRegion.left, accessRegion.top, accessRegion.width, + accessRegion.height}; mapper->lockYCbCr(buffer, cpuUsage, accessRegionCopy, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpLayout) { - if (tmpError == E::NONE) { - // Member by member copy from different versions of YCbCrLayout. - layout.y = tmpLayout.y; - layout.cb = tmpLayout.cb; - layout.cr = tmpLayout.cr; - layout.yStride = tmpLayout.yStride; - layout.cStride = tmpLayout.cStride; - layout.chromaStep = tmpLayout.chromaStep; - } else { - ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, tmpError); - } - }); + [&](const auto& tmpError, const auto& tmpLayout) { + if (tmpError == E::NONE) { + // Member by member copy from different versions of YCbCrLayout. + layout.y = tmpLayout.y; + layout.cb = tmpLayout.cb; + layout.cr = tmpLayout.cr; + layout.yStride = tmpLayout.yStride; + layout.cStride = tmpLayout.cStride; + layout.chromaStep = tmpLayout.chromaStep; + } else { + ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, tmpError); + } + }); return layout; } bool isMetadataPesent(const sp mapper, const buffer_handle_t& buf, - MetadataType metadataType) { + MetadataType metadataType) { auto buffer = const_cast(buf); bool ret = false; hidl_vec vec; - mapper->get(buffer, metadataType, [&] (const auto& tmpError, - const auto& tmpMetadata) { - if (tmpError == MapperErrorV4::NONE) { - vec = tmpMetadata; - } else { - ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError); - }}); + mapper->get(buffer, metadataType, [&](const auto& tmpError, const auto& tmpMetadata) { + if (tmpError == MapperErrorV4::NONE) { + vec = tmpMetadata; + } else { + ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError); + } + }); if (vec.size() > 0) { - if (metadataType == gralloc4::MetadataType_Smpte2086){ - std::optional realSmpte2086; - gralloc4::decodeSmpte2086(vec, &realSmpte2086); - ret = realSmpte2086.has_value(); - } else if (metadataType == gralloc4::MetadataType_Smpte2094_10) { - std::optional> realSmpte2094_10; - gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10); - ret = realSmpte2094_10.has_value(); - } else if (metadataType == gralloc4::MetadataType_Smpte2094_40) { - std::optional> realSmpte2094_40; - gralloc4::decodeSmpte2094_40(vec, &realSmpte2094_40); - ret = realSmpte2094_40.has_value(); - } else { - ALOGE("%s: Unknown metadata type!", __FUNCTION__); - } + if (metadataType == gralloc4::MetadataType_Smpte2086) { + std::optional realSmpte2086; + gralloc4::decodeSmpte2086(vec, &realSmpte2086); + ret = realSmpte2086.has_value(); + } else if (metadataType == gralloc4::MetadataType_Smpte2094_10) { + std::optional> realSmpte2094_10; + gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10); + ret = realSmpte2094_10.has_value(); + } else if (metadataType == gralloc4::MetadataType_Smpte2094_40) { + std::optional> realSmpte2094_40; + gralloc4::decodeSmpte2094_40(vec, &realSmpte2094_40); + ret = realSmpte2094_40.has_value(); + } else { + ALOGE("%s: Unknown metadata type!", __FUNCTION__); + } } return ret; @@ -239,31 +237,29 @@ YCbCrLayout HandleImporter::lockYCbCrInternal( return layout; } -template +template int HandleImporter::unlockInternal(const sp mapper, buffer_handle_t& buf) { int releaseFence = -1; auto buffer = const_cast(buf); - mapper->unlock( - buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) { - if (tmpError == E::NONE) { - auto fenceHandle = tmpReleaseFence.getNativeHandle(); - if (fenceHandle) { - if (fenceHandle->numInts != 0 || fenceHandle->numFds != 1) { - ALOGE("%s: bad release fence numInts %d numFds %d", - __FUNCTION__, fenceHandle->numInts, fenceHandle->numFds); - return; - } - releaseFence = dup(fenceHandle->data[0]); - if (releaseFence < 0) { - ALOGE("%s: bad release fence FD %d", - __FUNCTION__, releaseFence); - } + mapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) { + if (tmpError == E::NONE) { + auto fenceHandle = tmpReleaseFence.getNativeHandle(); + if (fenceHandle) { + if (fenceHandle->numInts != 0 || fenceHandle->numFds != 1) { + ALOGE("%s: bad release fence numInts %d numFds %d", __FUNCTION__, + fenceHandle->numInts, fenceHandle->numFds); + return; + } + releaseFence = dup(fenceHandle->data[0]); + if (releaseFence < 0) { + ALOGE("%s: bad release fence FD %d", __FUNCTION__, releaseFence); } - } else { - ALOGE("%s: failed to unlock error %d!", __FUNCTION__, tmpError); } - }); + } else { + ALOGE("%s: failed to unlock error %d!", __FUNCTION__, tmpError); + } + }); return releaseFence; } @@ -315,14 +311,12 @@ void HandleImporter::freeBuffer(buffer_handle_t handle) { } else if (mMapperV3 != nullptr) { auto ret = mMapperV3->freeBuffer(const_cast(handle)); if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", - __FUNCTION__, ret.description().c_str()); + ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); } } else { auto ret = mMapperV2->freeBuffer(const_cast(handle)); if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", - __FUNCTION__, ret.description().c_str()); + ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); } } } @@ -337,8 +331,7 @@ bool HandleImporter::importFence(const native_handle_t* handle, int& fd) const { return false; } } else { - ALOGE("invalid fence handle with %d file descriptors", - handle->numFds); + ALOGE("invalid fence handle with %d file descriptors", handle->numFds); return false; } @@ -351,8 +344,7 @@ void HandleImporter::closeFence(int fd) const { } } -void* HandleImporter::lock( - buffer_handle_t& buf, uint64_t cpuUsage, size_t size) { +void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size) { IMapper::Rect accessRegion{0, 0, static_cast(size), 1}; return lock(buf, cpuUsage, accessRegion); } @@ -401,13 +393,13 @@ void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, }); } else { mMapperV2->lock(buffer, cpuUsage, accessRegion, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV2::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); + [&](const auto& tmpError, const auto& tmpPtr) { + if (tmpError == MapperErrorV2::NONE) { + ret = tmpPtr; + } else { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); + } + }); } ALOGV("%s: ptr %p accessRegion.top: %d accessRegion.left: %d accessRegion.width: %d " @@ -417,9 +409,8 @@ void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, return ret; } -YCbCrLayout HandleImporter::lockYCbCr( - buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { +YCbCrLayout HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const IMapper::Rect& accessRegion) { Mutex::Autolock lock(mLock); if (!mInitialized) { @@ -431,20 +422,18 @@ YCbCrLayout HandleImporter::lockYCbCr( } if (mMapperV3 != nullptr) { - return lockYCbCrInternal( - mMapperV3, buf, cpuUsage, accessRegion); + return lockYCbCrInternal(mMapperV3, buf, cpuUsage, accessRegion); } if (mMapperV2 != nullptr) { - return lockYCbCrInternal( - mMapperV2, buf, cpuUsage, accessRegion); + return lockYCbCrInternal(mMapperV2, buf, cpuUsage, accessRegion); } ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); return {}; } -status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t &buf, uint32_t *stride /*out*/) { +status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/) { if (stride == nullptr) { return BAD_VALUE; } @@ -458,7 +447,7 @@ status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t &buf, uint32_t if (mMapperV4 != nullptr) { std::vector planeLayouts = getPlaneLayouts(mMapperV4, buf); if (planeLayouts.size() != 1) { - ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); + ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); return BAD_VALUE; } @@ -534,10 +523,8 @@ bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { return false; } - -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/common/default/SimpleThread.cpp b/camera/common/default/SimpleThread.cpp new file mode 100644 index 0000000000..46e89ba47b --- /dev/null +++ b/camera/common/default/SimpleThread.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SimpleThread.h" + +namespace android { +namespace hardware { +namespace camera { +namespace common { +namespace helper { + +SimpleThread::SimpleThread() : mDone(true), mThread() {} +SimpleThread::~SimpleThread() { + // Safe to call requestExitAndWait() from the destructor because requestExitAndWait() ensures + // that the thread is joinable before joining on it. This is different from how + // android::Thread worked. + requestExitAndWait(); +} + +void SimpleThread::run() { + requestExitAndWait(); // Exit current execution, if any. + + // start thread + mDone.store(false, std::memory_order_release); + mThread = std::thread(&SimpleThread::runLoop, this); +} + +void SimpleThread::requestExitAndWait() { + // Signal thread to stop + mDone.store(true, std::memory_order_release); + + // Wait for thread to exit if needed. This should happen in no more than one iteration of + // threadLoop + if (mThread.joinable()) { + mThread.join(); + } + mThread = std::thread(); +} + +void SimpleThread::runLoop() { + while (!exitPending()) { + if (!threadLoop()) { + break; + } + } +} + +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android \ No newline at end of file diff --git a/camera/common/1.0/default/VendorTagDescriptor.cpp b/camera/common/default/VendorTagDescriptor.cpp similarity index 92% rename from camera/common/1.0/default/VendorTagDescriptor.cpp rename to camera/common/default/VendorTagDescriptor.cpp index ba3fe39df5..fba9caaa2e 100644 --- a/camera/common/1.0/default/VendorTagDescriptor.cpp +++ b/camera/common/default/VendorTagDescriptor.cpp @@ -16,9 +16,9 @@ #define LOG_TAG "CamComm1.0-VTDesc" +#include #include #include -#include #include #include #include @@ -36,15 +36,12 @@ namespace params { VendorTagDescriptor::~VendorTagDescriptor() { size_t len = mReverseMapping.size(); - for (size_t i = 0; i < len; ++i) { + for (size_t i = 0; i < len; ++i) { delete mReverseMapping[i]; } } -VendorTagDescriptor::VendorTagDescriptor() : - mTagCount(0), - mVendorOps() { -} +VendorTagDescriptor::VendorTagDescriptor() : mTagCount(0), mVendorOps() {} VendorTagDescriptor::VendorTagDescriptor(const VendorTagDescriptor& src) { copyFrom(src); @@ -127,7 +124,8 @@ const SortedVector* VendorTagDescriptor::getAllSectionNames() const { return &mSections; } -status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& section, /*out*/uint32_t* tag) const { +status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& section, + /*out*/ uint32_t* tag) const { ssize_t index = mReverseMapping.indexOfKey(section); if (index < 0) { ALOGE("%s: Section '%s' does not exist.", __FUNCTION__, section.c_str()); @@ -147,18 +145,16 @@ status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& sect } void VendorTagDescriptor::dump(int fd, int verbosity, int indentation) const { - size_t size = mTagToNameMap.size(); if (size == 0) { - dprintf(fd, "%*sDumping configured vendor tag descriptors: None set\n", - indentation, ""); + dprintf(fd, "%*sDumping configured vendor tag descriptors: None set\n", indentation, ""); return; } - dprintf(fd, "%*sDumping configured vendor tag descriptors: %zu entries\n", - indentation, "", size); + dprintf(fd, "%*sDumping configured vendor tag descriptors: %zu entries\n", indentation, "", + size); for (size_t i = 0; i < size; ++i) { - uint32_t tag = mTagToNameMap.keyAt(i); + uint32_t tag = mTagToNameMap.keyAt(i); if (verbosity < 1) { dprintf(fd, "%*s0x%x\n", indentation + 2, "", tag); @@ -168,12 +164,11 @@ void VendorTagDescriptor::dump(int fd, int verbosity, int indentation) const { uint32_t sectionId = mTagToSectionMap.valueFor(tag); String8 sectionName = mSections[sectionId]; int type = mTagToTypeMap.at(tag); - const char* typeName = (type >= 0 && type < NUM_TYPES) ? - camera_metadata_type_names[type] : "UNKNOWN"; + const char* typeName = + (type >= 0 && type < NUM_TYPES) ? camera_metadata_type_names[type] : "UNKNOWN"; dprintf(fd, "%*s0x%x (%s) with type %d (%s) defined in section %s\n", indentation + 2, "", tag, name.c_str(), type, typeName, sectionName.c_str()); } - } int VendorTagDescriptorCache::getTagCount(metadata_vendor_id_t id) const { @@ -240,7 +235,7 @@ void VendorTagDescriptorCache::dump(int fd, int verbosity, int indentation) cons } int32_t VendorTagDescriptorCache::addVendorDescriptor( - metadata_vendor_id_t id, sp desc) { + metadata_vendor_id_t id, sp desc) { auto entry = mVendorMap.find(id); if (entry != mVendorMap.end()) { ALOGE("%s: Vendor descriptor with same id already present!", __func__); @@ -252,8 +247,8 @@ int32_t VendorTagDescriptorCache::addVendorDescriptor( } int32_t VendorTagDescriptorCache::getVendorTagDescriptor( - metadata_vendor_id_t id, - sp* desc /*out*/) { + metadata_vendor_id_t id, + sp* desc /*out*/) { auto entry = mVendorMap.find(id); if (entry == mVendorMap.end()) { return NAME_NOT_FOUND; @@ -263,12 +258,11 @@ int32_t VendorTagDescriptorCache::getVendorTagDescriptor( return NO_ERROR; } -} // namespace params -} // namespace camera2 +} // namespace params +} // namespace camera2 namespace camera { namespace common { -namespace V1_0 { namespace helper { extern "C" { @@ -292,8 +286,8 @@ static sp sGlobalVendorTagDescriptor; static sp sGlobalVendorTagDescriptorCache; status_t VendorTagDescriptor::createDescriptorFromOps(const vendor_tag_ops_t* vOps, - /*out*/ - sp& descriptor) { + /*out*/ + sp& descriptor) { if (vOps == NULL) { ALOGE("%s: vendor_tag_ops argument was NULL.", __FUNCTION__); return BAD_VALUE; @@ -307,9 +301,9 @@ status_t VendorTagDescriptor::createDescriptorFromOps(const vendor_tag_ops_t* vO Vector tagArray; LOG_ALWAYS_FATAL_IF(tagArray.resize(tagCount) != tagCount, - "%s: too many (%u) vendor tags defined.", __FUNCTION__, tagCount); + "%s: too many (%u) vendor tags defined.", __FUNCTION__, tagCount); - vOps->get_all_tags(vOps, /*out*/tagArray.editArray()); + vOps->get_all_tags(vOps, /*out*/ tagArray.editArray()); sp desc = new VendorTagDescriptor(); desc->mTagCount = tagCount; @@ -323,13 +317,13 @@ status_t VendorTagDescriptor::createDescriptorFromOps(const vendor_tag_ops_t* vO ALOGE("%s: vendor tag %d not in vendor tag section.", __FUNCTION__, tag); return BAD_VALUE; } - const char *tagName = vOps->get_tag_name(vOps, tag); + const char* tagName = vOps->get_tag_name(vOps, tag); if (tagName == NULL) { ALOGE("%s: no tag name defined for vendor tag %d.", __FUNCTION__, tag); return BAD_VALUE; } desc->mTagToNameMap.add(tag, String8(tagName)); - const char *sectionName = vOps->get_section_name(vOps, tag); + const char* sectionName = vOps->get_section_name(vOps, tag); if (sectionName == NULL) { ALOGE("%s: no section name defined for vendor tag %d.", __FUNCTION__, tag); return BAD_VALUE; @@ -386,9 +380,9 @@ status_t VendorTagDescriptor::setAsGlobalVendorTagDescriptor(const spget_tag_name = vendor_tag_descriptor_get_tag_name; opsPtr->get_tag_type = vendor_tag_descriptor_get_tag_type; } - if((res = set_camera_metadata_vendor_ops(opsPtr)) != OK) { - ALOGE("%s: Could not set vendor tag descriptor, received error %s (%d)." - , __FUNCTION__, strerror(-res), res); + if ((res = set_camera_metadata_vendor_ops(opsPtr)) != OK) { + ALOGE("%s: Could not set vendor tag descriptor, received error %s (%d).", __FUNCTION__, + strerror(-res), res); } return res; } @@ -405,7 +399,7 @@ sp VendorTagDescriptor::getGlobalVendorTagDescriptor() { } status_t VendorTagDescriptorCache::setAsGlobalVendorTagCache( - const sp& cache) { + const sp& cache) { status_t res = OK; Mutex::Autolock al(sLock); sGlobalVendorTagDescriptorCache = cache; @@ -530,9 +524,8 @@ int vendor_tag_descriptor_cache_get_tag_type(uint32_t tag, metadata_vendor_id_t } /* extern "C" */ -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/common/1.0/default/include/CameraMetadata.h b/camera/common/default/include/CameraMetadata.h similarity index 76% rename from camera/common/1.0/default/include/CameraMetadata.h rename to camera/common/default/include/CameraMetadata.h index d5e4d5691d..b67914ea45 100644 --- a/camera/common/1.0/default/include/CameraMetadata.h +++ b/camera/common/default/include/CameraMetadata.h @@ -26,7 +26,6 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { class VendorTagDescriptor; @@ -46,15 +45,15 @@ class CameraMetadata { ~CameraMetadata(); /** Takes ownership of passed-in buffer */ - CameraMetadata(camera_metadata_t *buffer); + CameraMetadata(camera_metadata_t* buffer); /** Clones the metadata */ - CameraMetadata(const CameraMetadata &other); + CameraMetadata(const CameraMetadata& other); /** * Assignment clones metadata buffer. */ - CameraMetadata &operator=(const CameraMetadata &other); - CameraMetadata &operator=(const camera_metadata_t *buffer); + CameraMetadata& operator=(const CameraMetadata& other); + CameraMetadata& operator=(const camera_metadata_t* buffer); /** * Get reference to the underlying metadata buffer. Ownership remains with @@ -71,7 +70,7 @@ class CameraMetadata { * from getAndLock must be provided to guarantee that the right object is * being unlocked. */ - status_t unlock(const camera_metadata_t *buffer) const; + status_t unlock(const camera_metadata_t* buffer) const; /** * Release a raw metadata buffer to the caller. After this call, @@ -98,12 +97,12 @@ class CameraMetadata { * Acquires raw buffer from other CameraMetadata object. After the call, the argument * object no longer has any metadata. */ - void acquire(CameraMetadata &other); + void acquire(CameraMetadata& other); /** * Append metadata from another CameraMetadata object. */ - status_t append(const CameraMetadata &other); + status_t append(const CameraMetadata& other); /** * Append metadata from a raw camera_metadata buffer @@ -130,24 +129,16 @@ class CameraMetadata { * will reallocate the buffer if insufficient space exists. Overloaded for * the various types of valid data. */ - status_t update(uint32_t tag, - const uint8_t *data, size_t data_count); - status_t update(uint32_t tag, - const int32_t *data, size_t data_count); - status_t update(uint32_t tag, - const float *data, size_t data_count); - status_t update(uint32_t tag, - const int64_t *data, size_t data_count); - status_t update(uint32_t tag, - const double *data, size_t data_count); - status_t update(uint32_t tag, - const camera_metadata_rational_t *data, size_t data_count); - status_t update(uint32_t tag, - const String8 &string); - status_t update(const camera_metadata_ro_entry &entry); + status_t update(uint32_t tag, const uint8_t* data, size_t data_count); + status_t update(uint32_t tag, const int32_t* data, size_t data_count); + status_t update(uint32_t tag, const float* data, size_t data_count); + status_t update(uint32_t tag, const int64_t* data, size_t data_count); + status_t update(uint32_t tag, const double* data, size_t data_count); + status_t update(uint32_t tag, const camera_metadata_rational_t* data, size_t data_count); + status_t update(uint32_t tag, const String8& string); + status_t update(const camera_metadata_ro_entry& entry); - - template + template status_t update(uint32_t tag, Vector data) { return update(tag, data.array(), data.size()); } @@ -177,7 +168,7 @@ class CameraMetadata { * Swap the underlying camera metadata between this and the other * metadata object. */ - void swap(CameraMetadata &other); + void swap(CameraMetadata& other); /** * Dump contents into FD for debugging. The verbosity levels are @@ -196,12 +187,12 @@ class CameraMetadata { * * This is a slow method. */ - static status_t getTagFromName(const char *name, - const VendorTagDescriptor* vTags, uint32_t *tag); + static status_t getTagFromName(const char* name, const VendorTagDescriptor* vTags, + uint32_t* tag); private: - camera_metadata_t *mBuffer; - mutable bool mLocked; + camera_metadata_t* mBuffer; + mutable bool mLocked; /** * Check if tag has a given type @@ -211,20 +202,25 @@ class CameraMetadata { /** * Base update entry method */ - status_t updateImpl(uint32_t tag, const void *data, size_t data_count); + status_t updateImpl(uint32_t tag, const void* data, size_t data_count); /** * Resize metadata buffer if needed by reallocating it and copying it over. */ status_t resizeIfNeeded(size_t extraEntries, size_t extraData); - }; -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper + +// NOTE: Deprecated namespace. This namespace should no longer be used. +namespace V1_0::helper { +// Export symbols to the old namespace to preserve compatibility +typedef android::hardware::camera::common::helper::CameraMetadata CameraMetadata; +} // namespace V1_0::helper + +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android #endif diff --git a/camera/common/1.0/default/include/CameraModule.h b/camera/common/default/include/CameraModule.h similarity index 72% rename from camera/common/1.0/default/include/CameraModule.h rename to camera/common/default/include/CameraModule.h index c89e934655..5c1f8ec848 100644 --- a/camera/common/1.0/default/include/CameraModule.h +++ b/camera/common/default/include/CameraModule.h @@ -21,8 +21,8 @@ #include #include -#include #include +#include #include #include "CameraMetadata.h" @@ -31,7 +31,6 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { /** * A wrapper class for HAL camera module. @@ -41,21 +40,21 @@ namespace helper { * camera characteristics keys defined in newer HAL version on an older HAL. */ class CameraModule : public RefBase { -public: - explicit CameraModule(camera_module_t *module); + public: + explicit CameraModule(camera_module_t* module); virtual ~CameraModule(); // Must be called after construction // Returns OK on success, NO_INIT on failure int init(); - int getCameraInfo(int cameraId, struct camera_info *info); + int getCameraInfo(int cameraId, struct camera_info* info); int getDeviceVersion(int cameraId); int getNumberOfCameras(void); int open(const char* id, struct hw_device_t** device); bool isOpenLegacyDefined() const; int openLegacy(const char* id, uint32_t halVersion, struct hw_device_t** device); - int setCallbacks(const camera_module_callbacks_t *callbacks); + int setCallbacks(const camera_module_callbacks_t* callbacks); bool isVendorTagDefined() const; void getVendorTagOps(vendor_tag_ops_t* ops); bool isSetTorchModeSupported() const; @@ -65,25 +64,24 @@ public: uint16_t getHalApiVersion() const; const char* getModuleAuthor() const; // Only used by CameraModuleFixture native test. Do NOT use elsewhere. - void *getDso(); + void* getDso(); // Only used by CameraProvider void removeCamera(int cameraId); - int getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t **physicalInfo); - int isStreamCombinationSupported(int cameraId, camera_stream_combination_t *streams); + int getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t** physicalInfo); + int isStreamCombinationSupported(int cameraId, camera_stream_combination_t* streams); void notifyDeviceStateChange(uint64_t deviceState); - static bool isLogicalMultiCamera( - const common::V1_0::helper::CameraMetadata& metadata, - std::unordered_set* physicalCameraIds); + static bool isLogicalMultiCamera(const common::helper::CameraMetadata& metadata, + std::unordered_set* physicalCameraIds); -private: + private: // Derive camera characteristics keys defined after HAL device version - static void deriveCameraCharacteristicsKeys(uint32_t deviceVersion, CameraMetadata &chars); + static void deriveCameraCharacteristicsKeys(uint32_t deviceVersion, CameraMetadata& chars); // Helper function to append available[request|result|chars]Keys - static void appendAvailableKeys(CameraMetadata &chars, - int32_t keyTag, const Vector& appendKeys); + static void appendAvailableKeys(CameraMetadata& chars, int32_t keyTag, + const Vector& appendKeys); status_t filterOpenErrorCode(status_t err); - camera_module_t *mModule; + camera_module_t* mModule; int mNumberOfCameras; KeyedVector mCameraInfoMap; KeyedVector mDeviceVersionMap; @@ -91,11 +89,17 @@ private: Mutex mCameraInfoLock; }; -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper + +// NOTE: Deprecated namespace. This namespace should no longer be used for the following symbols +namespace V1_0::helper { +// Export symbols to the old namespace to preserve compatibility +typedef android::hardware::camera::common::helper::CameraModule CameraModule; +} // namespace V1_0::helper + +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android #endif diff --git a/camera/common/1.0/default/include/CameraParameters.h b/camera/common/default/include/CameraParameters.h similarity index 94% rename from camera/common/1.0/default/include/CameraParameters.h rename to camera/common/default/include/CameraParameters.h index e4ff6f21c3..d2b5075f43 100644 --- a/camera/common/1.0/default/include/CameraParameters.h +++ b/camera/common/default/include/CameraParameters.h @@ -24,7 +24,6 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { struct Size { @@ -42,28 +41,27 @@ struct Size { } }; -class CameraParameters -{ -public: +class CameraParameters { + public: CameraParameters(); - CameraParameters(const String8 ¶ms) { unflatten(params); } + CameraParameters(const String8& params) { unflatten(params); } ~CameraParameters(); String8 flatten() const; - void unflatten(const String8 ¶ms); + void unflatten(const String8& params); - void set(const char *key, const char *value); - void set(const char *key, int value); - void setFloat(const char *key, float value); - const char *get(const char *key) const; - int getInt(const char *key) const; - float getFloat(const char *key) const; + void set(const char* key, const char* value); + void set(const char* key, int value); + void setFloat(const char* key, float value); + const char* get(const char* key) const; + int getInt(const char* key) const; + float getFloat(const char* key) const; - void remove(const char *key); + void remove(const char* key); void setPreviewSize(int width, int height); - void getPreviewSize(int *width, int *height) const; - void getSupportedPreviewSizes(Vector &sizes) const; + void getPreviewSize(int* width, int* height) const; + void getSupportedPreviewSizes(Vector& sizes) const; // Set the dimensions in pixels to the given width and height // for video frames. The given width and height must be one @@ -76,14 +74,14 @@ public: // supported dimensions returned from getSupportedVideoSizes(). // Must not be called if getSupportedVideoSizes() returns an // empty Vector of Size. - void getVideoSize(int *width, int *height) const; + void getVideoSize(int* width, int* height) const; // Retrieve a Vector of supported dimensions (width and height) // in pixels for video frames. If sizes returned from the method // is empty, the camera does not support calls to setVideoSize() // or getVideoSize(). In adddition, it also indicates that // the camera only has a single output, and does not have // separate output for video frames and preview frame. - void getSupportedVideoSizes(Vector &sizes) const; + void getSupportedVideoSizes(Vector& sizes) const; // Retrieve the preferred preview size (width and height) in pixels // for video recording. The given width and height must be one of // supported preview sizes returned from getSupportedPreviewSizes(). @@ -91,18 +89,18 @@ public: // Vector of Size. If getSupportedVideoSizes() returns an empty // Vector of Size, the width and height returned from this method // is invalid, and is "-1x-1". - void getPreferredPreviewSizeForVideo(int *width, int *height) const; + void getPreferredPreviewSizeForVideo(int* width, int* height) const; void setPreviewFrameRate(int fps); int getPreviewFrameRate() const; - void getPreviewFpsRange(int *min_fps, int *max_fps) const; - void setPreviewFormat(const char *format); - const char *getPreviewFormat() const; + void getPreviewFpsRange(int* min_fps, int* max_fps) const; + void setPreviewFormat(const char* format); + const char* getPreviewFormat() const; void setPictureSize(int width, int height); - void getPictureSize(int *width, int *height) const; - void getSupportedPictureSizes(Vector &sizes) const; - void setPictureFormat(const char *format); - const char *getPictureFormat() const; + void getPictureSize(int* width, int* height) const; + void getSupportedPictureSizes(Vector& sizes) const; + void setPictureFormat(const char* format); + const char* getPictureFormat() const; void dump() const; status_t dump(int fd, const Vector& args) const; @@ -619,9 +617,9 @@ public: // Pixel color formats for KEY_PREVIEW_FORMAT, KEY_PICTURE_FORMAT, // and KEY_VIDEO_FRAME_FORMAT static const char PIXEL_FORMAT_YUV422SP[]; - static const char PIXEL_FORMAT_YUV420SP[]; // NV21 - static const char PIXEL_FORMAT_YUV422I[]; // YUY2 - static const char PIXEL_FORMAT_YUV420P[]; // YV12 + static const char PIXEL_FORMAT_YUV420SP[]; // NV21 + static const char PIXEL_FORMAT_YUV422I[]; // YUY2 + static const char PIXEL_FORMAT_YUV420P[]; // YV12 static const char PIXEL_FORMAT_RGB565[]; static const char PIXEL_FORMAT_RGBA8888[]; static const char PIXEL_FORMAT_JPEG[]; @@ -695,15 +693,22 @@ public: */ static int previewFormatToEnum(const char* format); -private: - DefaultKeyedVector mMap; + private: + DefaultKeyedVector mMap; }; -}; -}; -}; -}; -}; -}; // namespace +}; // namespace helper + +// NOTE: Deprecated namespace. This namespace should no longer be used for the following symbols +namespace V1_0::helper { +// Export symbols to the old namespace to preserve compatibility +typedef android::hardware::camera::common::helper::CameraParameters CameraParameters; +typedef android::hardware::camera::common::helper::Size Size; +} // namespace V1_0::helper + +}; // namespace common +}; // namespace camera +}; // namespace hardware +}; // namespace android #endif diff --git a/camera/common/1.0/default/include/Exif.h b/camera/common/default/include/Exif.h similarity index 95% rename from camera/common/1.0/default/include/Exif.h rename to camera/common/default/include/Exif.h index dc31679a67..6974b8ea30 100644 --- a/camera/common/1.0/default/include/Exif.h +++ b/camera/common/default/include/Exif.h @@ -23,10 +23,8 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { - // This is based on the original ChromeOS ARC implementation of a V4L2 HAL // ExifUtils can generate APP1 segment with tags which caller set. ExifUtils can @@ -44,8 +42,7 @@ namespace helper { // uint8_t* app1Buffer = new uint8_t[app1Length]; // memcpy(app1Buffer, utils->GetApp1Buffer(), app1Length); class ExifUtils { - - public: + public: virtual ~ExifUtils(); static ExifUtils* create(); @@ -55,8 +52,7 @@ class ExifUtils { virtual bool initialize() = 0; // Set all known fields from a metadata structure - virtual bool setFromMetadata(const CameraMetadata& metadata, - const size_t imageWidth, + virtual bool setFromMetadata(const CameraMetadata& metadata, const size_t imageWidth, const size_t imageHeight) = 0; // Sets the len aperture. @@ -244,13 +240,17 @@ class ExifUtils { virtual unsigned int getApp1Length() = 0; }; +} // namespace helper -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +// NOTE: Deprecated namespace. This namespace should no longer be used for the following symbols +namespace V1_0::helper { +// Export symbols to the old namespace to preserve compatibility +typedef android::hardware::camera::common::helper::ExifUtils ExifUtils; +} // namespace V1_0::helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android #endif // ANDROID_HARDWARE_INTERFACES_CAMERA_COMMON_1_0_EXIF_H diff --git a/camera/common/1.0/default/include/HandleImporter.h b/camera/common/default/include/HandleImporter.h similarity index 80% rename from camera/common/1.0/default/include/HandleImporter.h rename to camera/common/default/include/HandleImporter.h index 83fa755c99..5408ba92e6 100644 --- a/camera/common/1.0/default/include/HandleImporter.h +++ b/camera/common/default/include/HandleImporter.h @@ -30,12 +30,11 @@ namespace android { namespace hardware { namespace camera { namespace common { -namespace V1_0 { namespace helper { // Borrowed from graphics HAL. Use this until gralloc mapper HAL is working class HandleImporter { -public: + public: HandleImporter(); // In IComposer, any buffer_handle_t is owned by the caller and we need to @@ -59,23 +58,23 @@ public: // Query the stride of the first plane in bytes. status_t getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/); - int unlock(buffer_handle_t& buf); // returns release fence + int unlock(buffer_handle_t& buf); // returns release fence // Query Gralloc4 metadata bool isSmpte2086Present(const buffer_handle_t& buf); bool isSmpte2094_10Present(const buffer_handle_t& buf); bool isSmpte2094_40Present(const buffer_handle_t& buf); -private: + private: void initializeLocked(); void cleanup(); - template + template bool importBufferInternal(const sp mapper, buffer_handle_t& handle); - template + template YCbCrLayout lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion); - template + const IMapper::Rect& accessRegion); + template int unlockInternal(const sp mapper, buffer_handle_t& buf); Mutex mLock; @@ -85,11 +84,17 @@ private: sp mMapperV4; }; -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper -#endif // CAMERA_COMMON_1_0_HANDLEIMPORTED_H +// NOTE: Deprecated namespace. This namespace should no longer be used for the following symbols +namespace V1_0::helper { +// Export symbols to the old namespace to preserve compatibility +typedef android::hardware::camera::common::helper::HandleImporter HandleImporter; +} // namespace V1_0::helper + +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // CAMERA_COMMON_1_0_HANDLEIMPORTED_H diff --git a/camera/common/default/include/SimpleThread.h b/camera/common/default/include/SimpleThread.h new file mode 100644 index 0000000000..d1becd60be --- /dev/null +++ b/camera/common/default/include/SimpleThread.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_COMMON_SIMPLETHREAD_H_ +#define HARDWARE_INTERFACES_CAMERA_COMMON_SIMPLETHREAD_H_ + +#include + +namespace android { +namespace hardware { +namespace camera { +namespace common { +namespace helper { + +// A simple looper based on std::thread. +class SimpleThread { + public: + SimpleThread(); + virtual ~SimpleThread(); + + // Explicit call to start execution of the thread. No thread is created before this function + // is called. + virtual void run() final; + virtual void requestExitAndWait() final; + + protected: + // Main logic of the thread. This function is called repeatedly until it returns false. + // Thread execution stops if this function returns false. + virtual bool threadLoop() = 0; + + // Returns true if the thread execution should stop. Should be used by threadLoop to check if + // the thread has been requested to exit. + virtual inline bool exitPending() final { return mDone.load(std::memory_order_acquire); } + + private: + // Wraps threadLoop in a simple while loop that allows safe exit + virtual void runLoop() final; + + // Flag to signal end of thread execution. This flag is checked before every iteration + // of threadLoop. + std::atomic_bool mDone; + std::thread mThread; +}; + +} // namespace helper +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // HARDWARE_INTERFACES_CAMERA_COMMON_SIMPLETHREAD_H_ diff --git a/camera/common/1.0/default/include/VendorTagDescriptor.h b/camera/common/default/include/VendorTagDescriptor.h similarity index 60% rename from camera/common/1.0/default/include/VendorTagDescriptor.h rename to camera/common/default/include/VendorTagDescriptor.h index 0f54db52d1..3133c26e00 100644 --- a/camera/common/1.0/default/include/VendorTagDescriptor.h +++ b/camera/common/default/include/VendorTagDescriptor.h @@ -17,11 +17,11 @@ #ifndef CAMERA_COMMON_1_0_VENDORTAGDESCRIPTOR_H #define CAMERA_COMMON_1_0_VENDORTAGDESCRIPTOR_H -#include -#include -#include -#include #include +#include +#include +#include +#include #include #include @@ -37,78 +37,77 @@ namespace params { * information enumerated by the HAL to clients of the camera service. */ class VendorTagDescriptor { - public: - virtual ~VendorTagDescriptor(); + public: + virtual ~VendorTagDescriptor(); - VendorTagDescriptor(); - VendorTagDescriptor(const VendorTagDescriptor& src); - VendorTagDescriptor& operator=(const VendorTagDescriptor& rhs); + VendorTagDescriptor(); + VendorTagDescriptor(const VendorTagDescriptor& src); + VendorTagDescriptor& operator=(const VendorTagDescriptor& rhs); - void copyFrom(const VendorTagDescriptor& src); + void copyFrom(const VendorTagDescriptor& src); - /** - * The following 'get*' methods implement the corresponding - * functions defined in - * system/media/camera/include/system/camera_vendor_tags.h - */ + /** + * The following 'get*' methods implement the corresponding + * functions defined in + * system/media/camera/include/system/camera_vendor_tags.h + */ - // Returns the number of vendor tags defined. - int getTagCount() const; + // Returns the number of vendor tags defined. + int getTagCount() const; - // Returns an array containing the id's of vendor tags defined. - void getTagArray(uint32_t* tagArray) const; + // Returns an array containing the id's of vendor tags defined. + void getTagArray(uint32_t* tagArray) const; - // Returns the section name string for a given vendor tag id. - const char* getSectionName(uint32_t tag) const; + // Returns the section name string for a given vendor tag id. + const char* getSectionName(uint32_t tag) const; - // Returns the index in section vectors returned in getAllSectionNames() - // for a given vendor tag id. -1 if input tag does not exist. - ssize_t getSectionIndex(uint32_t tag) const; + // Returns the index in section vectors returned in getAllSectionNames() + // for a given vendor tag id. -1 if input tag does not exist. + ssize_t getSectionIndex(uint32_t tag) const; - // Returns the tag name string for a given vendor tag id. - const char* getTagName(uint32_t tag) const; + // Returns the tag name string for a given vendor tag id. + const char* getTagName(uint32_t tag) const; - // Returns the tag type for a given vendor tag id. - int getTagType(uint32_t tag) const; + // Returns the tag type for a given vendor tag id. + int getTagType(uint32_t tag) const; - /** - * Convenience method to get a vector containing all vendor tag - * sections, or an empty vector if none are defined. - * The pointer is valid for the lifetime of the VendorTagDescriptor, - * or until copyFrom is invoked. - */ - const SortedVector* getAllSectionNames() const; + /** + * Convenience method to get a vector containing all vendor tag + * sections, or an empty vector if none are defined. + * The pointer is valid for the lifetime of the VendorTagDescriptor, + * or until copyFrom is invoked. + */ + const SortedVector* getAllSectionNames() const; - /** - * Lookup the tag id for a given tag name and section. - * - * Returns OK on success, or a negative error code. - */ - status_t lookupTag(const String8& name, const String8& section, /*out*/uint32_t* tag) const; + /** + * Lookup the tag id for a given tag name and section. + * + * Returns OK on success, or a negative error code. + */ + status_t lookupTag(const String8& name, const String8& section, /*out*/ uint32_t* tag) const; - /** - * Dump the currently configured vendor tags to a file descriptor. - */ - void dump(int fd, int verbosity, int indentation) const; + /** + * Dump the currently configured vendor tags to a file descriptor. + */ + void dump(int fd, int verbosity, int indentation) const; - protected: - KeyedVector*> mReverseMapping; - KeyedVector mTagToNameMap; - KeyedVector mTagToSectionMap; // Value is offset in mSections + protected: + KeyedVector*> mReverseMapping; + KeyedVector mTagToNameMap; + KeyedVector mTagToSectionMap; // Value is offset in mSections - std::unordered_map mTagToTypeMap; - SortedVector mSections; - // must be int32_t to be compatible with Parcel::writeInt32 - int32_t mTagCount; + std::unordered_map mTagToTypeMap; + SortedVector mSections; + // must be int32_t to be compatible with Parcel::writeInt32 + int32_t mTagCount; - vendor_tag_ops mVendorOps; + vendor_tag_ops mVendorOps; }; } /* namespace params */ } /* namespace camera2 */ namespace camera { namespace common { -namespace V1_0 { namespace helper { /** @@ -119,12 +118,9 @@ namespace helper { * Parcelable objects cannot require being kept in an sp<> and still work with auto-generated AIDL * interface implementations. */ -class VendorTagDescriptor : - public ::android::hardware::camera2::params::VendorTagDescriptor, - public LightRefBase { - +class VendorTagDescriptor : public ::android::hardware::camera2::params::VendorTagDescriptor, + public LightRefBase { public: - /** * Create a VendorTagDescriptor object from the given vendor_tag_ops_t * struct. @@ -132,8 +128,8 @@ class VendorTagDescriptor : * Returns OK on success, or a negative error code. */ static status_t createDescriptorFromOps(const vendor_tag_ops_t* vOps, - /*out*/ - sp& descriptor); + /*out*/ + sp& descriptor); /** * Sets the global vendor tag descriptor to use for this process. @@ -154,11 +150,9 @@ class VendorTagDescriptor : * Clears the global vendor tag descriptor used by this process. */ static void clearGlobalVendorTagDescriptor(); - }; } /* namespace helper */ -} /* namespace V1_0 */ } /* namespace common */ } /* namespace camera */ @@ -166,9 +160,8 @@ namespace camera2 { namespace params { class VendorTagDescriptorCache { - public: - typedef android::hardware::camera::common::V1_0::helper::VendorTagDescriptor - VendorTagDescriptor; + public: + typedef android::hardware::camera::common::helper::VendorTagDescriptor VendorTagDescriptor; VendorTagDescriptorCache(){}; int32_t addVendorDescriptor(metadata_vendor_id_t id, sp desc); @@ -194,7 +187,7 @@ class VendorTagDescriptorCache { */ void dump(int fd, int verbosity, int indentation) const; - protected: + protected: std::unordered_map> mVendorMap; struct vendor_tag_cache_ops mVendorCacheOps; }; @@ -204,13 +197,12 @@ class VendorTagDescriptorCache { namespace camera { namespace common { -namespace V1_0 { namespace helper { class VendorTagDescriptorCache : public ::android::hardware::camera2::params::VendorTagDescriptorCache, public LightRefBase { - public: + public: /** * Sets the global vendor tag descriptor cache to use for this process. * Camera metadata operations that access vendor tags will use the @@ -232,11 +224,19 @@ class VendorTagDescriptorCache static void clearGlobalVendorTagCache(); }; -} // namespace helper -} // namespace V1_0 -} // namespace common -} // namespace camera -} // namespace hardware -} // namespace android +} // namespace helper + +// NOTE: Deprecated namespace. This namespace should no longer be used for the following symbols +namespace V1_0::helper { +// Export symbols to the old namespace to preserve compatibility +typedef android::hardware::camera::common::helper::VendorTagDescriptor VendorTagDescriptor; +typedef android::hardware::camera::common::helper::VendorTagDescriptorCache + VendorTagDescriptorCache; +} // namespace V1_0::helper + +} // namespace common +} // namespace camera +} // namespace hardware +} // namespace android #endif /* CAMERA_COMMON_1_0_VENDORTAGDESCRIPTOR_H */ diff --git a/camera/device/3.2/types.hal b/camera/device/3.2/types.hal index 276e92a3ee..3989161667 100644 --- a/camera/device/3.2/types.hal +++ b/camera/device/3.2/types.hal @@ -346,15 +346,18 @@ struct HalStream { * An override pixel format for the buffers in this stream. * * The HAL must respect the requested format in Stream unless it is - * IMPLEMENTATION_DEFINED, in which case the override format here must be - * used by the client instead, for this stream. This allows cross-platform - * HALs to use a standard format since IMPLEMENTATION_DEFINED formats often - * require device-specific information. In all other cases, the + * IMPLEMENTATION_DEFINED output, in which case the override format + * here must be used by the client instead, for this stream. This allows + * cross-platform HALs to use a standard format since IMPLEMENTATION_DEFINED + * formats often require device-specific information. In all other cases, the * overrideFormat must match the requested format. * * When HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform * gralloc module must select a format based on the usage flags provided by * the camera device and the other endpoint of the stream. + * + * For private reprocessing, the HAL must not override the input stream's + * IMPLEMENTATION_DEFINED format. */ android.hardware.graphics.common@1.0::PixelFormat overrideFormat; diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp index 461e89d546..43a3934e74 100644 --- a/camera/device/aidl/Android.bp +++ b/camera/device/aidl/Android.bp @@ -17,7 +17,7 @@ aidl_interface { "android.hardware.common-V2", "android.hardware.common.fmq-V1", "android.hardware.camera.common-V1", - "android.hardware.camera.metadata-V1", + "android.hardware.camera.metadata-V2", "android.hardware.graphics.common-V4", ], backend: { @@ -40,6 +40,17 @@ aidl_interface { "android.hardware.graphics.common-V4", ], }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + "android.hardware.camera.common-V1", + "android.hardware.camera.metadata-V2", + "android.hardware.graphics.common-V4", + ], + }, + ], } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/.hash b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/.hash new file mode 100644 index 0000000000..7a7bd43eb8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/.hash @@ -0,0 +1 @@ +c03791dc9ced356c793cc487d0de3266dcb06ac9 diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferCache.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferCache.aidl new file mode 100644 index 0000000000..9439172d6b --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferCache.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable BufferCache { + int streamId; + long bufferId; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferRequest.aidl new file mode 100644 index 0000000000..c40a24aa79 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferRequest.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable BufferRequest { + int streamId; + int numBuffersRequested; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferRequestStatus.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferRequestStatus.aidl new file mode 100644 index 0000000000..72fb61ba29 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferRequestStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum BufferRequestStatus { + OK = 0, + FAILED_PARTIAL = 1, + FAILED_CONFIGURING = 2, + FAILED_ILLEGAL_ARGUMENTS = 3, + FAILED_UNKNOWN = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferStatus.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferStatus.aidl new file mode 100644 index 0000000000..43a2b35e74 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/BufferStatus.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum BufferStatus { + OK = 0, + ERROR = 1, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraBlob.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraBlob.aidl new file mode 100644 index 0000000000..520181c87f --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraBlob.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable CameraBlob { + android.hardware.camera.device.CameraBlobId blobId; + int blobSizeBytes; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraBlobId.aidl new file mode 100644 index 0000000000..24083ad512 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraBlobId.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum CameraBlobId { + JPEG = 0x00FF, + JPEG_APP_SEGMENTS = 0x100, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraMetadata.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraMetadata.aidl new file mode 100644 index 0000000000..b96d69e1b8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraMetadata.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable CameraMetadata { + byte[] metadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraOfflineSessionInfo.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraOfflineSessionInfo.aidl new file mode 100644 index 0000000000..1ad8e115c8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CameraOfflineSessionInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable CameraOfflineSessionInfo { + android.hardware.camera.device.OfflineStream[] offlineStreams; + android.hardware.camera.device.OfflineRequest[] offlineRequests; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CaptureRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CaptureRequest.aidl new file mode 100644 index 0000000000..6b5b256571 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CaptureRequest.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable CaptureRequest { + int frameNumber; + long fmqSettingsSize; + android.hardware.camera.device.CameraMetadata settings; + android.hardware.camera.device.StreamBuffer inputBuffer; + int inputWidth; + int inputHeight; + android.hardware.camera.device.StreamBuffer[] outputBuffers; + android.hardware.camera.device.PhysicalCameraSetting[] physicalCameraSettings; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CaptureResult.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CaptureResult.aidl new file mode 100644 index 0000000000..a820e2c463 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/CaptureResult.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable CaptureResult { + int frameNumber; + long fmqResultSize; + android.hardware.camera.device.CameraMetadata result; + android.hardware.camera.device.StreamBuffer[] outputBuffers; + android.hardware.camera.device.StreamBuffer inputBuffer; + int partialResult; + android.hardware.camera.device.PhysicalCameraMetadata[] physicalCameraMetadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ErrorCode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ErrorCode.aidl new file mode 100644 index 0000000000..2f9887a7a5 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ErrorCode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum ErrorCode { + ERROR_DEVICE = 1, + ERROR_REQUEST = 2, + ERROR_RESULT = 3, + ERROR_BUFFER = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ErrorMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ErrorMsg.aidl new file mode 100644 index 0000000000..b2e9512bbf --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ErrorMsg.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable ErrorMsg { + int frameNumber; + int errorStreamId; + android.hardware.camera.device.ErrorCode errorCode; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/HalStream.aidl new file mode 100644 index 0000000000..a5784bcf32 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/HalStream.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable HalStream { + int id; + android.hardware.graphics.common.PixelFormat overrideFormat; + android.hardware.graphics.common.BufferUsage producerUsage; + android.hardware.graphics.common.BufferUsage consumerUsage; + int maxBuffers; + android.hardware.graphics.common.Dataspace overrideDataSpace; + String physicalCameraId; + boolean supportOffline; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDevice.aidl new file mode 100644 index 0000000000..51c60676be --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDevice.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +interface ICameraDevice { + android.hardware.camera.device.CameraMetadata getCameraCharacteristics(); + android.hardware.camera.device.CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId); + android.hardware.camera.common.CameraResourceCost getResourceCost(); + boolean isStreamCombinationSupported(in android.hardware.camera.device.StreamConfiguration streams); + android.hardware.camera.device.ICameraDeviceSession open(in android.hardware.camera.device.ICameraDeviceCallback callback); + android.hardware.camera.device.ICameraInjectionSession openInjectionSession(in android.hardware.camera.device.ICameraDeviceCallback callback); + void setTorchMode(boolean on); + void turnOnTorchWithStrengthLevel(int torchStrength); + int getTorchStrengthLevel(); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDeviceCallback.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDeviceCallback.aidl new file mode 100644 index 0000000000..7b79c6c87a --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDeviceCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +interface ICameraDeviceCallback { + void notify(in android.hardware.camera.device.NotifyMsg[] msgs); + void processCaptureResult(in android.hardware.camera.device.CaptureResult[] results); + android.hardware.camera.device.BufferRequestStatus requestStreamBuffers(in android.hardware.camera.device.BufferRequest[] bufReqs, out android.hardware.camera.device.StreamBufferRet[] buffers); + void returnStreamBuffers(in android.hardware.camera.device.StreamBuffer[] buffers); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDeviceSession.aidl new file mode 100644 index 0000000000..2196d37a6c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraDeviceSession.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +interface ICameraDeviceSession { + void close(); + android.hardware.camera.device.HalStream[] configureStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration); + android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type); + void flush(); + android.hardware.common.fmq.MQDescriptor getCaptureRequestMetadataQueue(); + android.hardware.common.fmq.MQDescriptor getCaptureResultMetadataQueue(); + boolean isReconfigurationRequired(in android.hardware.camera.device.CameraMetadata oldSessionParams, in android.hardware.camera.device.CameraMetadata newSessionParams); + int processCaptureRequest(in android.hardware.camera.device.CaptureRequest[] requests, in android.hardware.camera.device.BufferCache[] cachesToRemove); + oneway void signalStreamFlush(in int[] streamIds, in int streamConfigCounter); + android.hardware.camera.device.ICameraOfflineSession switchToOffline(in int[] streamsToKeep, out android.hardware.camera.device.CameraOfflineSessionInfo offlineSessionInfo); + void repeatingRequestEnd(in int frameNumber, in int[] streamIds); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraInjectionSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraInjectionSession.aidl new file mode 100644 index 0000000000..80f74f331c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraInjectionSession.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +interface ICameraInjectionSession { + void configureInjectionStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration, in android.hardware.camera.device.CameraMetadata characteristics); + android.hardware.camera.device.ICameraDeviceSession getCameraDeviceSession(); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraOfflineSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraOfflineSession.aidl new file mode 100644 index 0000000000..727d856fc8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ICameraOfflineSession.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +interface ICameraOfflineSession { + void close(); + android.hardware.common.fmq.MQDescriptor getCaptureResultMetadataQueue(); + void setCallback(in android.hardware.camera.device.ICameraDeviceCallback cb); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/NotifyMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/NotifyMsg.aidl new file mode 100644 index 0000000000..3ad7e52e63 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/NotifyMsg.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +union NotifyMsg { + android.hardware.camera.device.ErrorMsg error; + android.hardware.camera.device.ShutterMsg shutter; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/OfflineRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/OfflineRequest.aidl new file mode 100644 index 0000000000..6e6f29d6fc --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/OfflineRequest.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable OfflineRequest { + int frameNumber; + int[] pendingStreams; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/OfflineStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/OfflineStream.aidl new file mode 100644 index 0000000000..54cb1fed0e --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/OfflineStream.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable OfflineStream { + int id; + int numOutstandingBuffers; + long[] circulatingBufferIds; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/PhysicalCameraMetadata.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/PhysicalCameraMetadata.aidl new file mode 100644 index 0000000000..3d66ab8713 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/PhysicalCameraMetadata.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable PhysicalCameraMetadata { + long fmqMetadataSize; + String physicalCameraId; + android.hardware.camera.device.CameraMetadata metadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/PhysicalCameraSetting.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/PhysicalCameraSetting.aidl new file mode 100644 index 0000000000..a6c241d453 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/PhysicalCameraSetting.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable PhysicalCameraSetting { + long fmqSettingsSize; + String physicalCameraId; + android.hardware.camera.device.CameraMetadata settings; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/RequestTemplate.aidl new file mode 100644 index 0000000000..1f87aa338d --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/RequestTemplate.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum RequestTemplate { + PREVIEW = 1, + STILL_CAPTURE = 2, + VIDEO_RECORD = 3, + VIDEO_SNAPSHOT = 4, + ZERO_SHUTTER_LAG = 5, + MANUAL = 6, + VENDOR_TEMPLATE_START = 0x40000000, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ShutterMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ShutterMsg.aidl new file mode 100644 index 0000000000..ce059ac0db --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/ShutterMsg.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable ShutterMsg { + int frameNumber; + long timestamp; + long readoutTimestamp; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/Stream.aidl new file mode 100644 index 0000000000..5057663e65 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/Stream.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable Stream { + int id; + android.hardware.camera.device.StreamType streamType; + int width; + int height; + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.BufferUsage usage; + android.hardware.graphics.common.Dataspace dataSpace; + android.hardware.camera.device.StreamRotation rotation; + String physicalCameraId; + int bufferSize; + int groupId; + android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; + android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; + int colorSpace; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBuffer.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBuffer.aidl new file mode 100644 index 0000000000..8fabf032db --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBuffer.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable StreamBuffer { + int streamId; + long bufferId; + android.hardware.common.NativeHandle buffer; + android.hardware.camera.device.BufferStatus status; + android.hardware.common.NativeHandle acquireFence; + android.hardware.common.NativeHandle releaseFence; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBufferRequestError.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBufferRequestError.aidl new file mode 100644 index 0000000000..f450149635 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBufferRequestError.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum StreamBufferRequestError { + NO_BUFFER_AVAILABLE = 1, + MAX_BUFFER_EXCEEDED = 2, + STREAM_DISCONNECTED = 3, + UNKNOWN_ERROR = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBufferRet.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBufferRet.aidl new file mode 100644 index 0000000000..3998cc34fa --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBufferRet.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable StreamBufferRet { + int streamId; + android.hardware.camera.device.StreamBuffersVal val; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBuffersVal.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBuffersVal.aidl new file mode 100644 index 0000000000..bebc9fcced --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamBuffersVal.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +union StreamBuffersVal { + android.hardware.camera.device.StreamBufferRequestError error = android.hardware.camera.device.StreamBufferRequestError.UNKNOWN_ERROR; + android.hardware.camera.device.StreamBuffer[] buffers; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamConfiguration.aidl new file mode 100644 index 0000000000..97fd067b8d --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamConfiguration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@VintfStability +parcelable StreamConfiguration { + android.hardware.camera.device.Stream[] streams; + android.hardware.camera.device.StreamConfigurationMode operationMode; + android.hardware.camera.device.CameraMetadata sessionParams; + int streamConfigCounter; + boolean multiResolutionInputImage; + long logId = 0; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamConfigurationMode.aidl new file mode 100644 index 0000000000..ef7ec25d07 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamConfigurationMode.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum StreamConfigurationMode { + NORMAL_MODE = 0, + CONSTRAINED_HIGH_SPEED_MODE = 1, + VENDOR_MODE_0 = 0x8000, + VENDOR_MODE_1, + VENDOR_MODE_2, + VENDOR_MODE_3, + VENDOR_MODE_4, + VENDOR_MODE_5, + VENDOR_MODE_6, + VENDOR_MODE_7, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamRotation.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamRotation.aidl new file mode 100644 index 0000000000..2ef4274f88 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamRotation.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum StreamRotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamType.aidl new file mode 100644 index 0000000000..0f13fe8be7 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/2/android/hardware/camera/device/StreamType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.device; +@Backing(type="int") @VintfStability +enum StreamType { + OUTPUT = 0, + INPUT = 1, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl index 632499d55d..24083ad512 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl @@ -34,6 +34,6 @@ package android.hardware.camera.device; @Backing(type="int") @VintfStability enum CameraBlobId { - JPEG = 255, - JPEG_APP_SEGMENTS = 256, + JPEG = 0x00FF, + JPEG_APP_SEGMENTS = 0x100, } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl index b70b8997d9..1f87aa338d 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl @@ -40,5 +40,5 @@ enum RequestTemplate { VIDEO_SNAPSHOT = 4, ZERO_SHUTTER_LAG = 5, MANUAL = 6, - VENDOR_TEMPLATE_START = 1073741824, + VENDOR_TEMPLATE_START = 0x40000000, } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl index d2f295a160..5057663e65 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl @@ -48,4 +48,5 @@ parcelable Stream { android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; + int colorSpace; } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl index f3405780be..97fd067b8d 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl @@ -39,4 +39,5 @@ parcelable StreamConfiguration { android.hardware.camera.device.CameraMetadata sessionParams; int streamConfigCounter; boolean multiResolutionInputImage; + long logId = 0; } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl index bdef41209d..ef7ec25d07 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl @@ -36,12 +36,12 @@ package android.hardware.camera.device; enum StreamConfigurationMode { NORMAL_MODE = 0, CONSTRAINED_HIGH_SPEED_MODE = 1, - VENDOR_MODE_0 = 32768, - VENDOR_MODE_1 = 32769, - VENDOR_MODE_2 = 32770, - VENDOR_MODE_3 = 32771, - VENDOR_MODE_4 = 32772, - VENDOR_MODE_5 = 32773, - VENDOR_MODE_6 = 32774, - VENDOR_MODE_7 = 32775, + VENDOR_MODE_0 = 0x8000, + VENDOR_MODE_1, + VENDOR_MODE_2, + VENDOR_MODE_3, + VENDOR_MODE_4, + VENDOR_MODE_5, + VENDOR_MODE_6, + VENDOR_MODE_7, } diff --git a/camera/device/aidl/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl index b8ec3deec5..25a80bc16c 100644 --- a/camera/device/aidl/android/hardware/camera/device/HalStream.aidl +++ b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl @@ -38,7 +38,7 @@ parcelable HalStream { * An override pixel format for the buffers in this stream. * * The HAL must respect the requested format in Stream unless it is - * IMPLEMENTATION_DEFINED, in which case the override format here must be + * IMPLEMENTATION_DEFINED output, in which case the override format here must be * used by the client instead, for this stream. This allows cross-platform * HALs to use a standard format since IMPLEMENTATION_DEFINED formats often * require device-specific information. In all other cases, the @@ -47,6 +47,9 @@ parcelable HalStream { * When HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform * gralloc module must select a format based on the usage flags provided by * the camera device and the other endpoint of the stream. + * + * For private reprocessing, the HAL must not override the input stream's + * IMPLEMENTATION_DEFINED format. */ android.hardware.graphics.common.PixelFormat overrideFormat; diff --git a/camera/device/aidl/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/android/hardware/camera/device/Stream.aidl index e35e4ff6e6..0a657d70d7 100644 --- a/camera/device/aidl/android/hardware/camera/device/Stream.aidl +++ b/camera/device/aidl/android/hardware/camera/device/Stream.aidl @@ -98,14 +98,19 @@ parcelable Stream { * * For most formats, dataSpace defines the color space of the image data. * In addition, for some formats, dataSpace indicates whether image- or - * depth-based data is requested. See - * android.hardware.graphics.common@1.0::types for details of formats and - * valid dataSpace values for each format. + * depth-based data is requested. For others, it merely describes an encoding + * scheme. See android.hardware.graphics.common@1.0::types for details of formats + * and valid dataSpace values for each format. * * The HAL must use this dataSpace to configure the stream to the correct * colorspace, or to select between color and depth outputs if * supported. The dataspace values are set using the V0 dataspace * definitions. + * + * The standard bits of this field will match the requested colorSpace (if set) for + * non-BLOB formats. For BLOB formats, if colorSpace is not + * ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED, colorSpace takes + * over as the authority for the color space of the stream regardless of dataSpace. */ android.hardware.graphics.common.Dataspace dataSpace; @@ -222,4 +227,19 @@ parcelable Stream { * DEFAULT. */ android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; + + /** + * The color space of the stream. + * + * A client may not specify a color space. In this case, the value will be + * ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED, and the color space + * implied by dataSpace should be used instead. + * + * When specified, this field and the standard bits of dataSpace will match for non-BLOB + * formats. For BLOB formats, the dataSpace will remain unchanged. In this case, this field is + * the ultimate authority over the color space of the stream. + * + * See ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP for possible values. + */ + int colorSpace; } diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl index cacd32c171..197d9af588 100644 --- a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl +++ b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl @@ -62,7 +62,7 @@ parcelable StreamConfiguration { */ CameraMetadata sessionParams; - /** + /** * An incrementing counter used for HAL to keep track of the stream * configuration and the paired oneway signalStreamFlush call. When the * counter in signalStreamFlush call is less than the counter here, that @@ -83,4 +83,13 @@ parcelable StreamConfiguration { * any one of the supported multi-resolution input stream sizes. */ boolean multiResolutionInputImage; + + /** + * Logging identifier to join HAL logs to logs collected by cameraservice. This field has no + * functional purpose. + * + * See documentation of 'mLogId' in frameworks/av/camera/include/camera/CameraSessionStats.h + * for specifics of this identifier and how it can be used to join with cameraservice logs. + */ + long logId = 0; } diff --git a/camera/device/default/Android.bp b/camera/device/default/Android.bp new file mode 100644 index 0000000000..b577597d8c --- /dev/null +++ b/camera/device/default/Android.bp @@ -0,0 +1,71 @@ +// +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_library_shared { + name: "camera.device-external-impl", + defaults: ["hidl_defaults"], + proprietary: true, + srcs: [ + "ExternalCameraDevice.cpp", + "ExternalCameraDeviceSession.cpp", + "ExternalCameraOfflineSession.cpp", + "ExternalCameraUtils.cpp", + "convert.cpp", + ], + shared_libs: [ + "android.hardware.camera.common-V1-ndk", + "android.hardware.camera.device-V1-ndk", + "android.hardware.graphics.allocator-V1-ndk", + "android.hardware.graphics.common-V4-ndk", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", + "android.hidl.allocator@1.0", + "android.hidl.memory@1.0", + "libbinder_ndk", + "libcamera_metadata", + "libcutils", + "libexif", + "libfmq", + "libgralloctypes", + "libhardware", + "libhidlbase", + "libhidlmemory", + "libjpeg", + "liblog", + "libsync", + "libtinyxml2", + "libutils", + "libyuv", + ], + static_libs: [ + "android.hardware.camera.common@1.0-helper", + "libaidlcommonsupport", + ], + header_libs: [ + "media_plugin_headers", + ], + export_include_dirs: ["."], +} diff --git a/camera/device/default/ExternalCameraDevice.cpp b/camera/device/default/ExternalCameraDevice.cpp new file mode 100644 index 0000000000..677fb429ef --- /dev/null +++ b/camera/device/default/ExternalCameraDevice.cpp @@ -0,0 +1,1001 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "ExtCamDev" +// #define LOG_NDEBUG 0 +#include + +#include "ExternalCameraDevice.h" + +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace device { +namespace implementation { + +using ::aidl::android::hardware::camera::common::Status; + +namespace { +// Only support MJPEG for now as it seems to be the one supports higher fps +// Other formats to consider in the future: +// * V4L2_PIX_FMT_YVU420 (== YV12) +// * V4L2_PIX_FMT_YVYU (YVYU: can be converted to YV12 or other YUV420_888 formats) +const std::array kSupportedFourCCs{ + {V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_Z16}}; // double braces required in C++11 + +constexpr int MAX_RETRY = 5; // Allow retry v4l2 open failures a few times. +constexpr int OPEN_RETRY_SLEEP_US = 100'000; // 100ms * MAX_RETRY = 0.5 seconds + +const std::regex kDevicePathRE("/dev/video([0-9]+)"); +} // namespace + +std::string ExternalCameraDevice::kDeviceVersion = "1.1"; + +ExternalCameraDevice::ExternalCameraDevice(const std::string& devicePath, + const ExternalCameraConfig& config) + : mCameraId("-1"), mDevicePath(devicePath), mCfg(config) { + std::smatch sm; + if (std::regex_match(mDevicePath, sm, kDevicePathRE)) { + mCameraId = std::to_string(mCfg.cameraIdOffset + std::stoi(sm[1])); + } else { + ALOGE("%s: device path match failed for %s", __FUNCTION__, mDevicePath.c_str()); + } +} + +ExternalCameraDevice::~ExternalCameraDevice() {} + +ndk::ScopedAStatus ExternalCameraDevice::getCameraCharacteristics(CameraMetadata* _aidl_return) { + Mutex::Autolock _l(mLock); + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + + if (isInitFailedLocked()) { + return fromStatus(Status::INTERNAL_ERROR); + } + + const camera_metadata_t* rawMetadata = mCameraCharacteristics.getAndLock(); + convertToAidl(rawMetadata, _aidl_return); + mCameraCharacteristics.unlock(rawMetadata); + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraDevice::getPhysicalCameraCharacteristics(const std::string&, + CameraMetadata*) { + ALOGE("%s: Physical camera functions are not supported for external cameras.", __FUNCTION__); + return fromStatus(Status::ILLEGAL_ARGUMENT); +} + +ndk::ScopedAStatus ExternalCameraDevice::getResourceCost(CameraResourceCost* _aidl_return) { + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + + _aidl_return->resourceCost = 100; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraDevice::isStreamCombinationSupported( + const StreamConfiguration& in_streams, bool* _aidl_return) { + if (isInitFailed()) { + ALOGE("%s: camera %s. camera init failed!", __FUNCTION__, mCameraId.c_str()); + return fromStatus(Status::INTERNAL_ERROR); + } + Status s = ExternalCameraDeviceSession::isStreamCombinationSupported(in_streams, + mSupportedFormats, mCfg); + *_aidl_return = s == Status::OK; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraDevice::open( + const std::shared_ptr& in_callback, + std::shared_ptr* _aidl_return) { + if (_aidl_return == nullptr) { + ALOGE("%s: cannot open camera %s. return session ptr is null!", __FUNCTION__, + mCameraId.c_str()); + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + + Mutex::Autolock _l(mLock); + if (isInitFailedLocked()) { + ALOGE("%s: cannot open camera %s. camera init failed!", __FUNCTION__, mCameraId.c_str()); + return fromStatus(Status::INTERNAL_ERROR); + } + + std::shared_ptr session; + ALOGV("%s: Initializing device for camera %s", __FUNCTION__, mCameraId.c_str()); + session = mSession.lock(); + + if (session != nullptr && !session->isClosed()) { + ALOGE("%s: cannot open an already opened camera!", __FUNCTION__); + return fromStatus(Status::CAMERA_IN_USE); + } + + int numAttempt = 0; + unique_fd fd(::open(mDevicePath.c_str(), O_RDWR)); + while (fd.get() < 0 && numAttempt < MAX_RETRY) { + // Previous retry attempts failed. Retry opening the device at most MAX_RETRY times + ALOGW("%s: v4l2 device %s open failed, wait 33ms and try again", __FUNCTION__, + mDevicePath.c_str()); + usleep(OPEN_RETRY_SLEEP_US); // sleep and try again + fd.reset(::open(mDevicePath.c_str(), O_RDWR)); + numAttempt++; + } + + if (fd.get() < 0) { + ALOGE("%s: v4l2 device open %s failed: %s", __FUNCTION__, mDevicePath.c_str(), + strerror(errno)); + return fromStatus(Status::INTERNAL_ERROR); + } + + session = createSession(in_callback, mCfg, mSupportedFormats, mCroppingType, + mCameraCharacteristics, mCameraId, std::move(fd)); + if (session == nullptr) { + ALOGE("%s: camera device session allocation failed", __FUNCTION__); + return fromStatus(Status::INTERNAL_ERROR); + } + + if (session->isInitFailed()) { + ALOGE("%s: camera device session init failed", __FUNCTION__); + return fromStatus(Status::INTERNAL_ERROR); + } + + mSession = session; + *_aidl_return = session; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraDevice::openInjectionSession( + const std::shared_ptr&, std::shared_ptr*) { + return fromStatus(Status::OPERATION_NOT_SUPPORTED); +} + +ndk::ScopedAStatus ExternalCameraDevice::setTorchMode(bool) { + return fromStatus(Status::OPERATION_NOT_SUPPORTED); +} + +ndk::ScopedAStatus ExternalCameraDevice::turnOnTorchWithStrengthLevel(int32_t) { + return fromStatus(Status::OPERATION_NOT_SUPPORTED); +} + +ndk::ScopedAStatus ExternalCameraDevice::getTorchStrengthLevel(int32_t*) { + return fromStatus(Status::OPERATION_NOT_SUPPORTED); +} + +std::shared_ptr ExternalCameraDevice::createSession( + const std::shared_ptr& cb, const ExternalCameraConfig& cfg, + const std::vector& sortedFormats, const CroppingType& croppingType, + const common::V1_0::helper::CameraMetadata& chars, const std::string& cameraId, + unique_fd v4l2Fd) { + return ndk::SharedRefBase::make( + cb, cfg, sortedFormats, croppingType, chars, cameraId, std::move(v4l2Fd)); +} + +bool ExternalCameraDevice::isInitFailed() { + Mutex::Autolock _l(mLock); + return isInitFailedLocked(); +} + +bool ExternalCameraDevice::isInitFailedLocked() { + if (!mInitialized) { + status_t ret = initCameraCharacteristics(); + if (ret != OK) { + ALOGE("%s: init camera characteristics failed: errorno %d", __FUNCTION__, ret); + mInitFailed = true; + } + mInitialized = true; + } + return mInitFailed; +} + +void ExternalCameraDevice::initSupportedFormatsLocked(int fd) { + std::vector horizontalFmts = + getCandidateSupportedFormatsLocked(fd, HORIZONTAL, mCfg.fpsLimits, mCfg.depthFpsLimits, + mCfg.minStreamSize, mCfg.depthEnabled); + std::vector verticalFmts = + getCandidateSupportedFormatsLocked(fd, VERTICAL, mCfg.fpsLimits, mCfg.depthFpsLimits, + mCfg.minStreamSize, mCfg.depthEnabled); + + size_t horiSize = horizontalFmts.size(); + size_t vertSize = verticalFmts.size(); + + if (horiSize == 0 && vertSize == 0) { + ALOGE("%s: cannot find suitable cropping type!", __FUNCTION__); + return; + } + + if (horiSize == 0) { + mSupportedFormats = verticalFmts; + mCroppingType = VERTICAL; + return; + } else if (vertSize == 0) { + mSupportedFormats = horizontalFmts; + mCroppingType = HORIZONTAL; + return; + } + + const auto& maxHoriSize = horizontalFmts[horizontalFmts.size() - 1]; + const auto& maxVertSize = verticalFmts[verticalFmts.size() - 1]; + + // Try to keep the largest possible output size + // When they are the same or ambiguous, pick the one support more sizes + if (maxHoriSize.width == maxVertSize.width && maxHoriSize.height == maxVertSize.height) { + if (horiSize > vertSize) { + mSupportedFormats = horizontalFmts; + mCroppingType = HORIZONTAL; + } else { + mSupportedFormats = verticalFmts; + mCroppingType = VERTICAL; + } + } else if (maxHoriSize.width >= maxVertSize.width && maxHoriSize.height >= maxVertSize.height) { + mSupportedFormats = horizontalFmts; + mCroppingType = HORIZONTAL; + } else if (maxHoriSize.width <= maxVertSize.width && maxHoriSize.height <= maxVertSize.height) { + mSupportedFormats = verticalFmts; + mCroppingType = VERTICAL; + } else { + if (horiSize > vertSize) { + mSupportedFormats = horizontalFmts; + mCroppingType = HORIZONTAL; + } else { + mSupportedFormats = verticalFmts; + mCroppingType = VERTICAL; + } + } +} + +status_t ExternalCameraDevice::initCameraCharacteristics() { + if (!mCameraCharacteristics.isEmpty()) { + // Camera Characteristics previously initialized. Skip. + return OK; + } + + // init camera characteristics + unique_fd fd(::open(mDevicePath.c_str(), O_RDWR)); + if (fd.get() < 0) { + ALOGE("%s: v4l2 device open %s failed", __FUNCTION__, mDevicePath.c_str()); + return DEAD_OBJECT; + } + + status_t ret; + ret = initDefaultCharsKeys(&mCameraCharacteristics); + if (ret != OK) { + ALOGE("%s: init default characteristics key failed: errorno %d", __FUNCTION__, ret); + mCameraCharacteristics.clear(); + return ret; + } + + ret = initCameraControlsCharsKeys(fd.get(), &mCameraCharacteristics); + if (ret != OK) { + ALOGE("%s: init camera control characteristics key failed: errorno %d", __FUNCTION__, ret); + mCameraCharacteristics.clear(); + return ret; + } + + ret = initOutputCharsKeys(fd.get(), &mCameraCharacteristics); + if (ret != OK) { + ALOGE("%s: init output characteristics key failed: errorno %d", __FUNCTION__, ret); + mCameraCharacteristics.clear(); + return ret; + } + + ret = initAvailableCapabilities(&mCameraCharacteristics); + if (ret != OK) { + ALOGE("%s: init available capabilities key failed: errorno %d", __FUNCTION__, ret); + mCameraCharacteristics.clear(); + return ret; + } + + return OK; +} + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#define UPDATE(tag, data, size) \ + do { \ + if (metadata->update((tag), (data), (size))) { \ + ALOGE("Update " #tag " failed!"); \ + return -EINVAL; \ + } \ + } while (0) + +status_t ExternalCameraDevice::initAvailableCapabilities( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata) { + if (mSupportedFormats.empty()) { + ALOGE("%s: Supported formats list is empty", __FUNCTION__); + return UNKNOWN_ERROR; + } + + bool hasDepth = false; + bool hasColor = false; + for (const auto& fmt : mSupportedFormats) { + switch (fmt.fourcc) { + case V4L2_PIX_FMT_Z16: + hasDepth = true; + break; + case V4L2_PIX_FMT_MJPEG: + hasColor = true; + break; + default: + ALOGW("%s: Unsupported format found", __FUNCTION__); + } + } + + std::vector availableCapabilities; + if (hasDepth) { + availableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT); + } + if (hasColor) { + availableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE); + } + if (!availableCapabilities.empty()) { + UPDATE(ANDROID_REQUEST_AVAILABLE_CAPABILITIES, availableCapabilities.data(), + availableCapabilities.size()); + } + + return OK; +} + +status_t ExternalCameraDevice::initDefaultCharsKeys( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata) { + const uint8_t hardware_level = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL; + UPDATE(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, &hardware_level, 1); + + // android.colorCorrection + const uint8_t availableAberrationModes[] = {ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF}; + UPDATE(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, availableAberrationModes, + ARRAY_SIZE(availableAberrationModes)); + + // android.control + const uint8_t antibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO; + UPDATE(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, &antibandingMode, 1); + + const int32_t controlMaxRegions[] = {/*AE*/ 0, /*AWB*/ 0, /*AF*/ 0}; + UPDATE(ANDROID_CONTROL_MAX_REGIONS, controlMaxRegions, ARRAY_SIZE(controlMaxRegions)); + + const uint8_t videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF; + UPDATE(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, &videoStabilizationMode, 1); + + const uint8_t awbAvailableMode = ANDROID_CONTROL_AWB_MODE_AUTO; + UPDATE(ANDROID_CONTROL_AWB_AVAILABLE_MODES, &awbAvailableMode, 1); + + const uint8_t aeAvailableMode = ANDROID_CONTROL_AE_MODE_ON; + UPDATE(ANDROID_CONTROL_AE_AVAILABLE_MODES, &aeAvailableMode, 1); + + const uint8_t availableFffect = ANDROID_CONTROL_EFFECT_MODE_OFF; + UPDATE(ANDROID_CONTROL_AVAILABLE_EFFECTS, &availableFffect, 1); + + const uint8_t controlAvailableModes[] = {ANDROID_CONTROL_MODE_OFF, ANDROID_CONTROL_MODE_AUTO}; + UPDATE(ANDROID_CONTROL_AVAILABLE_MODES, controlAvailableModes, + ARRAY_SIZE(controlAvailableModes)); + + // android.edge + const uint8_t edgeMode = ANDROID_EDGE_MODE_OFF; + UPDATE(ANDROID_EDGE_AVAILABLE_EDGE_MODES, &edgeMode, 1); + + // android.flash + const uint8_t flashInfo = ANDROID_FLASH_INFO_AVAILABLE_FALSE; + UPDATE(ANDROID_FLASH_INFO_AVAILABLE, &flashInfo, 1); + + // android.hotPixel + const uint8_t hotPixelMode = ANDROID_HOT_PIXEL_MODE_OFF; + UPDATE(ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES, &hotPixelMode, 1); + + // android.jpeg + const int32_t jpegAvailableThumbnailSizes[] = {0, 0, 176, 144, 240, 144, 256, + 144, 240, 160, 256, 154, 240, 180}; + UPDATE(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, jpegAvailableThumbnailSizes, + ARRAY_SIZE(jpegAvailableThumbnailSizes)); + + const int32_t jpegMaxSize = mCfg.maxJpegBufSize; + UPDATE(ANDROID_JPEG_MAX_SIZE, &jpegMaxSize, 1); + + // android.lens + const uint8_t focusDistanceCalibration = + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED; + UPDATE(ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, &focusDistanceCalibration, 1); + + const uint8_t opticalStabilizationMode = ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF; + UPDATE(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, &opticalStabilizationMode, 1); + + const uint8_t facing = ANDROID_LENS_FACING_EXTERNAL; + UPDATE(ANDROID_LENS_FACING, &facing, 1); + + // android.noiseReduction + const uint8_t noiseReductionMode = ANDROID_NOISE_REDUCTION_MODE_OFF; + UPDATE(ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, &noiseReductionMode, 1); + UPDATE(ANDROID_NOISE_REDUCTION_MODE, &noiseReductionMode, 1); + + const int32_t partialResultCount = 1; + UPDATE(ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &partialResultCount, 1); + + // This means pipeline latency of X frame intervals. The maximum number is 4. + const uint8_t requestPipelineMaxDepth = 4; + UPDATE(ANDROID_REQUEST_PIPELINE_MAX_DEPTH, &requestPipelineMaxDepth, 1); + + // Three numbers represent the maximum numbers of different types of output + // streams simultaneously. The types are raw sensor, processed (but not + // stalling), and processed (but stalling). For usb limited mode, raw sensor + // is not supported. Stalling stream is JPEG. Non-stalling streams are + // YUV_420_888 or YV12. + const int32_t requestMaxNumOutputStreams[] = { + /*RAW*/ 0, + /*Processed*/ ExternalCameraDeviceSession::kMaxProcessedStream, + /*Stall*/ ExternalCameraDeviceSession::kMaxStallStream}; + UPDATE(ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, requestMaxNumOutputStreams, + ARRAY_SIZE(requestMaxNumOutputStreams)); + + // Limited mode doesn't support reprocessing. + const int32_t requestMaxNumInputStreams = 0; + UPDATE(ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, &requestMaxNumInputStreams, 1); + + // android.scaler + // TODO: b/72263447 V4L2_CID_ZOOM_* + const float scalerAvailableMaxDigitalZoom[] = {1}; + UPDATE(ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, scalerAvailableMaxDigitalZoom, + ARRAY_SIZE(scalerAvailableMaxDigitalZoom)); + + const uint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY; + UPDATE(ANDROID_SCALER_CROPPING_TYPE, &croppingType, 1); + + const int32_t testPatternModes[] = {ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR}; + UPDATE(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, testPatternModes, + ARRAY_SIZE(testPatternModes)); + + const uint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN; + UPDATE(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, ×tampSource, 1); + + // Orientation is a bit odd for external camera, but consider it as the orientation + // between the external camera sensor (which is usually landscape) and the device's + // natural display orientation. For devices with natural landscape display (ex: tablet/TV), the + // orientation should be 0. For devices with natural portrait display (phone), the orientation + // should be 270. + const int32_t orientation = mCfg.orientation; + UPDATE(ANDROID_SENSOR_ORIENTATION, &orientation, 1); + + // android.shading + const uint8_t availableMode = ANDROID_SHADING_MODE_OFF; + UPDATE(ANDROID_SHADING_AVAILABLE_MODES, &availableMode, 1); + + // android.statistics + const uint8_t faceDetectMode = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF; + UPDATE(ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, &faceDetectMode, 1); + + const int32_t maxFaceCount = 0; + UPDATE(ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, &maxFaceCount, 1); + + const uint8_t availableHotpixelMode = ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF; + UPDATE(ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES, &availableHotpixelMode, 1); + + const uint8_t lensShadingMapMode = ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF; + UPDATE(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, &lensShadingMapMode, 1); + + // android.sync + const int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN; + UPDATE(ANDROID_SYNC_MAX_LATENCY, &maxLatency, 1); + + /* Other sensor/RAW related keys: + * android.sensor.info.colorFilterArrangement -> no need if we don't do RAW + * android.sensor.info.physicalSize -> not available + * android.sensor.info.whiteLevel -> not available/not needed + * android.sensor.info.lensShadingApplied -> not needed + * android.sensor.info.preCorrectionActiveArraySize -> not available/not needed + * android.sensor.blackLevelPattern -> not available/not needed + */ + + const int32_t availableRequestKeys[] = {ANDROID_COLOR_CORRECTION_ABERRATION_MODE, + ANDROID_CONTROL_AE_ANTIBANDING_MODE, + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, + ANDROID_CONTROL_AE_LOCK, + ANDROID_CONTROL_AE_MODE, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, + ANDROID_CONTROL_AE_TARGET_FPS_RANGE, + ANDROID_CONTROL_AF_MODE, + ANDROID_CONTROL_AF_TRIGGER, + ANDROID_CONTROL_AWB_LOCK, + ANDROID_CONTROL_AWB_MODE, + ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_EFFECT_MODE, + ANDROID_CONTROL_MODE, + ANDROID_CONTROL_SCENE_MODE, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + ANDROID_FLASH_MODE, + ANDROID_JPEG_ORIENTATION, + ANDROID_JPEG_QUALITY, + ANDROID_JPEG_THUMBNAIL_QUALITY, + ANDROID_JPEG_THUMBNAIL_SIZE, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE, + ANDROID_NOISE_REDUCTION_MODE, + ANDROID_SCALER_CROP_REGION, + ANDROID_SENSOR_TEST_PATTERN_MODE, + ANDROID_STATISTICS_FACE_DETECT_MODE, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE}; + UPDATE(ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, availableRequestKeys, + ARRAY_SIZE(availableRequestKeys)); + + const int32_t availableResultKeys[] = {ANDROID_COLOR_CORRECTION_ABERRATION_MODE, + ANDROID_CONTROL_AE_ANTIBANDING_MODE, + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, + ANDROID_CONTROL_AE_LOCK, + ANDROID_CONTROL_AE_MODE, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, + ANDROID_CONTROL_AE_STATE, + ANDROID_CONTROL_AE_TARGET_FPS_RANGE, + ANDROID_CONTROL_AF_MODE, + ANDROID_CONTROL_AF_STATE, + ANDROID_CONTROL_AF_TRIGGER, + ANDROID_CONTROL_AWB_LOCK, + ANDROID_CONTROL_AWB_MODE, + ANDROID_CONTROL_AWB_STATE, + ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_EFFECT_MODE, + ANDROID_CONTROL_MODE, + ANDROID_CONTROL_SCENE_MODE, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + ANDROID_FLASH_MODE, + ANDROID_FLASH_STATE, + ANDROID_JPEG_ORIENTATION, + ANDROID_JPEG_QUALITY, + ANDROID_JPEG_THUMBNAIL_QUALITY, + ANDROID_JPEG_THUMBNAIL_SIZE, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE, + ANDROID_NOISE_REDUCTION_MODE, + ANDROID_REQUEST_PIPELINE_DEPTH, + ANDROID_SCALER_CROP_REGION, + ANDROID_SENSOR_TIMESTAMP, + ANDROID_STATISTICS_FACE_DETECT_MODE, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, + ANDROID_STATISTICS_SCENE_FLICKER}; + UPDATE(ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, availableResultKeys, + ARRAY_SIZE(availableResultKeys)); + + UPDATE(ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, AVAILABLE_CHARACTERISTICS_KEYS.data(), + AVAILABLE_CHARACTERISTICS_KEYS.size()); + + return OK; +} + +status_t ExternalCameraDevice::initCameraControlsCharsKeys( + int, ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata) { + // android.sensor.info.sensitivityRange -> V4L2_CID_ISO_SENSITIVITY + // android.sensor.info.exposureTimeRange -> V4L2_CID_EXPOSURE_ABSOLUTE + // android.sensor.info.maxFrameDuration -> TBD + // android.lens.info.minimumFocusDistance -> V4L2_CID_FOCUS_ABSOLUTE + // android.lens.info.hyperfocalDistance + // android.lens.info.availableFocalLengths -> not available? + + // android.control + // No AE compensation support for now. + // TODO: V4L2_CID_EXPOSURE_BIAS + const int32_t controlAeCompensationRange[] = {0, 0}; + UPDATE(ANDROID_CONTROL_AE_COMPENSATION_RANGE, controlAeCompensationRange, + ARRAY_SIZE(controlAeCompensationRange)); + const camera_metadata_rational_t controlAeCompensationStep[] = {{0, 1}}; + UPDATE(ANDROID_CONTROL_AE_COMPENSATION_STEP, controlAeCompensationStep, + ARRAY_SIZE(controlAeCompensationStep)); + + // TODO: Check V4L2_CID_AUTO_FOCUS_*. + const uint8_t afAvailableModes[] = {ANDROID_CONTROL_AF_MODE_AUTO, ANDROID_CONTROL_AF_MODE_OFF}; + UPDATE(ANDROID_CONTROL_AF_AVAILABLE_MODES, afAvailableModes, ARRAY_SIZE(afAvailableModes)); + + // TODO: V4L2_CID_SCENE_MODE + const uint8_t availableSceneMode = ANDROID_CONTROL_SCENE_MODE_DISABLED; + UPDATE(ANDROID_CONTROL_AVAILABLE_SCENE_MODES, &availableSceneMode, 1); + + // TODO: V4L2_CID_3A_LOCK + const uint8_t aeLockAvailable = ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE; + UPDATE(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &aeLockAvailable, 1); + const uint8_t awbLockAvailable = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE; + UPDATE(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &awbLockAvailable, 1); + + // TODO: V4L2_CID_ZOOM_* + const float scalerAvailableMaxDigitalZoom[] = {1}; + UPDATE(ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, scalerAvailableMaxDigitalZoom, + ARRAY_SIZE(scalerAvailableMaxDigitalZoom)); + + return OK; +} + +status_t ExternalCameraDevice::initOutputCharsKeys( + int fd, ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata) { + initSupportedFormatsLocked(fd); + if (mSupportedFormats.empty()) { + ALOGE("%s: Init supported format list failed", __FUNCTION__); + return UNKNOWN_ERROR; + } + + bool hasDepth = false; + bool hasColor = false; + + // For V4L2_PIX_FMT_Z16 + std::array halDepthFormats{{HAL_PIXEL_FORMAT_Y16}}; + // For V4L2_PIX_FMT_MJPEG + std::array halFormats{{HAL_PIXEL_FORMAT_BLOB, HAL_PIXEL_FORMAT_YCbCr_420_888, + HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED}}; + + for (const auto& supportedFormat : mSupportedFormats) { + switch (supportedFormat.fourcc) { + case V4L2_PIX_FMT_Z16: + hasDepth = true; + break; + case V4L2_PIX_FMT_MJPEG: + hasColor = true; + break; + default: + ALOGW("%s: format %c%c%c%c is not supported!", __FUNCTION__, + supportedFormat.fourcc & 0xFF, (supportedFormat.fourcc >> 8) & 0xFF, + (supportedFormat.fourcc >> 16) & 0xFF, (supportedFormat.fourcc >> 24) & 0xFF); + } + } + + if (hasDepth) { + status_t ret = initOutputCharsKeysByFormat( + metadata, V4L2_PIX_FMT_Z16, halDepthFormats, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS, + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS, + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS); + if (ret != OK) { + ALOGE("%s: Unable to initialize depth format keys: %s", __FUNCTION__, + statusToString(ret).c_str()); + return ret; + } + } + if (hasColor) { + status_t ret = + initOutputCharsKeysByFormat(metadata, V4L2_PIX_FMT_MJPEG, halFormats, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS); + if (ret != OK) { + ALOGE("%s: Unable to initialize color format keys: %s", __FUNCTION__, + statusToString(ret).c_str()); + return ret; + } + } + + status_t ret = calculateMinFps(metadata); + if (ret != OK) { + ALOGE("%s: Unable to update fps metadata: %s", __FUNCTION__, statusToString(ret).c_str()); + return ret; + } + + SupportedV4L2Format maximumFormat{.width = 0, .height = 0}; + for (const auto& supportedFormat : mSupportedFormats) { + if (supportedFormat.width >= maximumFormat.width && + supportedFormat.height >= maximumFormat.height) { + maximumFormat = supportedFormat; + } + } + int32_t activeArraySize[] = {0, 0, static_cast(maximumFormat.width), + static_cast(maximumFormat.height)}; + UPDATE(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, activeArraySize, + ARRAY_SIZE(activeArraySize)); + UPDATE(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, activeArraySize, ARRAY_SIZE(activeArraySize)); + + int32_t pixelArraySize[] = {static_cast(maximumFormat.width), + static_cast(maximumFormat.height)}; + UPDATE(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, pixelArraySize, ARRAY_SIZE(pixelArraySize)); + return OK; +} + +template +status_t ExternalCameraDevice::initOutputCharsKeysByFormat( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata, + uint32_t fourcc, const std::array& halFormats, int streamConfigTag, + int streamConfigurationKey, int minFrameDurationKey, int stallDurationKey) { + if (mSupportedFormats.empty()) { + ALOGE("%s: Init supported format list failed", __FUNCTION__); + return UNKNOWN_ERROR; + } + + std::vector streamConfigurations; + std::vector minFrameDurations; + std::vector stallDurations; + + for (const auto& supportedFormat : mSupportedFormats) { + if (supportedFormat.fourcc != fourcc) { + // Skip 4CCs not meant for the halFormats + continue; + } + for (const auto& format : halFormats) { + streamConfigurations.push_back(format); + streamConfigurations.push_back(supportedFormat.width); + streamConfigurations.push_back(supportedFormat.height); + streamConfigurations.push_back(streamConfigTag); + } + + int64_t minFrameDuration = std::numeric_limits::max(); + for (const auto& fr : supportedFormat.frameRates) { + // 1000000000LL < (2^32 - 1) and + // fr.durationNumerator is uint32_t, so no overflow here + int64_t frameDuration = 1000000000LL * fr.durationNumerator / fr.durationDenominator; + if (frameDuration < minFrameDuration) { + minFrameDuration = frameDuration; + } + } + + for (const auto& format : halFormats) { + minFrameDurations.push_back(format); + minFrameDurations.push_back(supportedFormat.width); + minFrameDurations.push_back(supportedFormat.height); + minFrameDurations.push_back(minFrameDuration); + } + + // The stall duration is 0 for non-jpeg formats. For JPEG format, stall + // duration can be 0 if JPEG is small. Here we choose 1 sec for JPEG. + // TODO: b/72261675. Maybe set this dynamically + for (const auto& format : halFormats) { + const int64_t NS_TO_SECOND = 1E9; + int64_t stall_duration = (format == HAL_PIXEL_FORMAT_BLOB) ? NS_TO_SECOND : 0; + stallDurations.push_back(format); + stallDurations.push_back(supportedFormat.width); + stallDurations.push_back(supportedFormat.height); + stallDurations.push_back(stall_duration); + } + } + + UPDATE(streamConfigurationKey, streamConfigurations.data(), streamConfigurations.size()); + + UPDATE(minFrameDurationKey, minFrameDurations.data(), minFrameDurations.size()); + + UPDATE(stallDurationKey, stallDurations.data(), stallDurations.size()); + + return OK; +} + +status_t ExternalCameraDevice::calculateMinFps( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata) { + std::set framerates; + int32_t minFps = std::numeric_limits::max(); + + for (const auto& supportedFormat : mSupportedFormats) { + for (const auto& fr : supportedFormat.frameRates) { + int32_t frameRateInt = static_cast(fr.getFramesPerSecond()); + if (minFps > frameRateInt) { + minFps = frameRateInt; + } + framerates.insert(frameRateInt); + } + } + + std::vector fpsRanges; + // FPS ranges + for (const auto& framerate : framerates) { + // Empirical: webcams often have close to 2x fps error and cannot support fixed fps range + fpsRanges.push_back(framerate / 2); + fpsRanges.push_back(framerate); + } + minFps /= 2; + int64_t maxFrameDuration = 1000000000LL / minFps; + + UPDATE(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, fpsRanges.data(), fpsRanges.size()); + + UPDATE(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, &maxFrameDuration, 1); + + return OK; +} + +#undef ARRAY_SIZE +#undef UPDATE + +void ExternalCameraDevice::getFrameRateList(int fd, double fpsUpperBound, + SupportedV4L2Format* format) { + format->frameRates.clear(); + + v4l2_frmivalenum frameInterval{ + .index = 0, + .pixel_format = format->fourcc, + .width = static_cast<__u32>(format->width), + .height = static_cast<__u32>(format->height), + }; + + for (frameInterval.index = 0; + TEMP_FAILURE_RETRY(ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frameInterval)) == 0; + ++frameInterval.index) { + if (frameInterval.type == V4L2_FRMIVAL_TYPE_DISCRETE) { + if (frameInterval.discrete.numerator != 0) { + SupportedV4L2Format::FrameRate fr = {frameInterval.discrete.numerator, + frameInterval.discrete.denominator}; + double framerate = fr.getFramesPerSecond(); + if (framerate > fpsUpperBound) { + continue; + } + ALOGV("index:%d, format:%c%c%c%c, w %d, h %d, framerate %f", frameInterval.index, + frameInterval.pixel_format & 0xFF, (frameInterval.pixel_format >> 8) & 0xFF, + (frameInterval.pixel_format >> 16) & 0xFF, + (frameInterval.pixel_format >> 24) & 0xFF, frameInterval.width, + frameInterval.height, framerate); + format->frameRates.push_back(fr); + } + } + } + + if (format->frameRates.empty()) { + ALOGE("%s: failed to get supported frame rates for format:%c%c%c%c w %d h %d", __FUNCTION__, + frameInterval.pixel_format & 0xFF, (frameInterval.pixel_format >> 8) & 0xFF, + (frameInterval.pixel_format >> 16) & 0xFF, (frameInterval.pixel_format >> 24) & 0xFF, + frameInterval.width, frameInterval.height); + } +} + +void ExternalCameraDevice::updateFpsBounds( + int fd, CroppingType cropType, + const std::vector& fpsLimits, + SupportedV4L2Format format, std::vector& outFmts) { + double fpsUpperBound = -1.0; + for (const auto& limit : fpsLimits) { + if (cropType == VERTICAL) { + if (format.width <= limit.size.width) { + fpsUpperBound = limit.fpsUpperBound; + break; + } + } else { // HORIZONTAL + if (format.height <= limit.size.height) { + fpsUpperBound = limit.fpsUpperBound; + break; + } + } + } + if (fpsUpperBound < 0.f) { + return; + } + + getFrameRateList(fd, fpsUpperBound, &format); + if (!format.frameRates.empty()) { + outFmts.push_back(format); + } +} + +std::vector ExternalCameraDevice::getCandidateSupportedFormatsLocked( + int fd, CroppingType cropType, + const std::vector& fpsLimits, + const std::vector& depthFpsLimits, + const Size& minStreamSize, bool depthEnabled) { + std::vector outFmts; + struct v4l2_fmtdesc fmtdesc { + .index = 0, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE + }; + int ret = 0; + while (ret == 0) { + ret = TEMP_FAILURE_RETRY(ioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc)); + ALOGV("index:%d,ret:%d, format:%c%c%c%c", fmtdesc.index, ret, fmtdesc.pixelformat & 0xFF, + (fmtdesc.pixelformat >> 8) & 0xFF, (fmtdesc.pixelformat >> 16) & 0xFF, + (fmtdesc.pixelformat >> 24) & 0xFF); + + if (ret != 0 || (fmtdesc.flags & V4L2_FMT_FLAG_EMULATED)) { + // Skip if IOCTL failed, or if the format is emulated + fmtdesc.index++; + continue; + } + auto it = + std::find(kSupportedFourCCs.begin(), kSupportedFourCCs.end(), fmtdesc.pixelformat); + if (it == kSupportedFourCCs.end()) { + fmtdesc.index++; + continue; + } + + // Found supported format + v4l2_frmsizeenum frameSize{.index = 0, .pixel_format = fmtdesc.pixelformat}; + for (; TEMP_FAILURE_RETRY(ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frameSize)) == 0; + ++frameSize.index) { + if (frameSize.type == V4L2_FRMSIZE_TYPE_DISCRETE) { + ALOGV("index:%d, format:%c%c%c%c, w %d, h %d", frameSize.index, + fmtdesc.pixelformat & 0xFF, (fmtdesc.pixelformat >> 8) & 0xFF, + (fmtdesc.pixelformat >> 16) & 0xFF, (fmtdesc.pixelformat >> 24) & 0xFF, + frameSize.discrete.width, frameSize.discrete.height); + + // Disregard h > w formats so all aspect ratio (h/w) <= 1.0 + // This will simplify the crop/scaling logic down the road + if (frameSize.discrete.height > frameSize.discrete.width) { + continue; + } + + // Discard all formats which is smaller than minStreamSize + if (frameSize.discrete.width < minStreamSize.width || + frameSize.discrete.height < minStreamSize.height) { + continue; + } + + SupportedV4L2Format format{ + .width = static_cast(frameSize.discrete.width), + .height = static_cast(frameSize.discrete.height), + .fourcc = fmtdesc.pixelformat}; + + if (format.fourcc == V4L2_PIX_FMT_Z16 && depthEnabled) { + updateFpsBounds(fd, cropType, depthFpsLimits, format, outFmts); + } else { + updateFpsBounds(fd, cropType, fpsLimits, format, outFmts); + } + } + } + fmtdesc.index++; + } + trimSupportedFormats(cropType, &outFmts); + return outFmts; +} + +void ExternalCameraDevice::trimSupportedFormats(CroppingType cropType, + std::vector* pFmts) { + std::vector& sortedFmts = *pFmts; + if (cropType == VERTICAL) { + std::sort(sortedFmts.begin(), sortedFmts.end(), + [](const SupportedV4L2Format& a, const SupportedV4L2Format& b) -> bool { + if (a.width == b.width) { + return a.height < b.height; + } + return a.width < b.width; + }); + } else { + std::sort(sortedFmts.begin(), sortedFmts.end(), + [](const SupportedV4L2Format& a, const SupportedV4L2Format& b) -> bool { + if (a.height == b.height) { + return a.width < b.width; + } + return a.height < b.height; + }); + } + + if (sortedFmts.empty()) { + ALOGE("%s: input format list is empty!", __FUNCTION__); + return; + } + + const auto& maxSize = sortedFmts[sortedFmts.size() - 1]; + float maxSizeAr = ASPECT_RATIO(maxSize); + + // Remove formats that has aspect ratio not croppable from largest size + std::vector out; + for (const auto& fmt : sortedFmts) { + float ar = ASPECT_RATIO(fmt); + if (isAspectRatioClose(ar, maxSizeAr)) { + out.push_back(fmt); + } else if (cropType == HORIZONTAL && ar < maxSizeAr) { + out.push_back(fmt); + } else if (cropType == VERTICAL && ar > maxSizeAr) { + out.push_back(fmt); + } else { + ALOGV("%s: size (%d,%d) is removed due to unable to crop %s from (%d,%d)", __FUNCTION__, + fmt.width, fmt.height, cropType == VERTICAL ? "vertically" : "horizontally", + maxSize.width, maxSize.height); + } + } + sortedFmts = out; +} + +binder_status_t ExternalCameraDevice::dump(int fd, const char** args, uint32_t numArgs) { + std::shared_ptr session = mSession.lock(); + if (session == nullptr) { + dprintf(fd, "No active camera device session instance\n"); + return STATUS_OK; + } + + return session->dump(fd, args, numArgs); +} + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android \ No newline at end of file diff --git a/camera/device/default/ExternalCameraDevice.h b/camera/device/default/ExternalCameraDevice.h new file mode 100644 index 0000000000..bcae1945e9 --- /dev/null +++ b/camera/device/default/ExternalCameraDevice.h @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERADEVICE_H_ +#define HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERADEVICE_H_ + +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace device { +namespace implementation { + +using ::aidl::android::hardware::camera::common::CameraResourceCost; +using ::aidl::android::hardware::camera::device::BnCameraDevice; +using ::aidl::android::hardware::camera::device::CameraMetadata; +using ::aidl::android::hardware::camera::device::ICameraDeviceCallback; +using ::aidl::android::hardware::camera::device::ICameraDeviceSession; +using ::aidl::android::hardware::camera::device::ICameraInjectionSession; +using ::aidl::android::hardware::camera::device::StreamConfiguration; +using ::android::hardware::camera::external::common::ExternalCameraConfig; + +class ExternalCameraDevice : public BnCameraDevice { + public: + // Called by external camera provider HAL. + // Provider HAL must ensure the uniqueness of CameraDevice object per cameraId, or there could + // be multiple CameraDevice trying to access the same physical camera. Also, provider will have + // to keep track of all CameraDevice objects in order to notify CameraDevice when the underlying + // camera is detached. + ExternalCameraDevice(const std::string& devicePath, const ExternalCameraConfig& config); + ~ExternalCameraDevice() override; + + ndk::ScopedAStatus getCameraCharacteristics(CameraMetadata* _aidl_return) override; + ndk::ScopedAStatus getPhysicalCameraCharacteristics(const std::string& in_physicalCameraId, + CameraMetadata* _aidl_return) override; + ndk::ScopedAStatus getResourceCost(CameraResourceCost* _aidl_return) override; + ndk::ScopedAStatus isStreamCombinationSupported(const StreamConfiguration& in_streams, + bool* _aidl_return) override; + ndk::ScopedAStatus open(const std::shared_ptr& in_callback, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus openInjectionSession( + const std::shared_ptr& in_callback, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus setTorchMode(bool in_on) override; + ndk::ScopedAStatus turnOnTorchWithStrengthLevel(int32_t in_torchStrength) override; + ndk::ScopedAStatus getTorchStrengthLevel(int32_t* _aidl_return) override; + + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + + // Caller must use this method to check if CameraDevice ctor failed + bool isInitFailed(); + + // Device version to be used by the external camera provider. + // Should be of the form . + static std::string kDeviceVersion; + + private: + virtual std::shared_ptr createSession( + const std::shared_ptr&, const ExternalCameraConfig& cfg, + const std::vector& sortedFormats, const CroppingType& croppingType, + const common::V1_0::helper::CameraMetadata& chars, const std::string& cameraId, + unique_fd v4l2Fd); + + bool isInitFailedLocked(); + + // Init supported w/h/format/fps in mSupportedFormats. Caller still owns fd + void initSupportedFormatsLocked(int fd); + + // Calls into virtual member function. Do not use it in constructor + status_t initCameraCharacteristics(); + // Init available capabilities keys + virtual status_t initAvailableCapabilities( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata*); + // Init non-device dependent keys + virtual status_t initDefaultCharsKeys( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata*); + // Init camera control chars keys. Caller still owns fd + status_t initCameraControlsCharsKeys( + int fd, ::android::hardware::camera::common::V1_0::helper::CameraMetadata*); + // Init camera output configuration related keys. Caller still owns fd + status_t initOutputCharsKeys( + int fd, ::android::hardware::camera::common::V1_0::helper::CameraMetadata*); + + // Helper function for initOutputCharskeys + template + status_t initOutputCharsKeysByFormat( + ::android::hardware::camera::common::V1_0::helper::CameraMetadata* metadata, + uint32_t fourcc, const std::array& halFormats, int streamConfigTag, + int streamConfiguration, int minFrameDuration, int stallDuration); + + status_t calculateMinFps(::android::hardware::camera::common::V1_0::helper::CameraMetadata*); + + static void getFrameRateList(int fd, double fpsUpperBound, SupportedV4L2Format* format); + + static void updateFpsBounds(int fd, CroppingType cropType, + const std::vector& fpsLimits, + SupportedV4L2Format format, + std::vector& outFmts); + + // Get candidate supported formats list of input cropping type. + static std::vector getCandidateSupportedFormatsLocked( + int fd, CroppingType cropType, + const std::vector& fpsLimits, + const std::vector& depthFpsLimits, + const Size& minStreamSize, bool depthEnabled); + // Trim supported format list by the cropping type. Also sort output formats by width/height + static void trimSupportedFormats(CroppingType cropType, + /*inout*/ std::vector* pFmts); + + Mutex mLock; + bool mInitialized = false; + bool mInitFailed = false; + std::string mCameraId; + std::string mDevicePath; + const ExternalCameraConfig& mCfg; + std::vector mSupportedFormats; + CroppingType mCroppingType; + + std::weak_ptr mSession = + std::weak_ptr(); + + ::android::hardware::camera::common::V1_0::helper::CameraMetadata mCameraCharacteristics; + + const std::vector AVAILABLE_CHARACTERISTICS_KEYS = { + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, + ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, + ANDROID_CONTROL_AE_AVAILABLE_MODES, + ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, + ANDROID_CONTROL_AE_COMPENSATION_RANGE, + ANDROID_CONTROL_AE_COMPENSATION_STEP, + ANDROID_CONTROL_AE_LOCK_AVAILABLE, + ANDROID_CONTROL_AF_AVAILABLE_MODES, + ANDROID_CONTROL_AVAILABLE_EFFECTS, + ANDROID_CONTROL_AVAILABLE_MODES, + ANDROID_CONTROL_AVAILABLE_SCENE_MODES, + ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, + ANDROID_CONTROL_AWB_AVAILABLE_MODES, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + ANDROID_CONTROL_MAX_REGIONS, + ANDROID_FLASH_INFO_AVAILABLE, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, + ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, + ANDROID_LENS_FACING, + ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, + ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, + ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, + ANDROID_REQUEST_PARTIAL_RESULT_COUNT, + ANDROID_REQUEST_PIPELINE_MAX_DEPTH, + ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + ANDROID_SCALER_CROPPING_TYPE, + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, + ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, + ANDROID_SENSOR_ORIENTATION, + ANDROID_SHADING_AVAILABLE_MODES, + ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, + ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES, + ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, + ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, + ANDROID_SYNC_MAX_LATENCY}; +}; + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERADEVICE_H_ diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp new file mode 100644 index 0000000000..c9629744c2 --- /dev/null +++ b/camera/device/default/ExternalCameraDeviceSession.cpp @@ -0,0 +1,2945 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "ExtCamDevSsn" +// #define LOG_NDEBUG 0 +#include + +#include "ExternalCameraDeviceSession.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define HAVE_JPEG // required for libyuv.h to export MJPEG decode APIs +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace device { +namespace implementation { + +namespace { + +// Size of request/result metadata fast message queue. Change to 0 to always use hwbinder buffer. +static constexpr size_t kMetadataMsgQueueSize = 1 << 18 /* 256kB */; + +const int kBadFramesAfterStreamOn = 1; // drop x frames after streamOn to get rid of some initial + // bad frames. TODO: develop a better bad frame detection + // method +constexpr int MAX_RETRY = 15; // Allow retry some ioctl failures a few times to account for some + // webcam showing temporarily ioctl failures. +constexpr int IOCTL_RETRY_SLEEP_US = 33000; // 33ms * MAX_RETRY = 0.5 seconds + +// Constants for tryLock during dumpstate +static constexpr int kDumpLockRetries = 50; +static constexpr int kDumpLockSleep = 60000; + +bool tryLock(Mutex& mutex) { + bool locked = false; + for (int i = 0; i < kDumpLockRetries; ++i) { + if (mutex.tryLock() == NO_ERROR) { + locked = true; + break; + } + usleep(kDumpLockSleep); + } + return locked; +} + +bool tryLock(std::mutex& mutex) { + bool locked = false; + for (int i = 0; i < kDumpLockRetries; ++i) { + if (mutex.try_lock()) { + locked = true; + break; + } + usleep(kDumpLockSleep); + } + return locked; +} + +} // anonymous namespace + +using ::aidl::android::hardware::camera::device::BufferRequestStatus; +using ::aidl::android::hardware::camera::device::CameraBlob; +using ::aidl::android::hardware::camera::device::CameraBlobId; +using ::aidl::android::hardware::camera::device::ErrorMsg; +using ::aidl::android::hardware::camera::device::ShutterMsg; +using ::aidl::android::hardware::camera::device::StreamBuffer; +using ::aidl::android::hardware::camera::device::StreamBufferRet; +using ::aidl::android::hardware::camera::device::StreamBuffersVal; +using ::aidl::android::hardware::camera::device::StreamConfigurationMode; +using ::aidl::android::hardware::camera::device::StreamRotation; +using ::aidl::android::hardware::camera::device::StreamType; +using ::aidl::android::hardware::graphics::common::Dataspace; +using ::android::hardware::camera::common::V1_0::helper::ExifUtils; + +// Static instances +const int ExternalCameraDeviceSession::kMaxProcessedStream; +const int ExternalCameraDeviceSession::kMaxStallStream; +HandleImporter ExternalCameraDeviceSession::sHandleImporter; + +ExternalCameraDeviceSession::ExternalCameraDeviceSession( + const std::shared_ptr& callback, const ExternalCameraConfig& cfg, + const std::vector& sortedFormats, const CroppingType& croppingType, + const common::V1_0::helper::CameraMetadata& chars, const std::string& cameraId, + unique_fd v4l2Fd) + : mCallback(callback), + mCfg(cfg), + mCameraCharacteristics(chars), + mSupportedFormats(sortedFormats), + mCroppingType(croppingType), + mCameraId(cameraId), + mV4l2Fd(std::move(v4l2Fd)), + mMaxThumbResolution(getMaxThumbResolution()), + mMaxJpegResolution(getMaxJpegResolution()) {} + +Size ExternalCameraDeviceSession::getMaxThumbResolution() const { + return getMaxThumbnailResolution(mCameraCharacteristics); +} + +Size ExternalCameraDeviceSession::getMaxJpegResolution() const { + Size ret{0, 0}; + for (auto& fmt : mSupportedFormats) { + if (fmt.width * fmt.height > ret.width * ret.height) { + ret = Size{fmt.width, fmt.height}; + } + } + return ret; +} + +bool ExternalCameraDeviceSession::initialize() { + if (mV4l2Fd.get() < 0) { + ALOGE("%s: invalid v4l2 device fd %d!", __FUNCTION__, mV4l2Fd.get()); + return true; + } + + struct v4l2_capability capability; + int ret = ioctl(mV4l2Fd.get(), VIDIOC_QUERYCAP, &capability); + std::string make, model; + if (ret < 0) { + ALOGW("%s v4l2 QUERYCAP failed", __FUNCTION__); + mExifMake = "Generic UVC webcam"; + mExifModel = "Generic UVC webcam"; + } else { + // capability.card is UTF-8 encoded + char card[32]; + int j = 0; + for (int i = 0; i < 32; i++) { + if (capability.card[i] < 128) { + card[j++] = capability.card[i]; + } + if (capability.card[i] == '\0') { + break; + } + } + if (j == 0 || card[j - 1] != '\0') { + mExifMake = "Generic UVC webcam"; + mExifModel = "Generic UVC webcam"; + } else { + mExifMake = card; + mExifModel = card; + } + } + + initOutputThread(); + if (mOutputThread == nullptr) { + ALOGE("%s: init OutputThread failed!", __FUNCTION__); + return true; + } + mOutputThread->setExifMakeModel(mExifMake, mExifModel); + + status_t status = initDefaultRequests(); + if (status != OK) { + ALOGE("%s: init default requests failed!", __FUNCTION__); + return true; + } + + mRequestMetadataQueue = + std::make_unique(kMetadataMsgQueueSize, false /* non blocking */); + if (!mRequestMetadataQueue->isValid()) { + ALOGE("%s: invalid request fmq", __FUNCTION__); + return true; + } + + mResultMetadataQueue = + std::make_shared(kMetadataMsgQueueSize, false /* non blocking */); + if (!mResultMetadataQueue->isValid()) { + ALOGE("%s: invalid result fmq", __FUNCTION__); + return true; + } + + mOutputThread->run(); + return false; +} + +bool ExternalCameraDeviceSession::isInitFailed() { + Mutex::Autolock _l(mLock); + if (!mInitialized) { + mInitFail = initialize(); + mInitialized = true; + } + return mInitFail; +} + +void ExternalCameraDeviceSession::initOutputThread() { + // Grab a shared_ptr to 'this' from ndk::SharedRefBase::ref() + std::shared_ptr thiz = ref(); + + mBufferRequestThread = std::make_shared(/*parent=*/thiz, mCallback); + mBufferRequestThread->run(); + mOutputThread = std::make_shared(/*parent=*/thiz, mCroppingType, + mCameraCharacteristics, mBufferRequestThread); +} + +void ExternalCameraDeviceSession::closeOutputThread() { + closeOutputThreadImpl(); +} + +void ExternalCameraDeviceSession::closeOutputThreadImpl() { + if (mOutputThread != nullptr) { + mOutputThread->flush(); + mOutputThread->requestExitAndWait(); + mOutputThread.reset(); + } +} + +Status ExternalCameraDeviceSession::initStatus() const { + Mutex::Autolock _l(mLock); + Status status = Status::OK; + if (mInitFail || mClosed) { + ALOGI("%s: session initFailed %d closed %d", __FUNCTION__, mInitFail, mClosed); + status = Status::INTERNAL_ERROR; + } + return status; +} + +ExternalCameraDeviceSession::~ExternalCameraDeviceSession() { + if (!isClosed()) { + ALOGE("ExternalCameraDeviceSession deleted before close!"); + close(/*callerIsDtor*/ true); + } +} + +ScopedAStatus ExternalCameraDeviceSession::constructDefaultRequestSettings( + RequestTemplate in_type, CameraMetadata* _aidl_return) { + CameraMetadata emptyMetadata; + Status status = initStatus(); + if (status != Status::OK) { + return fromStatus(status); + } + switch (in_type) { + case RequestTemplate::PREVIEW: + case RequestTemplate::STILL_CAPTURE: + case RequestTemplate::VIDEO_RECORD: + case RequestTemplate::VIDEO_SNAPSHOT: { + *_aidl_return = mDefaultRequests[in_type]; + break; + } + case RequestTemplate::MANUAL: + case RequestTemplate::ZERO_SHUTTER_LAG: + // Don't support MANUAL, ZSL templates + status = Status::ILLEGAL_ARGUMENT; + break; + default: + ALOGE("%s: unknown request template type %d", __FUNCTION__, static_cast(in_type)); + status = Status::ILLEGAL_ARGUMENT; + break; + } + return fromStatus(status); +} + +ScopedAStatus ExternalCameraDeviceSession::configureStreams( + const StreamConfiguration& in_requestedConfiguration, + std::vector* _aidl_return) { + uint32_t blobBufferSize = 0; + _aidl_return->clear(); + Mutex::Autolock _il(mInterfaceLock); + + Status status = + isStreamCombinationSupported(in_requestedConfiguration, mSupportedFormats, mCfg); + if (status != Status::OK) { + return fromStatus(status); + } + + status = initStatus(); + if (status != Status::OK) { + return fromStatus(status); + } + + { + std::lock_guard lk(mInflightFramesLock); + if (!mInflightFrames.empty()) { + ALOGE("%s: trying to configureStreams while there are still %zu inflight frames!", + __FUNCTION__, mInflightFrames.size()); + return fromStatus(Status::INTERNAL_ERROR); + } + } + + Mutex::Autolock _l(mLock); + { + Mutex::Autolock _cl(mCbsLock); + // Add new streams + for (const auto& stream : in_requestedConfiguration.streams) { + if (mStreamMap.count(stream.id) == 0) { + mStreamMap[stream.id] = stream; + mCirculatingBuffers.emplace(stream.id, CirculatingBuffers{}); + } + } + + // Cleanup removed streams + for (auto it = mStreamMap.begin(); it != mStreamMap.end();) { + int id = it->first; + bool found = false; + for (const auto& stream : in_requestedConfiguration.streams) { + if (id == stream.id) { + found = true; + break; + } + } + if (!found) { + // Unmap all buffers of deleted stream + cleanupBuffersLocked(id); + it = mStreamMap.erase(it); + } else { + ++it; + } + } + } + + // Now select a V4L2 format to produce all output streams + float desiredAr = (mCroppingType == VERTICAL) ? kMaxAspectRatio : kMinAspectRatio; + uint32_t maxDim = 0; + for (const auto& stream : in_requestedConfiguration.streams) { + float aspectRatio = ASPECT_RATIO(stream); + ALOGI("%s: request stream %dx%d", __FUNCTION__, stream.width, stream.height); + if ((mCroppingType == VERTICAL && aspectRatio < desiredAr) || + (mCroppingType == HORIZONTAL && aspectRatio > desiredAr)) { + desiredAr = aspectRatio; + } + + // The dimension that's not cropped + uint32_t dim = (mCroppingType == VERTICAL) ? stream.width : stream.height; + if (dim > maxDim) { + maxDim = dim; + } + } + + // Find the smallest format that matches the desired aspect ratio and is wide/high enough + SupportedV4L2Format v4l2Fmt{.width = 0, .height = 0}; + for (const auto& fmt : mSupportedFormats) { + uint32_t dim = (mCroppingType == VERTICAL) ? fmt.width : fmt.height; + if (dim >= maxDim) { + float aspectRatio = ASPECT_RATIO(fmt); + if (isAspectRatioClose(aspectRatio, desiredAr)) { + v4l2Fmt = fmt; + // since mSupportedFormats is sorted by width then height, the first matching fmt + // will be the smallest one with matching aspect ratio + break; + } + } + } + + if (v4l2Fmt.width == 0) { + // Cannot find exact good aspect ratio candidate, try to find a close one + for (const auto& fmt : mSupportedFormats) { + uint32_t dim = (mCroppingType == VERTICAL) ? fmt.width : fmt.height; + if (dim >= maxDim) { + float aspectRatio = ASPECT_RATIO(fmt); + if ((mCroppingType == VERTICAL && aspectRatio < desiredAr) || + (mCroppingType == HORIZONTAL && aspectRatio > desiredAr)) { + v4l2Fmt = fmt; + break; + } + } + } + } + + if (v4l2Fmt.width == 0) { + ALOGE("%s: unable to find a resolution matching (%s at least %d, aspect ratio %f)", + __FUNCTION__, (mCroppingType == VERTICAL) ? "width" : "height", maxDim, desiredAr); + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + + if (configureV4l2StreamLocked(v4l2Fmt) != 0) { + ALOGE("V4L configuration failed!, format:%c%c%c%c, w %d, h %d", v4l2Fmt.fourcc & 0xFF, + (v4l2Fmt.fourcc >> 8) & 0xFF, (v4l2Fmt.fourcc >> 16) & 0xFF, + (v4l2Fmt.fourcc >> 24) & 0xFF, v4l2Fmt.width, v4l2Fmt.height); + return fromStatus(Status::INTERNAL_ERROR); + } + + Size v4lSize = {v4l2Fmt.width, v4l2Fmt.height}; + Size thumbSize{0, 0}; + camera_metadata_ro_entry entry = + mCameraCharacteristics.find(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES); + for (uint32_t i = 0; i < entry.count; i += 2) { + Size sz{entry.data.i32[i], entry.data.i32[i + 1]}; + if (sz.width * sz.height > thumbSize.width * thumbSize.height) { + thumbSize = sz; + } + } + + if (thumbSize.width * thumbSize.height == 0) { + ALOGE("%s: non-zero thumbnail size not available", __FUNCTION__); + return fromStatus(Status::INTERNAL_ERROR); + } + + mBlobBufferSize = blobBufferSize; + status = mOutputThread->allocateIntermediateBuffers( + v4lSize, mMaxThumbResolution, in_requestedConfiguration.streams, blobBufferSize); + if (status != Status::OK) { + ALOGE("%s: allocating intermediate buffers failed!", __FUNCTION__); + return fromStatus(status); + } + + std::vector& out = *_aidl_return; + out.resize(in_requestedConfiguration.streams.size()); + for (size_t i = 0; i < in_requestedConfiguration.streams.size(); i++) { + out[i].overrideDataSpace = in_requestedConfiguration.streams[i].dataSpace; + out[i].id = in_requestedConfiguration.streams[i].id; + // TODO: double check should we add those CAMERA flags + mStreamMap[in_requestedConfiguration.streams[i].id].usage = out[i].producerUsage = + static_cast(((int64_t)in_requestedConfiguration.streams[i].usage) | + ((int64_t)BufferUsage::CPU_WRITE_OFTEN) | + ((int64_t)BufferUsage::CAMERA_OUTPUT)); + out[i].consumerUsage = static_cast(0); + out[i].maxBuffers = static_cast(mV4L2BufferCount); + + switch (in_requestedConfiguration.streams[i].format) { + case PixelFormat::BLOB: + case PixelFormat::YCBCR_420_888: + case PixelFormat::YV12: // Used by SurfaceTexture + case PixelFormat::Y16: + // No override + out[i].overrideFormat = in_requestedConfiguration.streams[i].format; + break; + case PixelFormat::IMPLEMENTATION_DEFINED: + // Implementation Defined + // This should look at the Stream's dataspace flag to determine the format or leave + // it as is if the rest of the system knows how to handle a private format. To keep + // this HAL generic, this is being overridden to YUV420 + out[i].overrideFormat = PixelFormat::YCBCR_420_888; + // Save overridden format in mStreamMap + mStreamMap[in_requestedConfiguration.streams[i].id].format = out[i].overrideFormat; + break; + default: + ALOGE("%s: unsupported format 0x%x", __FUNCTION__, + in_requestedConfiguration.streams[i].format); + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + } + + mFirstRequest = true; + mLastStreamConfigCounter = in_requestedConfiguration.streamConfigCounter; + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraDeviceSession::flush() { + ATRACE_CALL(); + Mutex::Autolock _il(mInterfaceLock); + Status status = initStatus(); + if (status != Status::OK) { + return fromStatus(status); + } + mOutputThread->flush(); + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraDeviceSession::getCaptureRequestMetadataQueue( + MQDescriptor* _aidl_return) { + Mutex::Autolock _il(mInterfaceLock); + *_aidl_return = mRequestMetadataQueue->dupeDesc(); + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraDeviceSession::getCaptureResultMetadataQueue( + MQDescriptor* _aidl_return) { + Mutex::Autolock _il(mInterfaceLock); + *_aidl_return = mResultMetadataQueue->dupeDesc(); + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraDeviceSession::isReconfigurationRequired( + const CameraMetadata& in_oldSessionParams, const CameraMetadata& in_newSessionParams, + bool* _aidl_return) { + // reconfiguration required if there is any change in the session params + *_aidl_return = in_oldSessionParams != in_newSessionParams; + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraDeviceSession::processCaptureRequest( + const std::vector& in_requests, + const std::vector& in_cachesToRemove, int32_t* _aidl_return) { + Mutex::Autolock _il(mInterfaceLock); + updateBufferCaches(in_cachesToRemove); + + int32_t& numRequestProcessed = *_aidl_return; + numRequestProcessed = 0; + Status s = Status::OK; + for (size_t i = 0; i < in_requests.size(); i++, numRequestProcessed++) { + s = processOneCaptureRequest(in_requests[i]); + if (s != Status::OK) { + break; + } + } + + return fromStatus(s); +} + +Status ExternalCameraDeviceSession::processOneCaptureRequest(const CaptureRequest& request) { + ATRACE_CALL(); + Status status = initStatus(); + if (status != Status::OK) { + return status; + } + + if (request.inputBuffer.streamId != -1) { + ALOGE("%s: external camera does not support reprocessing!", __FUNCTION__); + return Status::ILLEGAL_ARGUMENT; + } + + Mutex::Autolock _l(mLock); + if (!mV4l2Streaming) { + ALOGE("%s: cannot process request in streamOff state!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + + const camera_metadata_t* rawSettings = nullptr; + bool converted; + CameraMetadata settingsFmq; // settings from FMQ + + if (request.fmqSettingsSize > 0) { + // non-blocking read; client must write metadata before calling + // processOneCaptureRequest + settingsFmq.metadata.resize(request.fmqSettingsSize); + bool read = mRequestMetadataQueue->read( + reinterpret_cast(settingsFmq.metadata.data()), request.fmqSettingsSize); + if (read) { + converted = convertFromAidl(settingsFmq, &rawSettings); + } else { + ALOGE("%s: capture request settings metadata couldn't be read from fmq!", __FUNCTION__); + converted = false; + } + } else { + converted = convertFromAidl(request.settings, &rawSettings); + } + + if (converted && rawSettings != nullptr) { + mLatestReqSetting = rawSettings; + } + + if (!converted) { + ALOGE("%s: capture request settings metadata is corrupt!", __FUNCTION__); + return Status::ILLEGAL_ARGUMENT; + } + + if (mFirstRequest && rawSettings == nullptr) { + ALOGE("%s: capture request settings must not be null for first request!", __FUNCTION__); + return Status::ILLEGAL_ARGUMENT; + } + + std::vector allBufPtrs; + std::vector allFences; + size_t numOutputBufs = request.outputBuffers.size(); + + if (numOutputBufs == 0) { + ALOGE("%s: capture request must have at least one output buffer!", __FUNCTION__); + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_entry fpsRange = mLatestReqSetting.find(ANDROID_CONTROL_AE_TARGET_FPS_RANGE); + if (fpsRange.count == 2) { + double requestFpsMax = fpsRange.data.i32[1]; + double closestFps = 0.0; + double fpsError = 1000.0; + bool fpsSupported = false; + for (const auto& fr : mV4l2StreamingFmt.frameRates) { + double f = fr.getFramesPerSecond(); + if (std::fabs(requestFpsMax - f) < 1.0) { + fpsSupported = true; + break; + } + if (std::fabs(requestFpsMax - f) < fpsError) { + fpsError = std::fabs(requestFpsMax - f); + closestFps = f; + } + } + if (!fpsSupported) { + /* This can happen in a few scenarios: + * 1. The application is sending an FPS range not supported by the configured outputs. + * 2. The application is sending a valid FPS range for all configured outputs, but + * the selected V4L2 size can only run at slower speed. This should be very rare + * though: for this to happen a sensor needs to support at least 3 different aspect + * ratio outputs, and when (at least) two outputs are both not the main aspect ratio + * of the webcam, a third size that's larger might be picked and runs into this + * issue. + */ + ALOGW("%s: cannot reach fps %d! Will do %f instead", __FUNCTION__, fpsRange.data.i32[1], + closestFps); + requestFpsMax = closestFps; + } + + if (requestFpsMax != mV4l2StreamingFps) { + { + std::unique_lock lk(mV4l2BufferLock); + while (mNumDequeuedV4l2Buffers != 0) { + // Wait until pipeline is idle before reconfigure stream + int waitRet = waitForV4L2BufferReturnLocked(lk); + if (waitRet != 0) { + ALOGE("%s: wait for pipeline idle failed!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + } + } + configureV4l2StreamLocked(mV4l2StreamingFmt, requestFpsMax); + } + } + + status = importRequestLocked(request, allBufPtrs, allFences); + if (status != Status::OK) { + return status; + } + + nsecs_t shutterTs = 0; + std::unique_ptr frameIn = dequeueV4l2FrameLocked(&shutterTs); + if (frameIn == nullptr) { + ALOGE("%s: V4L2 deque frame failed!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + + std::shared_ptr halReq = std::make_shared(); + halReq->frameNumber = request.frameNumber; + halReq->setting = mLatestReqSetting; + halReq->frameIn = std::move(frameIn); + halReq->shutterTs = shutterTs; + halReq->buffers.resize(numOutputBufs); + for (size_t i = 0; i < numOutputBufs; i++) { + HalStreamBuffer& halBuf = halReq->buffers[i]; + int streamId = halBuf.streamId = request.outputBuffers[i].streamId; + halBuf.bufferId = request.outputBuffers[i].bufferId; + const Stream& stream = mStreamMap[streamId]; + halBuf.width = stream.width; + halBuf.height = stream.height; + halBuf.format = stream.format; + halBuf.usage = stream.usage; + halBuf.bufPtr = allBufPtrs[i]; + halBuf.acquireFence = allFences[i]; + halBuf.fenceTimeout = false; + } + { + std::lock_guard lk(mInflightFramesLock); + mInflightFrames.insert(halReq->frameNumber); + } + // Send request to OutputThread for the rest of processing + mOutputThread->submitRequest(halReq); + mFirstRequest = false; + return Status::OK; +} + +ScopedAStatus ExternalCameraDeviceSession::signalStreamFlush( + const std::vector& /*in_streamIds*/, int32_t in_streamConfigCounter) { + { + Mutex::Autolock _l(mLock); + if (in_streamConfigCounter < mLastStreamConfigCounter) { + // stale call. new streams have been configured since this call was issued. + // Do nothing. + return fromStatus(Status::OK); + } + } + + // TODO: implement if needed. + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraDeviceSession::switchToOffline( + const std::vector& in_streamsToKeep, + CameraOfflineSessionInfo* out_offlineSessionInfo, + std::shared_ptr* _aidl_return) { + std::vector msgs; + std::vector results; + CameraOfflineSessionInfo info; + std::shared_ptr session; + Status st = switchToOffline(in_streamsToKeep, &msgs, &results, &info, &session); + + mCallback->notify(msgs); + invokeProcessCaptureResultCallback(results, /* tryWriteFmq= */ true); + freeReleaseFences(results); + + // setup return values + *out_offlineSessionInfo = info; + *_aidl_return = session; + return fromStatus(st); +} + +Status ExternalCameraDeviceSession::switchToOffline( + const std::vector& offlineStreams, std::vector* msgs, + std::vector* results, CameraOfflineSessionInfo* info, + std::shared_ptr* session) { + ATRACE_CALL(); + if (offlineStreams.size() > 1) { + ALOGE("%s: more than one offline stream is not supported", __FUNCTION__); + return Status::ILLEGAL_ARGUMENT; + } + + if (msgs == nullptr || results == nullptr || info == nullptr || session == nullptr) { + ALOGE("%s, output arguments (%p, %p, %p, %p) must not be null", __FUNCTION__, msgs, results, + info, session); + } + + Mutex::Autolock _il(mInterfaceLock); + Status status = initStatus(); + if (status != Status::OK) { + return status; + } + + Mutex::Autolock _l(mLock); + for (auto streamId : offlineStreams) { + if (!supportOfflineLocked(streamId)) { + return Status::ILLEGAL_ARGUMENT; + } + } + + // pause output thread and get all remaining inflight requests + auto remainingReqs = mOutputThread->switchToOffline(); + std::vector> halReqs; + + // Send out buffer/request error for remaining requests and filter requests + // to be handled in offline mode + for (auto& halReq : remainingReqs) { + bool dropReq = canDropRequest(offlineStreams, halReq); + if (dropReq) { + // Request is dropped completely. Just send request error and + // there is no need to send the request to offline session + processCaptureRequestError(halReq, msgs, results); + continue; + } + + // All requests reach here must have at least one offline stream output + NotifyMsg shutter; + aidl::android::hardware::camera::device::ShutterMsg shutterMsg = { + .frameNumber = static_cast(halReq->frameNumber), + .timestamp = halReq->shutterTs}; + shutter.set(shutterMsg); + msgs->push_back(shutter); + + std::vector offlineBuffers; + for (const auto& buffer : halReq->buffers) { + bool dropBuffer = true; + for (auto offlineStreamId : offlineStreams) { + if (buffer.streamId == offlineStreamId) { + dropBuffer = false; + break; + } + } + if (dropBuffer) { + aidl::android::hardware::camera::device::ErrorMsg errorMsg = { + .frameNumber = static_cast(halReq->frameNumber), + .errorStreamId = buffer.streamId, + .errorCode = ErrorCode::ERROR_BUFFER}; + + NotifyMsg error; + error.set(errorMsg); + msgs->push_back(error); + + results->push_back({ + .frameNumber = static_cast(halReq->frameNumber), + .outputBuffers = {}, + .inputBuffer = {.streamId = -1}, + .partialResult = 0, // buffer only result + }); + + CaptureResult& result = results->back(); + result.outputBuffers.resize(1); + StreamBuffer& outputBuffer = result.outputBuffers[0]; + outputBuffer.streamId = buffer.streamId; + outputBuffer.bufferId = buffer.bufferId; + outputBuffer.status = BufferStatus::ERROR; + if (buffer.acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = buffer.acquireFence; + outputBuffer.releaseFence = android::makeToAidl(handle); + } + } else { + offlineBuffers.push_back(buffer); + } + } + halReq->buffers = offlineBuffers; + halReqs.push_back(halReq); + } + + // convert hal requests to offline request + std::deque> offlineReqs(halReqs.size()); + size_t i = 0; + for (auto& v4lReq : halReqs) { + offlineReqs[i] = std::make_shared(); + offlineReqs[i]->frameNumber = v4lReq->frameNumber; + offlineReqs[i]->setting = v4lReq->setting; + offlineReqs[i]->shutterTs = v4lReq->shutterTs; + offlineReqs[i]->buffers = v4lReq->buffers; + std::shared_ptr v4l2Frame(static_cast(v4lReq->frameIn.get())); + offlineReqs[i]->frameIn = std::make_shared(v4l2Frame); + i++; + // enqueue V4L2 frame + enqueueV4l2Frame(v4l2Frame); + } + + // Collect buffer caches/streams + std::vector streamInfos(offlineStreams.size()); + std::map circulatingBuffers; + { + Mutex::Autolock _cbsl(mCbsLock); + for (auto streamId : offlineStreams) { + circulatingBuffers[streamId] = mCirculatingBuffers.at(streamId); + mCirculatingBuffers.erase(streamId); + streamInfos.push_back(mStreamMap.at(streamId)); + mStreamMap.erase(streamId); + } + } + + fillOfflineSessionInfo(offlineStreams, offlineReqs, circulatingBuffers, info); + // create the offline session object + bool afTrigger; + { + std::lock_guard _lk(mAfTriggerLock); + afTrigger = mAfTrigger; + } + + std::shared_ptr sessionImpl = + ndk::SharedRefBase::make( + mCroppingType, mCameraCharacteristics, mCameraId, mExifMake, mExifModel, + mBlobBufferSize, afTrigger, streamInfos, offlineReqs, circulatingBuffers); + + bool initFailed = sessionImpl->initialize(); + if (initFailed) { + ALOGE("%s: offline session initialize failed!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + + // cleanup stream and buffer caches + { + Mutex::Autolock _cbsl(mCbsLock); + for (auto pair : mStreamMap) { + cleanupBuffersLocked(/*Stream ID*/ pair.first); + } + mCirculatingBuffers.clear(); + } + mStreamMap.clear(); + + // update inflight records + { + std::lock_guard _lk(mInflightFramesLock); + mInflightFrames.clear(); + } + + // stop v4l2 streaming + if (v4l2StreamOffLocked() != 0) { + ALOGE("%s: stop V4L2 streaming failed!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + + // No need to return session if there is no offline requests left + if (!offlineReqs.empty()) { + *session = sessionImpl; + } else { + *session = nullptr; + } + + return Status::OK; +} + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#define UPDATE(md, tag, data, size) \ + do { \ + if ((md).update((tag), (data), (size))) { \ + ALOGE("Update " #tag " failed!"); \ + return BAD_VALUE; \ + } \ + } while (0) + +status_t ExternalCameraDeviceSession::initDefaultRequests() { + common::V1_0::helper::CameraMetadata md; + + const uint8_t aberrationMode = ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF; + UPDATE(md, ANDROID_COLOR_CORRECTION_ABERRATION_MODE, &aberrationMode, 1); + + const int32_t exposureCompensation = 0; + UPDATE(md, ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, &exposureCompensation, 1); + + const uint8_t videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF; + UPDATE(md, ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, &videoStabilizationMode, 1); + + const uint8_t awbMode = ANDROID_CONTROL_AWB_MODE_AUTO; + UPDATE(md, ANDROID_CONTROL_AWB_MODE, &awbMode, 1); + + const uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON; + UPDATE(md, ANDROID_CONTROL_AE_MODE, &aeMode, 1); + + const uint8_t aePrecaptureTrigger = ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE; + UPDATE(md, ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, &aePrecaptureTrigger, 1); + + const uint8_t afMode = ANDROID_CONTROL_AF_MODE_AUTO; + UPDATE(md, ANDROID_CONTROL_AF_MODE, &afMode, 1); + + const uint8_t afTrigger = ANDROID_CONTROL_AF_TRIGGER_IDLE; + UPDATE(md, ANDROID_CONTROL_AF_TRIGGER, &afTrigger, 1); + + const uint8_t sceneMode = ANDROID_CONTROL_SCENE_MODE_DISABLED; + UPDATE(md, ANDROID_CONTROL_SCENE_MODE, &sceneMode, 1); + + const uint8_t effectMode = ANDROID_CONTROL_EFFECT_MODE_OFF; + UPDATE(md, ANDROID_CONTROL_EFFECT_MODE, &effectMode, 1); + + const uint8_t flashMode = ANDROID_FLASH_MODE_OFF; + UPDATE(md, ANDROID_FLASH_MODE, &flashMode, 1); + + const int32_t thumbnailSize[] = {240, 180}; + UPDATE(md, ANDROID_JPEG_THUMBNAIL_SIZE, thumbnailSize, 2); + + const uint8_t jpegQuality = 90; + UPDATE(md, ANDROID_JPEG_QUALITY, &jpegQuality, 1); + UPDATE(md, ANDROID_JPEG_THUMBNAIL_QUALITY, &jpegQuality, 1); + + const int32_t jpegOrientation = 0; + UPDATE(md, ANDROID_JPEG_ORIENTATION, &jpegOrientation, 1); + + const uint8_t oisMode = ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF; + UPDATE(md, ANDROID_LENS_OPTICAL_STABILIZATION_MODE, &oisMode, 1); + + const uint8_t nrMode = ANDROID_NOISE_REDUCTION_MODE_OFF; + UPDATE(md, ANDROID_NOISE_REDUCTION_MODE, &nrMode, 1); + + const int32_t testPatternModes = ANDROID_SENSOR_TEST_PATTERN_MODE_OFF; + UPDATE(md, ANDROID_SENSOR_TEST_PATTERN_MODE, &testPatternModes, 1); + + const uint8_t fdMode = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF; + UPDATE(md, ANDROID_STATISTICS_FACE_DETECT_MODE, &fdMode, 1); + + const uint8_t hotpixelMode = ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF; + UPDATE(md, ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE, &hotpixelMode, 1); + + bool support30Fps = false; + int32_t maxFps = std::numeric_limits::min(); + for (const auto& supportedFormat : mSupportedFormats) { + for (const auto& fr : supportedFormat.frameRates) { + int32_t framerateInt = static_cast(fr.getFramesPerSecond()); + if (maxFps < framerateInt) { + maxFps = framerateInt; + } + if (framerateInt == 30) { + support30Fps = true; + break; + } + } + if (support30Fps) { + break; + } + } + + int32_t defaultFramerate = support30Fps ? 30 : maxFps; + int32_t defaultFpsRange[] = {defaultFramerate / 2, defaultFramerate}; + UPDATE(md, ANDROID_CONTROL_AE_TARGET_FPS_RANGE, defaultFpsRange, ARRAY_SIZE(defaultFpsRange)); + + uint8_t antibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO; + UPDATE(md, ANDROID_CONTROL_AE_ANTIBANDING_MODE, &antibandingMode, 1); + + const uint8_t controlMode = ANDROID_CONTROL_MODE_AUTO; + UPDATE(md, ANDROID_CONTROL_MODE, &controlMode, 1); + + for (const auto& type : ndk::enum_range()) { + common::V1_0::helper::CameraMetadata mdCopy = md; + uint8_t intent = ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW; + switch (type) { + case RequestTemplate::PREVIEW: + intent = ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW; + break; + case RequestTemplate::STILL_CAPTURE: + intent = ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE; + break; + case RequestTemplate::VIDEO_RECORD: + intent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD; + break; + case RequestTemplate::VIDEO_SNAPSHOT: + intent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT; + break; + default: + ALOGV("%s: unsupported RequestTemplate type %d", __FUNCTION__, type); + continue; + } + UPDATE(mdCopy, ANDROID_CONTROL_CAPTURE_INTENT, &intent, 1); + camera_metadata_t* mdPtr = mdCopy.release(); + uint8_t* rawMd = reinterpret_cast(mdPtr); + CameraMetadata aidlMd; + aidlMd.metadata.assign(rawMd, rawMd + get_camera_metadata_size(mdPtr)); + mDefaultRequests[type] = aidlMd; + free_camera_metadata(mdPtr); + } + return OK; +} + +status_t ExternalCameraDeviceSession::fillCaptureResult(common::V1_0::helper::CameraMetadata& md, + nsecs_t timestamp) { + bool afTrigger = false; + { + std::lock_guard lk(mAfTriggerLock); + afTrigger = mAfTrigger; + if (md.exists(ANDROID_CONTROL_AF_TRIGGER)) { + camera_metadata_entry entry = md.find(ANDROID_CONTROL_AF_TRIGGER); + if (entry.data.u8[0] == ANDROID_CONTROL_AF_TRIGGER_START) { + mAfTrigger = afTrigger = true; + } else if (entry.data.u8[0] == ANDROID_CONTROL_AF_TRIGGER_CANCEL) { + mAfTrigger = afTrigger = false; + } + } + } + + // For USB camera, the USB camera handles everything and we don't have control + // over AF. We only simply fake the AF metadata based on the request + // received here. + uint8_t afState; + if (afTrigger) { + afState = ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED; + } else { + afState = ANDROID_CONTROL_AF_STATE_INACTIVE; + } + UPDATE(md, ANDROID_CONTROL_AF_STATE, &afState, 1); + + camera_metadata_ro_entry activeArraySize = + mCameraCharacteristics.find(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE); + + return fillCaptureResultCommon(md, timestamp, activeArraySize); +} + +int ExternalCameraDeviceSession::configureV4l2StreamLocked(const SupportedV4L2Format& v4l2Fmt, + double requestFps) { + ATRACE_CALL(); + int ret = v4l2StreamOffLocked(); + if (ret != OK) { + ALOGE("%s: stop v4l2 streaming failed: ret %d", __FUNCTION__, ret); + return ret; + } + + // VIDIOC_S_FMT w/h/fmt + v4l2_format fmt; + fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + fmt.fmt.pix.width = v4l2Fmt.width; + fmt.fmt.pix.height = v4l2Fmt.height; + fmt.fmt.pix.pixelformat = v4l2Fmt.fourcc; + + { + int numAttempt = 0; + do { + ret = TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_S_FMT, &fmt)); + if (numAttempt == MAX_RETRY) { + break; + } + numAttempt++; + if (ret < 0) { + ALOGW("%s: VIDIOC_S_FMT failed, wait 33ms and try again", __FUNCTION__); + usleep(IOCTL_RETRY_SLEEP_US); // sleep and try again + } + } while (ret < 0); + if (ret < 0) { + ALOGE("%s: S_FMT ioctl failed: %s", __FUNCTION__, strerror(errno)); + return -errno; + } + } + + if (v4l2Fmt.width != fmt.fmt.pix.width || v4l2Fmt.height != fmt.fmt.pix.height || + v4l2Fmt.fourcc != fmt.fmt.pix.pixelformat) { + ALOGE("%s: S_FMT expect %c%c%c%c %dx%d, got %c%c%c%c %dx%d instead!", __FUNCTION__, + v4l2Fmt.fourcc & 0xFF, (v4l2Fmt.fourcc >> 8) & 0xFF, (v4l2Fmt.fourcc >> 16) & 0xFF, + (v4l2Fmt.fourcc >> 24) & 0xFF, v4l2Fmt.width, v4l2Fmt.height, + fmt.fmt.pix.pixelformat & 0xFF, (fmt.fmt.pix.pixelformat >> 8) & 0xFF, + (fmt.fmt.pix.pixelformat >> 16) & 0xFF, (fmt.fmt.pix.pixelformat >> 24) & 0xFF, + fmt.fmt.pix.width, fmt.fmt.pix.height); + return -EINVAL; + } + + uint32_t bufferSize = fmt.fmt.pix.sizeimage; + ALOGI("%s: V4L2 buffer size is %d", __FUNCTION__, bufferSize); + uint32_t expectedMaxBufferSize = kMaxBytesPerPixel * fmt.fmt.pix.width * fmt.fmt.pix.height; + if ((bufferSize == 0) || (bufferSize > expectedMaxBufferSize)) { + ALOGE("%s: V4L2 buffer size: %u looks invalid. Expected maximum size: %u", __FUNCTION__, + bufferSize, expectedMaxBufferSize); + return -EINVAL; + } + mMaxV4L2BufferSize = bufferSize; + + const double kDefaultFps = 30.0; + double fps = std::numeric_limits::max(); + if (requestFps != 0.0) { + fps = requestFps; + } else { + double maxFps = -1.0; + // Try to pick the slowest fps that is at least 30 + for (const auto& fr : v4l2Fmt.frameRates) { + double f = fr.getFramesPerSecond(); + if (maxFps < f) { + maxFps = f; + } + if (f >= kDefaultFps && f < fps) { + fps = f; + } + } + // No fps > 30 found, use the highest fps available within supported formats. + if (fps == std::numeric_limits::max()) { + fps = maxFps; + } + } + + int fpsRet = setV4l2FpsLocked(fps); + if (fpsRet != 0 && fpsRet != -EINVAL) { + ALOGE("%s: set fps failed: %s", __FUNCTION__, strerror(fpsRet)); + return fpsRet; + } + + uint32_t v4lBufferCount = (fps >= kDefaultFps) ? mCfg.numVideoBuffers : mCfg.numStillBuffers; + + // VIDIOC_REQBUFS: create buffers + v4l2_requestbuffers req_buffers{}; + req_buffers.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + req_buffers.memory = V4L2_MEMORY_MMAP; + req_buffers.count = v4lBufferCount; + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_REQBUFS, &req_buffers)) < 0) { + ALOGE("%s: VIDIOC_REQBUFS failed: %s", __FUNCTION__, strerror(errno)); + return -errno; + } + + // Driver can indeed return more buffer if it needs more to operate + if (req_buffers.count < v4lBufferCount) { + ALOGE("%s: VIDIOC_REQBUFS expected %d buffers, got %d instead", __FUNCTION__, + v4lBufferCount, req_buffers.count); + return NO_MEMORY; + } + + // VIDIOC_QUERYBUF: get buffer offset in the V4L2 fd + // VIDIOC_QBUF: send buffer to driver + mV4L2BufferCount = req_buffers.count; + for (uint32_t i = 0; i < req_buffers.count; i++) { + v4l2_buffer buffer = { + .index = i, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .memory = V4L2_MEMORY_MMAP}; + + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_QUERYBUF, &buffer)) < 0) { + ALOGE("%s: QUERYBUF %d failed: %s", __FUNCTION__, i, strerror(errno)); + return -errno; + } + + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_QBUF, &buffer)) < 0) { + ALOGE("%s: QBUF %d failed: %s", __FUNCTION__, i, strerror(errno)); + return -errno; + } + } + + { + // VIDIOC_STREAMON: start streaming + v4l2_buf_type capture_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + int numAttempt = 0; + do { + ret = TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_STREAMON, &capture_type)); + if (numAttempt == MAX_RETRY) { + break; + } + if (ret < 0) { + ALOGW("%s: VIDIOC_STREAMON failed, wait 33ms and try again", __FUNCTION__); + usleep(IOCTL_RETRY_SLEEP_US); // sleep 100 ms and try again + } + } while (ret < 0); + + if (ret < 0) { + ALOGE("%s: VIDIOC_STREAMON ioctl failed: %s", __FUNCTION__, strerror(errno)); + return -errno; + } + } + + // Swallow first few frames after streamOn to account for bad frames from some devices + for (int i = 0; i < kBadFramesAfterStreamOn; i++) { + v4l2_buffer buffer{}; + buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buffer.memory = V4L2_MEMORY_MMAP; + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_DQBUF, &buffer)) < 0) { + ALOGE("%s: DQBUF fails: %s", __FUNCTION__, strerror(errno)); + return -errno; + } + + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_QBUF, &buffer)) < 0) { + ALOGE("%s: QBUF index %d fails: %s", __FUNCTION__, buffer.index, strerror(errno)); + return -errno; + } + } + + ALOGI("%s: start V4L2 streaming %dx%d@%ffps", __FUNCTION__, v4l2Fmt.width, v4l2Fmt.height, fps); + mV4l2StreamingFmt = v4l2Fmt; + mV4l2Streaming = true; + return OK; +} + +std::unique_ptr ExternalCameraDeviceSession::dequeueV4l2FrameLocked(nsecs_t* shutterTs) { + ATRACE_CALL(); + std::unique_ptr ret = nullptr; + if (shutterTs == nullptr) { + ALOGE("%s: shutterTs must not be null!", __FUNCTION__); + return ret; + } + + { + std::unique_lock lk(mV4l2BufferLock); + if (mNumDequeuedV4l2Buffers == mV4L2BufferCount) { + int waitRet = waitForV4L2BufferReturnLocked(lk); + if (waitRet != 0) { + return ret; + } + } + } + + ATRACE_BEGIN("VIDIOC_DQBUF"); + v4l2_buffer buffer{}; + buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buffer.memory = V4L2_MEMORY_MMAP; + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_DQBUF, &buffer)) < 0) { + ALOGE("%s: DQBUF fails: %s", __FUNCTION__, strerror(errno)); + return ret; + } + ATRACE_END(); + + if (buffer.index >= mV4L2BufferCount) { + ALOGE("%s: Invalid buffer id: %d", __FUNCTION__, buffer.index); + return ret; + } + + if (buffer.flags & V4L2_BUF_FLAG_ERROR) { + ALOGE("%s: v4l2 buf error! buf flag 0x%x", __FUNCTION__, buffer.flags); + // TODO: try to dequeue again + } + + if (buffer.bytesused > mMaxV4L2BufferSize) { + ALOGE("%s: v4l2 buffer bytes used: %u maximum %u", __FUNCTION__, buffer.bytesused, + mMaxV4L2BufferSize); + return ret; + } + + if (buffer.flags & V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) { + // Ideally we should also check for V4L2_BUF_FLAG_TSTAMP_SRC_SOE, but + // even V4L2_BUF_FLAG_TSTAMP_SRC_EOF is better than capture a timestamp now + *shutterTs = static_cast(buffer.timestamp.tv_sec) * 1000000000LL + + buffer.timestamp.tv_usec * 1000LL; + } else { + *shutterTs = systemTime(SYSTEM_TIME_MONOTONIC); + } + + { + std::lock_guard lk(mV4l2BufferLock); + mNumDequeuedV4l2Buffers++; + } + + return std::make_unique(mV4l2StreamingFmt.width, mV4l2StreamingFmt.height, + mV4l2StreamingFmt.fourcc, buffer.index, mV4l2Fd.get(), + buffer.bytesused, buffer.m.offset); +} + +void ExternalCameraDeviceSession::enqueueV4l2Frame(const std::shared_ptr& frame) { + ATRACE_CALL(); + frame->unmap(); + ATRACE_BEGIN("VIDIOC_QBUF"); + v4l2_buffer buffer{}; + buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buffer.memory = V4L2_MEMORY_MMAP; + buffer.index = frame->mBufferIndex; + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_QBUF, &buffer)) < 0) { + ALOGE("%s: QBUF index %d fails: %s", __FUNCTION__, frame->mBufferIndex, strerror(errno)); + return; + } + ATRACE_END(); + + { + std::lock_guard lk(mV4l2BufferLock); + mNumDequeuedV4l2Buffers--; + } + mV4L2BufferReturned.notify_one(); +} + +bool ExternalCameraDeviceSession::isSupported( + const Stream& stream, const std::vector& supportedFormats, + const ExternalCameraConfig& devCfg) { + Dataspace ds = stream.dataSpace; + PixelFormat fmt = stream.format; + uint32_t width = stream.width; + uint32_t height = stream.height; + // TODO: check usage flags + + if (stream.streamType != StreamType::OUTPUT) { + ALOGE("%s: does not support non-output stream type", __FUNCTION__); + return false; + } + + if (stream.rotation != StreamRotation::ROTATION_0) { + ALOGE("%s: does not support stream rotation", __FUNCTION__); + return false; + } + + switch (fmt) { + case PixelFormat::BLOB: + if (ds != Dataspace::JFIF) { + ALOGI("%s: BLOB format does not support dataSpace %x", __FUNCTION__, ds); + return false; + } + break; + case PixelFormat::IMPLEMENTATION_DEFINED: + case PixelFormat::YCBCR_420_888: + case PixelFormat::YV12: + // TODO: check what dataspace we can support here. + // intentional no-ops. + break; + case PixelFormat::Y16: + if (!devCfg.depthEnabled) { + ALOGI("%s: Depth is not Enabled", __FUNCTION__); + return false; + } + if (!(static_cast(ds) & static_cast(Dataspace::DEPTH))) { + ALOGI("%s: Y16 supports only dataSpace DEPTH", __FUNCTION__); + return false; + } + break; + default: + ALOGI("%s: does not support format %x", __FUNCTION__, fmt); + return false; + } + + // Assume we can convert any V4L2 format to any of supported output format for now, i.e. + // ignoring v4l2Fmt.fourcc for now. Might need more subtle check if we support more v4l format + // in the futrue. + for (const auto& v4l2Fmt : supportedFormats) { + if (width == v4l2Fmt.width && height == v4l2Fmt.height) { + return true; + } + } + ALOGI("%s: resolution %dx%d is not supported", __FUNCTION__, width, height); + return false; +} + +Status ExternalCameraDeviceSession::importRequestLocked(const CaptureRequest& request, + std::vector& allBufPtrs, + std::vector& allFences) { + return importRequestLockedImpl(request, allBufPtrs, allFences); +} + +Status ExternalCameraDeviceSession::importRequestLockedImpl( + const CaptureRequest& request, std::vector& allBufPtrs, + std::vector& allFences) { + size_t numOutputBufs = request.outputBuffers.size(); + size_t numBufs = numOutputBufs; + // Validate all I/O buffers + std::vector allBufs; + std::vector allBufIds; + allBufs.resize(numBufs); + allBufIds.resize(numBufs); + allBufPtrs.resize(numBufs); + allFences.resize(numBufs); + std::vector streamIds(numBufs); + + for (size_t i = 0; i < numOutputBufs; i++) { + allBufs[i] = ::android::makeFromAidl(request.outputBuffers[i].buffer); + allBufIds[i] = request.outputBuffers[i].bufferId; + allBufPtrs[i] = &allBufs[i]; + streamIds[i] = request.outputBuffers[i].streamId; + } + + { + Mutex::Autolock _l(mCbsLock); + for (size_t i = 0; i < numBufs; i++) { + Status st = importBufferLocked(streamIds[i], allBufIds[i], allBufs[i], &allBufPtrs[i]); + if (st != Status::OK) { + // Detailed error logs printed in importBuffer + return st; + } + } + } + + // All buffers are imported. Now validate output buffer acquire fences + for (size_t i = 0; i < numOutputBufs; i++) { + if (!sHandleImporter.importFence( + ::android::makeFromAidl(request.outputBuffers[i].acquireFence), allFences[i])) { + ALOGE("%s: output buffer %zu acquire fence is invalid", __FUNCTION__, i); + cleanupInflightFences(allFences, i); + return Status::INTERNAL_ERROR; + } + } + return Status::OK; +} + +Status ExternalCameraDeviceSession::importBuffer(int32_t streamId, uint64_t bufId, + buffer_handle_t buf, + /*out*/ buffer_handle_t** outBufPtr) { + Mutex::Autolock _l(mCbsLock); + return importBufferLocked(streamId, bufId, buf, outBufPtr); +} + +Status ExternalCameraDeviceSession::importBufferLocked(int32_t streamId, uint64_t bufId, + buffer_handle_t buf, + buffer_handle_t** outBufPtr) { + return importBufferImpl(mCirculatingBuffers, sHandleImporter, streamId, bufId, buf, outBufPtr); +} + +ScopedAStatus ExternalCameraDeviceSession::close() { + close(false); + return fromStatus(Status::OK); +} + +void ExternalCameraDeviceSession::close(bool callerIsDtor) { + Mutex::Autolock _il(mInterfaceLock); + bool closed = isClosed(); + if (!closed) { + if (callerIsDtor) { + closeOutputThreadImpl(); + } else { + closeOutputThread(); + } + + Mutex::Autolock _l(mLock); + // free all buffers + { + Mutex::Autolock _cbsl(mCbsLock); + for (auto pair : mStreamMap) { + cleanupBuffersLocked(/*Stream ID*/ pair.first); + } + } + v4l2StreamOffLocked(); + ALOGV("%s: closing V4L2 camera FD %d", __FUNCTION__, mV4l2Fd.get()); + mV4l2Fd.reset(); + mClosed = true; + } +} + +bool ExternalCameraDeviceSession::isClosed() { + Mutex::Autolock _l(mLock); + return mClosed; +} + +ScopedAStatus ExternalCameraDeviceSession::repeatingRequestEnd( + int32_t /*in_frameNumber*/, const std::vector& /*in_streamIds*/) { + // TODO: Figure this one out. + return fromStatus(Status::OK); +} + +int ExternalCameraDeviceSession::v4l2StreamOffLocked() { + if (!mV4l2Streaming) { + return OK; + } + + { + std::lock_guard lk(mV4l2BufferLock); + if (mNumDequeuedV4l2Buffers != 0) { + ALOGE("%s: there are %zu inflight V4L buffers", __FUNCTION__, mNumDequeuedV4l2Buffers); + return -1; + } + } + mV4L2BufferCount = 0; + + // VIDIOC_STREAMOFF + v4l2_buf_type capture_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_STREAMOFF, &capture_type)) < 0) { + ALOGE("%s: STREAMOFF failed: %s", __FUNCTION__, strerror(errno)); + return -errno; + } + + // VIDIOC_REQBUFS: clear buffers + v4l2_requestbuffers req_buffers{}; + req_buffers.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + req_buffers.memory = V4L2_MEMORY_MMAP; + req_buffers.count = 0; + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_REQBUFS, &req_buffers)) < 0) { + ALOGE("%s: REQBUFS failed: %s", __FUNCTION__, strerror(errno)); + return -errno; + } + + mV4l2Streaming = false; + return OK; +} + +int ExternalCameraDeviceSession::setV4l2FpsLocked(double fps) { + // VIDIOC_G_PARM/VIDIOC_S_PARM: set fps + v4l2_streamparm streamparm = {.type = V4L2_BUF_TYPE_VIDEO_CAPTURE}; + // The following line checks that the driver knows about framerate get/set. + int ret = TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_G_PARM, &streamparm)); + if (ret != 0) { + if (errno == -EINVAL) { + ALOGW("%s: device does not support VIDIOC_G_PARM", __FUNCTION__); + } + return -errno; + } + // Now check if the device is able to accept a capture framerate set. + if (!(streamparm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME)) { + ALOGW("%s: device does not support V4L2_CAP_TIMEPERFRAME", __FUNCTION__); + return -EINVAL; + } + + // fps is float, approximate by a fraction. + const int kFrameRatePrecision = 10000; + streamparm.parm.capture.timeperframe.numerator = kFrameRatePrecision; + streamparm.parm.capture.timeperframe.denominator = (fps * kFrameRatePrecision); + + if (TEMP_FAILURE_RETRY(ioctl(mV4l2Fd.get(), VIDIOC_S_PARM, &streamparm)) < 0) { + ALOGE("%s: failed to set framerate to %f: %s", __FUNCTION__, fps, strerror(errno)); + return -1; + } + + double retFps = streamparm.parm.capture.timeperframe.denominator / + static_cast(streamparm.parm.capture.timeperframe.numerator); + if (std::fabs(fps - retFps) > 1.0) { + ALOGE("%s: expect fps %f, got %f instead", __FUNCTION__, fps, retFps); + return -1; + } + mV4l2StreamingFps = fps; + return 0; +} + +void ExternalCameraDeviceSession::cleanupInflightFences(std::vector& allFences, + size_t numFences) { + for (size_t j = 0; j < numFences; j++) { + sHandleImporter.closeFence(allFences[j]); + } +} + +void ExternalCameraDeviceSession::cleanupBuffersLocked(int id) { + for (auto& pair : mCirculatingBuffers.at(id)) { + sHandleImporter.freeBuffer(pair.second); + } + mCirculatingBuffers[id].clear(); + mCirculatingBuffers.erase(id); +} + +void ExternalCameraDeviceSession::notifyShutter(int32_t frameNumber, nsecs_t shutterTs) { + NotifyMsg msg; + msg.set(ShutterMsg{ + .frameNumber = frameNumber, + .timestamp = shutterTs, + }); + mCallback->notify({msg}); +} +void ExternalCameraDeviceSession::notifyError(int32_t frameNumber, int32_t streamId, ErrorCode ec) { + NotifyMsg msg; + msg.set(ErrorMsg{ + .frameNumber = frameNumber, + .errorStreamId = streamId, + .errorCode = ec, + }); + mCallback->notify({msg}); +} + +void ExternalCameraDeviceSession::invokeProcessCaptureResultCallback( + std::vector& results, bool tryWriteFmq) { + if (mProcessCaptureResultLock.tryLock() != OK) { + const nsecs_t NS_TO_SECOND = 1000000000; + ALOGV("%s: previous call is not finished! waiting 1s...", __FUNCTION__); + if (mProcessCaptureResultLock.timedLock(/* 1s */ NS_TO_SECOND) != OK) { + ALOGE("%s: cannot acquire lock in 1s, cannot proceed", __FUNCTION__); + return; + } + } + if (tryWriteFmq && mResultMetadataQueue->availableToWrite() > 0) { + for (CaptureResult& result : results) { + CameraMetadata& md = result.result; + if (!md.metadata.empty()) { + if (mResultMetadataQueue->write(reinterpret_cast(md.metadata.data()), + md.metadata.size())) { + result.fmqResultSize = md.metadata.size(); + md.metadata.resize(0); + } else { + ALOGW("%s: couldn't utilize fmq, fall back to hwbinder", __FUNCTION__); + result.fmqResultSize = 0; + } + } else { + result.fmqResultSize = 0; + } + } + } + auto status = mCallback->processCaptureResult(results); + if (!status.isOk()) { + ALOGE("%s: processCaptureResult ERROR : %d:%d", __FUNCTION__, status.getExceptionCode(), + status.getServiceSpecificError()); + } + + mProcessCaptureResultLock.unlock(); +} + +int ExternalCameraDeviceSession::waitForV4L2BufferReturnLocked(std::unique_lock& lk) { + ATRACE_CALL(); + auto timeout = std::chrono::seconds(kBufferWaitTimeoutSec); + mLock.unlock(); + auto st = mV4L2BufferReturned.wait_for(lk, timeout); + // Here we introduce an order where mV4l2BufferLock is acquired before mLock, while + // the normal lock acquisition order is reversed. This is fine because in most of + // cases we are protected by mInterfaceLock. The only thread that can cause deadlock + // is the OutputThread, where we do need to make sure we don't acquire mLock then + // mV4l2BufferLock + mLock.lock(); + if (st == std::cv_status::timeout) { + ALOGE("%s: wait for V4L2 buffer return timeout!", __FUNCTION__); + return -1; + } + return 0; +} + +bool ExternalCameraDeviceSession::supportOfflineLocked(int32_t streamId) { + const Stream& stream = mStreamMap[streamId]; + if (stream.format == PixelFormat::BLOB && + static_cast(stream.dataSpace) == static_cast(Dataspace::JFIF)) { + return true; + } + // TODO: support YUV output stream? + return false; +} + +bool ExternalCameraDeviceSession::canDropRequest(const std::vector& offlineStreams, + std::shared_ptr halReq) { + for (const auto& buffer : halReq->buffers) { + for (auto offlineStreamId : offlineStreams) { + if (buffer.streamId == offlineStreamId) { + return false; + } + } + } + // Only drop a request completely if it has no offline output + return true; +} + +void ExternalCameraDeviceSession::fillOfflineSessionInfo( + const std::vector& offlineStreams, + std::deque>& offlineReqs, + const std::map& circulatingBuffers, + CameraOfflineSessionInfo* info) { + if (info == nullptr) { + ALOGE("%s: output info must not be null!", __FUNCTION__); + return; + } + + info->offlineStreams.resize(offlineStreams.size()); + info->offlineRequests.resize(offlineReqs.size()); + + // Fill in offline reqs and count outstanding buffers + for (size_t i = 0; i < offlineReqs.size(); i++) { + info->offlineRequests[i].frameNumber = offlineReqs[i]->frameNumber; + info->offlineRequests[i].pendingStreams.resize(offlineReqs[i]->buffers.size()); + for (size_t bIdx = 0; bIdx < offlineReqs[i]->buffers.size(); bIdx++) { + int32_t streamId = offlineReqs[i]->buffers[bIdx].streamId; + info->offlineRequests[i].pendingStreams[bIdx] = streamId; + } + } + + for (size_t i = 0; i < offlineStreams.size(); i++) { + int32_t streamId = offlineStreams[i]; + info->offlineStreams[i].id = streamId; + // outstanding buffers are 0 since we are doing hal buffer management and + // offline session will ask for those buffers later + info->offlineStreams[i].numOutstandingBuffers = 0; + const CirculatingBuffers& bufIdMap = circulatingBuffers.at(streamId); + info->offlineStreams[i].circulatingBufferIds.resize(bufIdMap.size()); + size_t bIdx = 0; + for (const auto& pair : bufIdMap) { + // Fill in bufferId + info->offlineStreams[i].circulatingBufferIds[bIdx++] = pair.first; + } + } +} + +Status ExternalCameraDeviceSession::isStreamCombinationSupported( + const StreamConfiguration& config, const std::vector& supportedFormats, + const ExternalCameraConfig& devCfg) { + if (config.operationMode != StreamConfigurationMode::NORMAL_MODE) { + ALOGE("%s: unsupported operation mode: %d", __FUNCTION__, config.operationMode); + return Status::ILLEGAL_ARGUMENT; + } + + if (config.streams.size() == 0) { + ALOGE("%s: cannot configure zero stream", __FUNCTION__); + return Status::ILLEGAL_ARGUMENT; + } + + int numProcessedStream = 0; + int numStallStream = 0; + for (const auto& stream : config.streams) { + // Check if the format/width/height combo is supported + if (!isSupported(stream, supportedFormats, devCfg)) { + return Status::ILLEGAL_ARGUMENT; + } + if (stream.format == PixelFormat::BLOB) { + numStallStream++; + } else { + numProcessedStream++; + } + } + + if (numProcessedStream > kMaxProcessedStream) { + ALOGE("%s: too many processed streams (expect <= %d, got %d)", __FUNCTION__, + kMaxProcessedStream, numProcessedStream); + return Status::ILLEGAL_ARGUMENT; + } + + if (numStallStream > kMaxStallStream) { + ALOGE("%s: too many stall streams (expect <= %d, got %d)", __FUNCTION__, kMaxStallStream, + numStallStream); + return Status::ILLEGAL_ARGUMENT; + } + + return Status::OK; +} +void ExternalCameraDeviceSession::updateBufferCaches( + const std::vector& cachesToRemove) { + Mutex::Autolock _l(mCbsLock); + for (auto& cache : cachesToRemove) { + auto cbsIt = mCirculatingBuffers.find(cache.streamId); + if (cbsIt == mCirculatingBuffers.end()) { + // The stream could have been removed + continue; + } + CirculatingBuffers& cbs = cbsIt->second; + auto it = cbs.find(cache.bufferId); + if (it != cbs.end()) { + sHandleImporter.freeBuffer(it->second); + cbs.erase(it); + } else { + ALOGE("%s: stream %d buffer %" PRIu64 " is not cached", __FUNCTION__, cache.streamId, + cache.bufferId); + } + } +} + +Status ExternalCameraDeviceSession::processCaptureRequestError( + const std::shared_ptr& req, std::vector* outMsgs, + std::vector* outResults) { + ATRACE_CALL(); + // Return V4L2 buffer to V4L2 buffer queue + std::shared_ptr v4l2Frame = std::static_pointer_cast(req->frameIn); + enqueueV4l2Frame(v4l2Frame); + + if (outMsgs == nullptr) { + notifyShutter(req->frameNumber, req->shutterTs); + notifyError(/*frameNum*/ req->frameNumber, /*stream*/ -1, ErrorCode::ERROR_REQUEST); + } else { + NotifyMsg shutter; + shutter.set( + ShutterMsg{.frameNumber = req->frameNumber, .timestamp = req->shutterTs}); + + NotifyMsg error; + error.set(ErrorMsg{.frameNumber = req->frameNumber, + .errorStreamId = -1, + .errorCode = ErrorCode::ERROR_REQUEST}); + outMsgs->push_back(shutter); + outMsgs->push_back(error); + } + + // Fill output buffers + CaptureResult result; + result.frameNumber = req->frameNumber; + result.partialResult = 1; + result.inputBuffer.streamId = -1; + result.outputBuffers.resize(req->buffers.size()); + for (size_t i = 0; i < req->buffers.size(); i++) { + result.outputBuffers[i].streamId = req->buffers[i].streamId; + result.outputBuffers[i].bufferId = req->buffers[i].bufferId; + result.outputBuffers[i].status = BufferStatus::ERROR; + if (req->buffers[i].acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = req->buffers[i].acquireFence; + result.outputBuffers[i].releaseFence = ::android::makeToAidl(handle); + } + } + + // update inflight records + { + std::lock_guard lk(mInflightFramesLock); + mInflightFrames.erase(req->frameNumber); + } + + if (outResults == nullptr) { + // Callback into framework + std::vector results(1); + results[0] = std::move(result); + invokeProcessCaptureResultCallback(results, /* tryWriteFmq */ true); + freeReleaseFences(results); + } else { + outResults->push_back(std::move(result)); + } + return Status::OK; +} + +Status ExternalCameraDeviceSession::processCaptureResult(std::shared_ptr& req) { + ATRACE_CALL(); + // Return V4L2 buffer to V4L2 buffer queue + std::shared_ptr v4l2Frame = std::static_pointer_cast(req->frameIn); + enqueueV4l2Frame(v4l2Frame); + + // NotifyShutter + notifyShutter(req->frameNumber, req->shutterTs); + + // Fill output buffers; + std::vector results(1); + CaptureResult& result = results[0]; + result.frameNumber = req->frameNumber; + result.partialResult = 1; + result.inputBuffer.streamId = -1; + result.outputBuffers.resize(req->buffers.size()); + for (size_t i = 0; i < req->buffers.size(); i++) { + result.outputBuffers[i].streamId = req->buffers[i].streamId; + result.outputBuffers[i].bufferId = req->buffers[i].bufferId; + if (req->buffers[i].fenceTimeout) { + result.outputBuffers[i].status = BufferStatus::ERROR; + if (req->buffers[i].acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = req->buffers[i].acquireFence; + result.outputBuffers[i].releaseFence = ::android::makeToAidl(handle); + } + notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER); + } else { + result.outputBuffers[i].status = BufferStatus::OK; + // TODO: refactor + if (req->buffers[i].acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = req->buffers[i].acquireFence; + result.outputBuffers[i].releaseFence = ::android::makeToAidl(handle); + } + } + } + + // Fill capture result metadata + fillCaptureResult(req->setting, req->shutterTs); + const camera_metadata_t* rawResult = req->setting.getAndLock(); + convertToAidl(rawResult, &result.result); + req->setting.unlock(rawResult); + + // update inflight records + { + std::lock_guard lk(mInflightFramesLock); + mInflightFrames.erase(req->frameNumber); + } + + // Callback into framework + invokeProcessCaptureResultCallback(results, /* tryWriteFmq */ true); + freeReleaseFences(results); + return Status::OK; +} + +ssize_t ExternalCameraDeviceSession::getJpegBufferSize(int32_t width, int32_t height) const { + // Constant from camera3.h + const ssize_t kMinJpegBufferSize = 256 * 1024 + sizeof(CameraBlob); + // Get max jpeg size (area-wise). + if (mMaxJpegResolution.width == 0) { + ALOGE("%s: No supported JPEG stream", __FUNCTION__); + return BAD_VALUE; + } + + // Get max jpeg buffer size + ssize_t maxJpegBufferSize = 0; + camera_metadata_ro_entry jpegBufMaxSize = mCameraCharacteristics.find(ANDROID_JPEG_MAX_SIZE); + if (jpegBufMaxSize.count == 0) { + ALOGE("%s: Can't find maximum JPEG size in static metadata!", __FUNCTION__); + return BAD_VALUE; + } + maxJpegBufferSize = jpegBufMaxSize.data.i32[0]; + + if (maxJpegBufferSize <= kMinJpegBufferSize) { + ALOGE("%s: ANDROID_JPEG_MAX_SIZE (%zd) <= kMinJpegBufferSize (%zd)", __FUNCTION__, + maxJpegBufferSize, kMinJpegBufferSize); + return BAD_VALUE; + } + + // Calculate final jpeg buffer size for the given resolution. + float scaleFactor = + ((float)(width * height)) / (mMaxJpegResolution.width * mMaxJpegResolution.height); + ssize_t jpegBufferSize = + scaleFactor * (maxJpegBufferSize - kMinJpegBufferSize) + kMinJpegBufferSize; + if (jpegBufferSize > maxJpegBufferSize) { + jpegBufferSize = maxJpegBufferSize; + } + + return jpegBufferSize; +} +binder_status_t ExternalCameraDeviceSession::dump(int fd, const char** /*args*/, + uint32_t /*numArgs*/) { + bool intfLocked = tryLock(mInterfaceLock); + if (!intfLocked) { + dprintf(fd, "!! ExternalCameraDeviceSession interface may be deadlocked !!\n"); + } + + if (isClosed()) { + dprintf(fd, "External camera %s is closed\n", mCameraId.c_str()); + return STATUS_OK; + } + + bool streaming = false; + size_t v4L2BufferCount = 0; + SupportedV4L2Format streamingFmt; + { + bool sessionLocked = tryLock(mLock); + if (!sessionLocked) { + dprintf(fd, "!! ExternalCameraDeviceSession mLock may be deadlocked !!\n"); + } + streaming = mV4l2Streaming; + streamingFmt = mV4l2StreamingFmt; + v4L2BufferCount = mV4L2BufferCount; + + if (sessionLocked) { + mLock.unlock(); + } + } + + std::unordered_set inflightFrames; + { + bool iffLocked = tryLock(mInflightFramesLock); + if (!iffLocked) { + dprintf(fd, + "!! ExternalCameraDeviceSession mInflightFramesLock may be deadlocked !!\n"); + } + inflightFrames = mInflightFrames; + if (iffLocked) { + mInflightFramesLock.unlock(); + } + } + + dprintf(fd, "External camera %s V4L2 FD %d, cropping type %s, %s\n", mCameraId.c_str(), + mV4l2Fd.get(), (mCroppingType == VERTICAL) ? "vertical" : "horizontal", + streaming ? "streaming" : "not streaming"); + + if (streaming) { + // TODO: dump fps later + dprintf(fd, "Current V4L2 format %c%c%c%c %dx%d @ %ffps\n", streamingFmt.fourcc & 0xFF, + (streamingFmt.fourcc >> 8) & 0xFF, (streamingFmt.fourcc >> 16) & 0xFF, + (streamingFmt.fourcc >> 24) & 0xFF, streamingFmt.width, streamingFmt.height, + mV4l2StreamingFps); + + size_t numDequeuedV4l2Buffers = 0; + { + std::lock_guard lk(mV4l2BufferLock); + numDequeuedV4l2Buffers = mNumDequeuedV4l2Buffers; + } + dprintf(fd, "V4L2 buffer queue size %zu, dequeued %zu\n", v4L2BufferCount, + numDequeuedV4l2Buffers); + } + + dprintf(fd, "In-flight frames (not sorted):"); + for (const auto& frameNumber : inflightFrames) { + dprintf(fd, "%d, ", frameNumber); + } + dprintf(fd, "\n"); + mOutputThread->dump(fd); + dprintf(fd, "\n"); + + if (intfLocked) { + mInterfaceLock.unlock(); + } + + return STATUS_OK; +} + +// Start ExternalCameraDeviceSession::BufferRequestThread functions +ExternalCameraDeviceSession::BufferRequestThread::BufferRequestThread( + std::weak_ptr parent, + std::shared_ptr callbacks) + : mParent(parent), mCallbacks(callbacks) {} + +int ExternalCameraDeviceSession::BufferRequestThread::requestBufferStart( + const std::vector& bufReqs) { + if (bufReqs.empty()) { + ALOGE("%s: bufReqs is empty!", __FUNCTION__); + return -1; + } + + { + std::lock_guard lk(mLock); + if (mRequestingBuffer) { + ALOGE("%s: BufferRequestThread does not support more than one concurrent request!", + __FUNCTION__); + return -1; + } + + mBufferReqs = bufReqs; + mRequestingBuffer = true; + } + mRequestCond.notify_one(); + return 0; +} + +int ExternalCameraDeviceSession::BufferRequestThread::waitForBufferRequestDone( + std::vector* outBufReqs) { + std::unique_lock lk(mLock); + if (!mRequestingBuffer) { + ALOGE("%s: no pending buffer request!", __FUNCTION__); + return -1; + } + + if (mPendingReturnBufferReqs.empty()) { + std::chrono::milliseconds timeout = std::chrono::milliseconds(kReqProcTimeoutMs); + auto st = mRequestDoneCond.wait_for(lk, timeout); + if (st == std::cv_status::timeout) { + ALOGE("%s: wait for buffer request finish timeout!", __FUNCTION__); + return -1; + } + } + mRequestingBuffer = false; + *outBufReqs = std::move(mPendingReturnBufferReqs); + mPendingReturnBufferReqs.clear(); + return 0; +} + +void ExternalCameraDeviceSession::BufferRequestThread::waitForNextRequest() { + ATRACE_CALL(); + std::unique_lock lk(mLock); + int waitTimes = 0; + while (mBufferReqs.empty()) { + if (exitPending()) { + return; + } + auto timeout = std::chrono::milliseconds(kReqWaitTimeoutMs); + auto st = mRequestCond.wait_for(lk, timeout); + if (st == std::cv_status::timeout) { + waitTimes++; + if (waitTimes == kReqWaitTimesWarn) { + // BufferRequestThread just wait forever for new buffer request + // But it will print some periodic warning indicating it's waiting + ALOGV("%s: still waiting for new buffer request", __FUNCTION__); + waitTimes = 0; + } + } + } + + // Fill in BufferRequest + mHalBufferReqs.resize(mBufferReqs.size()); + for (size_t i = 0; i < mHalBufferReqs.size(); i++) { + mHalBufferReqs[i].streamId = mBufferReqs[i].streamId; + mHalBufferReqs[i].numBuffersRequested = 1; + } +} + +bool ExternalCameraDeviceSession::BufferRequestThread::threadLoop() { + waitForNextRequest(); + if (exitPending()) { + return false; + } + + ATRACE_BEGIN("AIDL requestStreamBuffers"); + BufferRequestStatus status; + std::vector bufRets; + ScopedAStatus ret = mCallbacks->requestStreamBuffers(mHalBufferReqs, &bufRets, &status); + if (!ret.isOk()) { + ALOGE("%s: Transaction error: %d:%d", __FUNCTION__, ret.getExceptionCode(), + ret.getServiceSpecificError()); + return false; + } + + std::unique_lock lk(mLock); + if (status == BufferRequestStatus::OK || status == BufferRequestStatus::FAILED_PARTIAL) { + if (bufRets.size() != mHalBufferReqs.size()) { + ALOGE("%s: expect %zu buffer requests returned, only got %zu", __FUNCTION__, + mHalBufferReqs.size(), bufRets.size()); + return false; + } + + auto parent = mParent.lock(); + if (parent == nullptr) { + ALOGE("%s: session has been disconnected!", __FUNCTION__); + return false; + } + + std::vector importedFences; + importedFences.resize(bufRets.size()); + for (size_t i = 0; i < bufRets.size(); i++) { + int streamId = bufRets[i].streamId; + switch (bufRets[i].val.getTag()) { + case StreamBuffersVal::Tag::error: + continue; + case StreamBuffersVal::Tag::buffers: { + const std::vector& hBufs = + bufRets[i].val.get(); + if (hBufs.size() != 1) { + ALOGE("%s: expect 1 buffer returned, got %zu!", __FUNCTION__, hBufs.size()); + return false; + } + const StreamBuffer& hBuf = hBufs[0]; + + mBufferReqs[i].bufferId = hBuf.bufferId; + // TODO: create a batch import API so we don't need to lock/unlock mCbsLock + // repeatedly? + lk.unlock(); + Status s = + parent->importBuffer(streamId, hBuf.bufferId, makeFromAidl(hBuf.buffer), + /*out*/ &mBufferReqs[i].bufPtr); + lk.lock(); + + if (s != Status::OK) { + ALOGE("%s: stream %d import buffer failed!", __FUNCTION__, streamId); + cleanupInflightFences(importedFences, i - 1); + return false; + } + if (!sHandleImporter.importFence(makeFromAidl(hBuf.acquireFence), + mBufferReqs[i].acquireFence)) { + ALOGE("%s: stream %d import fence failed!", __FUNCTION__, streamId); + cleanupInflightFences(importedFences, i - 1); + return false; + } + importedFences[i] = mBufferReqs[i].acquireFence; + } break; + default: + ALOGE("%s: Unknown StreamBuffersVal!", __FUNCTION__); + return false; + } + } + } else { + ALOGE("%s: requestStreamBuffers call failed!", __FUNCTION__); + } + + mPendingReturnBufferReqs = std::move(mBufferReqs); + mBufferReqs.clear(); + + lk.unlock(); + mRequestDoneCond.notify_one(); + return true; +} + +// End ExternalCameraDeviceSession::BufferRequestThread functions + +// Start ExternalCameraDeviceSession::OutputThread functions + +ExternalCameraDeviceSession::OutputThread::OutputThread( + std::weak_ptr parent, CroppingType ct, + const common::V1_0::helper::CameraMetadata& chars, + std::shared_ptr bufReqThread) + : mParent(parent), + mCroppingType(ct), + mCameraCharacteristics(chars), + mBufferRequestThread(bufReqThread) {} + +ExternalCameraDeviceSession::OutputThread::~OutputThread() {} + +Status ExternalCameraDeviceSession::OutputThread::allocateIntermediateBuffers( + const Size& v4lSize, const Size& thumbSize, const std::vector& streams, + uint32_t blobBufferSize) { + std::lock_guard lk(mBufferLock); + if (!mScaledYu12Frames.empty()) { + ALOGE("%s: intermediate buffer pool has %zu inflight buffers! (expect 0)", __FUNCTION__, + mScaledYu12Frames.size()); + return Status::INTERNAL_ERROR; + } + + // Allocating intermediate YU12 frame + if (mYu12Frame == nullptr || mYu12Frame->mWidth != v4lSize.width || + mYu12Frame->mHeight != v4lSize.height) { + mYu12Frame.reset(); + mYu12Frame = std::make_shared(v4lSize.width, v4lSize.height); + int ret = mYu12Frame->allocate(&mYu12FrameLayout); + if (ret != 0) { + ALOGE("%s: allocating YU12 frame failed!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + } + + // Allocating intermediate YU12 thumbnail frame + if (mYu12ThumbFrame == nullptr || mYu12ThumbFrame->mWidth != thumbSize.width || + mYu12ThumbFrame->mHeight != thumbSize.height) { + mYu12ThumbFrame.reset(); + mYu12ThumbFrame = std::make_shared(thumbSize.width, thumbSize.height); + int ret = mYu12ThumbFrame->allocate(&mYu12ThumbFrameLayout); + if (ret != 0) { + ALOGE("%s: allocating YU12 thumb frame failed!", __FUNCTION__); + return Status::INTERNAL_ERROR; + } + } + + // Allocating scaled buffers + for (const auto& stream : streams) { + Size sz = {stream.width, stream.height}; + if (sz == v4lSize) { + continue; // Don't need an intermediate buffer same size as v4lBuffer + } + if (mIntermediateBuffers.count(sz) == 0) { + // Create new intermediate buffer + std::shared_ptr buf = + std::make_shared(stream.width, stream.height); + int ret = buf->allocate(); + if (ret != 0) { + ALOGE("%s: allocating intermediate YU12 frame %dx%d failed!", __FUNCTION__, + stream.width, stream.height); + return Status::INTERNAL_ERROR; + } + mIntermediateBuffers[sz] = buf; + } + } + + // Remove unconfigured buffers + auto it = mIntermediateBuffers.begin(); + while (it != mIntermediateBuffers.end()) { + bool configured = false; + auto sz = it->first; + for (const auto& stream : streams) { + if (stream.width == sz.width && stream.height == sz.height) { + configured = true; + break; + } + } + if (configured) { + it++; + } else { + it = mIntermediateBuffers.erase(it); + } + } + + // Allocate mute test pattern frame + mMuteTestPatternFrame.resize(mYu12Frame->mWidth * mYu12Frame->mHeight * 3); + + mBlobBufferSize = blobBufferSize; + return Status::OK; +} + +Status ExternalCameraDeviceSession::OutputThread::submitRequest( + const std::shared_ptr& req) { + std::unique_lock lk(mRequestListLock); + mRequestList.push_back(req); + lk.unlock(); + mRequestCond.notify_one(); + return Status::OK; +} + +void ExternalCameraDeviceSession::OutputThread::flush() { + ATRACE_CALL(); + auto parent = mParent.lock(); + if (parent == nullptr) { + ALOGE("%s: session has been disconnected!", __FUNCTION__); + return; + } + + std::unique_lock lk(mRequestListLock); + std::list> reqs = std::move(mRequestList); + mRequestList.clear(); + if (mProcessingRequest) { + auto timeout = std::chrono::seconds(kFlushWaitTimeoutSec); + auto st = mRequestDoneCond.wait_for(lk, timeout); + if (st == std::cv_status::timeout) { + ALOGE("%s: wait for inflight request finish timeout!", __FUNCTION__); + } + } + + ALOGV("%s: flushing inflight requests", __FUNCTION__); + lk.unlock(); + for (const auto& req : reqs) { + parent->processCaptureRequestError(req); + } +} + +void ExternalCameraDeviceSession::OutputThread::dump(int fd) { + std::lock_guard lk(mRequestListLock); + if (mProcessingRequest) { + dprintf(fd, "OutputThread processing frame %d\n", mProcessingFrameNumber); + } else { + dprintf(fd, "OutputThread not processing any frames\n"); + } + dprintf(fd, "OutputThread request list contains frame: "); + for (const auto& req : mRequestList) { + dprintf(fd, "%d, ", req->frameNumber); + } + dprintf(fd, "\n"); +} + +void ExternalCameraDeviceSession::OutputThread::setExifMakeModel(const std::string& make, + const std::string& model) { + mExifMake = make; + mExifModel = model; +} + +std::list> +ExternalCameraDeviceSession::OutputThread::switchToOffline() { + ATRACE_CALL(); + auto parent = mParent.lock(); + if (parent == nullptr) { + ALOGE("%s: session has been disconnected!", __FUNCTION__); + return {}; + } + + std::unique_lock lk(mRequestListLock); + std::list> reqs = std::move(mRequestList); + mRequestList.clear(); + if (mProcessingRequest) { + auto timeout = std::chrono::seconds(kFlushWaitTimeoutSec); + auto st = mRequestDoneCond.wait_for(lk, timeout); + if (st == std::cv_status::timeout) { + ALOGE("%s: wait for inflight request finish timeout!", __FUNCTION__); + } + } + lk.unlock(); + clearIntermediateBuffers(); + ALOGV("%s: returning %zu request for offline processing", __FUNCTION__, reqs.size()); + return reqs; +} + +int ExternalCameraDeviceSession::OutputThread::requestBufferStart( + const std::vector& bufs) { + if (mBufferRequestThread == nullptr) { + return 0; + } + return mBufferRequestThread->requestBufferStart(bufs); +} + +int ExternalCameraDeviceSession::OutputThread::waitForBufferRequestDone( + std::vector* outBufs) { + if (mBufferRequestThread == nullptr) { + return 0; + } + return mBufferRequestThread->waitForBufferRequestDone(outBufs); +} + +void ExternalCameraDeviceSession::OutputThread::waitForNextRequest( + std::shared_ptr* out) { + ATRACE_CALL(); + if (out == nullptr) { + ALOGE("%s: out is null", __FUNCTION__); + return; + } + + std::unique_lock lk(mRequestListLock); + int waitTimes = 0; + while (mRequestList.empty()) { + if (exitPending()) { + return; + } + auto timeout = std::chrono::milliseconds(kReqWaitTimeoutMs); + auto st = mRequestCond.wait_for(lk, timeout); + if (st == std::cv_status::timeout) { + waitTimes++; + if (waitTimes == kReqWaitTimesMax) { + // no new request, return + return; + } + } + } + *out = mRequestList.front(); + mRequestList.pop_front(); + mProcessingRequest = true; + mProcessingFrameNumber = (*out)->frameNumber; +} + +void ExternalCameraDeviceSession::OutputThread::signalRequestDone() { + std::unique_lock lk(mRequestListLock); + mProcessingRequest = false; + mProcessingFrameNumber = 0; + lk.unlock(); + mRequestDoneCond.notify_one(); +} + +int ExternalCameraDeviceSession::OutputThread::cropAndScaleLocked( + std::shared_ptr& in, const Size& outSz, YCbCrLayout* out) { + Size inSz = {in->mWidth, in->mHeight}; + + int ret; + if (inSz == outSz) { + ret = in->getLayout(out); + if (ret != 0) { + ALOGE("%s: failed to get input image layout", __FUNCTION__); + return ret; + } + return ret; + } + + // Cropping to output aspect ratio + IMapper::Rect inputCrop; + ret = getCropRect(mCroppingType, inSz, outSz, &inputCrop); + if (ret != 0) { + ALOGE("%s: failed to compute crop rect for output size %dx%d", __FUNCTION__, outSz.width, + outSz.height); + return ret; + } + + YCbCrLayout croppedLayout; + ret = in->getCroppedLayout(inputCrop, &croppedLayout); + if (ret != 0) { + ALOGE("%s: failed to crop input image %dx%d to output size %dx%d", __FUNCTION__, inSz.width, + inSz.height, outSz.width, outSz.height); + return ret; + } + + if ((mCroppingType == VERTICAL && inSz.width == outSz.width) || + (mCroppingType == HORIZONTAL && inSz.height == outSz.height)) { + // No scale is needed + *out = croppedLayout; + return 0; + } + + auto it = mScaledYu12Frames.find(outSz); + std::shared_ptr scaledYu12Buf; + if (it != mScaledYu12Frames.end()) { + scaledYu12Buf = it->second; + } else { + it = mIntermediateBuffers.find(outSz); + if (it == mIntermediateBuffers.end()) { + ALOGE("%s: failed to find intermediate buffer size %dx%d", __FUNCTION__, outSz.width, + outSz.height); + return -1; + } + scaledYu12Buf = it->second; + } + // Scale + YCbCrLayout outLayout; + ret = scaledYu12Buf->getLayout(&outLayout); + if (ret != 0) { + ALOGE("%s: failed to get output buffer layout", __FUNCTION__); + return ret; + } + + ret = libyuv::I420Scale( + static_cast(croppedLayout.y), croppedLayout.yStride, + static_cast(croppedLayout.cb), croppedLayout.cStride, + static_cast(croppedLayout.cr), croppedLayout.cStride, inputCrop.width, + inputCrop.height, static_cast(outLayout.y), outLayout.yStride, + static_cast(outLayout.cb), outLayout.cStride, + static_cast(outLayout.cr), outLayout.cStride, outSz.width, outSz.height, + // TODO: b/72261744 see if we can use better filter without losing too much perf + libyuv::FilterMode::kFilterNone); + + if (ret != 0) { + ALOGE("%s: failed to scale buffer from %dx%d to %dx%d. Ret %d", __FUNCTION__, + inputCrop.width, inputCrop.height, outSz.width, outSz.height, ret); + return ret; + } + + *out = outLayout; + mScaledYu12Frames.insert({outSz, scaledYu12Buf}); + return 0; +} + +int ExternalCameraDeviceSession::OutputThread::cropAndScaleThumbLocked( + std::shared_ptr& in, const Size& outSz, YCbCrLayout* out) { + Size inSz{in->mWidth, in->mHeight}; + + if ((outSz.width * outSz.height) > (mYu12ThumbFrame->mWidth * mYu12ThumbFrame->mHeight)) { + ALOGE("%s: Requested thumbnail size too big (%d,%d) > (%d,%d)", __FUNCTION__, outSz.width, + outSz.height, mYu12ThumbFrame->mWidth, mYu12ThumbFrame->mHeight); + return -1; + } + + int ret; + + /* This will crop-and-zoom the input YUV frame to the thumbnail size + * Based on the following logic: + * 1) Square pixels come in, square pixels come out, therefore single + * scale factor is computed to either make input bigger or smaller + * depending on if we are upscaling or downscaling + * 2) That single scale factor would either make height too tall or width + * too wide so we need to crop the input either horizontally or vertically + * but not both + */ + + /* Convert the input and output dimensions into floats for ease of math */ + float fWin = static_cast(inSz.width); + float fHin = static_cast(inSz.height); + float fWout = static_cast(outSz.width); + float fHout = static_cast(outSz.height); + + /* Compute the one scale factor from (1) above, it will be the smaller of + * the two possibilities. */ + float scaleFactor = std::min(fHin / fHout, fWin / fWout); + + /* Since we are crop-and-zooming (as opposed to letter/pillar boxing) we can + * simply multiply the output by our scaleFactor to get the cropped input + * size. Note that at least one of {fWcrop, fHcrop} is going to wind up + * being {fWin, fHin} respectively because fHout or fWout cancels out the + * scaleFactor calculation above. + * + * Specifically: + * if ( fHin / fHout ) < ( fWin / fWout ) we crop the sides off + * input, in which case + * scaleFactor = fHin / fHout + * fWcrop = fHin / fHout * fWout + * fHcrop = fHin + * + * Note that fWcrop <= fWin ( because ( fHin / fHout ) * fWout < fWin, which + * is just the inequality above with both sides multiplied by fWout + * + * on the other hand if ( fWin / fWout ) < ( fHin / fHout) we crop the top + * and the bottom off of input, and + * scaleFactor = fWin / fWout + * fWcrop = fWin + * fHCrop = fWin / fWout * fHout + */ + float fWcrop = scaleFactor * fWout; + float fHcrop = scaleFactor * fHout; + + /* Convert to integer and truncate to an even number */ + Size cropSz = {.width = 2 * static_cast(fWcrop / 2.0f), + .height = 2 * static_cast(fHcrop / 2.0f)}; + + /* Convert to a centered rectange with even top/left */ + IMapper::Rect inputCrop{.left = 2 * static_cast((inSz.width - cropSz.width) / 4), + .top = 2 * static_cast((inSz.height - cropSz.height) / 4), + .width = static_cast(cropSz.width), + .height = static_cast(cropSz.height)}; + + if ((inputCrop.top < 0) || (inputCrop.top >= static_cast(inSz.height)) || + (inputCrop.left < 0) || (inputCrop.left >= static_cast(inSz.width)) || + (inputCrop.width <= 0) || + (inputCrop.width + inputCrop.left > static_cast(inSz.width)) || + (inputCrop.height <= 0) || + (inputCrop.height + inputCrop.top > static_cast(inSz.height))) { + ALOGE("%s: came up with really wrong crop rectangle", __FUNCTION__); + ALOGE("%s: input layout %dx%d to for output size %dx%d", __FUNCTION__, inSz.width, + inSz.height, outSz.width, outSz.height); + ALOGE("%s: computed input crop +%d,+%d %dx%d", __FUNCTION__, inputCrop.left, inputCrop.top, + inputCrop.width, inputCrop.height); + return -1; + } + + YCbCrLayout inputLayout; + ret = in->getCroppedLayout(inputCrop, &inputLayout); + if (ret != 0) { + ALOGE("%s: failed to crop input layout %dx%d to for output size %dx%d", __FUNCTION__, + inSz.width, inSz.height, outSz.width, outSz.height); + ALOGE("%s: computed input crop +%d,+%d %dx%d", __FUNCTION__, inputCrop.left, inputCrop.top, + inputCrop.width, inputCrop.height); + return ret; + } + ALOGV("%s: crop input layout %dx%d to for output size %dx%d", __FUNCTION__, inSz.width, + inSz.height, outSz.width, outSz.height); + ALOGV("%s: computed input crop +%d,+%d %dx%d", __FUNCTION__, inputCrop.left, inputCrop.top, + inputCrop.width, inputCrop.height); + + // Scale + YCbCrLayout outFullLayout; + + ret = mYu12ThumbFrame->getLayout(&outFullLayout); + if (ret != 0) { + ALOGE("%s: failed to get output buffer layout", __FUNCTION__); + return ret; + } + + ret = libyuv::I420Scale(static_cast(inputLayout.y), inputLayout.yStride, + static_cast(inputLayout.cb), inputLayout.cStride, + static_cast(inputLayout.cr), inputLayout.cStride, + inputCrop.width, inputCrop.height, + static_cast(outFullLayout.y), outFullLayout.yStride, + static_cast(outFullLayout.cb), outFullLayout.cStride, + static_cast(outFullLayout.cr), outFullLayout.cStride, + outSz.width, outSz.height, libyuv::FilterMode::kFilterNone); + + if (ret != 0) { + ALOGE("%s: failed to scale buffer from %dx%d to %dx%d. Ret %d", __FUNCTION__, + inputCrop.width, inputCrop.height, outSz.width, outSz.height, ret); + return ret; + } + + *out = outFullLayout; + return 0; +} + +int ExternalCameraDeviceSession::OutputThread::createJpegLocked( + HalStreamBuffer& halBuf, const common::V1_0::helper::CameraMetadata& setting) { + ATRACE_CALL(); + int ret; + auto lfail = [&](auto... args) { + ALOGE(args...); + + return 1; + }; + auto parent = mParent.lock(); + if (parent == nullptr) { + ALOGE("%s: session has been disconnected!", __FUNCTION__); + return 1; + } + + ALOGV("%s: HAL buffer sid: %d bid: %" PRIu64 " w: %u h: %u", __FUNCTION__, halBuf.streamId, + static_cast(halBuf.bufferId), halBuf.width, halBuf.height); + ALOGV("%s: HAL buffer fmt: %x usage: %" PRIx64 " ptr: %p", __FUNCTION__, halBuf.format, + static_cast(halBuf.usage), halBuf.bufPtr); + ALOGV("%s: YV12 buffer %d x %d", __FUNCTION__, mYu12Frame->mWidth, mYu12Frame->mHeight); + + int jpegQuality, thumbQuality; + Size thumbSize; + bool outputThumbnail = true; + + if (setting.exists(ANDROID_JPEG_QUALITY)) { + camera_metadata_ro_entry entry = setting.find(ANDROID_JPEG_QUALITY); + jpegQuality = entry.data.u8[0]; + } else { + return lfail("%s: ANDROID_JPEG_QUALITY not set", __FUNCTION__); + } + + if (setting.exists(ANDROID_JPEG_THUMBNAIL_QUALITY)) { + camera_metadata_ro_entry entry = setting.find(ANDROID_JPEG_THUMBNAIL_QUALITY); + thumbQuality = entry.data.u8[0]; + } else { + return lfail("%s: ANDROID_JPEG_THUMBNAIL_QUALITY not set", __FUNCTION__); + } + + if (setting.exists(ANDROID_JPEG_THUMBNAIL_SIZE)) { + camera_metadata_ro_entry entry = setting.find(ANDROID_JPEG_THUMBNAIL_SIZE); + thumbSize = Size{.width = entry.data.i32[0], .height = entry.data.i32[1]}; + if (thumbSize.width == 0 && thumbSize.height == 0) { + outputThumbnail = false; + } + } else { + return lfail("%s: ANDROID_JPEG_THUMBNAIL_SIZE not set", __FUNCTION__); + } + + /* Cropped and scaled YU12 buffer for main and thumbnail */ + YCbCrLayout yu12Main; + Size jpegSize{halBuf.width, halBuf.height}; + + /* Compute temporary buffer sizes accounting for the following: + * thumbnail can't exceed APP1 size of 64K + * main image needs to hold APP1, headers, and at most a poorly + * compressed image */ + const ssize_t maxThumbCodeSize = 64 * 1024; + const ssize_t maxJpegCodeSize = + mBlobBufferSize == 0 ? parent->getJpegBufferSize(jpegSize.width, jpegSize.height) + : mBlobBufferSize; + + /* Check that getJpegBufferSize did not return an error */ + if (maxJpegCodeSize < 0) { + return lfail("%s: getJpegBufferSize returned %zd", __FUNCTION__, maxJpegCodeSize); + } + + /* Hold actual thumbnail and main image code sizes */ + size_t thumbCodeSize = 0, jpegCodeSize = 0; + /* Temporary thumbnail code buffer */ + std::vector thumbCode(outputThumbnail ? maxThumbCodeSize : 0); + + YCbCrLayout yu12Thumb; + if (outputThumbnail) { + ret = cropAndScaleThumbLocked(mYu12Frame, thumbSize, &yu12Thumb); + + if (ret != 0) { + return lfail("%s: crop and scale thumbnail failed!", __FUNCTION__); + } + } + + /* Scale and crop main jpeg */ + ret = cropAndScaleLocked(mYu12Frame, jpegSize, &yu12Main); + + if (ret != 0) { + return lfail("%s: crop and scale main failed!", __FUNCTION__); + } + + /* Encode the thumbnail image */ + if (outputThumbnail) { + ret = encodeJpegYU12(thumbSize, yu12Thumb, thumbQuality, 0, 0, &thumbCode[0], + maxThumbCodeSize, thumbCodeSize); + + if (ret != 0) { + return lfail("%s: thumbnail encodeJpegYU12 failed with %d", __FUNCTION__, ret); + } + } + + /* Combine camera characteristics with request settings to form EXIF + * metadata */ + common::V1_0::helper::CameraMetadata meta(mCameraCharacteristics); + meta.append(setting); + + /* Generate EXIF object */ + std::unique_ptr utils(ExifUtils::create()); + /* Make sure it's initialized */ + utils->initialize(); + + utils->setFromMetadata(meta, jpegSize.width, jpegSize.height); + utils->setMake(mExifMake); + utils->setModel(mExifModel); + + ret = utils->generateApp1(outputThumbnail ? &thumbCode[0] : nullptr, thumbCodeSize); + + if (!ret) { + return lfail("%s: generating APP1 failed", __FUNCTION__); + } + + /* Get internal buffer */ + size_t exifDataSize = utils->getApp1Length(); + const uint8_t* exifData = utils->getApp1Buffer(); + + /* Lock the HAL jpeg code buffer */ + void* bufPtr = sHandleImporter.lock(*(halBuf.bufPtr), static_cast(halBuf.usage), + maxJpegCodeSize); + + if (!bufPtr) { + return lfail("%s: could not lock %zu bytes", __FUNCTION__, maxJpegCodeSize); + } + + /* Encode the main jpeg image */ + ret = encodeJpegYU12(jpegSize, yu12Main, jpegQuality, exifData, exifDataSize, bufPtr, + maxJpegCodeSize, jpegCodeSize); + + /* TODO: Not sure this belongs here, maybe better to pass jpegCodeSize out + * and do this when returning buffer to parent */ + CameraBlob blob{CameraBlobId::JPEG, static_cast(jpegCodeSize)}; + void* blobDst = reinterpret_cast(reinterpret_cast(bufPtr) + maxJpegCodeSize - + sizeof(CameraBlob)); + memcpy(blobDst, &blob, sizeof(CameraBlob)); + + /* Unlock the HAL jpeg code buffer */ + int relFence = sHandleImporter.unlock(*(halBuf.bufPtr)); + if (relFence >= 0) { + halBuf.acquireFence = relFence; + } + + /* Check if our JPEG actually succeeded */ + if (ret != 0) { + return lfail("%s: encodeJpegYU12 failed with %d", __FUNCTION__, ret); + } + + ALOGV("%s: encoded JPEG (ret:%d) with Q:%d max size: %zu", __FUNCTION__, ret, jpegQuality, + maxJpegCodeSize); + + return 0; +} + +void ExternalCameraDeviceSession::OutputThread::clearIntermediateBuffers() { + std::lock_guard lk(mBufferLock); + mYu12Frame.reset(); + mYu12ThumbFrame.reset(); + mIntermediateBuffers.clear(); + mMuteTestPatternFrame.clear(); + mBlobBufferSize = 0; +} + +bool ExternalCameraDeviceSession::OutputThread::threadLoop() { + std::shared_ptr req; + auto parent = mParent.lock(); + if (parent == nullptr) { + ALOGE("%s: session has been disconnected!", __FUNCTION__); + return false; + } + + // TODO: maybe we need to setup a sensor thread to dq/enq v4l frames + // regularly to prevent v4l buffer queue filled with stale buffers + // when app doesn't program a preview request + waitForNextRequest(&req); + if (req == nullptr) { + // No new request, wait again + return true; + } + + auto onDeviceError = [&](auto... args) { + ALOGE(args...); + parent->notifyError(req->frameNumber, /*stream*/ -1, ErrorCode::ERROR_DEVICE); + signalRequestDone(); + return false; + }; + + if (req->frameIn->mFourcc != V4L2_PIX_FMT_MJPEG && req->frameIn->mFourcc != V4L2_PIX_FMT_Z16) { + return onDeviceError("%s: do not support V4L2 format %c%c%c%c", __FUNCTION__, + req->frameIn->mFourcc & 0xFF, (req->frameIn->mFourcc >> 8) & 0xFF, + (req->frameIn->mFourcc >> 16) & 0xFF, + (req->frameIn->mFourcc >> 24) & 0xFF); + } + + int res = requestBufferStart(req->buffers); + if (res != 0) { + ALOGE("%s: send BufferRequest failed! res %d", __FUNCTION__, res); + return onDeviceError("%s: failed to send buffer request!", __FUNCTION__); + } + + std::unique_lock lk(mBufferLock); + // Convert input V4L2 frame to YU12 of the same size + // TODO: see if we can save some computation by converting to YV12 here + uint8_t* inData; + size_t inDataSize; + if (req->frameIn->getData(&inData, &inDataSize) != 0) { + lk.unlock(); + return onDeviceError("%s: V4L2 buffer map failed", __FUNCTION__); + } + + // Process camera mute state + auto testPatternMode = req->setting.find(ANDROID_SENSOR_TEST_PATTERN_MODE); + if (testPatternMode.count == 1) { + if (mCameraMuted != (testPatternMode.data.u8[0] != ANDROID_SENSOR_TEST_PATTERN_MODE_OFF)) { + mCameraMuted = !mCameraMuted; + // Get solid color for test pattern, if any was set + if (testPatternMode.data.u8[0] == ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR) { + auto entry = req->setting.find(ANDROID_SENSOR_TEST_PATTERN_DATA); + if (entry.count == 4) { + // Update the mute frame if the pattern color has changed + if (memcmp(entry.data.i32, mTestPatternData, sizeof(mTestPatternData)) != 0) { + memcpy(mTestPatternData, entry.data.i32, sizeof(mTestPatternData)); + // Fill the mute frame with the solid color, use only 8 MSB of RGGB as RGB + for (int i = 0; i < mMuteTestPatternFrame.size(); i += 3) { + mMuteTestPatternFrame[i] = entry.data.i32[0] >> 24; + mMuteTestPatternFrame[i + 1] = entry.data.i32[1] >> 24; + mMuteTestPatternFrame[i + 2] = entry.data.i32[3] >> 24; + } + } + } + } + } + } + + // TODO: in some special case maybe we can decode jpg directly to gralloc output? + if (req->frameIn->mFourcc == V4L2_PIX_FMT_MJPEG) { + ATRACE_BEGIN("MJPGtoI420"); + res = 0; + if (mCameraMuted) { + res = libyuv::ConvertToI420( + mMuteTestPatternFrame.data(), mMuteTestPatternFrame.size(), + static_cast(mYu12FrameLayout.y), mYu12FrameLayout.yStride, + static_cast(mYu12FrameLayout.cb), mYu12FrameLayout.cStride, + static_cast(mYu12FrameLayout.cr), mYu12FrameLayout.cStride, 0, 0, + mYu12Frame->mWidth, mYu12Frame->mHeight, mYu12Frame->mWidth, + mYu12Frame->mHeight, libyuv::kRotate0, libyuv::FOURCC_RAW); + } else { + res = libyuv::MJPGToI420( + inData, inDataSize, static_cast(mYu12FrameLayout.y), + mYu12FrameLayout.yStride, static_cast(mYu12FrameLayout.cb), + mYu12FrameLayout.cStride, static_cast(mYu12FrameLayout.cr), + mYu12FrameLayout.cStride, mYu12Frame->mWidth, mYu12Frame->mHeight, + mYu12Frame->mWidth, mYu12Frame->mHeight); + } + ATRACE_END(); + + if (res != 0) { + // For some webcam, the first few V4L2 frames might be malformed... + ALOGE("%s: Convert V4L2 frame to YU12 failed! res %d", __FUNCTION__, res); + lk.unlock(); + Status st = parent->processCaptureRequestError(req); + if (st != Status::OK) { + return onDeviceError("%s: failed to process capture request error!", __FUNCTION__); + } + signalRequestDone(); + return true; + } + } + + ATRACE_BEGIN("Wait for BufferRequest done"); + res = waitForBufferRequestDone(&req->buffers); + ATRACE_END(); + + if (res != 0) { + ALOGE("%s: wait for BufferRequest done failed! res %d", __FUNCTION__, res); + lk.unlock(); + return onDeviceError("%s: failed to process buffer request error!", __FUNCTION__); + } + + ALOGV("%s processing new request", __FUNCTION__); + const int kSyncWaitTimeoutMs = 500; + for (auto& halBuf : req->buffers) { + if (*(halBuf.bufPtr) == nullptr) { + ALOGW("%s: buffer for stream %d missing", __FUNCTION__, halBuf.streamId); + halBuf.fenceTimeout = true; + } else if (halBuf.acquireFence >= 0) { + int ret = sync_wait(halBuf.acquireFence, kSyncWaitTimeoutMs); + if (ret) { + halBuf.fenceTimeout = true; + } else { + ::close(halBuf.acquireFence); + halBuf.acquireFence = -1; + } + } + + if (halBuf.fenceTimeout) { + continue; + } + + // Gralloc lockYCbCr the buffer + switch (halBuf.format) { + case PixelFormat::BLOB: { + int ret = createJpegLocked(halBuf, req->setting); + + if (ret != 0) { + lk.unlock(); + return onDeviceError("%s: createJpegLocked failed with %d", __FUNCTION__, ret); + } + } break; + case PixelFormat::Y16: { + void* outLayout = sHandleImporter.lock( + *(halBuf.bufPtr), static_cast(halBuf.usage), inDataSize); + + std::memcpy(outLayout, inData, inDataSize); + + int relFence = sHandleImporter.unlock(*(halBuf.bufPtr)); + if (relFence >= 0) { + halBuf.acquireFence = relFence; + } + } break; + case PixelFormat::YCBCR_420_888: + case PixelFormat::YV12: { + IMapper::Rect outRect{0, 0, static_cast(halBuf.width), + static_cast(halBuf.height)}; + YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, + outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, + outLayout.chromaStep); + + // Convert to output buffer size/format + uint32_t outputFourcc = getFourCcFromLayout(outLayout); + ALOGV("%s: converting to format %c%c%c%c", __FUNCTION__, outputFourcc & 0xFF, + (outputFourcc >> 8) & 0xFF, (outputFourcc >> 16) & 0xFF, + (outputFourcc >> 24) & 0xFF); + + YCbCrLayout cropAndScaled; + ATRACE_BEGIN("cropAndScaleLocked"); + int ret = cropAndScaleLocked(mYu12Frame, Size{halBuf.width, halBuf.height}, + &cropAndScaled); + ATRACE_END(); + if (ret != 0) { + lk.unlock(); + return onDeviceError("%s: crop and scale failed!", __FUNCTION__); + } + + Size sz{halBuf.width, halBuf.height}; + ATRACE_BEGIN("formatConvert"); + ret = formatConvert(cropAndScaled, outLayout, sz, outputFourcc); + ATRACE_END(); + if (ret != 0) { + lk.unlock(); + return onDeviceError("%s: format conversion failed!", __FUNCTION__); + } + int relFence = sHandleImporter.unlock(*(halBuf.bufPtr)); + if (relFence >= 0) { + halBuf.acquireFence = relFence; + } + } break; + default: + lk.unlock(); + return onDeviceError("%s: unknown output format %x", __FUNCTION__, halBuf.format); + } + } // for each buffer + mScaledYu12Frames.clear(); + + // Don't hold the lock while calling back to parent + lk.unlock(); + Status st = parent->processCaptureResult(req); + if (st != Status::OK) { + return onDeviceError("%s: failed to process capture result!", __FUNCTION__); + } + signalRequestDone(); + return true; +} + +// End ExternalCameraDeviceSession::OutputThread functions + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h new file mode 100644 index 0000000000..e7eb799da2 --- /dev/null +++ b/camera/device/default/ExternalCameraDeviceSession.h @@ -0,0 +1,398 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERADEVICESESSION_H_ +#define HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERADEVICESESSION_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace device { +namespace implementation { + +using ::aidl::android::hardware::camera::common::Status; +using ::aidl::android::hardware::camera::device::BnCameraDeviceSession; +using ::aidl::android::hardware::camera::device::BufferCache; +using ::aidl::android::hardware::camera::device::BufferRequest; +using ::aidl::android::hardware::camera::device::CameraMetadata; +using ::aidl::android::hardware::camera::device::CameraOfflineSessionInfo; +using ::aidl::android::hardware::camera::device::CaptureRequest; +using ::aidl::android::hardware::camera::device::HalStream; +using ::aidl::android::hardware::camera::device::ICameraDeviceCallback; +using ::aidl::android::hardware::camera::device::ICameraOfflineSession; +using ::aidl::android::hardware::camera::device::RequestTemplate; +using ::aidl::android::hardware::camera::device::Stream; +using ::aidl::android::hardware::camera::device::StreamConfiguration; +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; +using ::android::base::unique_fd; +using ::android::hardware::camera::common::helper::SimpleThread; +using ::android::hardware::camera::external::common::ExternalCameraConfig; +using ::android::hardware::camera::external::common::SizeHasher; +using ::ndk::ScopedAStatus; + +class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputThreadInterface { + public: + ExternalCameraDeviceSession(const std::shared_ptr&, + const ExternalCameraConfig& cfg, + const std::vector& sortedFormats, + const CroppingType& croppingType, + const common::V1_0::helper::CameraMetadata& chars, + const std::string& cameraId, unique_fd v4l2Fd); + ~ExternalCameraDeviceSession() override; + + // Caller must use this method to check if CameraDeviceSession ctor failed + bool isInitFailed(); + bool isClosed(); + + ScopedAStatus close() override; + + ScopedAStatus configureStreams(const StreamConfiguration& in_requestedConfiguration, + std::vector* _aidl_return) override; + ScopedAStatus constructDefaultRequestSettings(RequestTemplate in_type, + CameraMetadata* _aidl_return) override; + ScopedAStatus flush() override; + ScopedAStatus getCaptureRequestMetadataQueue( + MQDescriptor* _aidl_return) override; + ScopedAStatus getCaptureResultMetadataQueue( + MQDescriptor* _aidl_return) override; + ScopedAStatus isReconfigurationRequired(const CameraMetadata& in_oldSessionParams, + const CameraMetadata& in_newSessionParams, + bool* _aidl_return) override; + ScopedAStatus processCaptureRequest(const std::vector& in_requests, + const std::vector& in_cachesToRemove, + int32_t* _aidl_return) override; + ScopedAStatus signalStreamFlush(const std::vector& in_streamIds, + int32_t in_streamConfigCounter) override; + ScopedAStatus switchToOffline(const std::vector& in_streamsToKeep, + CameraOfflineSessionInfo* out_offlineSessionInfo, + std::shared_ptr* _aidl_return) override; + ScopedAStatus repeatingRequestEnd(int32_t in_frameNumber, + const std::vector& in_streamIds) override; + + Status importBuffer(int32_t streamId, uint64_t bufId, buffer_handle_t buf, + buffer_handle_t** outBufPtr) override; + + void notifyError(int32_t frameNumber, int32_t streamId, ErrorCode ec) override; + + Status processCaptureRequestError(const std::shared_ptr& ptr, + std::vector* msgs, + std::vector* results) override; + + Status processCaptureResult(std::shared_ptr& ptr) override; + ssize_t getJpegBufferSize(int32_t width, int32_t height) const override; + + // Called by CameraDevice to dump active device states + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + + static Status isStreamCombinationSupported( + const StreamConfiguration& config, + const std::vector& supportedFormats, + const ExternalCameraConfig& devCfg); + + static const int kMaxProcessedStream = 2; + static const int kMaxStallStream = 1; + static const uint32_t kMaxBytesPerPixel = 2; + + class BufferRequestThread : public SimpleThread { + public: + BufferRequestThread(std::weak_ptr parent, + std::shared_ptr callbacks); + + int requestBufferStart(const std::vector&); + int waitForBufferRequestDone( + /*out*/ std::vector*); + + bool threadLoop() override; + + private: + void waitForNextRequest(); + + const std::weak_ptr mParent; + const std::shared_ptr mCallbacks; + + std::mutex mLock; + bool mRequestingBuffer = false; + + std::vector mBufferReqs; + std::vector mPendingReturnBufferReqs; + // mHalBufferReqs is not under mLock protection during the HIDL transaction + std::vector mHalBufferReqs; + + // request buffers takes much less time in steady state, but can take much longer + // when requesting 1st buffer from a stream. + // TODO: consider a separate timeout for new vs. steady state? + // TODO: or make sure framework is warming up the pipeline during configure new stream? + static const int kReqProcTimeoutMs = 66; + + static const int kReqWaitTimeoutMs = 33; + static const int kReqWaitTimesWarn = 90; // 33ms * 90 ~= 3 sec + std::condition_variable mRequestCond; // signaled when a new buffer request incoming + std::condition_variable mRequestDoneCond; // signaled when a request is done + }; + + class OutputThread : public SimpleThread { + public: + OutputThread(std::weak_ptr parent, CroppingType, + const common::V1_0::helper::CameraMetadata&, + std::shared_ptr bufReqThread); + ~OutputThread(); + + Status allocateIntermediateBuffers(const Size& v4lSize, const Size& thumbSize, + const std::vector& streams, + uint32_t blobBufferSize); + Status submitRequest(const std::shared_ptr&); + void flush(); + void dump(int fd); + bool threadLoop() override; + + void setExifMakeModel(const std::string& make, const std::string& model); + + // The remaining request list is returned for offline processing + std::list> switchToOffline(); + + protected: + static const int kFlushWaitTimeoutSec = 3; // 3 sec + static const int kReqWaitTimeoutMs = 33; // 33ms + static const int kReqWaitTimesMax = 90; // 33ms * 90 ~= 3 sec + + // Methods to request output buffer in parallel + int requestBufferStart(const std::vector&); + int waitForBufferRequestDone( + /*out*/ std::vector*); + + void waitForNextRequest(std::shared_ptr* out); + void signalRequestDone(); + + int cropAndScaleLocked(std::shared_ptr& in, const Size& outSize, + YCbCrLayout* out); + + int cropAndScaleThumbLocked(std::shared_ptr& in, const Size& outSize, + YCbCrLayout* out); + + int createJpegLocked(HalStreamBuffer& halBuf, + const common::V1_0::helper::CameraMetadata& settings); + + void clearIntermediateBuffers(); + + const std::weak_ptr mParent; + const CroppingType mCroppingType; + const common::V1_0::helper::CameraMetadata mCameraCharacteristics; + + mutable std::mutex mRequestListLock; // Protect access to mRequestList, + // mProcessingRequest and mProcessingFrameNumber + std::condition_variable mRequestCond; // signaled when a new request is submitted + std::condition_variable mRequestDoneCond; // signaled when a request is done processing + std::list> mRequestList; + bool mProcessingRequest = false; + uint32_t mProcessingFrameNumber = 0; + + // V4L2 frameIn + // (MJPG decode)-> mYu12Frame + // (Scale)-> mScaledYu12Frames + // (Format convert) -> output gralloc frames + mutable std::mutex mBufferLock; // Protect access to intermediate buffers + std::shared_ptr mYu12Frame; + std::shared_ptr mYu12ThumbFrame; + std::unordered_map, SizeHasher> mIntermediateBuffers; + std::unordered_map, SizeHasher> mScaledYu12Frames; + YCbCrLayout mYu12FrameLayout; + YCbCrLayout mYu12ThumbFrameLayout; + std::vector mMuteTestPatternFrame; + uint32_t mTestPatternData[4] = {0, 0, 0, 0}; + bool mCameraMuted = false; + uint32_t mBlobBufferSize = 0; // 0 -> HAL derive buffer size, else: use given size + + std::string mExifMake; + std::string mExifModel; + + const std::shared_ptr mBufferRequestThread; + }; + + private: + bool initialize(); + // To init/close different version of output thread + void initOutputThread(); + void closeOutputThread(); + void closeOutputThreadImpl(); + + void close(bool callerIsDtor); + Status initStatus() const; + status_t initDefaultRequests(); + + status_t fillCaptureResult(common::V1_0::helper::CameraMetadata& md, nsecs_t timestamp); + int configureV4l2StreamLocked(const SupportedV4L2Format& fmt, double fps = 0.0); + int v4l2StreamOffLocked(); + + int setV4l2FpsLocked(double fps); + + std::unique_ptr dequeueV4l2FrameLocked( + /*out*/ nsecs_t* shutterTs); // Called with mLock held + + void enqueueV4l2Frame(const std::shared_ptr&); + + // Check if input Stream is one of supported stream setting on this device + static bool isSupported(const Stream& stream, + const std::vector& supportedFormats, + const ExternalCameraConfig& cfg); + + // Validate and import request's output buffers and acquire fence + Status importRequestLocked(const CaptureRequest& request, + std::vector& allBufPtrs, + std::vector& allFences); + + Status importRequestLockedImpl(const CaptureRequest& request, + std::vector& allBufPtrs, + std::vector& allFences); + + Status importBufferLocked(int32_t streamId, uint64_t bufId, buffer_handle_t buf, + /*out*/ buffer_handle_t** outBufPtr); + static void cleanupInflightFences(std::vector& allFences, size_t numFences); + void cleanupBuffersLocked(int id); + + void updateBufferCaches(const std::vector& cachesToRemove); + + Status processOneCaptureRequest(const CaptureRequest& request); + void notifyShutter(int32_t frameNumber, nsecs_t shutterTs); + + void invokeProcessCaptureResultCallback(std::vector& results, bool tryWriteFmq); + Size getMaxJpegResolution() const; + + Size getMaxThumbResolution() const; + + int waitForV4L2BufferReturnLocked(std::unique_lock& lk); + + // Main body of switchToOffline. This method does not invoke any callbacks + // but instead returns the necessary callbacks in output arguments so callers + // can callback later without holding any locks + Status switchToOffline(const std::vector& offlineStreams, + /*out*/ std::vector* msgs, + /*out*/ std::vector* results, + /*out*/ CameraOfflineSessionInfo* info, + /*out*/ std::shared_ptr* session); + + bool supportOfflineLocked(int32_t streamId); + + // Whether a request can be completely dropped when switching to offline + bool canDropRequest(const std::vector& offlineStreams, + std::shared_ptr halReq); + + void fillOfflineSessionInfo(const std::vector& offlineStreams, + std::deque>& offlineReqs, + const std::map& circulatingBuffers, + /*out*/ CameraOfflineSessionInfo* info); + + // Protect (most of) HIDL interface methods from synchronized-entering + mutable Mutex mInterfaceLock; + + mutable Mutex mLock; // Protect all private members except otherwise noted + const std::shared_ptr mCallback; + const ExternalCameraConfig& mCfg; + const common::V1_0::helper::CameraMetadata mCameraCharacteristics; + const std::vector mSupportedFormats; + const CroppingType mCroppingType; + const std::string mCameraId; + + // Not protected by mLock, this is almost a const. + // Setup in constructor, reset in close() after OutputThread is joined + unique_fd mV4l2Fd; + + // device is closed either + // - closed by user + // - init failed + // - camera disconnected + bool mClosed = false; + bool mInitialized = false; + bool mInitFail = false; + bool mFirstRequest = false; + common::V1_0::helper::CameraMetadata mLatestReqSetting; + + bool mV4l2Streaming = false; + SupportedV4L2Format mV4l2StreamingFmt; + double mV4l2StreamingFps = 0.0; + size_t mV4L2BufferCount = 0; + + static const int kBufferWaitTimeoutSec = 3; // TODO: handle long exposure (or not allowing) + std::mutex mV4l2BufferLock; // protect the buffer count and condition below + std::condition_variable mV4L2BufferReturned; + size_t mNumDequeuedV4l2Buffers = 0; + uint32_t mMaxV4L2BufferSize = 0; + + // Not protected by mLock (but might be used when mLock is locked) + std::shared_ptr mOutputThread; + + // Stream ID -> Stream cache + std::unordered_map mStreamMap; + + std::mutex mInflightFramesLock; // protect mInflightFrames + std::unordered_set mInflightFrames; + + // Stream ID -> circulating buffers map + std::map mCirculatingBuffers; + // Protect mCirculatingBuffers, must not lock mLock after acquiring this lock + mutable Mutex mCbsLock; + + std::mutex mAfTriggerLock; // protect mAfTrigger + bool mAfTrigger = false; + + uint32_t mBlobBufferSize = 0; + + static HandleImporter sHandleImporter; + + std::shared_ptr mBufferRequestThread; + + /* Beginning of members not changed after initialize() */ + using RequestMetadataQueue = AidlMessageQueue; + std::unique_ptr mRequestMetadataQueue; + using ResultMetadataQueue = AidlMessageQueue; + std::shared_ptr mResultMetadataQueue; + + // Protect against invokeProcessCaptureResultCallback() + Mutex mProcessCaptureResultLock; + + // tracks last seen stream config counter + int32_t mLastStreamConfigCounter = -1; + + std::unordered_map mDefaultRequests; + + const Size mMaxThumbResolution; + const Size mMaxJpegResolution; + + std::string mExifMake; + std::string mExifModel; + /* End of members not changed after initialize() */ +}; + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERADEVICESESSION_H_ diff --git a/camera/device/default/ExternalCameraOfflineSession.cpp b/camera/device/default/ExternalCameraOfflineSession.cpp new file mode 100644 index 0000000000..4c7f732f87 --- /dev/null +++ b/camera/device/default/ExternalCameraOfflineSession.cpp @@ -0,0 +1,547 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "ExtCamOfflnSsn" +#include + +#include "ExternalCameraOfflineSession.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define HAVE_JPEG // required for libyuv.h to export MJPEG decode APIs +#include + +namespace { + +// Size of request/result metadata fast message queue. Change to 0 to always use hwbinder buffer. +constexpr size_t kMetadataMsgQueueSize = 1 << 18 /* 256kB */; + +} // anonymous namespace + +namespace android { +namespace hardware { +namespace camera { +namespace device { +namespace implementation { + +using ::aidl::android::hardware::camera::device::BufferStatus; +using ::aidl::android::hardware::camera::device::ErrorMsg; +using ::aidl::android::hardware::camera::device::ShutterMsg; +using ::aidl::android::hardware::camera::device::StreamBuffer; + +// Static instance +HandleImporter ExternalCameraOfflineSession::sHandleImporter; + +ExternalCameraOfflineSession::ExternalCameraOfflineSession( + const CroppingType& croppingType, const common::V1_0::helper::CameraMetadata& chars, + const std::string& cameraId, const std::string& exifMake, const std::string& exifModel, + uint32_t blobBufferSize, bool afTrigger, const std::vector& offlineStreams, + std::deque>& offlineReqs, + const std::map& circulatingBuffers) + : mCroppingType(croppingType), + mChars(chars), + mCameraId(cameraId), + mExifMake(exifMake), + mExifModel(exifModel), + mBlobBufferSize(blobBufferSize), + mAfTrigger(afTrigger), + mOfflineStreams(offlineStreams), + mOfflineReqs(offlineReqs), + mCirculatingBuffers(circulatingBuffers) {} + +ExternalCameraOfflineSession::~ExternalCameraOfflineSession() { + close(); +} + +bool ExternalCameraOfflineSession::initialize() { + mResultMetadataQueue = + std::make_shared(kMetadataMsgQueueSize, false /* non blocking */); + if (!mResultMetadataQueue->isValid()) { + ALOGE("%s: invalid result fmq", __FUNCTION__); + return true; + } + return false; +} + +Status ExternalCameraOfflineSession::importBuffer(int32_t streamId, uint64_t bufId, + buffer_handle_t buf, + buffer_handle_t** outBufPtr) { + Mutex::Autolock _l(mCbsLock); + return importBufferImpl(mCirculatingBuffers, sHandleImporter, streamId, bufId, buf, outBufPtr); +} + +Status ExternalCameraOfflineSession::processCaptureResult(std::shared_ptr& req) { + ATRACE_CALL(); + // Fill output buffers + std::vector results; + results.resize(1); + CaptureResult& result = results[0]; + result.frameNumber = req->frameNumber; + result.partialResult = 1; + result.inputBuffer.streamId = -1; + result.outputBuffers.resize(req->buffers.size()); + for (size_t i = 0; i < req->buffers.size(); i++) { + StreamBuffer& outputBuffer = result.outputBuffers[i]; + outputBuffer.streamId = req->buffers[i].streamId; + outputBuffer.bufferId = req->buffers[i].bufferId; + if (req->buffers[i].fenceTimeout) { + outputBuffer.status = BufferStatus::ERROR; + if (req->buffers[i].acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = req->buffers[i].acquireFence; + result.outputBuffers[i].releaseFence = android::makeToAidl(handle); + } + notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER); + } else { + result.outputBuffers[i].status = BufferStatus::OK; + // TODO: refactor + if (req->buffers[i].acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = req->buffers[i].acquireFence; + outputBuffer.releaseFence = android::makeToAidl(handle); + } + } + } + + // Fill capture result metadata + fillCaptureResult(req->setting, req->shutterTs); + const camera_metadata_t* rawResult = req->setting.getAndLock(); + convertToAidl(rawResult, &result.result); + req->setting.unlock(rawResult); + + // Callback into framework + invokeProcessCaptureResultCallback(results, /* tryWriteFmq */ true); + freeReleaseFences(results); + return Status::OK; +} + +#define UPDATE(md, tag, data, size) \ + do { \ + if ((md).update((tag), (data), (size))) { \ + ALOGE("Update " #tag " failed!"); \ + return BAD_VALUE; \ + } \ + } while (0) + +status_t ExternalCameraOfflineSession::fillCaptureResult(common::V1_0::helper::CameraMetadata md, + nsecs_t timestamp) { + bool afTrigger = false; + { + std::lock_guard lk(mAfTriggerLock); + afTrigger = mAfTrigger; + if (md.exists(ANDROID_CONTROL_AF_TRIGGER)) { + camera_metadata_entry entry = md.find(ANDROID_CONTROL_AF_TRIGGER); + if (entry.data.u8[0] == ANDROID_CONTROL_AF_TRIGGER_START) { + mAfTrigger = afTrigger = true; + } else if (entry.data.u8[0] == ANDROID_CONTROL_AF_TRIGGER_CANCEL) { + mAfTrigger = afTrigger = false; + } + } + } + + // For USB camera, the USB camera handles everything and we don't have control + // over AF. We only simply fake the AF metadata based on the request + // received here. + uint8_t afState; + if (afTrigger) { + afState = ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED; + } else { + afState = ANDROID_CONTROL_AF_STATE_INACTIVE; + } + UPDATE(md, ANDROID_CONTROL_AF_STATE, &afState, 1); + + camera_metadata_ro_entry activeArraySize = mChars.find(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE); + + return fillCaptureResultCommon(md, timestamp, activeArraySize); +} +void ExternalCameraOfflineSession::invokeProcessCaptureResultCallback( + std::vector& results, bool tryWriteFmq) { + if (mProcessCaptureResultLock.tryLock() != OK) { + const nsecs_t NS_TO_SECOND = 1E9; + ALOGV("%s: previous call is not finished! waiting 1s...", __FUNCTION__); + if (mProcessCaptureResultLock.timedLock(/* 1s */ NS_TO_SECOND) != OK) { + ALOGE("%s: cannot acquire lock in 1s, cannot proceed", __FUNCTION__); + return; + } + } + if (tryWriteFmq && mResultMetadataQueue->availableToWrite() > 0) { + for (CaptureResult& result : results) { + if (!result.result.metadata.empty()) { + if (mResultMetadataQueue->write( + reinterpret_cast(result.result.metadata.data()), + result.result.metadata.size())) { + result.fmqResultSize = result.result.metadata.size(); + result.result.metadata.clear(); + } else { + ALOGW("%s: couldn't utilize fmq, fall back to hwbinder", __FUNCTION__); + result.fmqResultSize = 0; + } + } else { + result.fmqResultSize = 0; + } + } + } + auto status = mCallback->processCaptureResult(results); + if (!status.isOk()) { + ALOGE("%s: processCaptureResult ERROR : %d:%d", __FUNCTION__, status.getExceptionCode(), + status.getServiceSpecificError()); + } + + mProcessCaptureResultLock.unlock(); +} + +Status ExternalCameraOfflineSession::processCaptureRequestError( + const std::shared_ptr& req, std::vector* outMsgs, + std::vector* outResults) { + ATRACE_CALL(); + + if (outMsgs == nullptr) { + notifyError(/*frameNum*/ req->frameNumber, /*stream*/ -1, ErrorCode::ERROR_REQUEST); + } else { + NotifyMsg shutter; + shutter.set(ShutterMsg{ + .frameNumber = req->frameNumber, + .timestamp = req->shutterTs, + }); + + NotifyMsg error; + error.set(ErrorMsg{.frameNumber = req->frameNumber, + .errorStreamId = -1, + .errorCode = ErrorCode::ERROR_REQUEST}); + outMsgs->push_back(shutter); + outMsgs->push_back(error); + } + + // Fill output buffers + CaptureResult result; + result.frameNumber = req->frameNumber; + result.partialResult = 1; + result.inputBuffer.streamId = -1; + result.outputBuffers.resize(req->buffers.size()); + for (size_t i = 0; i < req->buffers.size(); i++) { + StreamBuffer& outputBuffer = result.outputBuffers[i]; + outputBuffer.streamId = req->buffers[i].streamId; + outputBuffer.bufferId = req->buffers[i].bufferId; + outputBuffer.status = BufferStatus::ERROR; + if (req->buffers[i].acquireFence >= 0) { + native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0); + handle->data[0] = req->buffers[i].acquireFence; + outputBuffer.releaseFence = makeToAidl(handle); + } + } + + if (outResults == nullptr) { + // Callback into framework + std::vector results(1); + results[0] = std::move(result); + invokeProcessCaptureResultCallback(results, /* tryWriteFmq */ true); + freeReleaseFences(results); + } else { + outResults->push_back(std::move(result)); + } + return Status::OK; +} + +ssize_t ExternalCameraOfflineSession::getJpegBufferSize(int32_t, int32_t) const { + // Empty implementation here as the jpeg buffer size is passed in by ctor + return 0; +} + +void ExternalCameraOfflineSession::notifyError(int32_t frameNumber, int32_t streamId, + ErrorCode ec) { + NotifyMsg msg; + msg.set( + ErrorMsg{.frameNumber = frameNumber, .errorStreamId = streamId, .errorCode = ec}); + mCallback->notify({msg}); +} + +ScopedAStatus ExternalCameraOfflineSession::setCallback( + const std::shared_ptr& in_cb) { + Mutex::Autolock _il(mInterfaceLock); + if (mCallback != nullptr && in_cb != nullptr) { + ALOGE("%s: callback must not be set twice!", __FUNCTION__); + return fromStatus(Status::OK); + } + mCallback = in_cb; + + initOutputThread(); + + if (mOutputThread == nullptr) { + ALOGE("%s: init OutputThread failed!", __FUNCTION__); + } + return fromStatus(Status::OK); +} +void ExternalCameraOfflineSession::initOutputThread() { + if (mOutputThread != nullptr) { + ALOGE("%s: OutputThread already exist!", __FUNCTION__); + return; + } + + // Grab a shared_ptr to 'this' from ndk::SharedRefBase::ref() + std::shared_ptr thiz = ref(); + + mBufferRequestThread = std::make_shared( + /*parent=*/thiz, mCallback); + mBufferRequestThread->run(); + + mOutputThread = std::make_shared(/*parent=*/thiz, mCroppingType, mChars, + mBufferRequestThread, mOfflineReqs); + + mOutputThread->setExifMakeModel(mExifMake, mExifModel); + + Size inputSize = {mOfflineReqs[0]->frameIn->mWidth, mOfflineReqs[0]->frameIn->mHeight}; + Size maxThumbSize = getMaxThumbnailResolution(mChars); + mOutputThread->allocateIntermediateBuffers(inputSize, maxThumbSize, mOfflineStreams, + mBlobBufferSize); + + mOutputThread->run(); +} + +ScopedAStatus ExternalCameraOfflineSession::getCaptureResultMetadataQueue( + MQDescriptor* _aidl_return) { + Mutex::Autolock _il(mInterfaceLock); + *_aidl_return = mResultMetadataQueue->dupeDesc(); + return fromStatus(Status::OK); +} + +ScopedAStatus ExternalCameraOfflineSession::close() { + Mutex::Autolock _il(mInterfaceLock); + { + Mutex::Autolock _l(mLock); + if (mClosed) { + ALOGW("%s: offline session already closed!", __FUNCTION__); + return fromStatus(Status::OK); + } + } + if (mBufferRequestThread != nullptr) { + mBufferRequestThread->requestExitAndWait(); + mBufferRequestThread.reset(); + } + if (mOutputThread) { + mOutputThread->flush(); + mOutputThread->requestExitAndWait(); + mOutputThread.reset(); + } + + Mutex::Autolock _l(mLock); + // free all buffers + { + Mutex::Autolock _cbl(mCbsLock); + for (auto& stream : mOfflineStreams) { + cleanupBuffersLocked(stream.id); + } + } + mCallback.reset(); + mClosed = true; + return fromStatus(Status::OK); +} +void ExternalCameraOfflineSession::cleanupBuffersLocked(int32_t id) { + for (auto& pair : mCirculatingBuffers.at(id)) { + sHandleImporter.freeBuffer(pair.second); + } + mCirculatingBuffers[id].clear(); + mCirculatingBuffers.erase(id); +} + +bool ExternalCameraOfflineSession::OutputThread::threadLoop() { + auto parent = mParent.lock(); + if (parent == nullptr) { + ALOGE("%s: session has been disconnected!", __FUNCTION__); + return false; + } + + if (mOfflineReqs.empty()) { + ALOGI("%s: all offline requests are processed. Stopping.", __FUNCTION__); + return false; + } + + std::shared_ptr req = mOfflineReqs.front(); + mOfflineReqs.pop_front(); + + auto onDeviceError = [&](auto... args) { + ALOGE(args...); + parent->notifyError(req->frameNumber, /*stream*/ -1, ErrorCode::ERROR_DEVICE); + signalRequestDone(); + return false; + }; + + if (req->frameIn->mFourcc != V4L2_PIX_FMT_MJPEG && req->frameIn->mFourcc != V4L2_PIX_FMT_Z16) { + return onDeviceError("%s: do not support V4L2 format %c%c%c%c", __FUNCTION__, + req->frameIn->mFourcc & 0xFF, (req->frameIn->mFourcc >> 8) & 0xFF, + (req->frameIn->mFourcc >> 16) & 0xFF, + (req->frameIn->mFourcc >> 24) & 0xFF); + } + + int res = requestBufferStart(req->buffers); + if (res != 0) { + ALOGE("%s: send BufferRequest failed! res %d", __FUNCTION__, res); + return onDeviceError("%s: failed to send buffer request!", __FUNCTION__); + } + + std::unique_lock lk(mBufferLock); + // Convert input V4L2 frame to YU12 of the same size + // TODO: see if we can save some computation by converting to YV12 here + uint8_t* inData; + size_t inDataSize; + if (req->frameIn->getData(&inData, &inDataSize) != 0) { + lk.unlock(); + return onDeviceError("%s: V4L2 buffer map failed", __FUNCTION__); + } + + // TODO: in some special case maybe we can decode jpg directly to gralloc output? + if (req->frameIn->mFourcc == V4L2_PIX_FMT_MJPEG) { + ATRACE_BEGIN("MJPGtoI420"); + int convRes = libyuv::MJPGToI420( + inData, inDataSize, static_cast(mYu12FrameLayout.y), + mYu12FrameLayout.yStride, static_cast(mYu12FrameLayout.cb), + mYu12FrameLayout.cStride, static_cast(mYu12FrameLayout.cr), + mYu12FrameLayout.cStride, mYu12Frame->mWidth, mYu12Frame->mHeight, + mYu12Frame->mWidth, mYu12Frame->mHeight); + ATRACE_END(); + + if (convRes != 0) { + // For some webcam, the first few V4L2 frames might be malformed... + ALOGE("%s: Convert V4L2 frame to YU12 failed! res %d", __FUNCTION__, convRes); + lk.unlock(); + Status st = parent->processCaptureRequestError(req); + if (st != Status::OK) { + return onDeviceError("%s: failed to process capture request error!", __FUNCTION__); + } + signalRequestDone(); + return true; + } + } + + ATRACE_BEGIN("Wait for BufferRequest done"); + res = waitForBufferRequestDone(&req->buffers); + ATRACE_END(); + + if (res != 0) { + ALOGE("%s: wait for BufferRequest done failed! res %d", __FUNCTION__, res); + lk.unlock(); + return onDeviceError("%s: failed to process buffer request error!", __FUNCTION__); + } + + ALOGV("%s processing new request", __FUNCTION__); + const int kSyncWaitTimeoutMs = 500; + for (auto& halBuf : req->buffers) { + if (*(halBuf.bufPtr) == nullptr) { + ALOGW("%s: buffer for stream %d missing", __FUNCTION__, halBuf.streamId); + halBuf.fenceTimeout = true; + } else if (halBuf.acquireFence >= 0) { + int ret = sync_wait(halBuf.acquireFence, kSyncWaitTimeoutMs); + if (ret) { + halBuf.fenceTimeout = true; + } else { + ::close(halBuf.acquireFence); + halBuf.acquireFence = -1; + } + } + + if (halBuf.fenceTimeout) { + continue; + } + + // Gralloc lockYCbCr the buffer + switch (halBuf.format) { + case PixelFormat::BLOB: { + int ret = createJpegLocked(halBuf, req->setting); + + if (ret != 0) { + lk.unlock(); + return onDeviceError("%s: createJpegLocked failed with %d", __FUNCTION__, ret); + } + } break; + case PixelFormat::Y16: { + void* outLayout = sHandleImporter.lock( + *(halBuf.bufPtr), static_cast(halBuf.usage), inDataSize); + + std::memcpy(outLayout, inData, inDataSize); + + int relFence = sHandleImporter.unlock(*(halBuf.bufPtr)); + if (relFence >= 0) { + halBuf.acquireFence = relFence; + } + } break; + case PixelFormat::YCBCR_420_888: + case PixelFormat::YV12: { + IMapper::Rect outRect{0, 0, static_cast(halBuf.width), + static_cast(halBuf.height)}; + YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, + outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, + outLayout.chromaStep); + + // Convert to output buffer size/format + uint32_t outputFourcc = getFourCcFromLayout(outLayout); + ALOGV("%s: converting to format %c%c%c%c", __FUNCTION__, outputFourcc & 0xFF, + (outputFourcc >> 8) & 0xFF, (outputFourcc >> 16) & 0xFF, + (outputFourcc >> 24) & 0xFF); + + YCbCrLayout cropAndScaled; + ATRACE_BEGIN("cropAndScaleLocked"); + int ret = cropAndScaleLocked(mYu12Frame, Size{halBuf.width, halBuf.height}, + &cropAndScaled); + ATRACE_END(); + if (ret != 0) { + lk.unlock(); + return onDeviceError("%s: crop and scale failed!", __FUNCTION__); + } + + Size sz{halBuf.width, halBuf.height}; + ATRACE_BEGIN("formatConvert"); + ret = formatConvert(cropAndScaled, outLayout, sz, outputFourcc); + ATRACE_END(); + if (ret != 0) { + lk.unlock(); + return onDeviceError("%s: format coversion failed!", __FUNCTION__); + } + int relFence = sHandleImporter.unlock(*(halBuf.bufPtr)); + if (relFence >= 0) { + halBuf.acquireFence = relFence; + } + } break; + default: + lk.unlock(); + return onDeviceError("%s: unknown output format %x", __FUNCTION__, halBuf.format); + } + } // for each buffer + mScaledYu12Frames.clear(); + + // Don't hold the lock while calling back to parent + lk.unlock(); + Status st = parent->processCaptureResult(req); + if (st != Status::OK) { + return onDeviceError("%s: failed to process capture result!", __FUNCTION__); + } + signalRequestDone(); + return true; +} + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android \ No newline at end of file diff --git a/camera/device/default/ExternalCameraOfflineSession.h b/camera/device/default/ExternalCameraOfflineSession.h new file mode 100644 index 0000000000..1d0c057a37 --- /dev/null +++ b/camera/device/default/ExternalCameraOfflineSession.h @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERAOFFLINESESSION_H_ +#define HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERAOFFLINESESSION_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace device { +namespace implementation { + +using ::aidl::android::hardware::camera::common::Status; +using ::aidl::android::hardware::camera::device::BnCameraOfflineSession; +using ::aidl::android::hardware::camera::device::ICameraDeviceCallback; +using ::aidl::android::hardware::camera::device::Stream; +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; + +class ExternalCameraOfflineSession final : public BnCameraOfflineSession, + public virtual RefBase, + public virtual OutputThreadInterface { + public: + ExternalCameraOfflineSession(const CroppingType& croppingType, + const common::V1_0::helper::CameraMetadata& chars, + const std::string& cameraId, const std::string& exifMake, + const std::string& exifModel, uint32_t blobBufferSize, + bool afTrigger, const std::vector& offlineStreams, + std::deque>& offlineReqs, + const std::map& circulatingBuffers); + + ~ExternalCameraOfflineSession() override; + + bool initialize(); + + // Methods from OutputThreadInterface + Status importBuffer(int32_t streamId, uint64_t bufId, buffer_handle_t buf, + /*out*/ buffer_handle_t** outBufPtr) override; + + Status processCaptureResult(std::shared_ptr&) override; + + Status processCaptureRequestError(const std::shared_ptr&, + /*out*/ std::vector* msgs, + /*out*/ std::vector* results) override; + + ssize_t getJpegBufferSize(int32_t width, int32_t height) const override; + + void notifyError(int32_t frameNumber, int32_t streamId, ErrorCode ec) override; + // End of OutputThreadInterface methods + + ScopedAStatus setCallback(const std::shared_ptr& in_cb) override; + ScopedAStatus getCaptureResultMetadataQueue( + MQDescriptor* _aidl_return) override; + ScopedAStatus close() override; + + private: + class OutputThread : public ExternalCameraDeviceSession::OutputThread { + public: + OutputThread(std::weak_ptr parent, CroppingType ct, + const common::V1_0::helper::CameraMetadata& chars, + std::shared_ptr bufReqThread, + std::deque>& offlineReqs) + : ExternalCameraDeviceSession::OutputThread(std::move(parent), ct, chars, + std::move(bufReqThread)), + mOfflineReqs(offlineReqs) {} + + bool threadLoop() override; + + protected: + std::deque> mOfflineReqs; + }; // OutputThread + + status_t fillCaptureResult(common::V1_0::helper::CameraMetadata md, nsecs_t timestamp); + void invokeProcessCaptureResultCallback(std::vector& results, bool tryWriteFmq); + void initOutputThread(); + void cleanupBuffersLocked(int32_t id); + + // Protect (most of) HIDL interface methods from synchronized-entering + mutable Mutex mInterfaceLock; + + mutable Mutex mLock; // Protect all data members except otherwise noted + + bool mClosed = false; + const CroppingType mCroppingType; + const common::V1_0::helper::CameraMetadata mChars; + const std::string mCameraId; + const std::string mExifMake; + const std::string mExifModel; + const uint32_t mBlobBufferSize; + + std::mutex mAfTriggerLock; // protect mAfTrigger + bool mAfTrigger; + + const std::vector mOfflineStreams; + std::deque> mOfflineReqs; + + // Protect mCirculatingBuffers, must not lock mLock after acquiring this lock + mutable Mutex mCbsLock; + std::map mCirculatingBuffers; + + static HandleImporter sHandleImporter; + + using ResultMetadataQueue = AidlMessageQueue; + std::shared_ptr mResultMetadataQueue; + + // Protect against invokeProcessCaptureResultCallback() + Mutex mProcessCaptureResultLock; + + std::shared_ptr mCallback; + + std::shared_ptr mBufferRequestThread; + std::shared_ptr mOutputThread; +}; + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERAOFFLINESESSION_H_ diff --git a/camera/device/default/ExternalCameraUtils.cpp b/camera/device/default/ExternalCameraUtils.cpp new file mode 100644 index 0000000000..cfb95f2a4d --- /dev/null +++ b/camera/device/default/ExternalCameraUtils.cpp @@ -0,0 +1,860 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "ExtCamUtils" +// #define LOG_NDEBUG 0 + +#include "ExternalCameraUtils.h" + +#include +#include +#include +#include +#include +#include +#include + +#define HAVE_JPEG // required for libyuv.h to export MJPEG decode APIs +#include + +namespace android { +namespace hardware { +namespace camera { + +namespace external { +namespace common { + +namespace { +const int kDefaultCameraIdOffset = 100; +const int kDefaultJpegBufSize = 5 << 20; // 5MB +const int kDefaultNumVideoBuffer = 4; +const int kDefaultNumStillBuffer = 2; +const int kDefaultOrientation = 0; // suitable for natural landscape displays like tablet/TV + // For phone devices 270 is better +} // anonymous namespace + +const char* ExternalCameraConfig::kDefaultCfgPath = "/vendor/etc/external_camera_config.xml"; + +ExternalCameraConfig ExternalCameraConfig::loadFromCfg(const char* cfgPath) { + using namespace tinyxml2; + ExternalCameraConfig ret; + + XMLDocument configXml; + XMLError err = configXml.LoadFile(cfgPath); + if (err != XML_SUCCESS) { + ALOGE("%s: Unable to load external camera config file '%s'. Error: %s", __FUNCTION__, + cfgPath, XMLDocument::ErrorIDToName(err)); + return ret; + } else { + ALOGI("%s: load external camera config succeeded!", __FUNCTION__); + } + + XMLElement* extCam = configXml.FirstChildElement("ExternalCamera"); + if (extCam == nullptr) { + ALOGI("%s: no external camera config specified", __FUNCTION__); + return ret; + } + + XMLElement* providerCfg = extCam->FirstChildElement("Provider"); + if (providerCfg == nullptr) { + ALOGI("%s: no external camera provider config specified", __FUNCTION__); + return ret; + } + + XMLElement* cameraIdOffset = providerCfg->FirstChildElement("CameraIdOffset"); + if (cameraIdOffset != nullptr) { + ret.cameraIdOffset = std::atoi(cameraIdOffset->GetText()); + } + + XMLElement* ignore = providerCfg->FirstChildElement("ignore"); + if (ignore == nullptr) { + ALOGI("%s: no internal ignored device specified", __FUNCTION__); + return ret; + } + + XMLElement* id = ignore->FirstChildElement("id"); + while (id != nullptr) { + const char* text = id->GetText(); + if (text != nullptr) { + ret.mInternalDevices.insert(text); + ALOGI("%s: device %s will be ignored by external camera provider", __FUNCTION__, text); + } + id = id->NextSiblingElement("id"); + } + + XMLElement* deviceCfg = extCam->FirstChildElement("Device"); + if (deviceCfg == nullptr) { + ALOGI("%s: no external camera device config specified", __FUNCTION__); + return ret; + } + + XMLElement* jpegBufSz = deviceCfg->FirstChildElement("MaxJpegBufferSize"); + if (jpegBufSz == nullptr) { + ALOGI("%s: no max jpeg buffer size specified", __FUNCTION__); + } else { + ret.maxJpegBufSize = jpegBufSz->UnsignedAttribute("bytes", /*Default*/ kDefaultJpegBufSize); + } + + XMLElement* numVideoBuf = deviceCfg->FirstChildElement("NumVideoBuffers"); + if (numVideoBuf == nullptr) { + ALOGI("%s: no num video buffers specified", __FUNCTION__); + } else { + ret.numVideoBuffers = + numVideoBuf->UnsignedAttribute("count", /*Default*/ kDefaultNumVideoBuffer); + } + + XMLElement* numStillBuf = deviceCfg->FirstChildElement("NumStillBuffers"); + if (numStillBuf == nullptr) { + ALOGI("%s: no num still buffers specified", __FUNCTION__); + } else { + ret.numStillBuffers = + numStillBuf->UnsignedAttribute("count", /*Default*/ kDefaultNumStillBuffer); + } + + XMLElement* fpsList = deviceCfg->FirstChildElement("FpsList"); + if (fpsList == nullptr) { + ALOGI("%s: no fps list specified", __FUNCTION__); + } else { + if (!updateFpsList(fpsList, ret.fpsLimits)) { + return ret; + } + } + + XMLElement* depth = deviceCfg->FirstChildElement("Depth16Supported"); + if (depth == nullptr) { + ret.depthEnabled = false; + ALOGI("%s: depth output is not enabled", __FUNCTION__); + } else { + ret.depthEnabled = depth->BoolAttribute("enabled", false); + } + + if (ret.depthEnabled) { + XMLElement* depthFpsList = deviceCfg->FirstChildElement("DepthFpsList"); + if (depthFpsList == nullptr) { + ALOGW("%s: no depth fps list specified", __FUNCTION__); + } else { + if (!updateFpsList(depthFpsList, ret.depthFpsLimits)) { + return ret; + } + } + } + + XMLElement* minStreamSize = deviceCfg->FirstChildElement("MinimumStreamSize"); + if (minStreamSize == nullptr) { + ALOGI("%s: no minimum stream size specified", __FUNCTION__); + } else { + ret.minStreamSize = { + static_cast(minStreamSize->UnsignedAttribute("width", /*Default*/ 0)), + static_cast(minStreamSize->UnsignedAttribute("height", /*Default*/ 0))}; + } + + XMLElement* orientation = deviceCfg->FirstChildElement("Orientation"); + if (orientation == nullptr) { + ALOGI("%s: no sensor orientation specified", __FUNCTION__); + } else { + ret.orientation = orientation->IntAttribute("degree", /*Default*/ kDefaultOrientation); + } + + ALOGI("%s: external camera cfg loaded: maxJpgBufSize %d," + " num video buffers %d, num still buffers %d, orientation %d", + __FUNCTION__, ret.maxJpegBufSize, ret.numVideoBuffers, ret.numStillBuffers, + ret.orientation); + for (const auto& limit : ret.fpsLimits) { + ALOGI("%s: fpsLimitList: %dx%d@%f", __FUNCTION__, limit.size.width, limit.size.height, + limit.fpsUpperBound); + } + for (const auto& limit : ret.depthFpsLimits) { + ALOGI("%s: depthFpsLimitList: %dx%d@%f", __FUNCTION__, limit.size.width, limit.size.height, + limit.fpsUpperBound); + } + ALOGI("%s: minStreamSize: %dx%d", __FUNCTION__, ret.minStreamSize.width, + ret.minStreamSize.height); + return ret; +} + +bool ExternalCameraConfig::updateFpsList(tinyxml2::XMLElement* fpsList, + std::vector& fpsLimits) { + using namespace tinyxml2; + std::vector limits; + XMLElement* row = fpsList->FirstChildElement("Limit"); + while (row != nullptr) { + FpsLimitation prevLimit{{0, 0}, 1000.0}; + FpsLimitation limit = { + {/* width */ static_cast(row->UnsignedAttribute("width", /*Default*/ 0)), + /* height */ static_cast( + row->UnsignedAttribute("height", /*Default*/ 0))}, + /* fpsUpperBound */ row->DoubleAttribute("fpsBound", /*Default*/ 1000.0)}; + if (limit.size.width <= prevLimit.size.width || + limit.size.height <= prevLimit.size.height || + limit.fpsUpperBound >= prevLimit.fpsUpperBound) { + ALOGE("%s: FPS limit list must have increasing size and decreasing fps!" + " Prev %dx%d@%f, Current %dx%d@%f", + __FUNCTION__, prevLimit.size.width, prevLimit.size.height, + prevLimit.fpsUpperBound, limit.size.width, limit.size.height, + limit.fpsUpperBound); + return false; + } + limits.push_back(limit); + row = row->NextSiblingElement("Limit"); + } + fpsLimits = limits; + return true; +} + +ExternalCameraConfig::ExternalCameraConfig() + : cameraIdOffset(kDefaultCameraIdOffset), + maxJpegBufSize(kDefaultJpegBufSize), + numVideoBuffers(kDefaultNumVideoBuffer), + numStillBuffers(kDefaultNumStillBuffer), + depthEnabled(false), + orientation(kDefaultOrientation) { + fpsLimits.push_back({/* size */ {/* width */ 640, /* height */ 480}, /* fpsUpperBound */ 30.0}); + fpsLimits.push_back({/* size */ {/* width */ 1280, /* height */ 720}, /* fpsUpperBound */ 7.5}); + fpsLimits.push_back( + {/* size */ {/* width */ 1920, /* height */ 1080}, /* fpsUpperBound */ 5.0}); + minStreamSize = {0, 0}; +} + +} // namespace common +} // namespace external + +namespace device { +namespace implementation { + +double SupportedV4L2Format::FrameRate::getFramesPerSecond() const { + return static_cast(durationDenominator) / durationNumerator; +} + +Frame::Frame(uint32_t width, uint32_t height, uint32_t fourcc) + : mWidth(width), mHeight(height), mFourcc(fourcc) {} +Frame::~Frame() {} + +V4L2Frame::V4L2Frame(uint32_t w, uint32_t h, uint32_t fourcc, int bufIdx, int fd, uint32_t dataSize, + uint64_t offset) + : Frame(w, h, fourcc), mBufferIndex(bufIdx), mFd(fd), mDataSize(dataSize), mOffset(offset) {} + +V4L2Frame::~V4L2Frame() { + unmap(); +} + +int V4L2Frame::getData(uint8_t** outData, size_t* dataSize) { + return map(outData, dataSize); +} + +int V4L2Frame::map(uint8_t** data, size_t* dataSize) { + if (data == nullptr || dataSize == nullptr) { + ALOGI("%s: V4L2 buffer map bad argument: data %p, dataSize %p", __FUNCTION__, data, + dataSize); + return -EINVAL; + } + + std::lock_guard lk(mLock); + if (!mMapped) { + void* addr = mmap(nullptr, mDataSize, PROT_READ, MAP_SHARED, mFd, mOffset); + if (addr == MAP_FAILED) { + ALOGE("%s: V4L2 buffer map failed: %s", __FUNCTION__, strerror(errno)); + return -EINVAL; + } + mData = static_cast(addr); + mMapped = true; + } + *data = mData; + *dataSize = mDataSize; + ALOGV("%s: V4L map FD %d, data %p size %zu", __FUNCTION__, mFd, mData, mDataSize); + return 0; +} + +int V4L2Frame::unmap() { + std::lock_guard lk(mLock); + if (mMapped) { + ALOGV("%s: V4L unmap data %p size %zu", __FUNCTION__, mData, mDataSize); + if (munmap(mData, mDataSize) != 0) { + ALOGE("%s: V4L2 buffer unmap failed: %s", __FUNCTION__, strerror(errno)); + return -EINVAL; + } + mMapped = false; + } + return 0; +} + +AllocatedFrame::AllocatedFrame(uint32_t w, uint32_t h) : Frame(w, h, V4L2_PIX_FMT_YUV420) {} +AllocatedFrame::~AllocatedFrame() {} + +int AllocatedFrame::getData(uint8_t** outData, size_t* dataSize) { + YCbCrLayout layout; + int ret = allocate(&layout); + if (ret != 0) { + return ret; + } + *outData = mData.data(); + *dataSize = mBufferSize; + return 0; +} + +int AllocatedFrame::allocate(YCbCrLayout* out) { + std::lock_guard lk(mLock); + if ((mWidth % 2) || (mHeight % 2)) { + ALOGE("%s: bad dimension %dx%d (not multiple of 2)", __FUNCTION__, mWidth, mHeight); + return -EINVAL; + } + + // This frame might be sent to jpeglib to be encoded. Since AllocatedFrame only contains YUV420, + // jpeglib expects height and width of Y component to be an integral multiple of 2*DCTSIZE, + // and heights and widths of Cb and Cr components to be an integral multiple of DCTSIZE. If the + // image size does not meet this requirement, libjpeg expects its input to be padded to meet the + // constraints. This padding is removed from the final encoded image so the content in the + // padding doesn't matter. What matters is that the memory is accessible to jpeglib at the time + // of encoding. + // For example, if the image size is 1500x844 and DCTSIZE is 8, jpeglib expects a YUV 420 + // frame with components of following sizes: + // Y: 1504x848 because 1504 and 848 are the next smallest multiples of 2*8 + // Cb/Cr: 752x424 which are the next smallest multiples of 8 + + // jpeglib takes an array of row pointers which makes vertical padding trivial when setting up + // the pointers. Padding horizontally is a bit more complicated. AllocatedFrame holds the data + // in a flattened buffer, which means memory accesses past a row will flow into the next logical + // row. For any row of a component, we can consider the first few bytes of the next row as + // padding for the current one. This is true for Y and Cb components and all but last row of the + // Cr component. Reading past the last row of Cr component will lead to undefined behavior as + // libjpeg attempts to read memory past the allocated buffer. To prevent undefined behavior, + // the buffer allocated here is padded such that libjpeg never accesses unallocated memory when + // reading the last row. Effectively, we only need to ensure that the last row of Cr component + // has width that is an integral multiple of DCTSIZE. + + size_t dataSize = mWidth * mHeight * 3 / 2; // YUV420 + + size_t cbWidth = mWidth / 2; + size_t requiredCbWidth = DCTSIZE * ((cbWidth + DCTSIZE - 1) / DCTSIZE); + size_t padding = requiredCbWidth - cbWidth; + size_t finalSize = dataSize + padding; + + if (mData.size() != finalSize) { + mData.resize(finalSize); + mBufferSize = dataSize; + } + + if (out != nullptr) { + out->y = mData.data(); + out->yStride = mWidth; + uint8_t* cbStart = mData.data() + mWidth * mHeight; + uint8_t* crStart = cbStart + mWidth * mHeight / 4; + out->cb = cbStart; + out->cr = crStart; + out->cStride = mWidth / 2; + out->chromaStep = 1; + } + return 0; +} + +int AllocatedFrame::getLayout(YCbCrLayout* out) { + IMapper::Rect noCrop = {0, 0, static_cast(mWidth), static_cast(mHeight)}; + return getCroppedLayout(noCrop, out); +} + +int AllocatedFrame::getCroppedLayout(const IMapper::Rect& rect, YCbCrLayout* out) { + if (out == nullptr) { + ALOGE("%s: null out", __FUNCTION__); + return -1; + } + + std::lock_guard lk(mLock); + if ((rect.left + rect.width) > static_cast(mWidth) || + (rect.top + rect.height) > static_cast(mHeight) || (rect.left % 2) || (rect.top % 2) || + (rect.width % 2) || (rect.height % 2)) { + ALOGE("%s: bad rect left %d top %d w %d h %d", __FUNCTION__, rect.left, rect.top, + rect.width, rect.height); + return -1; + } + + out->y = mData.data() + mWidth * rect.top + rect.left; + out->yStride = mWidth; + uint8_t* cbStart = mData.data() + mWidth * mHeight; + uint8_t* crStart = cbStart + mWidth * mHeight / 4; + out->cb = cbStart + mWidth * rect.top / 4 + rect.left / 2; + out->cr = crStart + mWidth * rect.top / 4 + rect.left / 2; + out->cStride = mWidth / 2; + out->chromaStep = 1; + return 0; +} + +bool isAspectRatioClose(float ar1, float ar2) { + constexpr float kAspectRatioMatchThres = 0.025f; // This threshold is good enough to + // distinguish 4:3/16:9/20:9 1.33/1.78/2 + return std::abs(ar1 - ar2) < kAspectRatioMatchThres; +} + +aidl::android::hardware::camera::common::Status importBufferImpl( + /*inout*/ std::map& circulatingBuffers, + /*inout*/ HandleImporter& handleImporter, int32_t streamId, uint64_t bufId, + buffer_handle_t buf, + /*out*/ buffer_handle_t** outBufPtr) { + using ::aidl::android::hardware::camera::common::Status; + if (buf == nullptr && bufId == BUFFER_ID_NO_BUFFER) { + ALOGE("%s: bufferId %" PRIu64 " has null buffer handle!", __FUNCTION__, bufId); + return Status::ILLEGAL_ARGUMENT; + } + + CirculatingBuffers& cbs = circulatingBuffers[streamId]; + if (cbs.count(bufId) == 0) { + if (buf == nullptr) { + ALOGE("%s: bufferId %" PRIu64 " has null buffer handle!", __FUNCTION__, bufId); + return Status::ILLEGAL_ARGUMENT; + } + // Register a newly seen buffer + buffer_handle_t importedBuf = buf; + handleImporter.importBuffer(importedBuf); + if (importedBuf == nullptr) { + ALOGE("%s: output buffer for stream %d is invalid!", __FUNCTION__, streamId); + return Status::INTERNAL_ERROR; + } else { + cbs[bufId] = importedBuf; + } + } + *outBufPtr = &cbs[bufId]; + return Status::OK; +} + +uint32_t getFourCcFromLayout(const YCbCrLayout& layout) { + intptr_t cb = reinterpret_cast(layout.cb); + intptr_t cr = reinterpret_cast(layout.cr); + if (std::abs(cb - cr) == 1 && layout.chromaStep == 2) { + // Interleaved format + if (layout.cb > layout.cr) { + return V4L2_PIX_FMT_NV21; + } else { + return V4L2_PIX_FMT_NV12; + } + } else if (layout.chromaStep == 1) { + // Planar format + if (layout.cb > layout.cr) { + return V4L2_PIX_FMT_YVU420; // YV12 + } else { + return V4L2_PIX_FMT_YUV420; // YU12 + } + } else { + return FLEX_YUV_GENERIC; + } +} + +int getCropRect(CroppingType ct, const Size& inSize, const Size& outSize, IMapper::Rect* out) { + if (out == nullptr) { + ALOGE("%s: out is null", __FUNCTION__); + return -1; + } + + uint32_t inW = inSize.width; + uint32_t inH = inSize.height; + uint32_t outW = outSize.width; + uint32_t outH = outSize.height; + + // Handle special case where aspect ratio is close to input but scaled + // dimension is slightly larger than input + float arIn = ASPECT_RATIO(inSize); + float arOut = ASPECT_RATIO(outSize); + if (isAspectRatioClose(arIn, arOut)) { + out->left = 0; + out->top = 0; + out->width = static_cast(inW); + out->height = static_cast(inH); + return 0; + } + + if (ct == VERTICAL) { + uint64_t scaledOutH = static_cast(outH) * inW / outW; + if (scaledOutH > inH) { + ALOGE("%s: Output size %dx%d cannot be vertically cropped from input size %dx%d", + __FUNCTION__, outW, outH, inW, inH); + return -1; + } + scaledOutH = scaledOutH & ~0x1; // make it multiple of 2 + + out->left = 0; + out->top = static_cast((inH - scaledOutH) / 2) & ~0x1; + out->width = static_cast(inW); + out->height = static_cast(scaledOutH); + ALOGV("%s: crop %dx%d to %dx%d: top %d, scaledH %d", __FUNCTION__, inW, inH, outW, outH, + out->top, static_cast(scaledOutH)); + } else { + uint64_t scaledOutW = static_cast(outW) * inH / outH; + if (scaledOutW > inW) { + ALOGE("%s: Output size %dx%d cannot be horizontally cropped from input size %dx%d", + __FUNCTION__, outW, outH, inW, inH); + return -1; + } + scaledOutW = scaledOutW & ~0x1; // make it multiple of 2 + + out->left = static_cast((inW - scaledOutW) / 2) & ~0x1; + out->top = 0; + out->width = static_cast(scaledOutW); + out->height = static_cast(inH); + ALOGV("%s: crop %dx%d to %dx%d: top %d, scaledW %d", __FUNCTION__, inW, inH, outW, outH, + out->top, static_cast(scaledOutW)); + } + + return 0; +} + +int formatConvert(const YCbCrLayout& in, const YCbCrLayout& out, Size sz, uint32_t format) { + int ret = 0; + switch (format) { + case V4L2_PIX_FMT_NV21: + ret = libyuv::I420ToNV21( + static_cast(in.y), static_cast(in.yStride), + static_cast(in.cb), static_cast(in.cStride), + static_cast(in.cr), static_cast(in.cStride), + static_cast(out.y), static_cast(out.yStride), + static_cast(out.cr), static_cast(out.cStride), + static_cast(sz.width), static_cast(sz.height)); + if (ret != 0) { + ALOGE("%s: convert to NV21 buffer failed! ret %d", __FUNCTION__, ret); + return ret; + } + break; + case V4L2_PIX_FMT_NV12: + ret = libyuv::I420ToNV12( + static_cast(in.y), static_cast(in.yStride), + static_cast(in.cb), static_cast(in.cStride), + static_cast(in.cr), static_cast(in.cStride), + static_cast(out.y), static_cast(out.yStride), + static_cast(out.cb), static_cast(out.cStride), + static_cast(sz.width), static_cast(sz.height)); + if (ret != 0) { + ALOGE("%s: convert to NV12 buffer failed! ret %d", __FUNCTION__, ret); + return ret; + } + break; + case V4L2_PIX_FMT_YVU420: // YV12 + case V4L2_PIX_FMT_YUV420: // YU12 + // TODO: maybe we can speed up here by somehow save this copy? + ret = libyuv::I420Copy(static_cast(in.y), static_cast(in.yStride), + static_cast(in.cb), static_cast(in.cStride), + static_cast(in.cr), static_cast(in.cStride), + static_cast(out.y), static_cast(out.yStride), + static_cast(out.cb), static_cast(out.cStride), + static_cast(out.cr), static_cast(out.cStride), + static_cast(sz.width), static_cast(sz.height)); + if (ret != 0) { + ALOGE("%s: copy to YV12 or YU12 buffer failed! ret %d", __FUNCTION__, ret); + return ret; + } + break; + case FLEX_YUV_GENERIC: + // TODO: b/72261744 write to arbitrary flexible YUV layout. Slow. + ALOGE("%s: unsupported flexible yuv layout" + " y %p cb %p cr %p y_str %d c_str %d c_step %d", + __FUNCTION__, out.y, out.cb, out.cr, out.yStride, out.cStride, out.chromaStep); + return -1; + default: + ALOGE("%s: unknown YUV format 0x%x!", __FUNCTION__, format); + return -1; + } + return 0; +} + +int encodeJpegYU12(const Size& inSz, const YCbCrLayout& inLayout, int jpegQuality, + const void* app1Buffer, size_t app1Size, void* out, size_t maxOutSize, + size_t& actualCodeSize) { + /* libjpeg is a C library so we use C-style "inheritance" by + * putting libjpeg's jpeg_destination_mgr first in our custom + * struct. This allows us to cast jpeg_destination_mgr* to + * CustomJpegDestMgr* when we get it passed to us in a callback */ + struct CustomJpegDestMgr { + struct jpeg_destination_mgr mgr; + JOCTET* mBuffer; + size_t mBufferSize; + size_t mEncodedSize; + bool mSuccess; + } dmgr; + + jpeg_compress_struct cinfo = {}; + jpeg_error_mgr jerr; + + /* Initialize error handling with standard callbacks, but + * then override output_message (to print to ALOG) and + * error_exit to set a flag and print a message instead + * of killing the whole process */ + cinfo.err = jpeg_std_error(&jerr); + + cinfo.err->output_message = [](j_common_ptr cinfo) { + char buffer[JMSG_LENGTH_MAX]; + + /* Create the message */ + (*cinfo->err->format_message)(cinfo, buffer); + ALOGE("libjpeg error: %s", buffer); + }; + cinfo.err->error_exit = [](j_common_ptr cinfo) { + (*cinfo->err->output_message)(cinfo); + if (cinfo->client_data) { + auto& dmgr = *reinterpret_cast(cinfo->client_data); + dmgr.mSuccess = false; + } + }; + + /* Now that we initialized some callbacks, let's create our compressor */ + jpeg_create_compress(&cinfo); + + /* Initialize our destination manager */ + dmgr.mBuffer = static_cast(out); + dmgr.mBufferSize = maxOutSize; + dmgr.mEncodedSize = 0; + dmgr.mSuccess = true; + cinfo.client_data = static_cast(&dmgr); + + /* These lambdas become C-style function pointers and as per C++11 spec + * may not capture anything */ + dmgr.mgr.init_destination = [](j_compress_ptr cinfo) { + auto& dmgr = reinterpret_cast(*cinfo->dest); + dmgr.mgr.next_output_byte = dmgr.mBuffer; + dmgr.mgr.free_in_buffer = dmgr.mBufferSize; + ALOGV("%s:%d jpeg start: %p [%zu]", __FUNCTION__, __LINE__, dmgr.mBuffer, dmgr.mBufferSize); + }; + + dmgr.mgr.empty_output_buffer = [](j_compress_ptr cinfo __unused) { + ALOGV("%s:%d Out of buffer", __FUNCTION__, __LINE__); + return 0; + }; + + dmgr.mgr.term_destination = [](j_compress_ptr cinfo) { + auto& dmgr = reinterpret_cast(*cinfo->dest); + dmgr.mEncodedSize = dmgr.mBufferSize - dmgr.mgr.free_in_buffer; + ALOGV("%s:%d Done with jpeg: %zu", __FUNCTION__, __LINE__, dmgr.mEncodedSize); + }; + cinfo.dest = reinterpret_cast(&dmgr); + + /* We are going to be using JPEG in raw data mode, so we are passing + * straight subsampled planar YCbCr and it will not touch our pixel + * data or do any scaling or anything */ + cinfo.image_width = inSz.width; + cinfo.image_height = inSz.height; + cinfo.input_components = 3; + cinfo.in_color_space = JCS_YCbCr; + + /* Initialize defaults and then override what we want */ + jpeg_set_defaults(&cinfo); + + jpeg_set_quality(&cinfo, jpegQuality, 1); + jpeg_set_colorspace(&cinfo, JCS_YCbCr); + cinfo.raw_data_in = 1; + cinfo.dct_method = JDCT_IFAST; + + /* Configure sampling factors. The sampling factor is JPEG subsampling 420 + * because the source format is YUV420. Note that libjpeg sampling factors + * are... a little weird. Sampling of Y=2,U=1,V=1 means there is 1 U and + * 1 V value for each 2 Y values */ + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 2; + cinfo.comp_info[1].h_samp_factor = 1; + cinfo.comp_info[1].v_samp_factor = 1; + cinfo.comp_info[2].h_samp_factor = 1; + cinfo.comp_info[2].v_samp_factor = 1; + + /* Start the compressor */ + jpeg_start_compress(&cinfo, TRUE); + + /* Let's not hardcode YUV420 in 6 places... 5 was enough */ + int maxVSampFactor = cinfo.max_v_samp_factor; + int cVSubSampling = cinfo.comp_info[0].v_samp_factor / cinfo.comp_info[1].v_samp_factor; + + /* Compute our macroblock height, so we can pad our input to be vertically + * macroblock aligned. No need to for horizontal alignment since AllocatedFrame already + * pads horizontally */ + + size_t mcuV = DCTSIZE * maxVSampFactor; + size_t paddedHeight = mcuV * ((inSz.height + mcuV - 1) / mcuV); + + /* libjpeg uses arrays of row pointers, which makes it really easy to pad + * data vertically (unfortunately doesn't help horizontally) */ + std::vector yLines(paddedHeight); + std::vector cbLines(paddedHeight / cVSubSampling); + std::vector crLines(paddedHeight / cVSubSampling); + + uint8_t* py = static_cast(inLayout.y); + uint8_t* pcb = static_cast(inLayout.cb); + uint8_t* pcr = static_cast(inLayout.cr); + + for (int32_t i = 0; i < paddedHeight; i++) { + /* Once we are in the padding territory we still point to the last line + * effectively replicating it several times ~ CLAMP_TO_EDGE */ + int li = std::min(i, inSz.height - 1); + yLines[i] = static_cast(py + li * inLayout.yStride); + if (i < paddedHeight / cVSubSampling) { + li = std::min(i, (inSz.height - 1) / cVSubSampling); + cbLines[i] = static_cast(pcb + li * inLayout.cStride); + crLines[i] = static_cast(pcr + li * inLayout.cStride); + } + } + + /* If APP1 data was passed in, use it */ + if (app1Buffer && app1Size) { + jpeg_write_marker(&cinfo, JPEG_APP0 + 1, static_cast(app1Buffer), app1Size); + } + + /* While we still have padded height left to go, keep giving it one + * macroblock at a time. */ + while (cinfo.next_scanline < cinfo.image_height) { + const uint32_t batchSize = DCTSIZE * maxVSampFactor; + const uint32_t nl = cinfo.next_scanline; + JSAMPARRAY planes[3]{&yLines[nl], &cbLines[nl / cVSubSampling], + &crLines[nl / cVSubSampling]}; + + uint32_t done = jpeg_write_raw_data(&cinfo, planes, batchSize); + + if (done != batchSize) { + ALOGE("%s: compressed %u lines, expected %u (total %u/%u)", __FUNCTION__, done, + batchSize, cinfo.next_scanline, cinfo.image_height); + return -1; + } + } + + /* This will flush everything */ + jpeg_finish_compress(&cinfo); + + /* Grab the actual code size and set it */ + actualCodeSize = dmgr.mEncodedSize; + + return 0; +} + +Size getMaxThumbnailResolution(const common::V1_0::helper::CameraMetadata& chars) { + Size thumbSize{0, 0}; + camera_metadata_ro_entry entry = chars.find(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES); + for (uint32_t i = 0; i < entry.count; i += 2) { + Size sz{.width = entry.data.i32[i], .height = entry.data.i32[i + 1]}; + if (sz.width * sz.height > thumbSize.width * thumbSize.height) { + thumbSize = sz; + } + } + + if (thumbSize.width * thumbSize.height == 0) { + ALOGW("%s: non-zero thumbnail size not available", __FUNCTION__); + } + + return thumbSize; +} + +void freeReleaseFences(std::vector& results) { + for (auto& result : results) { + native_handle_t* inputReleaseFence = + ::android::makeFromAidl(result.inputBuffer.releaseFence); + if (inputReleaseFence != nullptr) { + native_handle_close(inputReleaseFence); + native_handle_delete(inputReleaseFence); + } + for (auto& buf : result.outputBuffers) { + native_handle_t* outReleaseFence = ::android::makeFromAidl(buf.releaseFence); + if (outReleaseFence != nullptr) { + native_handle_close(outReleaseFence); + native_handle_delete(outReleaseFence); + } + } + } +} + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#define UPDATE(md, tag, data, size) \ + do { \ + if ((md).update((tag), (data), (size))) { \ + ALOGE("Update " #tag " failed!"); \ + return BAD_VALUE; \ + } \ + } while (0) + +status_t fillCaptureResultCommon(CameraMetadata& md, nsecs_t timestamp, + camera_metadata_ro_entry& activeArraySize) { + if (activeArraySize.count < 4) { + ALOGE("%s: cannot find active array size!", __FUNCTION__); + return -EINVAL; + } + // android.control + // For USB camera, we don't know the AE state. Set the state to converged to + // indicate the frame should be good to use. Then apps don't have to wait the + // AE state. + const uint8_t aeState = ANDROID_CONTROL_AE_STATE_CONVERGED; + UPDATE(md, ANDROID_CONTROL_AE_STATE, &aeState, 1); + + const uint8_t ae_lock = ANDROID_CONTROL_AE_LOCK_OFF; + UPDATE(md, ANDROID_CONTROL_AE_LOCK, &ae_lock, 1); + + // Set AWB state to converged to indicate the frame should be good to use. + const uint8_t awbState = ANDROID_CONTROL_AWB_STATE_CONVERGED; + UPDATE(md, ANDROID_CONTROL_AWB_STATE, &awbState, 1); + + const uint8_t awbLock = ANDROID_CONTROL_AWB_LOCK_OFF; + UPDATE(md, ANDROID_CONTROL_AWB_LOCK, &awbLock, 1); + + const uint8_t flashState = ANDROID_FLASH_STATE_UNAVAILABLE; + UPDATE(md, ANDROID_FLASH_STATE, &flashState, 1); + + // This means pipeline latency of X frame intervals. The maximum number is 4. + const uint8_t requestPipelineMaxDepth = 4; + UPDATE(md, ANDROID_REQUEST_PIPELINE_DEPTH, &requestPipelineMaxDepth, 1); + + // android.scaler + const int32_t crop_region[] = { + activeArraySize.data.i32[0], + activeArraySize.data.i32[1], + activeArraySize.data.i32[2], + activeArraySize.data.i32[3], + }; + UPDATE(md, ANDROID_SCALER_CROP_REGION, crop_region, ARRAY_SIZE(crop_region)); + + // android.sensor + UPDATE(md, ANDROID_SENSOR_TIMESTAMP, ×tamp, 1); + + // android.statistics + const uint8_t lensShadingMapMode = ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF; + UPDATE(md, ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, &lensShadingMapMode, 1); + + const uint8_t sceneFlicker = ANDROID_STATISTICS_SCENE_FLICKER_NONE; + UPDATE(md, ANDROID_STATISTICS_SCENE_FLICKER, &sceneFlicker, 1); + + return OK; +} + +#undef ARRAY_SIZE +#undef UPDATE + +AllocatedV4L2Frame::AllocatedV4L2Frame(std::shared_ptr frameIn) + : Frame(frameIn->mWidth, frameIn->mHeight, frameIn->mFourcc) { + uint8_t* dataIn; + size_t dataSize; + if (frameIn->getData(&dataIn, &dataSize) != 0) { + ALOGE("%s: map input V4L2 frame failed!", __FUNCTION__); + return; + } + + mData.resize(dataSize); + std::memcpy(mData.data(), dataIn, dataSize); +} + +AllocatedV4L2Frame::~AllocatedV4L2Frame() {} + +int AllocatedV4L2Frame::getData(uint8_t** outData, size_t* dataSize) { + if (outData == nullptr || dataSize == nullptr) { + ALOGE("%s: outData(%p)/dataSize(%p) must not be null", __FUNCTION__, outData, dataSize); + return -1; + } + + *outData = mData.data(); + *dataSize = mData.size(); + return 0; +} + +} // namespace implementation +} // namespace device +} // namespace camera +} // namespace hardware +} // namespace android \ No newline at end of file diff --git a/camera/device/default/ExternalCameraUtils.h b/camera/device/default/ExternalCameraUtils.h new file mode 100644 index 0000000000..b37933ce7e --- /dev/null +++ b/camera/device/default/ExternalCameraUtils.h @@ -0,0 +1,300 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERAUTILS_H_ +#define HARDWARE_INTERFACES_CAMERA_DEVICE_DEFAULT_EXTERNALCAMERAUTILS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::camera::common::Status; +using ::aidl::android::hardware::camera::device::CaptureResult; +using ::aidl::android::hardware::camera::device::ErrorCode; +using ::aidl::android::hardware::camera::device::NotifyMsg; +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::aidl::android::hardware::graphics::common::PixelFormat; +using ::android::hardware::camera::common::V1_0::helper::CameraMetadata; +using ::android::hardware::camera::common::V1_0::helper::HandleImporter; + +namespace android { +namespace hardware { +namespace camera { + +namespace external { +namespace common { + +struct Size { + int32_t width; + int32_t height; + + bool operator==(const Size& other) const { + return (width == other.width && height == other.height); + } +}; + +struct SizeHasher { + size_t operator()(const Size& sz) const { + size_t result = 1; + result = 31 * result + sz.width; + result = 31 * result + sz.height; + return result; + } +}; + +struct ExternalCameraConfig { + static const char* kDefaultCfgPath; + static ExternalCameraConfig loadFromCfg(const char* cfgPath = kDefaultCfgPath); + + // CameraId base offset for numerical representation + uint32_t cameraIdOffset; + + // List of internal V4L2 video nodes external camera HAL must ignore. + std::unordered_set mInternalDevices; + + // Maximal size of a JPEG buffer, in bytes + int32_t maxJpegBufSize; + + // Maximum Size that can sustain 30fps streaming + Size maxVideoSize; + + // Size of v4l2 buffer queue when streaming <= kMaxVideoSize + uint32_t numVideoBuffers; + + // Size of v4l2 buffer queue when streaming > kMaxVideoSize + uint32_t numStillBuffers; + + // Indication that the device connected supports depth output + bool depthEnabled; + + struct FpsLimitation { + Size size; + double fpsUpperBound; + }; + std::vector fpsLimits; + std::vector depthFpsLimits; + + // Minimum output stream size + Size minStreamSize; + + // The value of android.sensor.orientation + int32_t orientation; + + private: + ExternalCameraConfig(); + static bool updateFpsList(tinyxml2::XMLElement* fpsList, std::vector& fpsLimits); +}; + +} // namespace common +} // namespace external + +namespace device { +namespace implementation { + +struct SupportedV4L2Format { + int32_t width; + int32_t height; + uint32_t fourcc; + // All supported frame rate for this w/h/fourcc combination + struct FrameRate { + // Duration (in seconds) of a single frame. + // Numerator and denominator of the frame duration are stored separately. + // For ex. a frame lasting 1/30 of a second will be stored as {1, 30} + uint32_t durationNumerator; // frame duration numerator. Ex: 1 + uint32_t durationDenominator; // frame duration denominator. Ex: 30 + double getFramesPerSecond() const; // FPS as double. Ex: 30.0 + }; + std::vector frameRates; +}; + +// A Base class with basic information about a frame +struct Frame : public std::enable_shared_from_this

The desired CaptureRequest settings override with which certain keys are + * applied earlier so that they can take effect sooner.

+ */ + ANDROID_CONTROL_SETTINGS_OVERRIDE = 65588, + /** + * android.control.availableSettingsOverrides [static, int32[], public] + * + *

List of available settings overrides supported by the camera device that can + * be used to speed up certain controls.

+ */ + ANDROID_CONTROL_AVAILABLE_SETTINGS_OVERRIDES, + /** + * android.control.settingsOverridingFrameNumber [dynamic, int32, system] + * + *

The frame number of the newer request overriding this capture.

+ */ + ANDROID_CONTROL_SETTINGS_OVERRIDING_FRAME_NUMBER, + /** + * android.control.autoframing [dynamic, enum, public] + * + *

Automatic crop, pan and zoom to keep objects in the center of the frame.

+ */ + ANDROID_CONTROL_AUTOFRAMING, + /** + * android.control.autoframingAvailable [static, enum, public] + * + *

Whether the camera device supports ANDROID_CONTROL_AUTOFRAMING.

+ * + * @see ANDROID_CONTROL_AUTOFRAMING + */ + ANDROID_CONTROL_AUTOFRAMING_AVAILABLE, + /** + * android.control.autoframingState [dynamic, enum, public] + * + *

Current state of auto-framing.

+ */ + ANDROID_CONTROL_AUTOFRAMING_STATE, /** * android.demosaic.mode [controls, enum, system] * @@ -1029,6 +1069,12 @@ enum CameraMetadataTag { *

Recommended 10-bit dynamic range profile.

*/ ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE, + /** + * android.request.availableColorSpaceProfilesMap [static, enum[], ndk_public] + * + *

A list of all possible color space profiles supported by a camera device.

+ */ + ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP, /** * android.scaler.cropRegion [dynamic, int32[], public] * @@ -1237,6 +1283,13 @@ enum CameraMetadataTag { *

The stream use cases supported by this camera device.

*/ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851994, + /** + * android.scaler.rawCropRegion [dynamic, int32[], public] + * + *

The region of the sensor that corresponds to the RAW read out for this + * capture when the stream use case of a RAW stream is set to CROPPED_RAW.

+ */ + ANDROID_SCALER_RAW_CROP_REGION, /** * android.sensor.exposureTime [dynamic, int64, public] * @@ -2229,8 +2282,8 @@ enum CameraMetadataTag { * *

Whether this camera device can support identical set of stream combinations * involving HEIC image format, compared to the - * table of combinations - * involving JPEG image format required for the device's hardware level and capabilities.

+ * table of combinations involving JPEG image format required for the device's hardware + * level and capabilities.

*/ ANDROID_HEIC_INFO_SUPPORTED = CameraMetadataSectionStart.ANDROID_HEIC_INFO_START, /** @@ -2252,4 +2305,56 @@ enum CameraMetadataTag { * passenger seats.

*/ ANDROID_AUTOMOTIVE_LENS_FACING = CameraMetadataSectionStart.ANDROID_AUTOMOTIVE_LENS_START, + /** + * android.jpegr.availableJpegRStreamConfigurations [static, enum[], ndk_public] + * + *

The available Jpeg/R stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS = CameraMetadataSectionStart.ANDROID_JPEGR_START, + /** + * android.jpegr.availableJpegRMinFrameDurations [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for Jpeg/R output formats.

+ */ + ANDROID_JPEGR_AVAILABLE_JPEG_R_MIN_FRAME_DURATIONS, + /** + * android.jpegr.availableJpegRStallDurations [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for Jpeg/R streams.

+ */ + ANDROID_JPEGR_AVAILABLE_JPEG_R_STALL_DURATIONS, + /** + * android.jpegr.availableJpegRStreamConfigurationsMaximumResolution [static, enum[], ndk_public] + * + *

The available Jpeg/R stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION, + /** + * android.jpegr.availableJpegRMinFrameDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for Jpeg/R output formats for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_JPEGR_AVAILABLE_JPEG_R_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.jpegr.availableJpegRStallDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for Jpeg/R streams for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_JPEGR_AVAILABLE_JPEG_R_STALL_DURATIONS_MAXIMUM_RESOLUTION, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl new file mode 100644 index 0000000000..0fef3735b1 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.control.autoframing enumeration values + * @see ANDROID_CONTROL_AUTOFRAMING + */ +@VintfStability +@Backing(type="int") +enum ControlAutoframing { + ANDROID_CONTROL_AUTOFRAMING_OFF, + ANDROID_CONTROL_AUTOFRAMING_ON, + ANDROID_CONTROL_AUTOFRAMING_AUTO, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl new file mode 100644 index 0000000000..da0d34894d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.control.autoframingAvailable enumeration values + * @see ANDROID_CONTROL_AUTOFRAMING_AVAILABLE + */ +@VintfStability +@Backing(type="int") +enum ControlAutoframingAvailable { + ANDROID_CONTROL_AUTOFRAMING_AVAILABLE_FALSE, + ANDROID_CONTROL_AUTOFRAMING_AVAILABLE_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl new file mode 100644 index 0000000000..13183a5314 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.control.autoframingState enumeration values + * @see ANDROID_CONTROL_AUTOFRAMING_STATE + */ +@VintfStability +@Backing(type="int") +enum ControlAutoframingState { + ANDROID_CONTROL_AUTOFRAMING_STATE_INACTIVE, + ANDROID_CONTROL_AUTOFRAMING_STATE_FRAMING, + ANDROID_CONTROL_AUTOFRAMING_STATE_CONVERGED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl new file mode 100644 index 0000000000..d97f7c83ac --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.control.settingsOverride enumeration values + * @see ANDROID_CONTROL_SETTINGS_OVERRIDE + */ +@VintfStability +@Backing(type="int") +enum ControlSettingsOverride { + ANDROID_CONTROL_SETTINGS_OVERRIDE_OFF, + ANDROID_CONTROL_SETTINGS_OVERRIDE_ZOOM, + ANDROID_CONTROL_SETTINGS_OVERRIDE_VENDOR_START = 0x4000, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl new file mode 100644 index 0000000000..911a062355 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.jpegr.availableJpegRStreamConfigurations enumeration values + * @see ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum JpegrAvailableJpegRStreamConfigurations { + ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..9e78662b5b --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.jpegr.availableJpegRStreamConfigurationsMaximumResolution enumeration values + * @see ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + */ +@VintfStability +@Backing(type="int") +enum JpegrAvailableJpegRStreamConfigurationsMaximumResolution { + ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT, + ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl index f5c77eb28c..ebe0b4c4a3 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl @@ -49,4 +49,5 @@ enum RequestAvailableCapabilities { ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl new file mode 100644 index 0000000000..b397dea8d2 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.request.availableColorSpaceProfilesMap enumeration values + * @see ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP + */ +@VintfStability +@Backing(type="long") +enum RequestAvailableColorSpaceProfilesMap { + ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED = -1L, + ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_SRGB = 0L, + ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_DISPLAY_P3 = 7L, + ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_BT2020_HLG = 16L, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl index daa0fd3028..da27a48e32 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -35,5 +35,6 @@ enum ScalerAvailableStreamUseCases { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3L, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 0x4L, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW = 0x6L, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000L, } diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp index e2c2bea788..35ec9766a0 100644 --- a/camera/provider/aidl/Android.bp +++ b/camera/provider/aidl/Android.bp @@ -14,9 +14,10 @@ aidl_interface { "android/hardware/camera/provider/*.aidl", ], imports: [ - "android.hardware.camera.device-V1", + "android.hardware.camera.device-V2", "android.hardware.camera.common-V1", ], + frozen: true, stability: "vintf", backend: { java: { @@ -34,6 +35,14 @@ aidl_interface { "android.hardware.camera.common-V1", ], }, + { + version: "2", + imports: [ + "android.hardware.camera.device-V2", + "android.hardware.camera.common-V1", + ], + }, + ], } diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/.hash b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/.hash new file mode 100644 index 0000000000..2770775591 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/.hash @@ -0,0 +1 @@ +5c3de5da344a2cf7f68e1078a9ed9d6770e59136 diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl new file mode 100644 index 0000000000..df77c40a28 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.provider; +@VintfStability +parcelable CameraIdAndStreamCombination { + String cameraId; + android.hardware.camera.device.StreamConfiguration streamConfiguration; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl new file mode 100644 index 0000000000..334fb2c827 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.provider; +@VintfStability +parcelable ConcurrentCameraIdCombination { + List combination; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ICameraProvider.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ICameraProvider.aidl new file mode 100644 index 0000000000..2f0184f639 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ICameraProvider.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.provider; +@VintfStability +interface ICameraProvider { + void setCallback(android.hardware.camera.provider.ICameraProviderCallback callback); + android.hardware.camera.common.VendorTagSection[] getVendorTags(); + String[] getCameraIdList(); + android.hardware.camera.device.ICameraDevice getCameraDeviceInterface(String cameraDeviceName); + void notifyDeviceStateChange(long deviceState); + android.hardware.camera.provider.ConcurrentCameraIdCombination[] getConcurrentCameraIds(); + boolean isConcurrentStreamCombinationSupported(in android.hardware.camera.provider.CameraIdAndStreamCombination[] configs); + const long DEVICE_STATE_NORMAL = 0; + const long DEVICE_STATE_BACK_COVERED = (1 << 0) /* 1 */; + const long DEVICE_STATE_FRONT_COVERED = (1 << 1) /* 2 */; + const long DEVICE_STATE_FOLDED = (1 << 2) /* 4 */; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ICameraProviderCallback.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ICameraProviderCallback.aidl new file mode 100644 index 0000000000..d3c53f5bc2 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/2/android/hardware/camera/provider/ICameraProviderCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.provider; +@VintfStability +interface ICameraProviderCallback { + void cameraDeviceStatusChange(String cameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus); + void torchModeStatusChange(String cameraDeviceName, android.hardware.camera.common.TorchModeStatus newStatus); + void physicalCameraDeviceStatusChange(String cameraDeviceName, String physicalCameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus); +} diff --git a/camera/provider/aidl/vts/Android.bp b/camera/provider/aidl/vts/Android.bp index 647cbacd8c..59f6c66051 100644 --- a/camera/provider/aidl/vts/Android.bp +++ b/camera/provider/aidl/vts/Android.bp @@ -27,6 +27,7 @@ cc_test { name: "VtsAidlHalCameraProvider_TargetTest", defaults: [ "VtsHalTargetTestDefaults", + "android.hardware.graphics.common-ndk_static", "use_libaidlvintf_gtest_helper_static", ], srcs: [ @@ -58,10 +59,9 @@ cc_test { static_libs: [ "android.hardware.camera.common@1.0-helper", "android.hardware.camera.common-V1-ndk", - "android.hardware.camera.device-V1-ndk", - "android.hardware.camera.metadata-V1-ndk", - "android.hardware.camera.provider-V1-ndk", - "android.hardware.graphics.common-V4-ndk", + "android.hardware.camera.device-V2-ndk", + "android.hardware.camera.metadata-V2-ndk", + "android.hardware.camera.provider-V2-ndk", "android.hidl.allocator@1.0", "libgrallocusage", "libhidlmemory", diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index b764ad6299..aee53664b0 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -36,6 +36,7 @@ using ::aidl::android::hardware::camera::common::CameraResourceCost; using ::aidl::android::hardware::camera::common::TorchModeStatus; using ::aidl::android::hardware::camera::common::VendorTagSection; using ::aidl::android::hardware::camera::device::ICameraDevice; +using ::aidl::android::hardware::camera::metadata::RequestAvailableColorSpaceProfilesMap; using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap; using ::aidl::android::hardware::camera::metadata::SensorPixelMode; using ::aidl::android::hardware::camera::provider::CameraIdAndStreamCombination; @@ -2025,6 +2026,61 @@ TEST_P(CameraAidlTest, process10BitDynamicRangeRequest) { } } +TEST_P(CameraAidlTest, process8BitColorSpaceRequests) { + static int profiles[] = {ColorSpaceNamed::DISPLAY_P3, ColorSpaceNamed::SRGB}; + + for (int32_t i = 0; i < sizeof(profiles) / sizeof(profiles[0]); i++) { + processColorSpaceRequest(static_cast(profiles[i]), + static_cast( + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD)); + } +} + +TEST_P(CameraAidlTest, process10BitColorSpaceRequests) { + static const camera_metadata_enum_android_request_available_dynamic_range_profiles_map + dynamicRangeProfiles[] = { + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO + }; + + // Process all dynamic range profiles with BT2020_HLG + for (int32_t i = 0; i < sizeof(dynamicRangeProfiles) / sizeof(dynamicRangeProfiles[0]); i++) { + processColorSpaceRequest( + static_cast(ColorSpaceNamed::BT2020_HLG), + static_cast(dynamicRangeProfiles[i])); + } +} + +TEST_P(CameraAidlTest, processZoomSettingsOverrideRequests) { + const int32_t kFrameCount = 5; + const int32_t kTestCases = 2; + const bool kOverrideSequence[kTestCases][kFrameCount] = {// ZOOM, ZOOM, ZOOM, ZOOM, ZOOM; + {true, true, true, true, true}, + // OFF, ZOOM, ZOOM, ZOOM, OFF; + {false, true, true, true, false}}; + const bool kExpectedOverrideResults[kTestCases][kFrameCount] = { + // All resuls should be overridden except the last one. The last result's + // zoom doesn't have speed-up. + {true, true, true, true, false}, + // Because we require at least 1 frame speed-up, request #1, #2 and #3 + // will be overridden. + {true, true, true, false, false}}; + + for (int i = 0; i < kTestCases; i++) { + processZoomSettingsOverrideRequests(kFrameCount, kOverrideSequence[i], + kExpectedOverrideResults[i]); + } +} + // Generate and verify a burst containing alternating sensor sensitivity values TEST_P(CameraAidlTest, processCaptureRequestBurstISO) { std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); @@ -2973,10 +3029,28 @@ TEST_P(CameraAidlTest, configureInjectionStreamsWithSessionParameters) { } } +TEST_P(CameraAidlTest, configureStreamsUseCasesCroppedRaw) { + AvailableStream rawStreamThreshold = + {INT_MAX, INT_MAX, static_cast(PixelFormat::RAW16)}; + configureStreamUseCaseInternal(rawStreamThreshold); +} + // Verify that valid stream use cases can be configured successfully, and invalid use cases // fail stream configuration. TEST_P(CameraAidlTest, configureStreamsUseCases) { + AvailableStream previewStreamThreshold = + {kMaxPreviewWidth, kMaxPreviewHeight, static_cast(PixelFormat::YCBCR_420_888)}; + configureStreamUseCaseInternal(previewStreamThreshold); +} + +// Validate the integrity of stream configuration metadata +TEST_P(CameraAidlTest, validateStreamConfigurations) { std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputStreams; + + const int32_t scalerSizesTag = ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS; + const int32_t scalerMinFrameDurationsTag = ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS; + const int32_t scalerStallDurationsTag = ANDROID_SCALER_AVAILABLE_STALL_DURATIONS; for (const auto& name : cameraDeviceNames) { CameraMetadata meta; @@ -2984,97 +3058,31 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) { openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, &cameraDevice /*out*/); - camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); - // Check if camera support depth only - if (isDepthOnly(staticMeta)) { - ndk::ScopedAStatus ret = mSession->close(); - mSession = nullptr; - ASSERT_TRUE(ret.isOk()); - continue; + + if (is10BitDynamicRangeCapable(staticMeta)) { + std::vector> supportedP010Sizes, supportedBlobSizes; + + getSupportedSizes(staticMeta, scalerSizesTag, HAL_PIXEL_FORMAT_BLOB, + &supportedBlobSizes); + getSupportedSizes(staticMeta, scalerSizesTag, HAL_PIXEL_FORMAT_YCBCR_P010, + &supportedP010Sizes); + ASSERT_FALSE(supportedP010Sizes.empty()); + + std::vector blobMinDurations, blobStallDurations; + getSupportedDurations(staticMeta, scalerMinFrameDurationsTag, HAL_PIXEL_FORMAT_BLOB, + supportedP010Sizes, &blobMinDurations); + getSupportedDurations(staticMeta, scalerStallDurationsTag, HAL_PIXEL_FORMAT_BLOB, + supportedP010Sizes, &blobStallDurations); + ASSERT_FALSE(blobStallDurations.empty()); + ASSERT_FALSE(blobMinDurations.empty()); + ASSERT_EQ(supportedP010Sizes.size(), blobMinDurations.size()); + ASSERT_EQ(blobMinDurations.size(), blobStallDurations.size()); } - std::vector outputPreviewStreams; - AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, - static_cast(PixelFormat::YCBCR_420_888)}; - ASSERT_EQ(Status::OK, - getAvailableOutputStreams(staticMeta, outputPreviewStreams, &previewThreshold)); - ASSERT_NE(0u, outputPreviewStreams.size()); + // TODO (b/280887191): Validate other aspects of stream configuration metadata... - // Combine valid and invalid stream use cases - std::vector useCases(kMandatoryUseCases); - useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1); - - std::vector supportedUseCases; - camera_metadata_ro_entry entry; - auto retcode = find_camera_metadata_ro_entry( - staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); - if ((0 == retcode) && (entry.count > 0)) { - supportedUseCases.insert(supportedUseCases.end(), entry.data.i64, - entry.data.i64 + entry.count); - } else { - supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); - } - - std::vector streams(1); - streams[0] = {0, - StreamType::OUTPUT, - outputPreviewStreams[0].width, - outputPreviewStreams[0].height, - static_cast(outputPreviewStreams[0].format), - static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( - GRALLOC1_CONSUMER_USAGE_CPU_READ), - Dataspace::UNKNOWN, - StreamRotation::ROTATION_0, - std::string(), - 0, - -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, - RequestAvailableDynamicRangeProfilesMap:: - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; - - int32_t streamConfigCounter = 0; - CameraMetadata req; - StreamConfiguration config; - RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; - ndk::ScopedAStatus ret = mSession->constructDefaultRequestSettings(reqTemplate, &req); - ASSERT_TRUE(ret.isOk()); - config.sessionParams = req; - - for (int64_t useCase : useCases) { - bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(), - useCase) != supportedUseCases.end(); - - streams[0].useCase = static_cast< - aidl::android::hardware::camera::metadata::ScalerAvailableStreamUseCases>( - useCase); - config.streams = streams; - config.operationMode = StreamConfigurationMode::NORMAL_MODE; - config.streamConfigCounter = streamConfigCounter; - config.multiResolutionInputImage = false; - - bool combSupported; - ret = cameraDevice->isStreamCombinationSupported(config, &combSupported); - if (static_cast(Status::OPERATION_NOT_SUPPORTED) == - ret.getServiceSpecificError()) { - continue; - } - - ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(combSupported, useCaseSupported); - - std::vector halStreams; - ret = mSession->configureStreams(config, &halStreams); - ALOGI("configureStreams returns status: %d", ret.getServiceSpecificError()); - if (useCaseSupported) { - ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(1u, halStreams.size()); - } else { - ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), - ret.getServiceSpecificError()); - } - } - ret = mSession->close(); + ndk::ScopedAStatus ret = mSession->close(); mSession = nullptr; ASSERT_TRUE(ret.isOk()); } @@ -3084,4 +3092,4 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CameraAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, CameraAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames(ICameraProvider::descriptor)), - android::hardware::PrintInstanceNameToString); \ No newline at end of file + android::hardware::PrintInstanceNameToString); diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index ef3ce4f91f..7665f797c1 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ using ::aidl::android::hardware::camera::common::TorchModeStatus; using ::aidl::android::hardware::camera::device::CameraMetadata; using ::aidl::android::hardware::camera::device::ICameraDevice; using ::aidl::android::hardware::camera::metadata::CameraMetadataTag; +using ::aidl::android::hardware::camera::metadata::RequestAvailableColorSpaceProfilesMap; using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap; using ::aidl::android::hardware::camera::metadata::SensorInfoColorFilterArrangement; using ::aidl::android::hardware::camera::metadata::SensorPixelMode; @@ -339,8 +341,8 @@ void CameraAidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* if (entry.data.i64[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { supportDefaultUseCase = true; } - ASSERT_TRUE(entry.data.i64[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || - entry.data.i64[i] >= + ASSERT_TRUE(entry.data.i64[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW + || entry.data.i64[i] >= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START); } ASSERT_TRUE(supportDefaultUseCase); @@ -349,6 +351,69 @@ void CameraAidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* ASSERT_EQ(hasStreamUseCaseCap, supportMandatoryUseCases); } +void CameraAidlTest::verifySettingsOverrideCharacteristics(const camera_metadata_t* metadata) { + camera_metadata_ro_entry entry; + int retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_CONTROL_AVAILABLE_SETTINGS_OVERRIDES, &entry); + bool supportSettingsOverride = false; + if (0 == retcode) { + supportSettingsOverride = true; + bool hasOff = false; + for (size_t i = 0; i < entry.count; i++) { + if (entry.data.u8[i] == ANDROID_CONTROL_SETTINGS_OVERRIDE_OFF) { + hasOff = true; + } + } + ASSERT_TRUE(hasOff); + } + + // Check availableRequestKeys + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, &entry); + bool hasSettingsOverrideRequestKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasSettingsOverrideRequestKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_SETTINGS_OVERRIDE) != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableRequestKeys failed!"; + } + + // Check availableResultKeys + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, &entry); + bool hasSettingsOverrideResultKey = false; + bool hasOverridingFrameNumberKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasSettingsOverrideResultKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_SETTINGS_OVERRIDE) != entry.data.i32 + entry.count; + hasOverridingFrameNumberKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_SETTINGS_OVERRIDING_FRAME_NUMBER) + != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableResultKeys failed!"; + } + + // Check availableCharacteristicKeys + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, &entry); + bool hasSettingsOverrideCharacteristicsKey= false; + if ((0 == retcode) && (entry.count > 0)) { + hasSettingsOverrideCharacteristicsKey = std::find(entry.data.i32, + entry.data.i32 + entry.count, ANDROID_CONTROL_AVAILABLE_SETTINGS_OVERRIDES) + != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableCharacteristicsKeys failed!"; + } + + ASSERT_EQ(supportSettingsOverride, hasSettingsOverrideRequestKey); + ASSERT_EQ(supportSettingsOverride, hasSettingsOverrideResultKey); + ASSERT_EQ(supportSettingsOverride, hasOverridingFrameNumberKey); + ASSERT_EQ(supportSettingsOverride, hasSettingsOverrideCharacteristicsKey); +} + Status CameraAidlTest::isMonochromeCamera(const camera_metadata_t* staticMeta) { Status ret = Status::OPERATION_NOT_SUPPORTED; if (nullptr == staticMeta) { @@ -624,6 +689,7 @@ void CameraAidlTest::verifyCameraCharacteristics(const CameraMetadata& chars) { verifyExtendedSceneModeCharacteristics(metadata); verifyZoomCharacteristics(metadata); verifyStreamUseCaseCharacteristics(metadata); + verifySettingsOverrideCharacteristics(metadata); } void CameraAidlTest::verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata) { @@ -1537,6 +1603,15 @@ void CameraAidlTest::verifyRequestTemplate(const camera_metadata_t* metadata, ASSERT_EQ(zoomRatioEntry.count, 1); ASSERT_EQ(zoomRatioEntry.data.f[0], 1.0f); } + + // Check settings override + camera_metadata_ro_entry settingsOverrideEntry; + int foundSettingsOverride = find_camera_metadata_ro_entry(metadata, + ANDROID_CONTROL_SETTINGS_OVERRIDE, &settingsOverrideEntry); + if (foundSettingsOverride == 0) { + ASSERT_EQ(settingsOverrideEntry.count, 1); + ASSERT_EQ(settingsOverrideEntry.data.u8[0], ANDROID_CONTROL_SETTINGS_OVERRIDE_OFF); + } } void CameraAidlTest::openEmptyDeviceSession(const std::string& name, @@ -2111,6 +2186,121 @@ void CameraAidlTest::processCaptureRequestInternal(uint64_t bufferUsage, } } +void CameraAidlTest::configureStreamUseCaseInternal(const AvailableStream &threshold) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr cameraDevice; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + // Check if camera support depth only + if (isDepthOnly(staticMeta) || + (threshold.format == static_cast(PixelFormat::RAW16) && + !supportsCroppedRawUseCase(staticMeta))) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + std::vector outputPreviewStreams; + + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputPreviewStreams, &threshold)); + ASSERT_NE(0u, outputPreviewStreams.size()); + + // Combine valid and invalid stream use cases + std::vector useCases(kMandatoryUseCases); + useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW + 1); + + std::vector supportedUseCases; + if (threshold.format == static_cast(PixelFormat::RAW16)) { + // If the format is RAW16, supported use case is only CROPPED_RAW. + // All others are unsupported for this format. + useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW); + supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW); + supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); + } else { + camera_metadata_ro_entry entry; + auto retcode = find_camera_metadata_ro_entry( + staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + supportedUseCases.insert(supportedUseCases.end(), entry.data.i64, + entry.data.i64 + entry.count); + } else { + supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); + } + } + + std::vector streams(1); + streams[0] = {0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + 0, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; + + int32_t streamConfigCounter = 0; + CameraMetadata req; + StreamConfiguration config; + RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; + ndk::ScopedAStatus ret = mSession->constructDefaultRequestSettings(reqTemplate, &req); + ASSERT_TRUE(ret.isOk()); + config.sessionParams = req; + + for (int64_t useCase : useCases) { + bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(), + useCase) != supportedUseCases.end(); + + streams[0].useCase = static_cast< + aidl::android::hardware::camera::metadata::ScalerAvailableStreamUseCases>( + useCase); + config.streams = streams; + config.operationMode = StreamConfigurationMode::NORMAL_MODE; + config.streamConfigCounter = streamConfigCounter; + config.multiResolutionInputImage = false; + + bool combSupported; + ret = cameraDevice->isStreamCombinationSupported(config, &combSupported); + if (static_cast(Status::OPERATION_NOT_SUPPORTED) == + ret.getServiceSpecificError()) { + continue; + } + + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(combSupported, useCaseSupported); + + std::vector halStreams; + ret = mSession->configureStreams(config, &halStreams); + ALOGI("configureStreams returns status: %d", ret.getServiceSpecificError()); + if (useCaseSupported) { + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(1u, halStreams.size()); + } else { + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), + ret.getServiceSpecificError()); + } + } + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } + +} + void CameraAidlTest::configureSingleStream( const std::string& name, const std::shared_ptr& provider, const AvailableStream* previewThreshold, uint64_t bufferUsage, RequestTemplate reqTemplate, @@ -2812,6 +3002,211 @@ void CameraAidlTest::verify10BitMetadata( } } +bool CameraAidlTest::reportsColorSpaces(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry capabilityEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &capabilityEntry); + if (rc == 0) { + for (uint32_t i = 0; i < capabilityEntry.count; i++) { + if (capabilityEntry.data.u8[i] == + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES) { + return true; + } + } + } + return false; +} + +void CameraAidlTest::getColorSpaceProfiles( + const camera_metadata_t* staticMeta, + std::vector* profiles) { + ASSERT_NE(nullptr, staticMeta); + ASSERT_NE(nullptr, profiles); + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP, &entry); + ASSERT_EQ(rc, 0); + ASSERT_TRUE(entry.count > 0); + ASSERT_EQ(entry.count % 3, 0); + + for (uint32_t i = 0; i < entry.count; i += 3) { + ASSERT_NE(entry.data.i64[i], + ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED); + if (std::find(profiles->begin(), profiles->end(), + static_cast(entry.data.i64[i])) + == profiles->end()) { + profiles->emplace_back( + static_cast(entry.data.i64[i])); + } + } +} + +bool CameraAidlTest::isColorSpaceCompatibleWithDynamicRangeAndPixelFormat( + const camera_metadata_t* staticMeta, + RequestAvailableColorSpaceProfilesMap colorSpace, + RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile, + aidl::android::hardware::graphics::common::PixelFormat pixelFormat) { + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP, &entry); + + if (rc == 0) { + for (uint32_t i = 0; i < entry.count; i += 3) { + RequestAvailableColorSpaceProfilesMap entryColorSpace = + static_cast(entry.data.i64[i]); + int64_t dynamicRangeProfileI64 = static_cast(dynamicRangeProfile); + int32_t entryImageFormat = static_cast(entry.data.i64[i + 1]); + int32_t expectedImageFormat = halFormatToPublicFormat(pixelFormat); + if (entryColorSpace == colorSpace + && (entry.data.i64[i + 2] & dynamicRangeProfileI64) != 0 + && entryImageFormat == expectedImageFormat) { + return true; + } + } + } + + return false; +} + +const char* CameraAidlTest::getColorSpaceProfileString( + RequestAvailableColorSpaceProfilesMap colorSpace) { + auto colorSpaceCast = static_cast(colorSpace); + switch (colorSpaceCast) { + case ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED: + return "UNSPECIFIED"; + case ColorSpaceNamed::SRGB: + return "SRGB"; + case ColorSpaceNamed::LINEAR_SRGB: + return "LINEAR_SRGB"; + case ColorSpaceNamed::EXTENDED_SRGB: + return "EXTENDED_SRGB"; + case ColorSpaceNamed::LINEAR_EXTENDED_SRGB: + return "LINEAR_EXTENDED_SRGB"; + case ColorSpaceNamed::BT709: + return "BT709"; + case ColorSpaceNamed::BT2020: + return "BT2020"; + case ColorSpaceNamed::DCI_P3: + return "DCI_P3"; + case ColorSpaceNamed::DISPLAY_P3: + return "DISPLAY_P3"; + case ColorSpaceNamed::NTSC_1953: + return "NTSC_1953"; + case ColorSpaceNamed::SMPTE_C: + return "SMPTE_C"; + case ColorSpaceNamed::ADOBE_RGB: + return "ADOBE_RGB"; + case ColorSpaceNamed::PRO_PHOTO_RGB: + return "PRO_PHOTO_RGB"; + case ColorSpaceNamed::ACES: + return "ACES"; + case ColorSpaceNamed::ACESCG: + return "ACESCG"; + case ColorSpaceNamed::CIE_XYZ: + return "CIE_XYZ"; + case ColorSpaceNamed::CIE_LAB: + return "CIE_LAB"; + case ColorSpaceNamed::BT2020_HLG: + return "BT2020_HLG"; + case ColorSpaceNamed::BT2020_PQ: + return "BT2020_PQ"; + default: + return "INVALID"; + } + + return "INVALID"; +} + +const char* CameraAidlTest::getDynamicRangeProfileString( + RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile) { + auto dynamicRangeProfileCast = + static_cast + (dynamicRangeProfile); + switch (dynamicRangeProfileCast) { + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD: + return "STANDARD"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10: + return "HLG10"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10: + return "HDR10"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS: + return "HDR10_PLUS"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF: + return "DOLBY_VISION_10B_HDR_REF"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO: + return "DOLBY_VISION_10B_HDR_REF_P0"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM: + return "DOLBY_VISION_10B_HDR_OEM"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO: + return "DOLBY_VISION_10B_HDR_OEM_P0"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF: + return "DOLBY_VISION_8B_HDR_REF"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO: + return "DOLBY_VISION_8B_HDR_REF_P0"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM: + return "DOLBY_VISION_8B_HDR_OEM"; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO: + return "DOLBY_VISION_8B_HDR_OEM_P0"; + default: + return "INVALID"; + } + + return "INVALID"; +} + +int32_t CameraAidlTest::halFormatToPublicFormat( + aidl::android::hardware::graphics::common::PixelFormat pixelFormat) { + // This is an incomplete mapping of pixel format to image format and assumes dataspaces + // (see getDataspace) + switch (pixelFormat) { + case PixelFormat::BLOB: + return 0x100; // ImageFormat.JPEG + case PixelFormat::Y16: + return 0x44363159; // ImageFormat.DEPTH16 + default: + return static_cast(pixelFormat); + } +} + +bool CameraAidlTest::supportZoomSettingsOverride(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry availableOverridesEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_CONTROL_AVAILABLE_SETTINGS_OVERRIDES, + &availableOverridesEntry); + if (rc == 0) { + for (size_t i = 0; i < availableOverridesEntry.count; i++) { + if (availableOverridesEntry.data.i32[i] == ANDROID_CONTROL_SETTINGS_OVERRIDE_ZOOM) { + return true; + } + } + } + return false; +} + +bool CameraAidlTest::supportsCroppedRawUseCase(const camera_metadata_t *staticMeta) { + camera_metadata_ro_entry availableStreamUseCasesEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, + &availableStreamUseCasesEntry); + if (rc == 0) { + for (size_t i = 0; i < availableStreamUseCasesEntry.count; i++) { + if (availableStreamUseCasesEntry.data.i64[i] == + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW) { + return true; + } + } + } + return false; +} + +bool CameraAidlTest::isPerFrameControl(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry syncLatencyEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_SYNC_MAX_LATENCY, + &syncLatencyEntry); + if (rc == 0 && syncLatencyEntry.data.i32[0] == ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL) { + return true; + } + return false; +} + void CameraAidlTest::configurePreviewStream( const std::string& name, const std::shared_ptr& provider, const AvailableStream* previewThreshold, std::shared_ptr* session, @@ -2957,4 +3352,425 @@ void CameraAidlTest::updateInflightResultQueue( for (auto& it : mInflightMap) { it.second->resultQueue = resultQueue; } -} \ No newline at end of file +} + +void CameraAidlTest::processColorSpaceRequest( + RequestAvailableColorSpaceProfilesMap colorSpace, + RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + std::string version, deviceId; + ASSERT_TRUE(matchDeviceName(name, mProviderType, &version, &deviceId)); + CameraMetadata meta; + std::shared_ptr device; + openEmptyDeviceSession(name, mProvider, &mSession, &meta, &device); + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + + // Device does not report color spaces, skip. + if (!reportsColorSpaces(staticMeta)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + ALOGV("Camera %s does not report color spaces", name.c_str()); + continue; + } + std::vector profileList; + getColorSpaceProfiles(staticMeta, &profileList); + ASSERT_FALSE(profileList.empty()); + + // Device does not support color space / dynamic range profile, skip + if (std::find(profileList.begin(), profileList.end(), colorSpace) + == profileList.end() || !isColorSpaceCompatibleWithDynamicRangeAndPixelFormat( + staticMeta, colorSpace, dynamicRangeProfile, + PixelFormat::IMPLEMENTATION_DEFINED)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + ALOGV("Camera %s does not support color space %s with dynamic range profile %s and " + "pixel format %d", name.c_str(), getColorSpaceProfileString(colorSpace), + getDynamicRangeProfileString(dynamicRangeProfile), + PixelFormat::IMPLEMENTATION_DEFINED); + continue; + } + + ALOGV("Camera %s supports color space %s with dynamic range profile %s and pixel format %d", + name.c_str(), getColorSpaceProfileString(colorSpace), + getDynamicRangeProfileString(dynamicRangeProfile), + PixelFormat::IMPLEMENTATION_DEFINED); + + // If an HDR dynamic range profile is reported in the color space profile list, + // the device must also have the dynamic range profiles map capability and contain + // the dynamic range profile in the map. + if (dynamicRangeProfile != static_cast( + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD)) { + ASSERT_TRUE(is10BitDynamicRangeCapable(staticMeta)); + + std::vector dynamicRangeProfiles; + get10BitDynamicRangeProfiles(staticMeta, &dynamicRangeProfiles); + ASSERT_FALSE(dynamicRangeProfiles.empty()); + ASSERT_FALSE(std::find(dynamicRangeProfiles.begin(), dynamicRangeProfiles.end(), + dynamicRangeProfile) == dynamicRangeProfiles.end()); + } + + CameraMetadata req; + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; + ndk::ScopedAStatus ret = + mSession->constructDefaultRequestSettings(RequestTemplate::PREVIEW, &req); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* metadata = + reinterpret_cast(req.metadata.data()); + size_t expectedSize = req.metadata.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + + size_t entryCount = get_camera_metadata_entry_count(metadata); + ASSERT_GT(entryCount, 0u); + defaultSettings = metadata; + + const camera_metadata_t* settingsBuffer = defaultSettings.getAndLock(); + uint8_t* rawSettingsBuffer = (uint8_t*)settingsBuffer; + settings.metadata = std::vector( + rawSettingsBuffer, rawSettingsBuffer + get_camera_metadata_size(settingsBuffer)); + overrideRotateAndCrop(&settings); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + std::vector halStreams; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + Stream previewStream; + std::shared_ptr cb; + + previewStream.usage = + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER); + previewStream.dataSpace = getDataspace(PixelFormat::IMPLEMENTATION_DEFINED); + previewStream.colorSpace = static_cast(colorSpace); + configureStreams(name, mProvider, PixelFormat::IMPLEMENTATION_DEFINED, &mSession, + &previewStream, &halStreams, &supportsPartialResults, + &partialResultCount, &useHalBufManager, &cb, 0, + /*maxResolution*/ false, dynamicRangeProfile); + ASSERT_NE(mSession, nullptr); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + mInflightMap.clear(); + // Stream as long as needed to fill the Hal inflight queue + std::vector requests(halStreams[0].maxBuffers); + + for (int32_t requestId = 0; requestId < requests.size(); requestId++) { + std::shared_ptr inflightReq = std::make_shared( + static_cast(halStreams.size()), false, supportsPartialResults, + partialResultCount, std::unordered_set(), resultQueue); + + CaptureRequest& request = requests[requestId]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(halStreams.size()); + + size_t k = 0; + inflightReq->mOutstandingBufferIds.resize(halStreams.size()); + std::vector graphicBuffers; + graphicBuffers.reserve(halStreams.size()); + + auto bufferId = requestId + 1; // Buffer id value 0 is not valid + for (const auto& halStream : halStreams) { + buffer_handle_t buffer_handle; + if (useHalBufManager) { + outputBuffers[k] = {halStream.id, 0, + NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + auto usage = android_convertGralloc1To0Usage( + static_cast(halStream.producerUsage), + static_cast(halStream.consumerUsage)); + allocateGraphicBuffer(previewStream.width, previewStream.height, usage, + halStream.overrideFormat, &buffer_handle); + + inflightReq->mOutstandingBufferIds[halStream.id][bufferId] = buffer_handle; + graphicBuffers.push_back(buffer_handle); + outputBuffers[k] = { + halStream.id, bufferId, android::makeToAidl(buffer_handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + k++; + } + + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + request.frameNumber = bufferId; + request.fmqSettingsSize = 0; + request.settings = settings; + request.inputWidth = 0; + request.inputHeight = 0; + + { + std::unique_lock l(mLock); + mInflightMap[bufferId] = inflightReq; + } + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, requests.size()); + + returnStatus = mSession->repeatingRequestEnd(requests.size() - 1, + std::vector {halStreams[0].id}); + ASSERT_TRUE(returnStatus.isOk()); + + // We are keeping frame numbers and buffer ids consistent. Buffer id value of 0 + // is used to indicate a buffer that is not present/available so buffer ids as well + // as frame numbers begin with 1. + for (int32_t frameNumber = 1; frameNumber <= requests.size(); frameNumber++) { + const auto& inflightReq = mInflightMap[frameNumber]; + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + + if (dynamicRangeProfile != static_cast( + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD)) { + verify10BitMetadata(mHandleImporter, *inflightReq, dynamicRangeProfile); + } + } + + if (useHalBufManager) { + std::vector streamIds(halStreams.size()); + for (size_t i = 0; i < streamIds.size(); i++) { + streamIds[i] = halStreams[i].id; + } + mSession->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0); + cb->waitForBuffersReturned(); + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +void CameraAidlTest::processZoomSettingsOverrideRequests( + int32_t frameCount, const bool *overrideSequence, const bool *expectedResults) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + ndk::ScopedAStatus ret; + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr device; + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &device /*out*/); + camera_metadata_t* staticMeta = + clone_camera_metadata(reinterpret_cast(meta.metadata.data())); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + // Device does not support zoom settnigs override + if (!supportZoomSettingsOverride(staticMeta)) { + continue; + } + + if (!isPerFrameControl(staticMeta)) { + continue; + } + + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + Stream previewStream; + std::vector halStreams; + std::shared_ptr cb; + configurePreviewStream(name, mProvider, &previewThreshold, &mSession /*out*/, + &previewStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + ASSERT_NE(mSession, nullptr); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + ret = mSession->constructDefaultRequestSettings(RequestTemplate::PREVIEW, &settings); + ASSERT_TRUE(ret.isOk()); + + mInflightMap.clear(); + ::android::hardware::camera::common::V1_0::helper::CameraMetadata requestMeta; + std::vector requests(frameCount); + std::vector buffers(frameCount); + std::vector> inflightReqs(frameCount); + std::vector requestSettings(frameCount); + + for (int32_t i = 0; i < frameCount; i++) { + std::unique_lock l(mLock); + CaptureRequest& request = requests[i]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + StreamBuffer& outputBuffer = outputBuffers[0]; + + if (useHalBufManager) { + outputBuffer = {halStreams[0].id, 0, + NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStreams[0].producerUsage), + static_cast(halStreams[0].consumerUsage)), + halStreams[0].overrideFormat, &buffers[i]); + outputBuffer = {halStreams[0].id, bufferId + i, ::android::makeToAidl(buffers[i]), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + + // Set appropriate settings override tag + requestMeta.append(reinterpret_cast(settings.metadata.data())); + int32_t settingsOverride = overrideSequence[i] ? + ANDROID_CONTROL_SETTINGS_OVERRIDE_ZOOM : ANDROID_CONTROL_SETTINGS_OVERRIDE_OFF; + ASSERT_EQ(::android::OK, requestMeta.update(ANDROID_CONTROL_SETTINGS_OVERRIDE, + &settingsOverride, 1)); + camera_metadata_t* metaBuffer = requestMeta.release(); + uint8_t* rawMetaBuffer = reinterpret_cast(metaBuffer); + requestSettings[i].metadata = std::vector( + rawMetaBuffer, rawMetaBuffer + get_camera_metadata_size(metaBuffer)); + overrideRotateAndCrop(&(requestSettings[i])); + request.frameNumber = frameNumber + i; + request.fmqSettingsSize = 0; + request.settings = requestSettings[i]; + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + + inflightReqs[i] = std::make_shared(1, false, supportsPartialResults, + partialResultCount, resultQueue); + mInflightMap[frameNumber + i] = inflightReqs[i]; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, frameCount); + + for (size_t i = 0; i < frameCount; i++) { + std::unique_lock l(mLock); + while (!inflightReqs[i]->errorCodeValid && ((0 < inflightReqs[i]->numBuffersLeft) || + (!inflightReqs[i]->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReqs[i]->errorCodeValid); + ASSERT_NE(inflightReqs[i]->resultOutputBuffers.size(), 0u); + ASSERT_EQ(previewStream.id, inflightReqs[i]->resultOutputBuffers[0].buffer.streamId); + ASSERT_FALSE(inflightReqs[i]->collectedResult.isEmpty()); + ASSERT_TRUE(inflightReqs[i]->collectedResult.exists(ANDROID_CONTROL_SETTINGS_OVERRIDE)); + camera_metadata_entry_t overrideResult = + inflightReqs[i]->collectedResult.find(ANDROID_CONTROL_SETTINGS_OVERRIDE); + ASSERT_EQ(overrideResult.data.i32[0] == ANDROID_CONTROL_SETTINGS_OVERRIDE_ZOOM, + expectedResults[i]); + ASSERT_TRUE(inflightReqs[i]->collectedResult.exists( + ANDROID_CONTROL_SETTINGS_OVERRIDING_FRAME_NUMBER)); + camera_metadata_entry_t frameNumberEntry = inflightReqs[i]->collectedResult.find( + ANDROID_CONTROL_SETTINGS_OVERRIDING_FRAME_NUMBER); + ALOGV("%s: i %zu, expcetedResults[i] %d, overrideResult is %d, frameNumber %d", + __FUNCTION__, i, expectedResults[i], overrideResult.data.i32[0], + frameNumberEntry.data.i32[0]); + if (expectedResults[i]) { + ASSERT_GT(frameNumberEntry.data.i32[0], inflightReqs[i]->frameNumber); + } else { + ASSERT_EQ(frameNumberEntry.data.i32[0], frameNumber + i); + } + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +void CameraAidlTest::getSupportedSizes(const camera_metadata_t* ch, uint32_t tag, int32_t format, + std::vector>* sizes /*out*/) { + if (sizes == nullptr) { + return; + } + + camera_metadata_ro_entry entry; + int retcode = find_camera_metadata_ro_entry(ch, tag, &entry); + if ((0 == retcode) && (entry.count > 0)) { + // Scaler entry contains 4 elements (format, width, height, type) + for (size_t i = 0; i < entry.count; i += 4) { + if ((entry.data.i32[i] == format) && + (entry.data.i32[i + 3] == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT)) { + sizes->push_back(std::make_tuple(entry.data.i32[i + 1], entry.data.i32[i + 2])); + } + } + } +} + +void CameraAidlTest::getSupportedDurations(const camera_metadata_t* ch, uint32_t tag, + int32_t format, + const std::vector>& sizes, + std::vector* durations /*out*/) { + if (durations == nullptr) { + return; + } + + camera_metadata_ro_entry entry; + int retcode = find_camera_metadata_ro_entry(ch, tag, &entry); + if ((0 == retcode) && (entry.count > 0)) { + // Duration entry contains 4 elements (format, width, height, duration) + for (const auto& size : sizes) { + int64_t width = std::get<0>(size); + int64_t height = std::get<1>(size); + for (size_t i = 0; i < entry.count; i += 4) { + if ((entry.data.i64[i] == format) && (entry.data.i64[i + 1] == width) && + (entry.data.i64[i + 2] == height)) { + durations->push_back(entry.data.i64[i + 3]); + break; + } + } + } + } +} diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h index fdf312e9f6..588cb503b9 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.h +++ b/camera/provider/aidl/vts/camera_aidl_test.h @@ -47,6 +47,8 @@ #include +#include + #include #include @@ -126,6 +128,28 @@ class CameraAidlTest : public ::testing::TestWithParam { YUV_REPROCESS, }; + // Copied from ColorSpace.java (see Named) + enum ColorSpaceNamed { + SRGB, + LINEAR_SRGB, + EXTENDED_SRGB, + LINEAR_EXTENDED_SRGB, + BT709, + BT2020, + DCI_P3, + DISPLAY_P3, + NTSC_1953, + SMPTE_C, + ADOBE_RGB, + PRO_PHOTO_RGB, + ACES, + ACESCG, + CIE_XYZ, + CIE_LAB, + BT2020_HLG, + BT2020_PQ + }; + struct AvailableZSLInputOutput { int32_t inputFormat; int32_t outputFormat; @@ -204,6 +228,8 @@ class CameraAidlTest : public ::testing::TestWithParam { int32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, std::shared_ptr* cb /*out*/, uint32_t streamConfigCounter = 0); + void configureStreamUseCaseInternal(const AvailableStream &threshold); + void configureSingleStream( const std::string& name, const std::shared_ptr& provider, const AvailableStream* previewThreshold, uint64_t bufferUsage, @@ -233,6 +259,8 @@ class CameraAidlTest : public ::testing::TestWithParam { static void verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata); + static void verifySettingsOverrideCharacteristics(const camera_metadata_t* metadata); + static void verifyStreamCombination(const std::shared_ptr& device, const StreamConfiguration& config, bool expectedStatus, bool expectStreamCombQuery); @@ -351,11 +379,54 @@ class CameraAidlTest : public ::testing::TestWithParam { std::vector* profiles); + static bool reportsColorSpaces(const camera_metadata_t* staticMeta); + + static void getColorSpaceProfiles( + const camera_metadata_t* staticMeta, + std::vector* profiles); + + static bool isColorSpaceCompatibleWithDynamicRangeAndPixelFormat( + const camera_metadata_t* staticMeta, + aidl::android::hardware::camera::metadata:: + RequestAvailableColorSpaceProfilesMap colorSpace, + aidl::android::hardware::camera::metadata:: + RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile, + aidl::android::hardware::graphics::common::PixelFormat pixelFormat); + + static const char* getColorSpaceProfileString(aidl::android::hardware::camera::metadata:: + RequestAvailableColorSpaceProfilesMap colorSpace); + + static const char* getDynamicRangeProfileString(aidl::android::hardware::camera::metadata:: + RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile); + + static int32_t halFormatToPublicFormat( + aidl::android::hardware::graphics::common::PixelFormat pixelFormat); + // Used by switchToOffline where a new result queue is created for offline reqs void updateInflightResultQueue(const std::shared_ptr& resultQueue); static Size getMinSize(Size a, Size b); + void processColorSpaceRequest(aidl::android::hardware::camera::metadata:: + RequestAvailableColorSpaceProfilesMap colorSpace, + aidl::android::hardware::camera::metadata:: + RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile); + + void processZoomSettingsOverrideRequests( + int32_t frameCount, const bool *overrideSequence, const bool *expectedResults); + + bool supportZoomSettingsOverride(const camera_metadata_t* staticMeta); + bool supportsCroppedRawUseCase(const camera_metadata_t *staticMeta); + bool isPerFrameControl(const camera_metadata_t* staticMeta); + + void getSupportedSizes(const camera_metadata_t* ch, uint32_t tag, int32_t format, + std::vector>* sizes /*out*/); + + void getSupportedDurations(const camera_metadata_t* ch, uint32_t tag, int32_t format, + const std::vector>& sizes, + std::vector* durations /*out*/); + protected: // In-flight queue for tracking completion of capture requests. struct InFlightRequest { diff --git a/camera/provider/default/Android.bp b/camera/provider/default/Android.bp new file mode 100644 index 0000000000..ed45cbed9d --- /dev/null +++ b/camera/provider/default/Android.bp @@ -0,0 +1,104 @@ +// +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_library_shared { + name: "android.hardware.camera.provider-V1-external-impl", + defaults: ["hidl_defaults"], + proprietary: true, + srcs: [ + "ExternalCameraProvider.cpp", + ], + shared_libs: [ + "android.hardware.camera.common-V1-ndk", + "android.hardware.camera.device-V1-ndk", + "android.hardware.camera.provider-V1-ndk", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", + "android.hidl.allocator@1.0", + "android.hidl.memory@1.0", + "camera.device-external-impl", + "libbinder_ndk", + "libcamera_metadata", + "libcutils", + "libfmq", + "libhardware", + "libhidlbase", + "liblog", + "libtinyxml2", + "libutils", + ], + static_libs: [ + "android.hardware.camera.common@1.0-helper", + ], + export_include_dirs: ["."], +} + +cc_defaults { + name: "camera_external_service_defaults", + defaults: ["hidl_defaults"], + proprietary: true, + relative_install_path: "hw", + srcs: ["external-service.cpp"], + compile_multilib: "first", + shared_libs: [ + "android.hardware.camera.common-V1-ndk", + "android.hardware.camera.device-V1-ndk", + "android.hardware.camera.provider-V1-ndk", + "android.hardware.camera.provider-V1-external-impl", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", + "android.hidl.allocator@1.0", + "android.hidl.memory@1.0", + "camera.device-external-impl", + "libbinder_ndk", + "libcamera_metadata", + "libcutils", + "libfmq", + "libhardware", + "libhidlbase", + "liblog", + "libtinyxml2", + "libutils", + ], + static_libs: [ + "android.hardware.camera.common@1.0-helper", + ], +} + +cc_binary { + name: "android.hardware.camera.provider-V1-external-service", + defaults: ["camera_external_service_defaults"], + init_rc: ["android.hardware.camera.provider-V1-external-service.rc"], +} + +cc_binary { + name: "android.hardware.camera.provider-V1-external-service-lazy", + overrides: ["android.hardware.camera.provider-V1-external-service"], + defaults: ["camera_external_service_defaults"], + init_rc: ["android.hardware.camera.provider-V1-external-service-lazy.rc"], + cflags: ["-DLAZY_SERVICE"], +} diff --git a/camera/provider/default/ExternalCameraProvider.cpp b/camera/provider/default/ExternalCameraProvider.cpp new file mode 100644 index 0000000000..4d2c847255 --- /dev/null +++ b/camera/provider/default/ExternalCameraProvider.cpp @@ -0,0 +1,382 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "ExtCamPrvdr" +// #define LOG_NDEBUG 0 + +#include "ExternalCameraProvider.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace provider { +namespace implementation { + +using ::aidl::android::hardware::camera::common::Status; +using ::android::hardware::camera::device::implementation::ExternalCameraDevice; +using ::android::hardware::camera::device::implementation::fromStatus; +using ::android::hardware::camera::external::common::ExternalCameraConfig; + +namespace { +// "device@/external/" +const std::regex kDeviceNameRE("device@([0-9]+\\.[0-9]+)/external/(.+)"); +const int kMaxDevicePathLen = 256; +constexpr char kDevicePath[] = "/dev/"; +constexpr char kPrefix[] = "video"; +constexpr int kPrefixLen = sizeof(kPrefix) - 1; +constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen - 1; + +bool matchDeviceName(int cameraIdOffset, const std::string& deviceName, std::string* deviceVersion, + std::string* cameraDevicePath) { + std::smatch sm; + if (std::regex_match(deviceName, sm, kDeviceNameRE)) { + if (deviceVersion != nullptr) { + *deviceVersion = sm[1]; + } + if (cameraDevicePath != nullptr) { + *cameraDevicePath = "/dev/video" + std::to_string(std::stoi(sm[2]) - cameraIdOffset); + } + return true; + } + return false; +} +} // namespace + +ExternalCameraProvider::ExternalCameraProvider() : mCfg(ExternalCameraConfig::loadFromCfg()) { + mHotPlugThread = std::make_shared(this); + mHotPlugThread->run(); +} + +ExternalCameraProvider::~ExternalCameraProvider() { + mHotPlugThread->requestExitAndWait(); +} + +ndk::ScopedAStatus ExternalCameraProvider::setCallback( + const std::shared_ptr& in_callback) { + { + Mutex::Autolock _l(mLock); + mCallback = in_callback; + } + + if (mCallback == nullptr) { + return fromStatus(Status::OK); + } + + for (const auto& pair : mCameraStatusMap) { + mCallback->cameraDeviceStatusChange(pair.first, pair.second); + } + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraProvider::getVendorTags( + std::vector* _aidl_return) { + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + // No vendor tag support for USB camera + *_aidl_return = {}; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraProvider::getCameraIdList(std::vector* _aidl_return) { + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + // External camera HAL always report 0 camera, and extra cameras + // are just reported via cameraDeviceStatusChange callbacks + *_aidl_return = {}; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraProvider::getCameraDeviceInterface( + const std::string& in_cameraDeviceName, std::shared_ptr* _aidl_return) { + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + std::string cameraDevicePath, deviceVersion; + bool match = matchDeviceName(mCfg.cameraIdOffset, in_cameraDeviceName, &deviceVersion, + &cameraDevicePath); + + if (!match) { + *_aidl_return = nullptr; + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + + if (mCameraStatusMap.count(in_cameraDeviceName) == 0 || + mCameraStatusMap[in_cameraDeviceName] != CameraDeviceStatus::PRESENT) { + *_aidl_return = nullptr; + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + + ALOGV("Constructing external camera device"); + std::shared_ptr deviceImpl = + ndk::SharedRefBase::make(cameraDevicePath, mCfg); + if (deviceImpl == nullptr || deviceImpl->isInitFailed()) { + ALOGE("%s: camera device %s init failed!", __FUNCTION__, cameraDevicePath.c_str()); + *_aidl_return = nullptr; + return fromStatus(Status::INTERNAL_ERROR); + } + + IF_ALOGV() { + int interfaceVersion; + deviceImpl->getInterfaceVersion(&interfaceVersion); + ALOGV("%s: device interface version: %d", __FUNCTION__, interfaceVersion); + } + + *_aidl_return = deviceImpl; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraProvider::notifyDeviceStateChange(int64_t) { + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraProvider::getConcurrentCameraIds( + std::vector* _aidl_return) { + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + *_aidl_return = {}; + return fromStatus(Status::OK); +} + +ndk::ScopedAStatus ExternalCameraProvider::isConcurrentStreamCombinationSupported( + const std::vector&, bool* _aidl_return) { + if (_aidl_return == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + // No concurrent stream combinations are supported + *_aidl_return = false; + return fromStatus(Status::OK); +} + +void ExternalCameraProvider::addExternalCamera(const char* devName) { + ALOGV("%s: ExtCam: adding %s to External Camera HAL!", __FUNCTION__, devName); + Mutex::Autolock _l(mLock); + std::string deviceName; + std::string cameraId = + std::to_string(mCfg.cameraIdOffset + std::atoi(devName + kDevicePrefixLen)); + deviceName = + std::string("device@") + ExternalCameraDevice::kDeviceVersion + "/external/" + cameraId; + mCameraStatusMap[deviceName] = CameraDeviceStatus::PRESENT; + if (mCallback != nullptr) { + mCallback->cameraDeviceStatusChange(deviceName, CameraDeviceStatus::PRESENT); + } +} + +void ExternalCameraProvider::deviceAdded(const char* devName) { + { + base::unique_fd fd(::open(devName, O_RDWR)); + if (fd.get() < 0) { + ALOGE("%s open v4l2 device %s failed:%s", __FUNCTION__, devName, strerror(errno)); + return; + } + + struct v4l2_capability capability; + int ret = ioctl(fd.get(), VIDIOC_QUERYCAP, &capability); + if (ret < 0) { + ALOGE("%s v4l2 QUERYCAP %s failed", __FUNCTION__, devName); + return; + } + + if (!(capability.device_caps & V4L2_CAP_VIDEO_CAPTURE)) { + ALOGW("%s device %s does not support VIDEO_CAPTURE", __FUNCTION__, devName); + return; + } + } + + // See if we can initialize ExternalCameraDevice correctly + std::shared_ptr deviceImpl = + ndk::SharedRefBase::make(devName, mCfg); + if (deviceImpl == nullptr || deviceImpl->isInitFailed()) { + ALOGW("%s: Attempt to init camera device %s failed!", __FUNCTION__, devName); + return; + } + deviceImpl.reset(); + addExternalCamera(devName); +} + +void ExternalCameraProvider::deviceRemoved(const char* devName) { + Mutex::Autolock _l(mLock); + std::string deviceName; + std::string cameraId = + std::to_string(mCfg.cameraIdOffset + std::atoi(devName + kDevicePrefixLen)); + + deviceName = + std::string("device@") + ExternalCameraDevice::kDeviceVersion + "/external/" + cameraId; + + if (mCameraStatusMap.erase(deviceName) == 0) { + // Unknown device, do not fire callback + ALOGE("%s: cannot find camera device to remove %s", __FUNCTION__, devName); + return; + } + + if (mCallback != nullptr) { + mCallback->cameraDeviceStatusChange(deviceName, CameraDeviceStatus::NOT_PRESENT); + } +} + +void ExternalCameraProvider::updateAttachedCameras() { + ALOGV("%s start scanning for existing V4L2 devices", __FUNCTION__); + + // Find existing /dev/video* devices + DIR* devdir = opendir(kDevicePath); + if (devdir == nullptr) { + ALOGE("%s: cannot open %s! Exiting threadloop", __FUNCTION__, kDevicePath); + return; + } + + struct dirent* de; + while ((de = readdir(devdir)) != nullptr) { + // Find external v4l devices that's existing before we start watching and add them + if (!strncmp(kPrefix, de->d_name, kPrefixLen)) { + std::string deviceId(de->d_name + kPrefixLen); + if (mCfg.mInternalDevices.count(deviceId) == 0) { + ALOGV("Non-internal v4l device %s found", de->d_name); + char v4l2DevicePath[kMaxDevicePathLen]; + snprintf(v4l2DevicePath, kMaxDevicePathLen, "%s%s", kDevicePath, de->d_name); + deviceAdded(v4l2DevicePath); + } + } + } + closedir(devdir); +} + +// Start ExternalCameraProvider::HotplugThread functions + +ExternalCameraProvider::HotplugThread::HotplugThread(ExternalCameraProvider* parent) + : mParent(parent), mInternalDevices(parent->mCfg.mInternalDevices) {} + +ExternalCameraProvider::HotplugThread::~HotplugThread() { + // Clean up inotify descriptor if needed. + if (mINotifyFD >= 0) { + close(mINotifyFD); + } +} + +bool ExternalCameraProvider::HotplugThread::initialize() { + // Update existing cameras + mParent->updateAttachedCameras(); + + // Set up non-blocking fd. The threadLoop will be responsible for polling read at the + // desired frequency + mINotifyFD = inotify_init(); + if (mINotifyFD < 0) { + ALOGE("%s: inotify init failed! Exiting threadloop", __FUNCTION__); + return false; + } + + // Start watching /dev/ directory for created and deleted files + mWd = inotify_add_watch(mINotifyFD, kDevicePath, IN_CREATE | IN_DELETE); + if (mWd < 0) { + ALOGE("%s: inotify add watch failed! Exiting threadloop", __FUNCTION__); + return false; + } + + mPollFd = {.fd = mINotifyFD, .events = POLLIN}; + + mIsInitialized = true; + return true; +} + +bool ExternalCameraProvider::HotplugThread::threadLoop() { + // Initialize inotify descriptors if needed. + if (!mIsInitialized && !initialize()) { + return true; + } + + // poll /dev/* and handle timeouts and error + int pollRet = poll(&mPollFd, /* fd_count= */ 1, /* timeout= */ 250); + if (pollRet == 0) { + // no read event in 100ms + mPollFd.revents = 0; + return true; + } else if (pollRet < 0) { + ALOGE("%s: error while polling for /dev/*: %d", __FUNCTION__, errno); + mPollFd.revents = 0; + return true; + } else if (mPollFd.revents & POLLERR) { + ALOGE("%s: polling /dev/ returned POLLERR", __FUNCTION__); + mPollFd.revents = 0; + return true; + } else if (mPollFd.revents & POLLHUP) { + ALOGE("%s: polling /dev/ returned POLLHUP", __FUNCTION__); + mPollFd.revents = 0; + return true; + } else if (mPollFd.revents & POLLNVAL) { + ALOGE("%s: polling /dev/ returned POLLNVAL", __FUNCTION__); + mPollFd.revents = 0; + return true; + } + // mPollFd.revents must contain POLLIN, so safe to reset it before reading + mPollFd.revents = 0; + + uint64_t offset = 0; + ssize_t ret = read(mINotifyFD, mEventBuf, sizeof(mEventBuf)); + if (ret < sizeof(struct inotify_event)) { + // invalid event. skip + return true; + } + + while (offset < ret) { + struct inotify_event* event = (struct inotify_event*)&mEventBuf[offset]; + offset += sizeof(struct inotify_event) + event->len; + + if (event->wd != mWd) { + // event for an unrelated descriptor. ignore. + continue; + } + + ALOGV("%s inotify_event %s", __FUNCTION__, event->name); + if (strncmp(kPrefix, event->name, kPrefixLen) != 0) { + // event not for /dev/video*. ignore. + continue; + } + + std::string deviceId = event->name + kPrefixLen; + if (mInternalDevices.count(deviceId) != 0) { + // update to an internal device. ignore. + continue; + } + + char v4l2DevicePath[kMaxDevicePathLen]; + snprintf(v4l2DevicePath, kMaxDevicePathLen, "%s%s", kDevicePath, event->name); + + if (event->mask & IN_CREATE) { + mParent->deviceAdded(v4l2DevicePath); + } else if (event->mask & IN_DELETE) { + mParent->deviceRemoved(v4l2DevicePath); + } + } + return true; +} + +// End ExternalCameraProvider::HotplugThread functions + +} // namespace implementation +} // namespace provider +} // namespace camera +} // namespace hardware +} // namespace android diff --git a/camera/provider/default/ExternalCameraProvider.h b/camera/provider/default/ExternalCameraProvider.h new file mode 100644 index 0000000000..347a53ce53 --- /dev/null +++ b/camera/provider/default/ExternalCameraProvider.h @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_PROVIDER_DEFAULT_EXTERNALCAMERAPROVIDER_H_ +#define HARDWARE_INTERFACES_CAMERA_PROVIDER_DEFAULT_EXTERNALCAMERAPROVIDER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace provider { +namespace implementation { + +using ::aidl::android::hardware::camera::common::CameraDeviceStatus; +using ::aidl::android::hardware::camera::common::VendorTagSection; +using ::aidl::android::hardware::camera::device::ICameraDevice; +using ::aidl::android::hardware::camera::provider::BnCameraProvider; +using ::aidl::android::hardware::camera::provider::CameraIdAndStreamCombination; +using ::aidl::android::hardware::camera::provider::ConcurrentCameraIdCombination; +using ::aidl::android::hardware::camera::provider::ICameraProviderCallback; +using ::android::hardware::camera::common::helper::SimpleThread; +using ::android::hardware::camera::external::common::ExternalCameraConfig; + +class ExternalCameraProvider : public BnCameraProvider { + public: + ExternalCameraProvider(); + ~ExternalCameraProvider() override; + ndk::ScopedAStatus setCallback( + const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus getVendorTags(std::vector* _aidl_return) override; + ndk::ScopedAStatus getCameraIdList(std::vector* _aidl_return) override; + ndk::ScopedAStatus getCameraDeviceInterface( + const std::string& in_cameraDeviceName, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus notifyDeviceStateChange(int64_t in_deviceState) override; + ndk::ScopedAStatus getConcurrentCameraIds( + std::vector* _aidl_return) override; + ndk::ScopedAStatus isConcurrentStreamCombinationSupported( + const std::vector& in_configs, + bool* _aidl_return) override; + + private: + void addExternalCamera(const char* devName); + void deviceAdded(const char* devName); + void deviceRemoved(const char* devName); + void updateAttachedCameras(); + + // A separate thread to monitor '/dev' directory for '/dev/video*' entries + // This thread calls back into ExternalCameraProvider when an actionable change is detected. + class HotplugThread : public SimpleThread { + public: + explicit HotplugThread(ExternalCameraProvider* parent); + ~HotplugThread() override; + + protected: + bool threadLoop() override; + + private: + // Returns true if thread initialization succeeded, and false if thread initialization + // failed. + bool initialize(); + + ExternalCameraProvider* mParent = nullptr; + const std::unordered_set mInternalDevices; + + bool mIsInitialized = false; + + int mINotifyFD = -1; + int mWd = -1; + + // struct to wrap mINotifyFD and poll it with timeout + struct pollfd mPollFd = {}; + char mEventBuf[512] = {0}; + }; + + Mutex mLock; + std::shared_ptr mCallback = nullptr; + std::unordered_map mCameraStatusMap; // camera id -> status + const ExternalCameraConfig mCfg; + std::shared_ptr mHotPlugThread; +}; + +} // namespace implementation +} // namespace provider +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // HARDWARE_INTERFACES_CAMERA_PROVIDER_DEFAULT_EXTERNALCAMERAPROVIDER_H_ diff --git a/camera/provider/default/android.hardware.camera.provider-V1-external-service-lazy.rc b/camera/provider/default/android.hardware.camera.provider-V1-external-service-lazy.rc new file mode 100644 index 0000000000..dcdd88cc15 --- /dev/null +++ b/camera/provider/default/android.hardware.camera.provider-V1-external-service-lazy.rc @@ -0,0 +1,10 @@ +service vendor.camera.provider-ext /vendor/bin/hw/android.hardware.camera.provider-V1-external-service-lazy + interface aidl android.hardware.camera.provider.ICameraProvider/external/0 + class hal + oneshot + disabled + user cameraserver + group audio camera input drmrpc usb + ioprio rt 4 + capabilities SYS_NICE + task_profiles CameraServiceCapacity MaxPerformance \ No newline at end of file diff --git a/camera/provider/default/android.hardware.camera.provider-V1-external-service.rc b/camera/provider/default/android.hardware.camera.provider-V1-external-service.rc new file mode 100644 index 0000000000..302c56f48b --- /dev/null +++ b/camera/provider/default/android.hardware.camera.provider-V1-external-service.rc @@ -0,0 +1,8 @@ +service vendor.camera.provider-ext /vendor/bin/hw/android.hardware.camera.provider-V1-external-service + interface aidl android.hardware.camera.provider.ICameraProvider/external/0 + class hal + user cameraserver + group audio camera input drmrpc usb + ioprio rt 4 + capabilities SYS_NICE + task_profiles CameraServiceCapacity MaxPerformance \ No newline at end of file diff --git a/camera/provider/default/external-service.cpp b/camera/provider/default/external-service.cpp new file mode 100644 index 0000000000..b18f182aad --- /dev/null +++ b/camera/provider/default/external-service.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +using ::android::hardware::camera::provider::implementation::ExternalCameraProvider; + +namespace { +// Default recommended RPC thread count for camera provider implementations +const int HWBINDER_THREAD_COUNT = 6; +} // namespace + +int main() { + ALOGI("CameraProvider: external webcam service is starting."); + + ABinderProcess_setThreadPoolMaxThreadCount(HWBINDER_THREAD_COUNT); + + std::shared_ptr defaultProvider = + ndk::SharedRefBase::make(); + const std::string serviceName = std::string(ExternalCameraProvider::descriptor) + "/external/0"; + +#ifdef LAZY_SERVICE + binder_exception_t ret = AServiceManager_registerLazyService(defaultProvider->asBinder().get(), + serviceName.c_str()); + LOG_ALWAYS_FATAL_IF(ret != EX_NONE, + "Error while registering lazy ext camera provider service: %d", ret); +#else + binder_exception_t ret = + AServiceManager_addService(defaultProvider->asBinder().get(), serviceName.c_str()); + LOG_ALWAYS_FATAL_IF(ret != EX_NONE, "Error while registering ext camera provider service: %d", + ret); +#endif + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} \ No newline at end of file diff --git a/cas/OWNERS b/cas/OWNERS new file mode 100644 index 0000000000..473c8f2621 --- /dev/null +++ b/cas/OWNERS @@ -0,0 +1 @@ +include /tv/input/OWNERS diff --git a/cas/aidl/Android.bp b/cas/aidl/Android.bp index 32f12b12a5..123d29d194 100644 --- a/cas/aidl/Android.bp +++ b/cas/aidl/Android.bp @@ -37,4 +37,12 @@ aidl_interface { sdk_version: "module_current", }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.common-V2"], + }, + ], + frozen: true, + } diff --git a/cas/aidl/TEST_MAPPING b/cas/aidl/TEST_MAPPING new file mode 100644 index 0000000000..5bcd388788 --- /dev/null +++ b/cas/aidl/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VtsHalCasAidlTargetTest" + } + ] +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/.hash b/cas/aidl/aidl_api/android.hardware.cas/1/.hash new file mode 100644 index 0000000000..025bfbdf0c --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/.hash @@ -0,0 +1 @@ +bc51d8d70a55ec4723d3f73d0acf7003306bf69f diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/AidlCasPluginDescriptor.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/AidlCasPluginDescriptor.aidl new file mode 100644 index 0000000000..89d8625307 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/AidlCasPluginDescriptor.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +parcelable AidlCasPluginDescriptor { + int caSystemId; + String name; +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/DestinationBuffer.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/DestinationBuffer.aidl new file mode 100644 index 0000000000..b69cc33a92 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/DestinationBuffer.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +union DestinationBuffer { + android.hardware.cas.SharedBuffer nonsecureMemory; + android.hardware.common.NativeHandle secureMemory; +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ICas.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ICas.aidl new file mode 100644 index 0000000000..903ab924ca --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ICas.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +interface ICas { + void closeSession(in byte[] sessionId); + byte[] openSessionDefault(); + byte[] openSession(in android.hardware.cas.SessionIntent intent, in android.hardware.cas.ScramblingMode mode); + void processEcm(in byte[] sessionId, in byte[] ecm); + void processEmm(in byte[] emm); + void provision(in String provisionString); + void refreshEntitlements(in int refreshType, in byte[] refreshData); + void release(); + void sendEvent(in int event, in int arg, in byte[] eventData); + void sendSessionEvent(in byte[] sessionId, in int event, in int arg, in byte[] eventData); + void setPrivateData(in byte[] pvtData); + void setSessionPrivateData(in byte[] sessionId, in byte[] pvtData); +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ICasListener.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ICasListener.aidl new file mode 100644 index 0000000000..db75062568 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ICasListener.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +interface ICasListener { + void onEvent(in int event, in int arg, in byte[] data); + void onSessionEvent(in byte[] sessionId, in int event, in int arg, in byte[] data); + void onStatusUpdate(in android.hardware.cas.StatusEvent event, in int number); +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/IDescrambler.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/IDescrambler.aidl new file mode 100644 index 0000000000..411891b6b1 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/IDescrambler.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +interface IDescrambler { + int descramble(in android.hardware.cas.ScramblingControl scramblingControl, in android.hardware.cas.SubSample[] subSamples, in android.hardware.cas.SharedBuffer srcBuffer, in long srcOffset, in android.hardware.cas.DestinationBuffer dstBuffer, in long dstOffset); + void release(); + boolean requiresSecureDecoderComponent(in String mime); + void setMediaCasSession(in byte[] sessionId); +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/IMediaCasService.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/IMediaCasService.aidl new file mode 100644 index 0000000000..1f945a7c94 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/IMediaCasService.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +interface IMediaCasService { + android.hardware.cas.IDescrambler createDescrambler(in int CA_system_id); + android.hardware.cas.ICas createPlugin(in int CA_system_id, in android.hardware.cas.ICasListener listener); + android.hardware.cas.AidlCasPluginDescriptor[] enumeratePlugins(); + boolean isDescramblerSupported(in int CA_system_id); + boolean isSystemIdSupported(in int CA_system_id); +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ScramblingControl.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ScramblingControl.aidl new file mode 100644 index 0000000000..c8834ac7df --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ScramblingControl.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@Backing(type="int") @VintfStability +enum ScramblingControl { + UNSCRAMBLED = 0, + RESERVED = 1, + EVENKEY = 2, + ODDKEY = 3, +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ScramblingMode.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ScramblingMode.aidl new file mode 100644 index 0000000000..9d542cc63e --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/ScramblingMode.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@Backing(type="int") @VintfStability +enum ScramblingMode { + RESERVED = 0, + DVB_CSA1, + DVB_CSA2, + DVB_CSA3_STANDARD, + DVB_CSA3_MINIMAL, + DVB_CSA3_ENHANCE, + DVB_CISSA_V1, + DVB_IDSA, + MULTI2, + AES128, + AES_ECB, + AES_SCTE52, + TDES_ECB, + TDES_SCTE52, + AES_CBC, +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SessionIntent.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SessionIntent.aidl new file mode 100644 index 0000000000..00a2fd778c --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SessionIntent.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@Backing(type="int") @VintfStability +enum SessionIntent { + LIVE, + PLAYBACK, + RECORD, + TIMESHIFT, +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SharedBuffer.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SharedBuffer.aidl new file mode 100644 index 0000000000..9200b1dbf3 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SharedBuffer.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +parcelable SharedBuffer { + android.hardware.common.Ashmem heapBase; + long offset; + long size; +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/Status.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/Status.aidl new file mode 100644 index 0000000000..3691009d5d --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/Status.aidl @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +parcelable Status { + const int OK = 0; + const int ERROR_CAS_NO_LICENSE = 1; + const int ERROR_CAS_LICENSE_EXPIRED = 2; + const int ERROR_CAS_SESSION_NOT_OPENED = 3; + const int ERROR_CAS_CANNOT_HANDLE = 4; + const int ERROR_CAS_INVALID_STATE = 5; + const int BAD_VALUE = 6; + const int ERROR_CAS_NOT_PROVISIONED = 7; + const int ERROR_CAS_RESOURCE_BUSY = 8; + const int ERROR_CAS_INSUFFICIENT_OUTPUT_PROTECTION = 9; + const int ERROR_CAS_TAMPER_DETECTED = 10; + const int ERROR_CAS_DEVICE_REVOKED = 11; + const int ERROR_CAS_DECRYPT_UNIT_NOT_INITIALIZED = 12; + const int ERROR_CAS_DECRYPT = 13; + const int ERROR_CAS_UNKNOWN = 14; + const int ERROR_CAS_NEED_ACTIVATION = 15; + const int ERROR_CAS_NEED_PAIRING = 16; + const int ERROR_CAS_NO_CARD = 17; + const int ERROR_CAS_CARD_MUTE = 18; + const int ERROR_CAS_CARD_INVALID = 19; + const int ERROR_CAS_BLACKOUT = 20; + const int ERROR_CAS_REBOOTING = 21; +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/StatusEvent.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/StatusEvent.aidl new file mode 100644 index 0000000000..0cf37ddfda --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/StatusEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@Backing(type="byte") @VintfStability +enum StatusEvent { + PLUGIN_PHYSICAL_MODULE_CHANGED, + PLUGIN_SESSION_NUMBER_CHANGED, +} diff --git a/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SubSample.aidl b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SubSample.aidl new file mode 100644 index 0000000000..5bd1a1e196 --- /dev/null +++ b/cas/aidl/aidl_api/android.hardware.cas/1/android/hardware/cas/SubSample.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.cas; +/* @hide */ +@VintfStability +parcelable SubSample { + int numBytesOfClearData; + int numBytesOfEncryptedData; +} diff --git a/cas/aidl/android/hardware/cas/DestinationBuffer.aidl b/cas/aidl/android/hardware/cas/DestinationBuffer.aidl index 74336c2a43..ac562dc131 100644 --- a/cas/aidl/android/hardware/cas/DestinationBuffer.aidl +++ b/cas/aidl/android/hardware/cas/DestinationBuffer.aidl @@ -25,13 +25,13 @@ import android.hardware.common.NativeHandle; @VintfStability union DestinationBuffer { /** - * If type == SHARED_MEMORY, the descrambled data must be written + * If the buffer is SharedBuffer, the descrambled data must be written * to user-space non-secure shared memory. */ SharedBuffer nonsecureMemory; /** - * If type == NATIVE_HANDLE, the descrambled data must be written + * If the buffer is presented by NativeHandle, the descrambled data must be written * to secure memory referenced by the vendor's buffer allocator. */ NativeHandle secureMemory; diff --git a/cas/aidl/vts/functional/AndroidTest.xml b/cas/aidl/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..6e6af933bc --- /dev/null +++ b/cas/aidl/vts/functional/AndroidTest.xml @@ -0,0 +1,33 @@ + + + + diff --git a/common/aidl/Android.bp b/common/aidl/Android.bp index 7f6890c92f..f3ea8e80bb 100644 --- a/common/aidl/Android.bp +++ b/common/aidl/Android.bp @@ -36,6 +36,9 @@ aidl_interface { ], min_sdk_version: "29", }, + rust: { + enabled: true, + } }, frozen: true, versions: [ diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp index 148c63c65b..3b022fcb65 100644 --- a/common/fmq/aidl/Android.bp +++ b/common/fmq/aidl/Android.bp @@ -24,9 +24,14 @@ aidl_interface { stability: "vintf", backend: { java: { + // There is no Java FMQ library, but we support the AIDL type + // to allow subsets of interfaces that include it to be used in Java + enabled: true, sdk_version: "module_current", }, cpp: { + // FMQ will not be supported in the cpp backend because the parcelables + // are not stable enough for use in shared memory enabled: false, }, ndk: { @@ -37,6 +42,10 @@ aidl_interface { ], min_sdk_version: "29", }, + rust: { + // FMQ is not supported in the rust backend + enabled: false, + }, }, frozen: true, versions_with_info: [ diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index b7ed64863a..89f62f7c4e 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -62,38 +62,25 @@ android.hardware.automotive.audiocontrol - 2 + 2-3 IAudioControl default - + android.hardware.automotive.can - 1.0 - - ICanBus - .* - + 1 ICanController - .* + default android.hardware.automotive.evs + 1-2 IEvsEnumerator - default - [a-z]+/[0-9]+ - - - - android.hardware.automotive.evs - 1.0-1 - - IEvsEnumerator - default [a-z]+/[0-9]+ @@ -107,29 +94,29 @@ android.hardware.automotive.vehicle + 1-2 IVehicle - .* + default android.hardware.automotive.remoteaccess IRemoteAccess - .* + default - - android.hardware.automotive.vehicle - 2.0 + + android.hardware.automotive.ivn - IVehicle - .* + IIvnAndroidDevice + default android.hardware.biometrics.face - 2 + 3 IFace default @@ -137,10 +124,11 @@ android.hardware.biometrics.fingerprint - 2 + 3 IFingerprint default + virtual @@ -173,33 +161,16 @@ default - + android.hardware.broadcastradio - 1.0-1 - - IBroadcastRadioFactory - default - - - - android.hardware.broadcastradio - 2.0 IBroadcastRadio .* - - android.hardware.camera.provider - 2.4-7 - - ICameraProvider - [^/]+/[0-9]+ - - android.hardware.camera.provider - 1 + 1-2 ICameraProvider [^/]+/[0-9]+ @@ -222,6 +193,7 @@ android.hardware.contexthub + 2 IContextHub default @@ -235,18 +207,6 @@ .* - - android.hardware.drm - 1.3-4 - - ICryptoFactory - .* - - - IDrmFactory - .* - - android.hardware.dumpstate @@ -264,27 +224,12 @@ android.hardware.gnss - 2 + 2-3 IGnss default - - - android.hardware.graphics.allocator - - 2.0 - 3.0 - 4.0 - - IAllocator - default - - android.hardware.graphics.allocator 1-2 @@ -293,20 +238,9 @@ default - - - android.hardware.graphics.composer - 2.1-4 - - IComposer - default - - android.hardware.graphics.composer3 - 1 + 2 IComposer default @@ -395,6 +329,7 @@ IRemotelyProvisionedComponent default strongbox + widevine @@ -424,15 +359,6 @@ software - - android.hardware.media.c2 - 1 - - IComponentStore - default[0-9]* - vendor[0-9]*_software - - android.hardware.memtrack 1 @@ -441,14 +367,6 @@ default - - android.hardware.neuralnetworks - 1.0-3 - - IDevice - .* - - android.hardware.neuralnetworks 1-4 @@ -464,17 +382,9 @@ default - - android.hardware.oemlock - 1.0 - - IOemLock - default - - android.hardware.power - 2-3 + 4 IPower default @@ -490,7 +400,7 @@ android.hardware.radio.config - 1 + 2 IRadioConfig default @@ -498,7 +408,7 @@ android.hardware.radio.data - 1 + 2 IRadioData slot1 @@ -508,7 +418,7 @@ android.hardware.radio.messaging - 1 + 2 IRadioMessaging slot1 @@ -518,7 +428,7 @@ android.hardware.radio.modem - 1 + 2 IRadioModem slot1 @@ -528,7 +438,7 @@ android.hardware.radio.network - 1 + 2 IRadioNetwork slot1 @@ -538,7 +448,7 @@ android.hardware.radio.sim - 1 + 2 IRadioSim slot1 @@ -558,7 +468,7 @@ android.hardware.radio.voice - 1 + 2 IRadioVoice slot1 @@ -566,13 +476,22 @@ slot3 - - android.hardware.radio - 1.2 + + android.hardware.radio.ims + 1 - ISap + IRadioIms slot1 slot2 + slot3 + + + + android.hardware.radio.ims.media + 1 + + IImsMedia + default @@ -619,15 +538,7 @@ android.hardware.sensors - - ISensors - default - - - - android.hardware.sensors - 1.0 - 2.0-1 + 2 ISensors default @@ -705,32 +616,25 @@ default - + + android.hardware.tv.tuner + 1-2 + + ITuner + default + + + android.hardware.tv.input - 1.0 + 1 ITvInput default - - android.hardware.tv.tuner - 1.0-1 - - ITuner - default - - - - android.hardware.tv.tuner - 1 - - ITuner - default - - android.hardware.usb + 1-2 IUsb default @@ -759,17 +663,9 @@ default - - android.hardware.weaver - 1.0 - - IWeaver - default - - android.hardware.weaver - 1 + 2 IWeaver default @@ -783,14 +679,6 @@ default - - android.hardware.wifi - 1.3-6 - - IWifi - default - - android.hardware.uwb 1 @@ -809,6 +697,7 @@ android.hardware.wifi.supplicant + 2 ISupplicant default diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 6e2178a54d..c7b5f0bda4 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -60,48 +60,27 @@ default - - android.hardware.authsecret - 1.0 - - IAuthSecret - default - - android.hardware.automotive.audiocontrol - 2 + 2-3 IAudioControl default - + android.hardware.automotive.can - 1.0 - - ICanBus - .* - + 1 ICanController - .* + default android.hardware.automotive.evs + 1-2 IEvsEnumerator - default - [a-z]+/[0-9]+ - - - - android.hardware.automotive.evs - 1.0-1 - - IEvsEnumerator - default [a-z]+/[0-9]+ @@ -115,29 +94,29 @@ android.hardware.automotive.vehicle + 1-2 IVehicle - .* + default android.hardware.automotive.remoteaccess IRemoteAccess - .* + default - - android.hardware.automotive.vehicle - 2.0 + + android.hardware.automotive.ivn - IVehicle - .* + IIvnAndroidDevice + default android.hardware.biometrics.face - 2 + 3 IFace default @@ -145,10 +124,11 @@ android.hardware.biometrics.fingerprint - 2 + 3 IFingerprint default + virtual @@ -173,33 +153,16 @@ default - + android.hardware.broadcastradio - 1.0-1 - - IBroadcastRadioFactory - default - - - - android.hardware.broadcastradio - 2.0 IBroadcastRadio .* - - android.hardware.camera.provider - 2.4-7 - - ICameraProvider - [^/]+/[0-9]+ - - android.hardware.camera.provider - 1 + 1-2 ICameraProvider [^/]+/[0-9]+ @@ -222,6 +185,7 @@ android.hardware.contexthub + 2 IContextHub default @@ -235,18 +199,6 @@ .* - - android.hardware.drm - 1.3-4 - - ICryptoFactory - .* - - - IDrmFactory - .* - - android.hardware.dumpstate @@ -264,27 +216,12 @@ android.hardware.gnss - 2 + 2-3 IGnss default - - - android.hardware.graphics.allocator - - 2.0 - 3.0 - 4.0 - - IAllocator - default - - android.hardware.graphics.allocator 1-2 @@ -293,20 +230,9 @@ default - - - android.hardware.graphics.composer - 2.1-4 - - IComposer - default - - android.hardware.graphics.composer3 - 1 + 2 IComposer default @@ -438,14 +364,6 @@ default - - android.hardware.neuralnetworks - 1.0-3 - - IDevice - .* - - android.hardware.neuralnetworks 1-4 @@ -461,17 +379,9 @@ default - - android.hardware.oemlock - 1.0 - - IOemLock - default - - android.hardware.power - 2-3 + 4 IPower default @@ -487,7 +397,7 @@ android.hardware.radio.config - 1 + 2 IRadioConfig default @@ -495,7 +405,7 @@ android.hardware.radio.data - 1 + 2 IRadioData slot1 @@ -505,7 +415,7 @@ android.hardware.radio.messaging - 1 + 2 IRadioMessaging slot1 @@ -515,7 +425,7 @@ android.hardware.radio.modem - 1 + 2 IRadioModem slot1 @@ -525,7 +435,7 @@ android.hardware.radio.network - 1 + 2 IRadioNetwork slot1 @@ -535,7 +445,7 @@ android.hardware.radio.sim - 1 + 2 IRadioSim slot1 @@ -555,7 +465,7 @@ android.hardware.radio.voice - 1 + 2 IRadioVoice slot1 @@ -563,13 +473,22 @@ slot3 - - android.hardware.radio - 1.2 + + android.hardware.radio.ims + 1 - ISap + IRadioIms slot1 slot2 + slot3 + + + + android.hardware.radio.ims.media + 1 + + IImsMedia + default @@ -608,15 +527,7 @@ android.hardware.sensors - - ISensors - default - - - - android.hardware.sensors - 1.0 - 2.0-1 + 2 ISensors default @@ -670,32 +581,25 @@ default - + + android.hardware.tv.tuner + 1-2 + + ITuner + default + + + android.hardware.tv.input - 1.0 + 1 ITvInput default - - android.hardware.tv.tuner - 1.0-1 - - ITuner - default - - - - android.hardware.tv.tuner - 1 - - ITuner - default - - android.hardware.usb + 1-2 IUsb default @@ -724,14 +628,6 @@ default - - android.hardware.weaver - 1.0 - - IWeaver - default - - android.hardware.weaver 2 @@ -748,14 +644,6 @@ default - - android.hardware.wifi - 1.3-6 - - IWifi - default - - android.hardware.uwb 1 @@ -774,6 +662,7 @@ android.hardware.wifi.supplicant + 2 ISupplicant default diff --git a/confirmationui/aidl/Android.bp b/confirmationui/aidl/Android.bp index 5395101ab2..51bde0a4a0 100644 --- a/confirmationui/aidl/Android.bp +++ b/confirmationui/aidl/Android.bp @@ -35,4 +35,12 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.security.keymint-V3"], + }, + ], + frozen: true, + } diff --git a/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/.hash b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/.hash new file mode 100644 index 0000000000..72b88d439c --- /dev/null +++ b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/.hash @@ -0,0 +1 @@ +4ae5a11c7bcce793ed8db5333483cc4296d3367e diff --git a/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/IConfirmationResultCallback.aidl b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/IConfirmationResultCallback.aidl new file mode 100644 index 0000000000..6d6ec97377 --- /dev/null +++ b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/IConfirmationResultCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.confirmationui; +@VintfStability +interface IConfirmationResultCallback { + void result(in int error, in byte[] formattedMessage, in byte[] confirmationToken); +} diff --git a/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/IConfirmationUI.aidl b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/IConfirmationUI.aidl new file mode 100644 index 0000000000..9c03173cc5 --- /dev/null +++ b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/IConfirmationUI.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.confirmationui; +@VintfStability +interface IConfirmationUI { + void abort(); + void deliverSecureInputEvent(in android.hardware.security.keymint.HardwareAuthToken secureInputToken); + void promptUserConfirmation(in android.hardware.confirmationui.IConfirmationResultCallback resultCB, in byte[] promptText, in byte[] extraData, in @utf8InCpp String locale, in android.hardware.confirmationui.UIOption[] uiOptions); + const int OK = 0; + const int CANCELED = 1; + const int ABORTED = 2; + const int OPERATION_PENDING = 3; + const int IGNORED = 4; + const int SYSTEM_ERROR = 5; + const int UNIMPLEMENTED = 6; + const int UNEXPECTED = 7; + const int UI_ERROR = 0x10000; + const int UI_ERROR_MISSING_GLYPH = 0x10001; + const int UI_ERROR_MESSAGE_TOO_LONG = 0x10002; + const int UI_ERROR_MALFORMED_UTF8ENCODING = 0x10003; + const int TEST_KEY_BYTE = 0xA5; + const int MAX_MESSAGE_SIZE = 0x1800; +} diff --git a/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/TestModeCommands.aidl b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/TestModeCommands.aidl new file mode 100644 index 0000000000..b8629d1321 --- /dev/null +++ b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/TestModeCommands.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.confirmationui; +@Backing(type="int") @VintfStability +enum TestModeCommands { + OK_EVENT = 0, + CANCEL_EVENT = 1, +} diff --git a/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/UIOption.aidl b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/UIOption.aidl new file mode 100644 index 0000000000..ebecf9e295 --- /dev/null +++ b/confirmationui/aidl/aidl_api/android.hardware.confirmationui/1/android/hardware/confirmationui/UIOption.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.confirmationui; +@Backing(type="int") @VintfStability +enum UIOption { + ACCESSIBILITY_INVERTED = 0, + ACCESSIBILITY_MAGNIFIED = 1, +} diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp index 7a0a93b9b7..a0315d0b30 100644 --- a/contexthub/aidl/Android.bp +++ b/contexthub/aidl/Android.bp @@ -43,6 +43,12 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], + frozen: true, } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/.hash b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/.hash new file mode 100644 index 0000000000..44f517b4bb --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/.hash @@ -0,0 +1 @@ +b0fd976b134e549e03726d3ebeeae848e520d3d3 diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/AsyncEventType.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/AsyncEventType.aidl new file mode 100644 index 0000000000..8e0ff89c12 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/AsyncEventType.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@Backing(type="int") @VintfStability +enum AsyncEventType { + RESTARTED = 1, +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/ContextHubInfo.aidl new file mode 100644 index 0000000000..e5735566e7 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/ContextHubInfo.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable ContextHubInfo { + String name; + String vendor; + String toolchain; + int id; + float peakMips; + int maxSupportedMessageLengthBytes; + long chrePlatformId; + byte chreApiMajorVersion; + byte chreApiMinorVersion; + char chrePatchVersion; + String[] supportedPermissions; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/ContextHubMessage.aidl new file mode 100644 index 0000000000..e38c251928 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/ContextHubMessage.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable ContextHubMessage { + long nanoappId; + char hostEndPoint; + int messageType; + byte[] messageBody; + String[] permissions; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/HostEndpointInfo.aidl new file mode 100644 index 0000000000..dabdbb6648 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/HostEndpointInfo.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable HostEndpointInfo { + char hostEndpointId; + android.hardware.contexthub.HostEndpointInfo.Type type; + @nullable String packageName; + @nullable String attributionTag; + @Backing(type="int") @VintfStability + enum Type { + FRAMEWORK = 1, + APP = 2, + NATIVE = 3, + } +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/IContextHub.aidl new file mode 100644 index 0000000000..de8d752695 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/IContextHub.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +interface IContextHub { + List getContextHubs(); + void loadNanoapp(in int contextHubId, in android.hardware.contexthub.NanoappBinary appBinary, in int transactionId); + void unloadNanoapp(in int contextHubId, in long appId, in int transactionId); + void disableNanoapp(in int contextHubId, in long appId, in int transactionId); + void enableNanoapp(in int contextHubId, in long appId, in int transactionId); + void onSettingChanged(in android.hardware.contexthub.Setting setting, in boolean enabled); + void queryNanoapps(in int contextHubId); + void registerCallback(in int contextHubId, in android.hardware.contexthub.IContextHubCallback cb); + void sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); + void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo); + void onHostEndpointDisconnected(char hostEndpointId); + long[] getPreloadedNanoappIds(in int contextHubId); + void onNanSessionStateChanged(in android.hardware.contexthub.NanSessionStateUpdate update); + void setTestMode(in boolean enable); + const int EX_CONTEXT_HUB_UNSPECIFIED = (-1) /* -1 */; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/IContextHubCallback.aidl new file mode 100644 index 0000000000..6163cfc662 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/IContextHubCallback.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +interface IContextHubCallback { + void handleNanoappInfo(in android.hardware.contexthub.NanoappInfo[] appInfo); + void handleContextHubMessage(in android.hardware.contexthub.ContextHubMessage msg, in String[] msgContentPerms); + void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt); + void handleTransactionResult(in int transactionId, in boolean success); + void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); + const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanSessionRequest.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanSessionRequest.aidl new file mode 100644 index 0000000000..d539707ccc --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanSessionRequest.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanSessionRequest { + boolean enable; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanSessionStateUpdate.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanSessionStateUpdate.aidl new file mode 100644 index 0000000000..80771e2365 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanSessionStateUpdate.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanSessionStateUpdate { + boolean state; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappBinary.aidl new file mode 100644 index 0000000000..fdf38601a9 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappBinary.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanoappBinary { + long nanoappId; + int nanoappVersion; + int flags; + byte targetChreApiMajorVersion; + byte targetChreApiMinorVersion; + byte[] customBinary; + const int FLAG_SIGNED = (1 << 0) /* 1 */; + const int FLAG_ENCRYPTED = (1 << 1) /* 2 */; + const int FLAG_TCM_CAPABLE = (1 << 2) /* 4 */; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappInfo.aidl new file mode 100644 index 0000000000..7175d7f329 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanoappInfo { + long nanoappId; + int nanoappVersion; + boolean enabled; + String[] permissions; + android.hardware.contexthub.NanoappRpcService[] rpcServices; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappRpcService.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappRpcService.aidl new file mode 100644 index 0000000000..a6a1644195 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/NanoappRpcService.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanoappRpcService { + long id; + int version; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/Setting.aidl new file mode 100644 index 0000000000..aeb720b779 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/2/android/hardware/contexthub/Setting.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@Backing(type="byte") @VintfStability +enum Setting { + LOCATION = 1, + WIFI_MAIN, + WIFI_SCANNING, + AIRPLANE_MODE, + MICROPHONE, + BT_MAIN, + BT_SCANNING, +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl index 84e8531eb9..dabdbb6648 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl @@ -42,5 +42,6 @@ parcelable HostEndpointInfo { enum Type { FRAMEWORK = 1, APP = 2, + NATIVE = 3, } } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl index f0676bec74..de8d752695 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl @@ -45,5 +45,8 @@ interface IContextHub { void sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo); void onHostEndpointDisconnected(char hostEndpointId); - const int EX_CONTEXT_HUB_UNSPECIFIED = -1; + long[] getPreloadedNanoappIds(in int contextHubId); + void onNanSessionStateChanged(in android.hardware.contexthub.NanSessionStateUpdate update); + void setTestMode(in boolean enable); + const int EX_CONTEXT_HUB_UNSPECIFIED = (-1) /* -1 */; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl index f81f7cfdee..6163cfc662 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl @@ -38,4 +38,6 @@ interface IContextHubCallback { void handleContextHubMessage(in android.hardware.contexthub.ContextHubMessage msg, in String[] msgContentPerms); void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt); void handleTransactionResult(in int transactionId, in boolean success); + void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); + const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionRequest.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionRequest.aidl new file mode 100644 index 0000000000..d539707ccc --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionRequest.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanSessionRequest { + boolean enable; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionStateUpdate.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionStateUpdate.aidl new file mode 100644 index 0000000000..80771e2365 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanSessionStateUpdate.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable NanSessionStateUpdate { + boolean state; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl index d53b28f943..fdf38601a9 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl @@ -40,7 +40,7 @@ parcelable NanoappBinary { byte targetChreApiMajorVersion; byte targetChreApiMinorVersion; byte[] customBinary; - const int FLAG_SIGNED = 1; - const int FLAG_ENCRYPTED = 2; - const int FLAG_TCM_CAPABLE = 4; + const int FLAG_SIGNED = (1 << 0) /* 1 */; + const int FLAG_ENCRYPTED = (1 << 1) /* 2 */; + const int FLAG_TCM_CAPABLE = (1 << 2) /* 4 */; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl index d998478db6..aeb720b779 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl @@ -35,10 +35,10 @@ package android.hardware.contexthub; @Backing(type="byte") @VintfStability enum Setting { LOCATION = 1, - WIFI_MAIN = 2, - WIFI_SCANNING = 3, - AIRPLANE_MODE = 4, - MICROPHONE = 5, - BT_MAIN = 6, - BT_SCANNING = 7, + WIFI_MAIN, + WIFI_SCANNING, + AIRPLANE_MODE, + MICROPHONE, + BT_MAIN, + BT_SCANNING, } diff --git a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl index a9d6657097..c083bb9cfa 100644 --- a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl +++ b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl @@ -44,5 +44,8 @@ parcelable HostEndpointInfo { /** This endpoint is an Android app. */ APP = 2, + + /** This endpoint is from an Android native program. */ + NATIVE = 3, } } diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl index 16666efd95..9683d2d7e4 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl @@ -20,7 +20,9 @@ import android.hardware.contexthub.ContextHubInfo; import android.hardware.contexthub.ContextHubMessage; import android.hardware.contexthub.HostEndpointInfo; import android.hardware.contexthub.IContextHubCallback; +import android.hardware.contexthub.NanSessionStateUpdate; import android.hardware.contexthub.NanoappBinary; +import android.hardware.contexthub.NanoappInfo; import android.hardware.contexthub.Setting; @VintfStability @@ -194,6 +196,45 @@ interface IContextHub { */ void onHostEndpointDisconnected(char hostEndpointId); + /** + * Provides the list of preloaded nanoapp IDs on the system. The output of this API must + * not change. + * + * @param contextHubId The identifier of the Context Hub. + * + * @return The list of preloaded nanoapp IDs. + */ + long[] getPreloadedNanoappIds(in int contextHubId); + + /** + * Invoked when the state of the NAN session requested through handleNanSessionRequest() + * changes. This function may be invoked without a corresponding handleNanSessionRequest to + * indicate if a NAN session was terminated without a request due to resource limitations. + * + * If the state becomes disabled without an explicit request from the HAL, the HAL MUST + * explicitly invoke handleNanSessionRequest() at a later point in time to attempt to + * re-enable NAN. + * + * @param update Information about the latest NAN session state. + */ + void onNanSessionStateChanged(in NanSessionStateUpdate update); + + /** + * Puts the context hub in and out of test mode. Test mode is a clean state + * where tests can be executed in the same environment. If enable is true, + * this will enable test mode by unloading all nanoapps. If enable is false, + * this will disable test mode and reverse the actions of enabling test mode + * by loading all preloaded nanoapps. This puts CHRE in a normal state. + * + * This should only be used for a test environment, either through a + * @TestApi or development tools. This should not be used in a production + * environment. + * + * @param enable If true, put the context hub in test mode. If false, disable + * test mode. + */ + void setTestMode(in boolean enable); + /** * Error codes that are used as service specific errors with the AIDL return * value EX_SERVICE_SPECIFIC. diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl index e385d48c55..bfcb51e589 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl @@ -18,6 +18,7 @@ package android.hardware.contexthub; import android.hardware.contexthub.AsyncEventType; import android.hardware.contexthub.ContextHubMessage; +import android.hardware.contexthub.NanSessionRequest; import android.hardware.contexthub.NanoappInfo; @VintfStability @@ -74,4 +75,24 @@ interface IContextHubCallback { * */ void handleTransactionResult(in int transactionId, in boolean success); + + /** + * This callback is passed by the Contexthub service to the HAL implementation to allow the HAL + * to request a WiFi NAN session is created to allow the Contexthub to be able to utilize NAN + * functionality. + * + * onNanSessionStateChanged() will be invoked asynchronously after the NAN session request has + * been completed. This must be done within CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS. If the + * request times out, onNanSessionStateChanged() will be invoked with the state that the session + * was previously in. + * + * @param request Request from the HAL indicating the latest NAN session state it would like. + */ + void handleNanSessionRequest(in NanSessionRequest request); + + /** + * Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the + * Contexthub service must respond. + */ + const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; } diff --git a/contexthub/aidl/android/hardware/contexthub/NanSessionRequest.aidl b/contexthub/aidl/android/hardware/contexthub/NanSessionRequest.aidl new file mode 100644 index 0000000000..c462ba1112 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/NanSessionRequest.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.contexthub; + +/** + * Contains information needed to request a state change for a NAN session. + */ +@VintfStability +parcelable NanSessionRequest { + /** + * Whether the NAN session should be enabled or disabled depending on whether the Contexthub + * needs access to NAN. + */ + boolean enable; +} diff --git a/contexthub/aidl/android/hardware/contexthub/NanSessionStateUpdate.aidl b/contexthub/aidl/android/hardware/contexthub/NanSessionStateUpdate.aidl new file mode 100644 index 0000000000..a58eda59b5 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/NanSessionStateUpdate.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.contexthub; + +/** + * Contains information provided as a response to a NanSessionRequest. + */ +@VintfStability +parcelable NanSessionStateUpdate { + /** + * True if the NAN session is currently enabled. + */ + boolean state; +} diff --git a/contexthub/aidl/default/Android.bp b/contexthub/aidl/default/Android.bp index 269057a2a2..6ee7407de8 100644 --- a/contexthub/aidl/default/Android.bp +++ b/contexthub/aidl/default/Android.bp @@ -29,7 +29,7 @@ cc_library_static { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.contexthub-V1-ndk", + "android.hardware.contexthub-V2-ndk", ], export_include_dirs: ["include"], srcs: [ @@ -50,7 +50,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.contexthub-V1-ndk", + "android.hardware.contexthub-V2-ndk", ], static_libs: [ "libcontexthubexampleimpl", diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp index 35e4650ef2..5272957f07 100644 --- a/contexthub/aidl/default/ContextHub.cpp +++ b/contexthub/aidl/default/ContextHub.cpp @@ -76,6 +76,22 @@ ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId) { } } +ScopedAStatus ContextHub::getPreloadedNanoappIds(int32_t /* in_contextHubId */, + std::vector* out_preloadedNanoappIds) { + if (out_preloadedNanoappIds == nullptr) { + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + + for (uint64_t i = 0; i < 10; ++i) { + out_preloadedNanoappIds->push_back(i); + } + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus ContextHub::onNanSessionStateChanged(const NanSessionStateUpdate& /*in_update*/) { + return ndk::ScopedAStatus::ok(); +} + ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId, const std::shared_ptr& in_cb) { if (in_contextHubId == kMockHubId) { @@ -98,6 +114,10 @@ ScopedAStatus ContextHub::sendMessageToHub(int32_t in_contextHubId, } } +ScopedAStatus ContextHub::setTestMode(bool /* enable */) { + return ndk::ScopedAStatus::ok(); +} + ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) { mConnectedHostEndpoints.insert(in_info.hostEndpointId); diff --git a/contexthub/aidl/default/contexthub-default.xml b/contexthub/aidl/default/contexthub-default.xml index e383c50ca0..930f672197 100644 --- a/contexthub/aidl/default/contexthub-default.xml +++ b/contexthub/aidl/default/contexthub-default.xml @@ -1,7 +1,10 @@ android.hardware.contexthub - 1 - IContextHub/default + 2 + + IContextHub + default + diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h index 03d8432134..7a2cfd1702 100644 --- a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h +++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h @@ -19,6 +19,7 @@ #include #include +#include namespace aidl { namespace android { @@ -37,13 +38,17 @@ class ContextHub : public BnContextHub { int32_t in_transactionId) override; ::ndk::ScopedAStatus onSettingChanged(Setting in_setting, bool in_enabled) override; ::ndk::ScopedAStatus queryNanoapps(int32_t in_contextHubId) override; + ::ndk::ScopedAStatus getPreloadedNanoappIds( + int32_t in_contextHubId, std::vector* out_preloadedNanoappIds) override; ::ndk::ScopedAStatus registerCallback( int32_t in_contextHubId, const std::shared_ptr& in_cb) override; ::ndk::ScopedAStatus sendMessageToHub(int32_t in_contextHubId, const ContextHubMessage& in_message) override; + ::ndk::ScopedAStatus setTestMode(bool enable) override; ::ndk::ScopedAStatus onHostEndpointConnected(const HostEndpointInfo& in_info) override; ::ndk::ScopedAStatus onHostEndpointDisconnected(char16_t in_hostEndpointId) override; + ::ndk::ScopedAStatus onNanSessionStateChanged(const NanSessionStateUpdate& in_update) override; private: static constexpr uint32_t kMockHubId = 0; diff --git a/contexthub/aidl/vts/Android.bp b/contexthub/aidl/vts/Android.bp index 673eac0b93..1534b40876 100644 --- a/contexthub/aidl/vts/Android.bp +++ b/contexthub/aidl/vts/Android.bp @@ -32,7 +32,7 @@ cc_test { "libbinder", ], static_libs: [ - "android.hardware.contexthub-V1-cpp", + "android.hardware.contexthub-V2-cpp", "VtsHalContexthubUtils", ], test_suites: [ diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index 3c01c6bac2..c1cc07cf51 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -42,6 +42,8 @@ using ::android::hardware::contexthub::IContextHubCallbackDefault; using ::android::hardware::contexthub::NanoappBinary; using ::android::hardware::contexthub::NanoappInfo; using ::android::hardware::contexthub::NanoappRpcService; +using ::android::hardware::contexthub::NanSessionRequest; +using ::android::hardware::contexthub::NanSessionStateUpdate; using ::android::hardware::contexthub::Setting; using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; using ::android::hardware::contexthub::vts_utils::waitForCallback; @@ -84,6 +86,26 @@ TEST_P(ContextHubAidl, TestGetHubs) { } } +TEST_P(ContextHubAidl, TestEnableTestMode) { + Status status = contextHub->setTestMode(true); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + ASSERT_TRUE(status.isOk()); + } +} + +TEST_P(ContextHubAidl, TestDisableTestMode) { + Status status = contextHub->setTestMode(false); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + ASSERT_TRUE(status.isOk()); + } +} + class EmptyContextHubCallback : public android::hardware::contexthub::BnContextHubCallback { public: Status handleNanoappInfo(const std::vector& /* appInfo */) override { @@ -100,6 +122,10 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH Status handleTransactionResult(int32_t /* transactionId */, bool /* success */) override { return Status::ok(); } + + Status handleNanSessionRequest(const NanSessionRequest& /* request */) override { + return Status::ok(); + } }; TEST_P(ContextHubAidl, TestRegisterCallback) { @@ -107,10 +133,6 @@ TEST_P(ContextHubAidl, TestRegisterCallback) { ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk()); } -TEST_P(ContextHubAidl, TestRegisterNullCallback) { - ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr).isOk()); -} - // Helper callback that puts the async appInfo callback data into a promise class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCallback { public: @@ -131,6 +153,10 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall return Status::ok(); } + Status handleNanSessionRequest(const NanSessionRequest& /* request */) override { + return Status::ok(); + } + std::promise> promise; }; @@ -156,6 +182,18 @@ TEST_P(ContextHubAidl, TestQueryApps) { } } +// Calls getPreloadedNanoappsIds() and verifies there are preloaded nanoapps +TEST_P(ContextHubAidl, TestGetPreloadedNanoappIds) { + std::vector preloadedNanoappIds; + Status status = contextHub->getPreloadedNanoappIds(getHubId(), &preloadedNanoappIds); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + ASSERT_TRUE(status.isOk()); + } +} + // Helper callback that puts the TransactionResult for the expectedTransactionId into a // promise class TransactionResultCallback : public android::hardware::contexthub::BnContextHubCallback { @@ -181,6 +219,10 @@ class TransactionResultCallback : public android::hardware::contexthub::BnContex return Status::ok(); } + Status handleNanSessionRequest(const NanSessionRequest& /* request */) override { + return Status::ok(); + } + uint32_t expectedTransactionId = 0; std::promise promise; }; @@ -276,8 +318,6 @@ void ContextHubAidl::testSettingChanged(Setting setting) { ASSERT_TRUE(contextHub->onSettingChanged(setting, true /* enabled */).isOk()); ASSERT_TRUE(contextHub->onSettingChanged(setting, false /* enabled */).isOk()); - - ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr).isOk()); } TEST_P(ContextHubAidl, TestOnLocationSettingChanged) { @@ -329,6 +369,7 @@ std::vector> generateContextHubMapping() { TEST_P(ContextHubAidl, TestHostConnection) { constexpr char16_t kHostEndpointId = 1; HostEndpointInfo hostEndpointInfo; + hostEndpointInfo.type = HostEndpointInfo::Type::NATIVE; hostEndpointInfo.hostEndpointId = kHostEndpointId; ASSERT_TRUE(contextHub->onHostEndpointConnected(hostEndpointInfo).isOk()); @@ -341,6 +382,20 @@ TEST_P(ContextHubAidl, TestInvalidHostConnection) { ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk()); } +TEST_P(ContextHubAidl, TestNanSessionStateChange) { + NanSessionStateUpdate update; + update.state = true; + Status status = contextHub->onNanSessionStateChanged(update); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + ASSERT_TRUE(status.isOk()); + update.state = false; + ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); + } +} + std::string PrintGeneratedTest(const testing::TestParamInfo& info) { return std::string("CONTEXT_HUB_ID_") + std::to_string(std::get<1>(info.param)); } diff --git a/current.txt b/current.txt index 0fb8b49992..754093f2b1 100644 --- a/current.txt +++ b/current.txt @@ -932,5 +932,11 @@ b7ce2d87841585551b082fca6d099622e63b7099e0d8013f687ea1a1dc35c4dc android.hardwar # ABI preserving changes to HALs during Android U 2aa559cda86c358c6429114ef6bc72c1b43281e98f9eb6b4df5e7073c8d05767 android.hardware.automotive.vehicle@2.0::types 42abd285a4293dadb8c89bc63b90cae2872fbffe90c4517aa3ea4965e8aecff7 android.hardware.graphics.common@1.2::types +4f1a02d21a22104c734f71cdbba19b6f7e93d4ee107ff79f0dbdd171a8430e0e android.hardware.automotive.vehicle@2.0::types +a2fbd9747fbb9ceb8c1090b5a24138312246502d5af0654a8c2b603a9bf521fc android.hardware.gnss@1.0::IGnssCallback +889b59e3e7a59afa67bf19882a44f51a2f9e43b6556ec52baa9ec3efd1ef7fbe android.hardware.camera.device@3.2::types +db37a1c757e2e69b1ec9c75a981a6987bd87a131d92ab6acc00e04d19f374281 android.hardware.automotive.vehicle@2.0::types +997017f581406fca1675d2f612f7ccd73f0d04eadd54bf6212e6cf5971d0872d android.hardware.automotive.vehicle@2.0::types +06983ffe6d75e90a22503a6d9fd14417f983a36bb060a80ad5915240d69b8a40 android.hardware.automotive.vehicle@2.0::types # There will be no more HIDL HALs. Use AIDL instead. diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp index 6273a38a26..fb04d842ef 100644 --- a/drm/aidl/Android.bp +++ b/drm/aidl/Android.bp @@ -23,7 +23,7 @@ aidl_interface { sdk_version: "module_current", }, ndk: { - min_sdk_version: "current", + min_sdk_version: "UpsideDownCake", }, }, double_loadable: true, diff --git a/drm/aidl/OWNERS b/drm/aidl/OWNERS index fa8fd20c9f..fe69725d67 100644 --- a/drm/aidl/OWNERS +++ b/drm/aidl/OWNERS @@ -1,4 +1,3 @@ # Bug component: 49079 -edwinwong@google.com kelzhan@google.com robertshih@google.com diff --git a/drm/aidl/vts/OWNERS b/drm/aidl/vts/OWNERS index e44b93eef9..fe69725d67 100644 --- a/drm/aidl/vts/OWNERS +++ b/drm/aidl/vts/OWNERS @@ -1,4 +1,3 @@ -edwinwong@google.com -jtinker@google.com +# Bug component: 49079 kelzhan@google.com robertshih@google.com diff --git a/fastboot/aidl/Android.bp b/fastboot/aidl/Android.bp index a5735abdb6..29423cb4df 100644 --- a/fastboot/aidl/Android.bp +++ b/fastboot/aidl/Android.bp @@ -35,4 +35,12 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/fastboot/aidl/aidl_api/android.hardware.fastboot/1/.hash b/fastboot/aidl/aidl_api/android.hardware.fastboot/1/.hash new file mode 100644 index 0000000000..458ca94d1b --- /dev/null +++ b/fastboot/aidl/aidl_api/android.hardware.fastboot/1/.hash @@ -0,0 +1 @@ +da59ee6c3e1088cbace3b6a913077ce52ca2ef25 diff --git a/fastboot/aidl/aidl_api/android.hardware.fastboot/1/android/hardware/fastboot/FileSystemType.aidl b/fastboot/aidl/aidl_api/android.hardware.fastboot/1/android/hardware/fastboot/FileSystemType.aidl new file mode 100644 index 0000000000..b8a8828ee1 --- /dev/null +++ b/fastboot/aidl/aidl_api/android.hardware.fastboot/1/android/hardware/fastboot/FileSystemType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.fastboot; +@Backing(type="byte") @VintfStability +enum FileSystemType { + EXT4, + F2FS, + RAW, +} diff --git a/fastboot/aidl/aidl_api/android.hardware.fastboot/1/android/hardware/fastboot/IFastboot.aidl b/fastboot/aidl/aidl_api/android.hardware.fastboot/1/android/hardware/fastboot/IFastboot.aidl new file mode 100644 index 0000000000..445fcdef75 --- /dev/null +++ b/fastboot/aidl/aidl_api/android.hardware.fastboot/1/android/hardware/fastboot/IFastboot.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.fastboot; +@VintfStability +interface IFastboot { + String doOemCommand(in String oemCmd); + void doOemSpecificErase(); + int getBatteryVoltageFlashingThreshold(); + boolean getOffModeChargeState(); + android.hardware.fastboot.FileSystemType getPartitionType(in String partitionName); + String getVariant(); + const int FAILURE_UNKNOWN = 1; +} diff --git a/gatekeeper/aidl/Android.bp b/gatekeeper/aidl/Android.bp index 770e8ab694..b050f6a1a5 100644 --- a/gatekeeper/aidl/Android.bp +++ b/gatekeeper/aidl/Android.bp @@ -26,4 +26,12 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.security.keymint-V3"], + }, + ], + frozen: true, + } diff --git a/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/.hash b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/.hash new file mode 100644 index 0000000000..f06e62b93b --- /dev/null +++ b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/.hash @@ -0,0 +1 @@ +d877e8a1608a00fd9068bcd7e69ea480a7ea17f0 diff --git a/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl new file mode 100644 index 0000000000..ae64ffce5a --- /dev/null +++ b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/GatekeeperEnrollResponse.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gatekeeper; +@VintfStability +parcelable GatekeeperEnrollResponse { + int statusCode; + int timeoutMs; + long secureUserId; + byte[] data; +} diff --git a/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl new file mode 100644 index 0000000000..f55da302d2 --- /dev/null +++ b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/GatekeeperVerifyResponse.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gatekeeper; +@VintfStability +parcelable GatekeeperVerifyResponse { + int statusCode; + int timeoutMs; + android.hardware.security.keymint.HardwareAuthToken hardwareAuthToken; +} diff --git a/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/IGatekeeper.aidl b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/IGatekeeper.aidl new file mode 100644 index 0000000000..ab74615a3b --- /dev/null +++ b/gatekeeper/aidl/aidl_api/android.hardware.gatekeeper/1/android/hardware/gatekeeper/IGatekeeper.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gatekeeper; +@SensitiveData @VintfStability +interface IGatekeeper { + void deleteAllUsers(); + void deleteUser(in int uid); + android.hardware.gatekeeper.GatekeeperEnrollResponse enroll(in int uid, in byte[] currentPasswordHandle, in byte[] currentPassword, in byte[] desiredPassword); + android.hardware.gatekeeper.GatekeeperVerifyResponse verify(in int uid, in long challenge, in byte[] enrolledPasswordHandle, in byte[] providedPassword); + const int STATUS_REENROLL = 1; + const int STATUS_OK = 0; + const int ERROR_GENERAL_FAILURE = (-1) /* -1 */; + const int ERROR_RETRY_TIMEOUT = (-2) /* -2 */; + const int ERROR_NOT_IMPLEMENTED = (-3) /* -3 */; +} diff --git a/gnss/1.0/IGnssCallback.hal b/gnss/1.0/IGnssCallback.hal index 311ab2166c..512763e717 100644 --- a/gnss/1.0/IGnssCallback.hal +++ b/gnss/1.0/IGnssCallback.hal @@ -37,7 +37,13 @@ interface IGnssCallback { MSA = 1 << 2, /** GNSS supports single-shot fixes */ SINGLE_SHOT = 1 << 3, - /** GNSS supports on demand time injection */ + /** + * The platform periodically injects time to GNSS in addition to + * on-demand and occasional time updates. + * + * Note: The naming of "on demand" should be "periodic" instead. This + * is the result of a historic implementation bug, b/73893222. + */ ON_DEMAND_TIME = 1 << 4, /** GNSS supports Geofencing */ GEOFENCING = 1 << 5, diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp index a73182edb6..300e8de3af 100644 --- a/gnss/1.1/default/Android.bp +++ b/gnss/1.1/default/Android.bp @@ -27,7 +27,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V2-ndk", + "android.hardware.gnss-V3-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp index f8fad94a34..2414cbc4aa 100644 --- a/gnss/1.1/vts/functional/Android.bp +++ b/gnss/1.1/vts/functional/Android.bp @@ -36,7 +36,7 @@ cc_test { "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss-V2-cpp", + "android.hardware.gnss-V3-cpp", ], shared_libs: [ "android.hardware.gnss.measurement_corrections@1.0", diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp index 769e8ae167..83bc2cc903 100644 --- a/gnss/2.0/default/Android.bp +++ b/gnss/2.0/default/Android.bp @@ -50,7 +50,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V2-ndk", + "android.hardware.gnss-V3-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp index 2042dd9f17..e8db8862d2 100644 --- a/gnss/2.0/vts/functional/Android.bp +++ b/gnss/2.0/vts/functional/Android.bp @@ -39,7 +39,7 @@ cc_test { "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss-V2-cpp", + "android.hardware.gnss-V3-cpp", ], test_suites: [ "general-tests", diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp index 2979f5c9b7..4a4ce544ae 100644 --- a/gnss/2.1/default/Android.bp +++ b/gnss/2.1/default/Android.bp @@ -44,7 +44,7 @@ cc_binary { "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", - "android.hardware.gnss-V2-ndk", + "android.hardware.gnss-V3-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp index d7b6eebbe9..76f9d07964 100644 --- a/gnss/2.1/vts/functional/Android.bp +++ b/gnss/2.1/vts/functional/Android.bp @@ -40,7 +40,7 @@ cc_test { "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss-V2-cpp", + "android.hardware.gnss-V3-cpp", ], shared_libs: [ "libvintf", diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index f45fe5d54b..cb2c001612 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -46,7 +46,12 @@ aidl_interface { version: "2", imports: [], }, + { + version: "3", + imports: [], + }, ], + frozen: true, } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/.hash b/gnss/aidl/aidl_api/android.hardware.gnss/3/.hash new file mode 100644 index 0000000000..06d0e5d850 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/.hash @@ -0,0 +1 @@ +747fa8b8b4bb55d21f2c42446dd1b31de1dfbeaa diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/BlocklistedSource.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/BlocklistedSource.aidl new file mode 100644 index 0000000000..ccb2b281db --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/BlocklistedSource.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable BlocklistedSource { + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + int svid; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/CorrelationVector.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/CorrelationVector.aidl new file mode 100644 index 0000000000..b9590036db --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/CorrelationVector.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable CorrelationVector { + double frequencyOffsetMps; + double samplingWidthM; + double samplingStartM; + int[] magnitude; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/ElapsedRealtime.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/ElapsedRealtime.aidl new file mode 100644 index 0000000000..5d7f51e342 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/ElapsedRealtime.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable ElapsedRealtime { + int flags; + long timestampNs; + double timeUncertaintyNs; + const int HAS_TIMESTAMP_NS = (1 << 0) /* 1 */; + const int HAS_TIME_UNCERTAINTY_NS = (1 << 1) /* 2 */; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssClock.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssClock.aidl new file mode 100644 index 0000000000..63edd44a19 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssClock.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssClock { + int gnssClockFlags; + int leapSecond; + long timeNs; + double timeUncertaintyNs; + long fullBiasNs; + double biasNs; + double biasUncertaintyNs; + double driftNsps; + double driftUncertaintyNsps; + int hwClockDiscontinuityCount; + android.hardware.gnss.GnssSignalType referenceSignalTypeForIsb; + const int HAS_LEAP_SECOND = (1 << 0) /* 1 */; + const int HAS_TIME_UNCERTAINTY = (1 << 1) /* 2 */; + const int HAS_FULL_BIAS = (1 << 2) /* 4 */; + const int HAS_BIAS = (1 << 3) /* 8 */; + const int HAS_BIAS_UNCERTAINTY = (1 << 4) /* 16 */; + const int HAS_DRIFT = (1 << 5) /* 32 */; + const int HAS_DRIFT_UNCERTAINTY = (1 << 6) /* 64 */; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssConstellationType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssConstellationType.aidl new file mode 100644 index 0000000000..fee2ef67c3 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssConstellationType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@Backing(type="int") @VintfStability +enum GnssConstellationType { + UNKNOWN = 0, + GPS = 1, + SBAS = 2, + GLONASS = 3, + QZSS = 4, + BEIDOU = 5, + GALILEO = 6, + IRNSS = 7, +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssData.aidl new file mode 100644 index 0000000000..54e3b2165e --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssData.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssData { + android.hardware.gnss.GnssMeasurement[] measurements; + android.hardware.gnss.GnssClock clock; + android.hardware.gnss.ElapsedRealtime elapsedRealtime; + android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs = {}; + boolean isFullTracking; + @VintfStability + parcelable GnssAgc { + double agcLevelDb; + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + long carrierFrequencyHz; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssLocation.aidl new file mode 100644 index 0000000000..e64d98a297 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssLocation.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssLocation { + int gnssLocationFlags; + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double speedMetersPerSec; + double bearingDegrees; + double horizontalAccuracyMeters; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + double bearingAccuracyDegrees; + long timestampMillis; + android.hardware.gnss.ElapsedRealtime elapsedRealtime; + const int HAS_LAT_LONG = 0x0001; + const int HAS_ALTITUDE = 0x0002; + const int HAS_SPEED = 0x0004; + const int HAS_BEARING = 0x0008; + const int HAS_HORIZONTAL_ACCURACY = 0x0010; + const int HAS_VERTICAL_ACCURACY = 0x0020; + const int HAS_SPEED_ACCURACY = 0x0040; + const int HAS_BEARING_ACCURACY = 0x0080; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssMeasurement.aidl new file mode 100644 index 0000000000..a2594af99a --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssMeasurement.aidl @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssMeasurement { + int flags; + int svid; + android.hardware.gnss.GnssSignalType signalType; + double timeOffsetNs; + int state; + long receivedSvTimeInNs; + long receivedSvTimeUncertaintyInNs; + double antennaCN0DbHz; + double basebandCN0DbHz; + double pseudorangeRateMps; + double pseudorangeRateUncertaintyMps; + int accumulatedDeltaRangeState; + double accumulatedDeltaRangeM; + double accumulatedDeltaRangeUncertaintyM; + long carrierCycles; + double carrierPhase; + double carrierPhaseUncertainty; + android.hardware.gnss.GnssMultipathIndicator multipathIndicator = android.hardware.gnss.GnssMultipathIndicator.UNKNOWN; + double snrDb; + double agcLevelDb; + double fullInterSignalBiasNs; + double fullInterSignalBiasUncertaintyNs; + double satelliteInterSignalBiasNs; + double satelliteInterSignalBiasUncertaintyNs; + android.hardware.gnss.SatellitePvt satellitePvt; + android.hardware.gnss.CorrelationVector[] correlationVectors; + const int HAS_SNR = (1 << 0) /* 1 */; + const int HAS_CARRIER_FREQUENCY = (1 << 9) /* 512 */; + const int HAS_CARRIER_CYCLES = (1 << 10) /* 1024 */; + const int HAS_CARRIER_PHASE = (1 << 11) /* 2048 */; + const int HAS_CARRIER_PHASE_UNCERTAINTY = (1 << 12) /* 4096 */; + const int HAS_AUTOMATIC_GAIN_CONTROL = (1 << 13) /* 8192 */; + const int HAS_FULL_ISB = (1 << 16) /* 65536 */; + const int HAS_FULL_ISB_UNCERTAINTY = (1 << 17) /* 131072 */; + const int HAS_SATELLITE_ISB = (1 << 18) /* 262144 */; + const int HAS_SATELLITE_ISB_UNCERTAINTY = (1 << 19) /* 524288 */; + const int HAS_SATELLITE_PVT = (1 << 20) /* 1048576 */; + const int HAS_CORRELATION_VECTOR = (1 << 21) /* 2097152 */; + const int STATE_UNKNOWN = 0; + const int STATE_CODE_LOCK = (1 << 0) /* 1 */; + const int STATE_BIT_SYNC = (1 << 1) /* 2 */; + const int STATE_SUBFRAME_SYNC = (1 << 2) /* 4 */; + const int STATE_TOW_DECODED = (1 << 3) /* 8 */; + const int STATE_MSEC_AMBIGUOUS = (1 << 4) /* 16 */; + const int STATE_SYMBOL_SYNC = (1 << 5) /* 32 */; + const int STATE_GLO_STRING_SYNC = (1 << 6) /* 64 */; + const int STATE_GLO_TOD_DECODED = (1 << 7) /* 128 */; + const int STATE_BDS_D2_BIT_SYNC = (1 << 8) /* 256 */; + const int STATE_BDS_D2_SUBFRAME_SYNC = (1 << 9) /* 512 */; + const int STATE_GAL_E1BC_CODE_LOCK = (1 << 10) /* 1024 */; + const int STATE_GAL_E1C_2ND_CODE_LOCK = (1 << 11) /* 2048 */; + const int STATE_GAL_E1B_PAGE_SYNC = (1 << 12) /* 4096 */; + const int STATE_SBAS_SYNC = (1 << 13) /* 8192 */; + const int STATE_TOW_KNOWN = (1 << 14) /* 16384 */; + const int STATE_GLO_TOD_KNOWN = (1 << 15) /* 32768 */; + const int STATE_2ND_CODE_LOCK = (1 << 16) /* 65536 */; + const int ADR_STATE_UNKNOWN = 0; + const int ADR_STATE_VALID = (1 << 0) /* 1 */; + const int ADR_STATE_RESET = (1 << 1) /* 2 */; + const int ADR_STATE_CYCLE_SLIP = (1 << 2) /* 4 */; + const int ADR_STATE_HALF_CYCLE_RESOLVED = (1 << 3) /* 8 */; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssMultipathIndicator.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssMultipathIndicator.aidl new file mode 100644 index 0000000000..62ade9c3e8 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssMultipathIndicator.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@Backing(type="int") @VintfStability +enum GnssMultipathIndicator { + UNKNOWN = 0, + PRESENT = 1, + NOT_PRESENT = 2, +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssPowerStats.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssPowerStats.aidl new file mode 100644 index 0000000000..c4a9e6179e --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssPowerStats.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssPowerStats { + android.hardware.gnss.ElapsedRealtime elapsedRealtime; + double totalEnergyMilliJoule; + double singlebandTrackingModeEnergyMilliJoule; + double multibandTrackingModeEnergyMilliJoule; + double singlebandAcquisitionModeEnergyMilliJoule; + double multibandAcquisitionModeEnergyMilliJoule; + double[] otherModesEnergyMilliJoule; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssSignalType.aidl new file mode 100644 index 0000000000..4a49547b49 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/GnssSignalType.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssSignalType { + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + double carrierFrequencyHz; + @utf8InCpp String codeType; + const @utf8InCpp String CODE_TYPE_A = "A"; + const @utf8InCpp String CODE_TYPE_B = "B"; + const @utf8InCpp String CODE_TYPE_C = "C"; + const @utf8InCpp String CODE_TYPE_D = "D"; + const @utf8InCpp String CODE_TYPE_I = "I"; + const @utf8InCpp String CODE_TYPE_L = "L"; + const @utf8InCpp String CODE_TYPE_M = "M"; + const @utf8InCpp String CODE_TYPE_N = "N"; + const @utf8InCpp String CODE_TYPE_P = "P"; + const @utf8InCpp String CODE_TYPE_Q = "Q"; + const @utf8InCpp String CODE_TYPE_S = "S"; + const @utf8InCpp String CODE_TYPE_W = "W"; + const @utf8InCpp String CODE_TYPE_X = "X"; + const @utf8InCpp String CODE_TYPE_Y = "Y"; + const @utf8InCpp String CODE_TYPE_Z = "Z"; + const @utf8InCpp String CODE_TYPE_UNKNOWN = "UNKNOWN"; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnss.aidl new file mode 100644 index 0000000000..639539ad65 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnss.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IAGnss { + void setCallback(in android.hardware.gnss.IAGnssCallback callback); + void dataConnClosed(); + void dataConnFailed(); + void setServer(in android.hardware.gnss.IAGnssCallback.AGnssType type, in @utf8InCpp String hostname, in int port); + void dataConnOpen(in long networkHandle, in @utf8InCpp String apn, in android.hardware.gnss.IAGnss.ApnIpType apnIpType); + @Backing(type="int") @VintfStability + enum ApnIpType { + INVALID = 0, + IPV4 = 1, + IPV6 = 2, + IPV4V6 = 3, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssCallback.aidl new file mode 100644 index 0000000000..b2da8d9583 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssCallback.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IAGnssCallback { + void agnssStatusCb(in android.hardware.gnss.IAGnssCallback.AGnssType type, in android.hardware.gnss.IAGnssCallback.AGnssStatusValue status); + @Backing(type="int") @VintfStability + enum AGnssType { + SUPL = 1, + C2K = 2, + SUPL_EIMS = 3, + SUPL_IMS = 4, + } + @Backing(type="int") @VintfStability + enum AGnssStatusValue { + REQUEST_AGNSS_DATA_CONN = 1, + RELEASE_AGNSS_DATA_CONN = 2, + AGNSS_DATA_CONNECTED = 3, + AGNSS_DATA_CONN_DONE = 4, + AGNSS_DATA_CONN_FAILED = 5, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssRil.aidl new file mode 100644 index 0000000000..c8634ec2b0 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssRil.aidl @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IAGnssRil { + void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); + void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); + void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid); + void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); + void injectNiSuplMessageData(in byte[] msgData, in int slotIndex); + const int NETWORK_CAPABILITY_NOT_METERED = 0x01; + const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02; + @Backing(type="int") @VintfStability + enum AGnssRefLocationType { + GSM_CELLID = 1, + UMTS_CELLID = 2, + LTE_CELLID = 4, + NR_CELLID = 8, + } + @Backing(type="int") @VintfStability + enum SetIdType { + NONE = 0, + IMSI = 1, + MSISDM = 2, + } + @VintfStability + parcelable AGnssRefLocationCellID { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + int mcc; + int mnc; + int lac; + long cid; + int tac; + int pcid; + int arfcn; + } + @VintfStability + parcelable AGnssRefLocation { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + android.hardware.gnss.IAGnssRil.AGnssRefLocationCellID cellID; + } + @VintfStability + parcelable NetworkAttributes { + long networkHandle; + boolean isConnected; + int capabilities; + @utf8InCpp String apn; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssRilCallback.aidl new file mode 100644 index 0000000000..3717026622 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IAGnssRilCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IAGnssRilCallback { + void requestSetIdCb(in int setIdflag); + void requestRefLocCb(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnss.aidl new file mode 100644 index 0000000000..d1aaf2c457 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnss.aidl @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnss { + void setCallback(in android.hardware.gnss.IGnssCallback callback); + void close(); + @nullable android.hardware.gnss.IGnssPsds getExtensionPsds(); + android.hardware.gnss.IGnssConfiguration getExtensionGnssConfiguration(); + android.hardware.gnss.IGnssMeasurementInterface getExtensionGnssMeasurement(); + android.hardware.gnss.IGnssPowerIndication getExtensionGnssPowerIndication(); + @nullable android.hardware.gnss.IGnssBatching getExtensionGnssBatching(); + @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); + @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); + android.hardware.gnss.IAGnss getExtensionAGnss(); + android.hardware.gnss.IAGnssRil getExtensionAGnssRil(); + android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); + android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); + void start(); + void stop(); + void injectTime(in long timeMs, in long timeReferenceMs, in int uncertaintyMs); + void injectLocation(in android.hardware.gnss.GnssLocation location); + void injectBestLocation(in android.hardware.gnss.GnssLocation location); + void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags); + void setPositionMode(in android.hardware.gnss.IGnss.PositionModeOptions options); + android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo(); + @nullable android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); + void startSvStatus(); + void stopSvStatus(); + void startNmea(); + void stopNmea(); + const int ERROR_INVALID_ARGUMENT = 1; + const int ERROR_ALREADY_INIT = 2; + const int ERROR_GENERIC = 3; + @Backing(type="int") @VintfStability + enum GnssPositionMode { + STANDALONE = 0, + MS_BASED = 1, + MS_ASSISTED = 2, + } + @Backing(type="int") @VintfStability + enum GnssPositionRecurrence { + RECURRENCE_PERIODIC = 0, + RECURRENCE_SINGLE = 1, + } + @Backing(type="int") @VintfStability + enum GnssAidingData { + EPHEMERIS = 0x0001, + ALMANAC = 0x0002, + POSITION = 0x0004, + TIME = 0x0008, + IONO = 0x0010, + UTC = 0x0020, + HEALTH = 0x0040, + SVDIR = 0x0080, + SVSTEER = 0x0100, + SADATA = 0x0200, + RTI = 0x0400, + CELLDB_INFO = 0x8000, + ALL = 0xFFFF, + } + @VintfStability + parcelable PositionModeOptions { + android.hardware.gnss.IGnss.GnssPositionMode mode; + android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence; + int minIntervalMs; + int preferredAccuracyMeters; + int preferredTimeMs; + boolean lowPowerMode; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssAntennaInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssAntennaInfo.aidl new file mode 100644 index 0000000000..43ad328e5c --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssAntennaInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssAntennaInfo { + void setCallback(in android.hardware.gnss.IGnssAntennaInfoCallback callback); + void close(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssAntennaInfoCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssAntennaInfoCallback.aidl new file mode 100644 index 0000000000..eb6abe55f8 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssAntennaInfoCallback.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssAntennaInfoCallback { + void gnssAntennaInfoCb(in android.hardware.gnss.IGnssAntennaInfoCallback.GnssAntennaInfo[] gnssAntennaInfos); + @VintfStability + parcelable Row { + double[] row; + } + @VintfStability + parcelable Coord { + double x; + double xUncertainty; + double y; + double yUncertainty; + double z; + double zUncertainty; + } + @VintfStability + parcelable GnssAntennaInfo { + long carrierFrequencyHz; + android.hardware.gnss.IGnssAntennaInfoCallback.Coord phaseCenterOffsetCoordinateMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] phaseCenterVariationCorrectionMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] phaseCenterVariationCorrectionUncertaintyMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] signalGainCorrectionDbi; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] signalGainCorrectionUncertaintyDbi; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssBatching.aidl new file mode 100644 index 0000000000..a021f55918 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssBatching.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssBatching { + void init(in android.hardware.gnss.IGnssBatchingCallback callback); + int getBatchSize(); + void start(in android.hardware.gnss.IGnssBatching.Options options); + void flush(); + void stop(); + void cleanup(); + const int WAKEUP_ON_FIFO_FULL = 0x01; + @VintfStability + parcelable Options { + long periodNanos; + float minDistanceMeters; + int flags; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssBatchingCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssBatchingCallback.aidl new file mode 100644 index 0000000000..b12a8bd519 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssBatchingCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssBatchingCallback { + void gnssLocationBatchCb(in android.hardware.gnss.GnssLocation[] locations); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssCallback.aidl new file mode 100644 index 0000000000..61710d3e25 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssCallback.aidl @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssCallback { + void gnssSetCapabilitiesCb(in int capabilities); + void gnssStatusCb(in android.hardware.gnss.IGnssCallback.GnssStatusValue status); + void gnssSvStatusCb(in android.hardware.gnss.IGnssCallback.GnssSvInfo[] svInfoList); + void gnssLocationCb(in android.hardware.gnss.GnssLocation location); + void gnssNmeaCb(in long timestamp, in @utf8InCpp String nmea); + void gnssAcquireWakelockCb(); + void gnssReleaseWakelockCb(); + void gnssSetSystemInfoCb(in android.hardware.gnss.IGnssCallback.GnssSystemInfo info); + void gnssRequestTimeCb(); + void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); + void gnssSetSignalTypeCapabilitiesCb(in android.hardware.gnss.GnssSignalType[] gnssSignalTypes); + const int CAPABILITY_SCHEDULING = (1 << 0) /* 1 */; + const int CAPABILITY_MSB = (1 << 1) /* 2 */; + const int CAPABILITY_MSA = (1 << 2) /* 4 */; + const int CAPABILITY_SINGLE_SHOT = (1 << 3) /* 8 */; + const int CAPABILITY_ON_DEMAND_TIME = (1 << 4) /* 16 */; + const int CAPABILITY_GEOFENCING = (1 << 5) /* 32 */; + const int CAPABILITY_MEASUREMENTS = (1 << 6) /* 64 */; + const int CAPABILITY_NAV_MESSAGES = (1 << 7) /* 128 */; + const int CAPABILITY_LOW_POWER_MODE = (1 << 8) /* 256 */; + const int CAPABILITY_SATELLITE_BLOCKLIST = (1 << 9) /* 512 */; + const int CAPABILITY_MEASUREMENT_CORRECTIONS = (1 << 10) /* 1024 */; + const int CAPABILITY_ANTENNA_INFO = (1 << 11) /* 2048 */; + const int CAPABILITY_CORRELATION_VECTOR = (1 << 12) /* 4096 */; + const int CAPABILITY_SATELLITE_PVT = (1 << 13) /* 8192 */; + const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = (1 << 14) /* 16384 */; + const int CAPABILITY_ACCUMULATED_DELTA_RANGE = (1 << 15) /* 32768 */; + @Backing(type="int") @VintfStability + enum GnssStatusValue { + NONE = 0, + SESSION_BEGIN = 1, + SESSION_END = 2, + ENGINE_ON = 3, + ENGINE_OFF = 4, + } + @Backing(type="int") @VintfStability + enum GnssSvFlags { + NONE = 0, + HAS_EPHEMERIS_DATA = (1 << 0) /* 1 */, + HAS_ALMANAC_DATA = (1 << 1) /* 2 */, + USED_IN_FIX = (1 << 2) /* 4 */, + HAS_CARRIER_FREQUENCY = (1 << 3) /* 8 */, + } + @VintfStability + parcelable GnssSvInfo { + int svid; + android.hardware.gnss.GnssConstellationType constellation; + float cN0Dbhz; + float basebandCN0DbHz; + float elevationDegrees; + float azimuthDegrees; + long carrierFrequencyHz; + int svFlag; + } + @VintfStability + parcelable GnssSystemInfo { + int yearOfHw; + @utf8InCpp String name; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssConfiguration.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssConfiguration.aidl new file mode 100644 index 0000000000..70df11afa9 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssConfiguration.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssConfiguration { + void setSuplVersion(in int version); + void setSuplMode(in int mode); + void setLppProfile(in int lppProfile); + void setGlonassPositioningProtocol(in int protocol); + void setEmergencySuplPdn(in boolean enable); + void setEsExtensionSec(in int emergencyExtensionSeconds); + void setBlocklist(in android.hardware.gnss.BlocklistedSource[] blocklist); + const int SUPL_MODE_MSB = 0x01; + const int SUPL_MODE_MSA = 0x02; + const int LPP_PROFILE_USER_PLANE = 0x01; + const int LPP_PROFILE_CONTROL_PLANE = 0x02; + const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 0x01; + const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 0x02; + const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 0x04; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssDebug.aidl new file mode 100644 index 0000000000..591b53301f --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssDebug.aidl @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssDebug { + android.hardware.gnss.IGnssDebug.DebugData getDebugData(); + @Backing(type="int") @VintfStability + enum SatelliteEphemerisType { + EPHEMERIS = 0, + ALMANAC_ONLY = 1, + NOT_AVAILABLE = 2, + } + @Backing(type="int") @VintfStability + enum SatelliteEphemerisHealth { + GOOD = 0, + BAD = 1, + UNKNOWN = 2, + } + @VintfStability + parcelable TimeDebug { + long timeEstimateMs; + float timeUncertaintyNs; + float frequencyUncertaintyNsPerSec; + } + @VintfStability + parcelable PositionDebug { + boolean valid; + double latitudeDegrees; + double longitudeDegrees; + float altitudeMeters; + float speedMetersPerSec; + float bearingDegrees; + double horizontalAccuracyMeters; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + double bearingAccuracyDegrees; + float ageSeconds; + } + @VintfStability + parcelable SatelliteData { + int svid; + android.hardware.gnss.GnssConstellationType constellation; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType; + android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth; + float ephemerisAgeSeconds; + boolean serverPredictionIsAvailable; + float serverPredictionAgeSeconds; + } + @VintfStability + parcelable DebugData { + android.hardware.gnss.IGnssDebug.PositionDebug position; + android.hardware.gnss.IGnssDebug.TimeDebug time; + List satelliteDataArray; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssGeofence.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssGeofence.aidl new file mode 100644 index 0000000000..5065ad49c8 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssGeofence.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssGeofence { + void setCallback(in android.hardware.gnss.IGnssGeofenceCallback callback); + void addGeofence(in int geofenceId, in double latitudeDegrees, in double longitudeDegrees, in double radiusMeters, in int lastTransition, in int monitorTransitions, in int notificationResponsivenessMs, in int unknownTimerMs); + void pauseGeofence(in int geofenceId); + void resumeGeofence(in int geofenceId, in int monitorTransitions); + void removeGeofence(in int geofenceId); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssGeofenceCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssGeofenceCallback.aidl new file mode 100644 index 0000000000..90f9ebce43 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssGeofenceCallback.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssGeofenceCallback { + void gnssGeofenceTransitionCb(in int geofenceId, in android.hardware.gnss.GnssLocation location, in int transition, in long timestampMillis); + void gnssGeofenceStatusCb(in int availability, in android.hardware.gnss.GnssLocation lastLocation); + void gnssGeofenceAddCb(in int geofenceId, in int status); + void gnssGeofenceRemoveCb(in int geofenceId, in int status); + void gnssGeofencePauseCb(in int geofenceId, in int status); + void gnssGeofenceResumeCb(in int geofenceId, in int status); + const int ENTERED = (1 << 0) /* 1 */; + const int EXITED = (1 << 1) /* 2 */; + const int UNCERTAIN = (1 << 2) /* 4 */; + const int UNAVAILABLE = (1 << 0) /* 1 */; + const int AVAILABLE = (1 << 1) /* 2 */; + const int OPERATION_SUCCESS = 0; + const int ERROR_TOO_MANY_GEOFENCES = (-100) /* -100 */; + const int ERROR_ID_EXISTS = (-101) /* -101 */; + const int ERROR_ID_UNKNOWN = (-102) /* -102 */; + const int ERROR_INVALID_TRANSITION = (-103) /* -103 */; + const int ERROR_GENERIC = (-149) /* -149 */; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssMeasurementCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssMeasurementCallback.aidl new file mode 100644 index 0000000000..624a7ae84d --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssMeasurementCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssMeasurementCallback { + void gnssMeasurementCb(in android.hardware.gnss.GnssData data); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssMeasurementInterface.aidl new file mode 100644 index 0000000000..6fe6a6c6fd --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssMeasurementInterface { + void setCallback(in android.hardware.gnss.IGnssMeasurementCallback callback, in boolean enableFullTracking, in boolean enableCorrVecOutputs); + void close(); + void setCallbackWithOptions(in android.hardware.gnss.IGnssMeasurementCallback callback, in android.hardware.gnss.IGnssMeasurementInterface.Options options); + @VintfStability + parcelable Options { + boolean enableFullTracking; + boolean enableCorrVecOutputs; + int intervalMs; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssNavigationMessageCallback.aidl new file mode 100644 index 0000000000..57d0e68d44 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssNavigationMessageCallback { + void gnssNavigationMessageCb(in android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage message); + @VintfStability + parcelable GnssNavigationMessage { + int svid; + android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage.GnssNavigationMessageType type; + int status; + int messageId; + int submessageId; + byte[] data; + const int STATUS_PARITY_PASSED = (1 << 0) /* 1 */; + const int STATUS_PARITY_REBUILT = (1 << 1) /* 2 */; + const int STATUS_UNKNOWN = 0; + @Backing(type="int") @VintfStability + enum GnssNavigationMessageType { + UNKNOWN = 0, + GPS_L1CA = 0x0101, + GPS_L2CNAV = 0x0102, + GPS_L5CNAV = 0x0103, + SBS = 0x0201, + GPS_CNAV2 = 0x0104, + GLO_L1CA = 0x0301, + QZS_L1CA = 0x0401, + BDS_D1 = 0x0501, + BDS_D2 = 0x0502, + BDS_CNAV1 = 0x0503, + BDS_CNAV2 = 0x0504, + GAL_I = 0x0601, + GAL_F = 0x0602, + IRN_L5CA = 0x0701, + } + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssNavigationMessageInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssNavigationMessageInterface.aidl new file mode 100644 index 0000000000..187773dd81 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssNavigationMessageInterface.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssNavigationMessageInterface { + void setCallback(in android.hardware.gnss.IGnssNavigationMessageCallback callback); + void close(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPowerIndication.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPowerIndication.aidl new file mode 100644 index 0000000000..f77dbfff86 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPowerIndication.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPowerIndication { + void setCallback(in android.hardware.gnss.IGnssPowerIndicationCallback callback); + oneway void requestGnssPowerStats(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPowerIndicationCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPowerIndicationCallback.aidl new file mode 100644 index 0000000000..07b10ad201 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPowerIndicationCallback.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPowerIndicationCallback { + void setCapabilitiesCb(in int capabilities); + oneway void gnssPowerStatsCb(in android.hardware.gnss.GnssPowerStats gnssPowerStats); + const int CAPABILITY_TOTAL = (1 << 0) /* 1 */; + const int CAPABILITY_SINGLEBAND_TRACKING = (1 << 1) /* 2 */; + const int CAPABILITY_MULTIBAND_TRACKING = (1 << 2) /* 4 */; + const int CAPABILITY_SINGLEBAND_ACQUISITION = (1 << 3) /* 8 */; + const int CAPABILITY_MULTIBAND_ACQUISITION = (1 << 4) /* 16 */; + const int CAPABILITY_OTHER_MODES = (1 << 5) /* 32 */; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPsds.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPsds.aidl new file mode 100644 index 0000000000..3aee798b33 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPsds.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPsds { + void injectPsdsData(in android.hardware.gnss.PsdsType psdsType, in byte[] psdsData); + void setCallback(in android.hardware.gnss.IGnssPsdsCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPsdsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPsdsCallback.aidl new file mode 100644 index 0000000000..dadc9fb092 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/IGnssPsdsCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPsdsCallback { + void downloadRequestCb(in android.hardware.gnss.PsdsType psdsType); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/PsdsType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/PsdsType.aidl new file mode 100644 index 0000000000..60b15d63eb --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/PsdsType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@Backing(type="int") @VintfStability +enum PsdsType { + LONG_TERM = 1, + NORMAL = 2, + REALTIME = 3, +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatelliteClockInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatelliteClockInfo.aidl new file mode 100644 index 0000000000..05f7733280 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatelliteClockInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatelliteClockInfo { + double satHardwareCodeBiasMeters; + double satTimeCorrectionMeters; + double satClkDriftMps; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatellitePositionEcef.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatellitePositionEcef.aidl new file mode 100644 index 0000000000..3d4f7ff6e2 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatellitePositionEcef.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatellitePositionEcef { + double posXMeters; + double posYMeters; + double posZMeters; + double ureMeters; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatellitePvt.aidl new file mode 100644 index 0000000000..ae65f39e3a --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatellitePvt.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatellitePvt { + int flags; + android.hardware.gnss.SatellitePositionEcef satPosEcef; + android.hardware.gnss.SatelliteVelocityEcef satVelEcef; + android.hardware.gnss.SatelliteClockInfo satClockInfo; + double ionoDelayMeters; + double tropoDelayMeters; + long timeOfClockSeconds; + int issueOfDataClock; + long timeOfEphemerisSeconds; + int issueOfDataEphemeris; + android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource = android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource.OTHER; + const int HAS_POSITION_VELOCITY_CLOCK_INFO = (1 << 0) /* 1 */; + const int HAS_IONO = (1 << 1) /* 2 */; + const int HAS_TROPO = (1 << 2) /* 4 */; + @Backing(type="int") @VintfStability + enum SatelliteEphemerisSource { + DEMODULATED = 0, + SERVER_NORMAL = 1, + SERVER_LONG_TERM = 2, + OTHER = 3, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatelliteVelocityEcef.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatelliteVelocityEcef.aidl new file mode 100644 index 0000000000..94d0b344b7 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/SatelliteVelocityEcef.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatelliteVelocityEcef { + double velXMps; + double velYMps; + double velZMps; + double ureRateMps; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl new file mode 100644 index 0000000000..61909d05f7 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.measurement_corrections; +/* @hide */ +@VintfStability +interface IMeasurementCorrectionsCallback { + void setCapabilitiesCb(in int capabilities); + const int CAPABILITY_LOS_SATS = (1 << 0) /* 1 */; + const int CAPABILITY_EXCESS_PATH_LENGTH = (1 << 1) /* 2 */; + const int CAPABILITY_REFLECTING_PLANE = (1 << 2) /* 4 */; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl new file mode 100644 index 0000000000..bd305345f6 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.measurement_corrections; +/* @hide */ +@VintfStability +interface IMeasurementCorrectionsInterface { + void setCorrections(in android.hardware.gnss.measurement_corrections.MeasurementCorrections corrections); + void setCallback(in android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl new file mode 100644 index 0000000000..35fd79e57e --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.measurement_corrections; +/* @hide */ +@VintfStability +parcelable MeasurementCorrections { + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double horizontalPositionUncertaintyMeters; + double verticalPositionUncertaintyMeters; + long toaGpsNanosecondsOfWeek; + android.hardware.gnss.measurement_corrections.SingleSatCorrection[] satCorrections; + boolean hasEnvironmentBearing; + float environmentBearingDegrees; + float environmentBearingUncertaintyDegrees; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl new file mode 100644 index 0000000000..90c9e03336 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.measurement_corrections; +/* @hide */ +@VintfStability +parcelable ReflectingPlane { + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double reflectingPlaneAzimuthDegrees; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl new file mode 100644 index 0000000000..72d32e434c --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.measurement_corrections; +/* @hide */ +@VintfStability +parcelable SingleSatCorrection { + int singleSatCorrectionFlags; + android.hardware.gnss.GnssConstellationType constellation; + int svid; + long carrierFrequencyHz; + float probSatIsLos; + float combinedExcessPathLengthMeters; + float combinedExcessPathLengthUncertaintyMeters; + float combinedAttenuationDb; + android.hardware.gnss.measurement_corrections.SingleSatCorrection.ExcessPathInfo[] excessPathInfos; + const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 0x0001; + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 0x0002; + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 0x0004; + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 0x0010; + @VintfStability + parcelable ExcessPathInfo { + int excessPathInfoFlags; + float excessPathLengthMeters; + float excessPathLengthUncertaintyMeters; + android.hardware.gnss.measurement_corrections.ReflectingPlane reflectingPlane; + float attenuationDb; + const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 0x0001; + const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 0x0002; + const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 0x0004; + const int EXCESS_PATH_INFO_HAS_ATTENUATION = 0x0008; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl new file mode 100644 index 0000000000..d7a7a9651f --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.visibility_control; +/* @hide */ +@VintfStability +interface IGnssVisibilityControl { + void enableNfwLocationAccess(in @utf8InCpp String[] proxyApps); + void setCallback(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl new file mode 100644 index 0000000000..c9b96f50bb --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/3/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss.visibility_control; +/* @hide */ +@VintfStability +interface IGnssVisibilityControlCallback { + void nfwNotifyCb(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwNotification notification); + boolean isInEmergencySession(); + @Backing(type="int") @VintfStability + enum NfwProtocolStack { + CTRL_PLANE = 0, + SUPL = 1, + IMS = 10, + SIM = 11, + OTHER_PROTOCOL_STACK = 100, + } + @Backing(type="int") @VintfStability + enum NfwRequestor { + CARRIER = 0, + OEM = 10, + MODEM_CHIPSET_VENDOR = 11, + GNSS_CHIPSET_VENDOR = 12, + OTHER_CHIPSET_VENDOR = 13, + AUTOMOBILE_CLIENT = 20, + OTHER_REQUESTOR = 100, + } + @Backing(type="int") @VintfStability + enum NfwResponseType { + REJECTED = 0, + ACCEPTED_NO_LOCATION_PROVIDED = 1, + ACCEPTED_LOCATION_PROVIDED = 2, + } + @VintfStability + parcelable NfwNotification { + String proxyAppPackageName; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwProtocolStack protocolStack; + String otherProtocolStackName; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwRequestor requestor; + String requestorId; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwResponseType responseType; + boolean inEmergencyMode; + boolean isCachedLocation; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl index 31426f0507..54e3b2165e 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl @@ -39,6 +39,7 @@ parcelable GnssData { android.hardware.gnss.GnssClock clock; android.hardware.gnss.ElapsedRealtime elapsedRealtime; android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs = {}; + boolean isFullTracking; @VintfStability parcelable GnssAgc { double agcLevelDb; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl index 8930752f7f..c782b6f8ff 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl @@ -39,6 +39,7 @@ interface IAGnssRil { void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid); void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); + void injectNiSuplMessageData(in byte[] msgData, in int slotIndex); const int NETWORK_CAPABILITY_NOT_METERED = 1; const int NETWORK_CAPABILITY_NOT_ROAMING = 2; @Backing(type="int") @VintfStability diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl index 48c88f5ffe..0247182207 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl @@ -45,6 +45,7 @@ interface IGnssCallback { void gnssSetSystemInfoCb(in android.hardware.gnss.IGnssCallback.GnssSystemInfo info); void gnssRequestTimeCb(); void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); + void gnssSetSignalTypeCapabilitiesCb(in android.hardware.gnss.GnssSignalType[] gnssSignalTypes); const int CAPABILITY_SCHEDULING = 1; const int CAPABILITY_MSB = 2; const int CAPABILITY_MSA = 4; @@ -60,6 +61,7 @@ interface IGnssCallback { const int CAPABILITY_CORRELATION_VECTOR = 4096; const int CAPABILITY_SATELLITE_PVT = 8192; const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = 16384; + const int CAPABILITY_ACCUMULATED_DELTA_RANGE = 32768; @Backing(type="int") @VintfStability enum GnssStatusValue { NONE = 0, diff --git a/gnss/aidl/android/hardware/gnss/GnssData.aidl b/gnss/aidl/android/hardware/gnss/GnssData.aidl index 075a0391e2..1bd8d48093 100644 --- a/gnss/aidl/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssData.aidl @@ -99,4 +99,15 @@ parcelable GnssData { * weak to be acquired, the AGC value must still be reported. */ GnssAgc[] gnssAgcs = {}; + + /** + * True indicates that the GNSS chipset switches off duty cycling. In such mode, no clock + * discontinuities are expected and, when supported, carrier phase should be continuous in good + * signal conditions. All non-blocklisted, healthy constellations, satellites and frequency + * bands that are meaningful to positioning accuracy must be tracked and reported in this mode. + * + * False indicates that the GNSS chipset optimizes power via duty cycling, constellations and + * frequency limits, etc. + */ + boolean isFullTracking; } diff --git a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl index db724a49c8..925df1a010 100644 --- a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl @@ -133,50 +133,50 @@ parcelable GnssMeasurement { * zero to the value in the table. The state flag with the widest range indicates the range of * the received GNSS satellite time value. * - * +---------------------------+--------------------+-----+-----------+--------------------+------+ - * | |GPS/QZSS |GLNS |BDS |GAL |SBAS | - * +---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |State Flag |L1 |L5I |L5Q |L1OF |B1I |B1I |E1B |E1C |E5AQ |L1 | - * | |C/A | | | |(D1) |(D2)| | | |C/A | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_UNKNOWN |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_CODE_LOCK |1ms |1 ms |1 ms |1 ms |1 ms |1 ms|- |- |1 ms |1 ms | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_SYMBOL_SYNC |20ms |10 ms |1 ms |10 ms|20 ms |2 ms|4 ms |4 ms |1 ms |2 ms | - * | |(opt.)| |(opt.)| |(opt.)| |(opt.)|(opt.)|(opt.)| | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_BIT_SYNC |20 ms |20 ms |1 ms |20 ms|20 ms |- |8 ms |- |1 ms |4 ms | - * | | | |(opt.)| | | | | |(opt.)| | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_SUBFRAME_SYNC |6s |6s |- |2 s |6 s |- |- |- |100 ms|- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_TOW_DECODED |1 week|- |- |1 day|1 week|- |1 week|- |- |1 week| - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_TOW_KNOWN |1 week|- |- |1 day|1 week|- |1 week|- |- |1 week| - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GLO_STRING_SYNC |- |- |- |2 s |- |- |- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GLO_TOD_DECODED |- |- |- |1 day|- |- |- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GLO_TOD_KNOWN |- |- |- |1 day|- |- |- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_BDS_D2_BIT_SYNC |- |- |- |- |- |2 ms|- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_BDS_D2_SUBFRAME_SYNC |- |- |- |- |- |600 |- |- |- |- | - * | | | | | | |ms | | | | | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GAL_E1BC_CODE_LOCK |- |- |- |- |- |- |4 ms |4 ms |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GAL_E1C_2ND_CODE_LOCK|- |- |- |- |- |- |- |100 ms|- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_2ND_CODE_LOCK |- |10 ms |20 ms |- |- |- |- |100 ms|100 ms|- | - * | | |(opt.)| | | | | |(opt.)| | | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GAL_E1B_PAGE_SYNC |- |- |- |- |- |- |2 s |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_SBAS_SYNC |- |- |- |- |- |- |- |- |- |1s | - * +---------------------------+------+------+------+-----+------+----+------+------+------+------+ + * +---------------------------+---------------------------+-----+---------------------------+--------------------+------+------+ + * | |GPS/QZSS |GLNS |BDS |GAL |SBAS |IRNSS | + * +---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |State Flag |L1 |L1C |L5I |L5Q |L1OF |B1I |B1I |B1C |B2AQ |E1B |E1C |E5AQ |L1 |L5C | + * | |C/A |(P) | | | |(D1) |(D2) |(P) | | | | |C/A | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_UNKNOWN |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_CODE_LOCK |1ms |10 ms |1 ms |1 ms |1 ms |1 ms |1 ms |10 ms |1 ms |- |- |1 ms |1 ms |1ms | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_SYMBOL_SYNC |- |- |10 ms |- |10 ms|- |2 ms |- |- |- |- |- |2 ms |- | + * | | | | | | | | | | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_BIT_SYNC |20 ms |- |20 ms |- |20 ms|20 ms |- |- |- |8 ms |- |- |4 ms |20 ms | + * | | | | | | | | | | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_SUBFRAME_SYNC |6s |- |6s |- |- |6 s |- |- |100 ms|- |- |100 ms|- |6s | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_TOW_DECODED |1 week|- |1 week|- |- |1 week|1 week|- |- |1 week|1 week|- |1 week|1 week| + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_TOW_KNOWN |1 week|1 week|1 week|1 week|- |1 week|1 week|1 week|1 week|1 week|1 week|1 week|1 week|1 week| + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GLO_STRING_SYNC |- |- |- |- |2 s |- |- |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GLO_TOD_DECODED |- |- |- |- |1 day|- |- |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GLO_TOD_KNOWN |- |- |- |- |1 day|- |- |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_BDS_D2_BIT_SYNC |- |- |- |- |- |- |2 ms |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_BDS_D2_SUBFRAME_SYNC |- |- |- |- |- |- |600 |- |- |- |- |- |- |- | + * | | | | | | | |ms | | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GAL_E1BC_CODE_LOCK |- |- |- |- |- |- |- |- |- |4 ms |4 ms |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GAL_E1C_2ND_CODE_LOCK|- |- |- |- |- |- |- |- |- |- |100 ms|- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_2ND_CODE_LOCK |- |18000 |10 ms |20 ms |- |- |- |18000 |100 ms|- |- |100 ms|- |- | + * | | |ms | | | | | |ms | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GAL_E1B_PAGE_SYNC |- |- |- |- |- |- |- |- |- |2 s |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_SBAS_SYNC |- |- |- |- |- |- |- |- |- |- |- |- |1s |- | + * +---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ * * Note: TOW Known refers to the case where TOW is possibly not decoded over the air but has * been determined from other sources. If TOW decoded is set then TOW Known must also be set. diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl index 44847f0ab1..5f2e261fad 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl @@ -164,4 +164,14 @@ interface IAGnssRil { * */ void updateNetworkState(in NetworkAttributes attributes); + + /** + * Injects an SMS/WAP initiated SUPL message. + * + * @param msgData ASN.1 encoded SUPL INIT message. This is defined in + * UserPlane Location Protocol (Version 2.0.4). + * @param slotIndex Specifies the slot index (See + * android.telephony.SubscriptionManager#getSlotIndex()) of the SUPL connection. + */ + void injectNiSuplMessageData(in byte[] msgData, in int slotIndex); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl index 8633bea070..0200625105 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl @@ -18,6 +18,7 @@ package android.hardware.gnss; import android.hardware.gnss.GnssConstellationType; import android.hardware.gnss.GnssLocation; +import android.hardware.gnss.GnssSignalType; import android.hardware.gnss.IGnssConfiguration; import android.hardware.gnss.IGnssPsds; @@ -48,7 +49,13 @@ interface IGnssCallback { /** Capability bit mask indicating that GNSS supports single-shot fixes */ const int CAPABILITY_SINGLE_SHOT = 1 << 3; - /** Capability bit mask indicating that GNSS supports on demand time injection */ + /** + * Capability bit indicating that the platform should periodically inject + * time to GNSS in addition to on-demand and occasional time updates. + * + *

Note:The naming of "on demand" should be "periodic" instead. This + * is the result of a historic implementation bug, b/73893222. + */ const int CAPABILITY_ON_DEMAND_TIME = 1 << 4; /** Capability bit mask indicating that GNSS supports Geofencing */ @@ -81,6 +88,9 @@ interface IGnssCallback { /** Capability bit mask indicating that GNSS supports measurement corrections for driving */ const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = 1 << 14; + /** Capability bit mask indicating that GNSS supports accumulated delta range */ + const int CAPABILITY_ACCUMULATED_DELTA_RANGE = 1 << 15; + /** * Callback to inform framework of the GNSS HAL implementation's capabilities. * @@ -204,9 +214,12 @@ interface IGnssCallback { /** * Callback for the HAL to pass a vector of GnssSvInfo back to the client. * - * If GnssMeasurement is registered, the SvStatus report interval is the same as the measurement - * interval, i.e., the interval the measurement engine runs at. If GnssMeasurement is not - * registered, the SvStatus interval is the same as the location interval. + * If only GnssMeasurement is registered, the SvStatus reporting interval must be + * the same as the measurement interval, i.e., the interval the measurement + * engine runs at. If only location is registered, the SvStatus interval must + * be the same as the location interval. If both GnssMeasurement and location + * are registered, then the SvStatus interval is the same as the lesser interval + * between the two. * * @param svInfo SV status information from HAL. */ @@ -308,4 +321,18 @@ interface IGnssCallback { * during-call to E911, or up to 5 minutes after end-of-call or text to E911). */ void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); + + /** + * Callback to inform the framework of the list of GnssSignalTypes the GNSS HAL implementation + * supports. + * + * These capabilities are static at runtime, i.e., they represent the signal types the + * GNSS implementation supports without considering the temporary disabled signal types such as + * the blocklisted satellites/constellations or the constellations disabled by regional + * restrictions. + * + * @param gnssSignalTypes a list of GnssSignalTypes specifying the constellations, carrier + * frequencies, and the code types the GNSS HAL implementation supports. + */ + void gnssSetSignalTypeCapabilitiesCb(in GnssSignalType[] gnssSignalTypes); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl index 8733754e96..33e9008db1 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -36,9 +36,9 @@ interface IGnssMeasurementInterface { * If true, GNSS chipset must switch off duty cycling. In such mode no clock discontinuities * are expected and, when supported, carrier phase should be continuous in good signal * conditions. All non-blocklisted, healthy constellations, satellites and frequency bands - * that the chipset supports must be reported in this mode. The GNSS chipset is allowed to - * consume more power in this mode. If false, API must optimize power via duty cycling, - * constellations and frequency limits, etc. + * that are meaningful to positioning accuracy must be tracked and reported in this mode. + * The GNSS chipset is allowed to consume more power in this mode. If false, API must + * optimize power via duty cycling, constellations and frequency limits, etc. */ boolean enableFullTracking; @@ -78,6 +78,9 @@ interface IGnssMeasurementInterface { * output rate of 1Hz (occasional intra-measurement time offsets in the range from 0-2000msec * can be tolerated.) * + * If setCallback() is invoked without a previous close(), the HAL must use the new callback + * and parameters to provide updates. + * * @param callback Handle to GnssMeasurement callback interface. * @param enableFullTracking If true, GNSS chipset must switch off duty cycling. In such mode * no clock discontinuities are expected and, when supported, carrier phase should be @@ -104,6 +107,9 @@ interface IGnssMeasurementInterface { /** * Initializes the interface and registers the callback routines with the HAL. * + * If setCallbackWithOptions() is invoked without a previous close(), the HAL must use the new + * callback and options to provide updates. + * * @param options See Options definition. */ void setCallbackWithOptions(in IGnssMeasurementCallback callback, in Options options); diff --git a/gnss/aidl/default/AGnssRil.cpp b/gnss/aidl/default/AGnssRil.cpp index 2aa1abcb98..81b4f2a26e 100644 --- a/gnss/aidl/default/AGnssRil.cpp +++ b/gnss/aidl/default/AGnssRil.cpp @@ -17,6 +17,7 @@ #define LOG_TAG "AGnssRilAidl" #include "AGnssRil.h" +#include #include #include @@ -55,4 +56,15 @@ ndk::ScopedAStatus AGnssRil::updateNetworkState(const NetworkAttributes& attribu return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus AGnssRil::injectNiSuplMessageData(const std::vector& msgData, + int slotIndex) { + ALOGD("AGnssRil::injectNiSuplMessageData: msgData:%d bytes slotIndex:%d", + static_cast(msgData.size()), slotIndex); + if (msgData.size() > 0) { + return ndk::ScopedAStatus::ok(); + } else { + return ndk::ScopedAStatus::fromServiceSpecificError(IGnss::ERROR_INVALID_ARGUMENT); + } +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/AGnssRil.h b/gnss/aidl/default/AGnssRil.h index e205b69763..76583ac38b 100644 --- a/gnss/aidl/default/AGnssRil.h +++ b/gnss/aidl/default/AGnssRil.h @@ -26,6 +26,8 @@ struct AGnssRil : public BnAGnssRil { ndk::ScopedAStatus setRefLocation(const AGnssRefLocation& agnssReflocation) override; ndk::ScopedAStatus setSetId(SetIdType type, const std::string& setid) override; ndk::ScopedAStatus updateNetworkState(const NetworkAttributes& attributes) override; + ndk::ScopedAStatus injectNiSuplMessageData(const std::vector& msgData, + int slotIndex) override; private: // Synchronization lock for sCallback diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index c8ae6b263d..ca5a41f8e5 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -50,7 +50,7 @@ cc_binary { "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss-V2-ndk", + "android.hardware.gnss-V3-ndk", ], srcs: [ "AGnssRil.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 2d6490c832..f1b9cbfd3f 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -60,7 +60,8 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | IGnssCallback::CAPABILITY_SATELLITE_PVT | IGnssCallback::CAPABILITY_CORRELATION_VECTOR | - IGnssCallback::CAPABILITY_ANTENNA_INFO); + IGnssCallback::CAPABILITY_ANTENNA_INFO | + IGnssCallback::CAPABILITY_ACCUMULATED_DELTA_RANGE); auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities); if (!status.isOk()) { ALOGE("%s: Unable to invoke callback.gnssSetCapabilitiesCb", __func__); @@ -68,13 +69,27 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) IGnssCallback::GnssSystemInfo systemInfo = { .yearOfHw = 2022, - .name = "Google, Cuttlefish, AIDL v2", + .name = "Google, Cuttlefish, AIDL v3", }; status = sGnssCallback->gnssSetSystemInfoCb(systemInfo); if (!status.isOk()) { ALOGE("%s: Unable to invoke callback.gnssSetSystemInfoCb", __func__); } - + GnssSignalType signalType1 = { + .constellation = GnssConstellationType::GPS, + .carrierFrequencyHz = 1.57542e+09, + .codeType = GnssSignalType::CODE_TYPE_C, + }; + GnssSignalType signalType2 = { + .constellation = GnssConstellationType::GLONASS, + .carrierFrequencyHz = 1.5980625e+09, + .codeType = GnssSignalType::CODE_TYPE_C, + }; + status = sGnssCallback->gnssSetSignalTypeCapabilitiesCb( + std::vector({signalType1, signalType2})); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback.gnssSetSignalTypeCapabilitiesCb", __func__); + } return ScopedAStatus::ok(); } @@ -310,6 +325,7 @@ ScopedAStatus Gnss::getExtensionGnssMeasurement( ALOGD("getExtensionGnssMeasurement"); if (mGnssMeasurementInterface == nullptr) { mGnssMeasurementInterface = SharedRefBase::make(); + mGnssMeasurementInterface->setGnssInterface(static_cast>(this)); } *iGnssMeasurement = mGnssMeasurementInterface; return ScopedAStatus::ok(); diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index df10fc856b..00540cd62b 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -84,13 +84,13 @@ class Gnss : public BnGnss { IMeasurementCorrectionsInterface>* iMeasurementCorrections) override; + void reportSvStatus() const; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; std::shared_ptr mGnssMeasurementInterface; private: void reportLocation(const GnssLocation&) const; - void reportSvStatus() const; void reportSvStatus(const std::vector& svInfoList) const; std::vector filterBlocklistedSatellites( std::vector gnssSvInfoList) const; diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index 606de07367..aab9e038d0 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -20,6 +20,7 @@ #include #include #include "DeviceFileReader.h" +#include "Gnss.h" #include "GnssRawMeasurementParser.h" #include "GnssReplayUtils.h" #include "Utils.h" @@ -54,7 +55,7 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallback( ALOGW("GnssMeasurement callback already set. Resetting the callback..."); stop(); } - start(enableCorrVecOutputs); + start(enableCorrVecOutputs, enableFullTracking); return ndk::ScopedAStatus::ok(); } @@ -73,7 +74,7 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions( stop(); } mIntervalMs = std::max(options.intervalMs, 1000); - start(options.enableCorrVecOutputs); + start(options.enableCorrVecOutputs, options.enableFullTracking); return ndk::ScopedAStatus::ok(); } @@ -91,7 +92,8 @@ ndk::ScopedAStatus GnssMeasurementInterface::close() { return ndk::ScopedAStatus::ok(); } -void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { +void GnssMeasurementInterface::start(const bool enableCorrVecOutputs, + const bool enableFullTracking) { ALOGD("start"); if (mIsActive) { @@ -103,7 +105,7 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { mIsActive = true; mThreadBlocker.reset(); - mThread = std::thread([this, enableCorrVecOutputs]() { + mThread = std::thread([this, enableCorrVecOutputs, enableFullTracking]() { int intervalMs; do { if (!mIsActive) { @@ -122,8 +124,12 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { this->reportMeasurement(*measurement); } } else { - auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); + auto measurement = + Utils::getMockMeasurement(enableCorrVecOutputs, enableFullTracking); this->reportMeasurement(measurement); + if (!mLocationEnabled) { + mGnss->reportSvStatus(); + } } intervalMs = (mLocationEnabled) ? std::min(mLocationIntervalMs, mIntervalMs) : mIntervalMs; @@ -162,6 +168,10 @@ void GnssMeasurementInterface::setLocationEnabled(const bool enabled) { mLocationEnabled = enabled; } +void GnssMeasurementInterface::setGnssInterface(const std::shared_ptr& gnss) { + mGnss = gnss; +} + void GnssMeasurementInterface::waitForStoppingThreads() { for (auto& future : mFutures) { ALOGD("Stopping previous thread."); diff --git a/gnss/aidl/default/GnssMeasurementInterface.h b/gnss/aidl/default/GnssMeasurementInterface.h index bb08027568..926a4e759b 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.h +++ b/gnss/aidl/default/GnssMeasurementInterface.h @@ -25,6 +25,7 @@ #include "Utils.h" namespace aidl::android::hardware::gnss { +class Gnss; struct GnssMeasurementInterface : public BnGnssMeasurementInterface { public: @@ -39,9 +40,10 @@ struct GnssMeasurementInterface : public BnGnssMeasurementInterface { const Options& options) override; void setLocationInterval(const int intervalMs); void setLocationEnabled(const bool enabled); + void setGnssInterface(const std::shared_ptr& gnss); private: - void start(const bool enableCorrVecOutputs); + void start(const bool enableCorrVecOutputs, const bool enableFullTracking); void stop(); void reportMeasurement(const GnssData&); void waitForStoppingThreads(); @@ -59,6 +61,8 @@ struct GnssMeasurementInterface : public BnGnssMeasurementInterface { // Synchronization lock for sCallback mutable std::mutex mMutex; + + std::shared_ptr mGnss; }; } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/gnss-default.xml b/gnss/aidl/default/gnss-default.xml index 7449310933..73b841e479 100644 --- a/gnss/aidl/default/gnss-default.xml +++ b/gnss/aidl/default/gnss-default.xml @@ -1,7 +1,7 @@ android.hardware.gnss - 2 + 3 IGnss default diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index f02a41e248..2a09a56866 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -51,7 +51,7 @@ cc_test { "libbinder", ], static_libs: [ - "android.hardware.gnss-V2-cpp", + "android.hardware.gnss-V3-cpp", "android.hardware.gnss@common-vts-lib", ], test_suites: [ diff --git a/gnss/aidl/vts/AndroidTest.xml b/gnss/aidl/vts/AndroidTest.xml new file mode 100644 index 0000000000..d203402053 --- /dev/null +++ b/gnss/aidl/vts/AndroidTest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/gnss/aidl/vts/GnssCallbackAidl.cpp b/gnss/aidl/vts/GnssCallbackAidl.cpp index 2f6128b6d2..2e34921006 100644 --- a/gnss/aidl/vts/GnssCallbackAidl.cpp +++ b/gnss/aidl/vts/GnssCallbackAidl.cpp @@ -18,11 +18,13 @@ #include "GnssCallbackAidl.h" #include +#include using android::binder::Status; using android::hardware::gnss::GnssLocation; using GnssSvInfo = android::hardware::gnss::IGnssCallback::GnssSvInfo; using GnssSystemInfo = android::hardware::gnss::IGnssCallback::GnssSystemInfo; +using GnssSignalType = android::hardware::gnss::GnssSignalType; Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) { ALOGI("Capabilities received %#08x", capabilities); @@ -30,6 +32,20 @@ Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) { return Status::ok(); } +Status GnssCallbackAidl::gnssSetSignalTypeCapabilitiesCb( + const std::vector& signalTypes) { + ALOGI("SignalTypeCapabilities received"); + std::ostringstream ss; + for (auto& signalType : signalTypes) { + ss << "[constellation=" << (int)signalType.constellation + << ", carrierFrequencyHz=" << signalType.carrierFrequencyHz + << ", codeType=" << signalType.codeType << "], "; + } + ALOGI("%s", ss.str().c_str()); + signal_type_capabilities_cbq_.store(signalTypes); + return Status::ok(); +} + Status GnssCallbackAidl::gnssStatusCb(const GnssStatusValue /* status */) { ALOGI("gnssStatusCb"); return Status::ok(); @@ -38,6 +54,7 @@ Status GnssCallbackAidl::gnssStatusCb(const GnssStatusValue /* status */) { Status GnssCallbackAidl::gnssSvStatusCb(const std::vector& svInfoList) { ALOGI("gnssSvStatusCb. Size = %d", (int)svInfoList.size()); sv_info_list_cbq_.store(svInfoList); + sv_info_list_timestamps_millis_cbq_.store(::android::elapsedRealtime()); return Status::ok(); } diff --git a/gnss/aidl/vts/GnssCallbackAidl.h b/gnss/aidl/vts/GnssCallbackAidl.h index a9495ba3c2..82a0df4814 100644 --- a/gnss/aidl/vts/GnssCallbackAidl.h +++ b/gnss/aidl/vts/GnssCallbackAidl.h @@ -25,13 +25,17 @@ class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback { public: GnssCallbackAidl() : capabilities_cbq_("capabilities"), + signal_type_capabilities_cbq_("signal_type_capabilities"), info_cbq_("system_info"), location_cbq_("location"), sv_info_list_cbq_("sv_info"), + sv_info_list_timestamps_millis_cbq_("sv_info_timestamps"), nmea_cbq_("nmea"){}; ~GnssCallbackAidl(){}; android::binder::Status gnssSetCapabilitiesCb(const int capabilities) override; + android::binder::Status gnssSetSignalTypeCapabilitiesCb( + const std::vector& signalTypes) override; android::binder::Status gnssStatusCb(const GnssStatusValue status) override; android::binder::Status gnssSvStatusCb(const std::vector& svInfoList) override; android::binder::Status gnssLocationCb( @@ -45,10 +49,14 @@ class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback { const bool isUserEmergency) override; int last_capabilities_; + std::vector last_signal_type_capabilities; android::hardware::gnss::IGnssCallback::GnssSystemInfo last_info_; android::hardware::gnss::GnssLocation last_location_; android::hardware::gnss::common::GnssCallbackEventQueue capabilities_cbq_; + android::hardware::gnss::common::GnssCallbackEventQueue< + std::vector> + signal_type_capabilities_cbq_; android::hardware::gnss::common::GnssCallbackEventQueue< android::hardware::gnss::IGnssCallback::GnssSystemInfo> info_cbq_; @@ -57,6 +65,8 @@ class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback { android::hardware::gnss::common::GnssCallbackEventQueue< std::vector> sv_info_list_cbq_; + android::hardware::gnss::common::GnssCallbackEventQueue + sv_info_list_timestamps_millis_cbq_; android::hardware::gnss::common::GnssCallbackEventQueue> nmea_cbq_; }; \ No newline at end of file diff --git a/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp b/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp index a553954a97..0d15b2ad51 100644 --- a/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp +++ b/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp @@ -24,9 +24,11 @@ using android::hardware::gnss::GnssData; android::binder::Status GnssMeasurementCallbackAidl::gnssMeasurementCb(const GnssData& gnssData) { ALOGI("gnssMeasurementCb"); - ALOGV("elapsedRealtime: flags = 0x%X, timestampNs: %" PRId64 ", timeUncertaintyNs=%lf", + ALOGV("elapsedRealtime: flags = 0x%X, timestampNs: %" PRId64 + ", timeUncertaintyNs=%lf" + " isFullTracking=%s", gnssData.elapsedRealtime.flags, gnssData.elapsedRealtime.timestampNs, - gnssData.elapsedRealtime.timeUncertaintyNs); + gnssData.elapsedRealtime.timeUncertaintyNs, gnssData.isFullTracking ? "true" : "false"); gnss_data_cbq_.store(gnssData); return android::binder::Status::ok(); diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index 64e51c7d4a..4f5e6a0b6b 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -105,6 +105,15 @@ void GnssHalTest::SetUpGnssCallback() { EXPECT_TRUE(aidl_gnss_cb_->info_cbq_.retrieve(aidl_gnss_cb_->last_info_, TIMEOUT_SEC)); EXPECT_EQ(aidl_gnss_cb_->info_cbq_.calledCount(), 1); } + + /* + * SignalTypeCapabilities callback should trigger. + */ + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + EXPECT_TRUE(aidl_gnss_cb_->signal_type_capabilities_cbq_.retrieve( + aidl_gnss_cb_->last_signal_type_capabilities, TIMEOUT_SEC)); + EXPECT_EQ(aidl_gnss_cb_->signal_type_capabilities_cbq_.calledCount(), 1); + } } void GnssHalTest::TearDown() { @@ -469,6 +478,52 @@ void GnssHalTest::collectMeasurementIntervals(const sp& deltasMs) { + aidl_gnss_cb_->sv_info_list_timestamps_millis_cbq_.reset(); + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + + auto status = aidl_gnss_hal_->startSvStatus(); + EXPECT_TRUE(status.isOk()); + ASSERT_TRUE(aidl_gnss_cb_->sv_info_list_timestamps_millis_cbq_.size() == + aidl_gnss_cb_->sv_info_list_cbq_.size()); + long lastElapsedRealtimeMillis = 0; + for (int i = 0; i < numMeasurementEvents; i++) { + long timeStamp; + ASSERT_TRUE(aidl_gnss_cb_->sv_info_list_timestamps_millis_cbq_.retrieve(timeStamp, + timeoutSeconds)); + if (lastElapsedRealtimeMillis != 0) { + deltasMs.push_back(timeStamp - lastElapsedRealtimeMillis); + } + lastElapsedRealtimeMillis = timeStamp; + } + status = aidl_gnss_hal_->stopSvStatus(); + EXPECT_TRUE(status.isOk()); +} + +void GnssHalTest::checkGnssDataFields(const sp& callback, + const int numMeasurementEvents, const int timeoutSeconds, + const bool isFullTracking) { + for (int i = 0; i < numMeasurementEvents; i++) { + GnssData lastGnssData; + ASSERT_TRUE(callback->gnss_data_cbq_.retrieve(lastGnssData, timeoutSeconds)); + EXPECT_EQ(callback->gnss_data_cbq_.calledCount(), i + 1); + ASSERT_TRUE(lastGnssData.measurements.size() > 0); + + // Validity check GnssData fields + checkGnssMeasurementClockFields(lastGnssData); + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + if (isFullTracking) { + EXPECT_EQ(lastGnssData.isFullTracking, isFullTracking); + } + } + for (const auto& measurement : lastGnssData.measurements) { + checkGnssMeasurementFields(measurement, lastGnssData); + } + } +} + void GnssHalTest::assertMeanAndStdev(int intervalMs, std::vector& deltasMs) { double mean = computeMean(deltasMs); double stdev = computeStdev(mean, deltasMs); diff --git a/gnss/aidl/vts/gnss_hal_test.h b/gnss/aidl/vts/gnss_hal_test.h index c49c1b9204..88d01c1769 100644 --- a/gnss/aidl/vts/gnss_hal_test.h +++ b/gnss/aidl/vts/gnss_hal_test.h @@ -101,6 +101,11 @@ class GnssHalTest : public android::hardware::gnss::common::GnssHalTestTemplate< void collectMeasurementIntervals(const sp& callback, const int numMeasurementEvents, const int timeoutSeconds, std::vector& deltaMs); + void collectSvInfoListTimestamps(const int numMeasurementEvents, const int timeoutSeconds, + std::vector& deltasMs); + void checkGnssDataFields(const sp& callback, + const int numMeasurementEvents, const int timeoutSeconds, + const bool isFullTracking); void assertMeanAndStdev(int intervalMillis, std::vector& deltasMillis); sp aidl_gnss_hal_; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index c7fc32aaee..aa8bdfdf16 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -173,6 +173,7 @@ TEST_P(GnssHalTest, InjectSeedLocation) { * GnssCapabilities: * 1. Verifies that GNSS hardware supports measurement capabilities. * 2. Verifies that GNSS hardware supports Scheduling capabilities. + * 3. Verifies that GNSS hardware supports non-empty signal type capabilities. */ TEST_P(GnssHalTest, GnssCapabilites) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { @@ -182,6 +183,10 @@ TEST_P(GnssHalTest, GnssCapabilites) { EXPECT_TRUE(aidl_gnss_cb_->last_capabilities_ & IGnssCallback::CAPABILITY_MEASUREMENTS); } EXPECT_TRUE(aidl_gnss_cb_->last_capabilities_ & IGnssCallback::CAPABILITY_SCHEDULING); + if (aidl_gnss_hal_->getInterfaceVersion() <= 2) { + return; + } + EXPECT_FALSE(aidl_gnss_cb_->last_signal_type_capabilities.empty()); } /* @@ -1082,6 +1087,7 @@ TEST_P(GnssHalTest, TestAGnssExtension) { * 2. Sets AGnssRilCallback. * 3. Update network state to connected and then disconnected. * 4. Sets reference location. + * 5. Injects empty NI message data and verifies that it returns an error. */ TEST_P(GnssHalTest, TestAGnssRilExtension) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { @@ -1125,6 +1131,11 @@ TEST_P(GnssHalTest, TestAGnssRilExtension) { status = iAGnssRil->setRefLocation(agnssReflocation); ASSERT_TRUE(status.isOk()); + + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + status = iAGnssRil->injectNiSuplMessageData(std::vector(), 0); + ASSERT_FALSE(status.isOk()); + } } /* @@ -1396,8 +1407,9 @@ TEST_P(GnssHalTest, TestStopSvStatusAndNmea) { /* * TestGnssMeasurementIntervals_WithoutLocation: - * 1. start measurement with interval - * 2. verify that the received measurement intervals have expected mean and stdev + * 1. Start measurement at intervals + * 2. Verify measurement are received at expected intervals + * 3. Verify status are reported at expected intervals */ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_WithoutLocation) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { @@ -1417,20 +1429,32 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_WithoutLocation) { auto callback = sp::make(); startMeasurementWithInterval(intervals[i], iGnssMeasurement, callback); - std::vector deltas; - collectMeasurementIntervals(callback, numEvents[i], /* timeoutSeconds= */ 10, deltas); + std::vector measurementDeltas; + std::vector svInfoListTimestampsDeltas; + collectMeasurementIntervals(callback, numEvents[i], /* timeoutSeconds= */ 10, + measurementDeltas); + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + collectSvInfoListTimestamps(numEvents[i], /* timeoutSeconds= */ 10, + svInfoListTimestampsDeltas); + } status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); - assertMeanAndStdev(intervals[i], deltas); + assertMeanAndStdev(intervals[i], measurementDeltas); + + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + assertMeanAndStdev(intervals[i], svInfoListTimestampsDeltas); + EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); + } } } /* * TestGnssMeasurementIntervals_LocationOnBeforeMeasurement: - * 1. start measurement with interval - * 2. verify that the received measurement intervals have expected mean and stdev + * 1. Start location at 1s. + * 2. Start measurement at 2s. Verify measurements are received at 1s. + * 3. Stop measurement. Stop location. */ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnBeforeMeasurement) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { @@ -1465,15 +1489,17 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnBeforeMeasurement) { } /* - * TestGnssMeasurementIntervals: - * 1. start measurement with interval - * 2. verify that the received measurement intervals have expected mean and stdev + * TestGnssMeasurementIntervals_LocationOnAfterMeasurement: + * 1. Start measurement at 2s + * 2. Start location at 1s. Verify measurements are received at 1s + * 3. Stop location. Verify measurements are received at 2s + * 4. Stop measurement */ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnAfterMeasurement) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } - + const int kFirstMeasTimeoutSec = 10; std::vector intervals({2000}); sp iGnssMeasurement; @@ -1482,20 +1508,171 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnAfterMeasurement) { ASSERT_TRUE(iGnssMeasurement != nullptr); int locationIntervalMs = 1000; - // Start location first and then start measurement + // Start measurement first and then start location ALOGD("TestGnssMeasurementIntervals_LocationOnAfterMeasurement"); for (auto& intervalMs : intervals) { auto callback = sp::make(); startMeasurementWithInterval(intervalMs, iGnssMeasurement, callback); + // Start location and verify the measurements are received at 1Hz StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false); std::vector deltas; - collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10, deltas); + collectMeasurementIntervals(callback, /*numEvents=*/10, kFirstMeasTimeoutSec, deltas); + assertMeanAndStdev(locationIntervalMs, deltas); + // Stop location request and verify the measurements are received at 2s intervals StopAndClearLocations(); + callback->gnss_data_cbq_.reset(); + deltas.clear(); + collectMeasurementIntervals(callback, /*numEvents=*/5, kFirstMeasTimeoutSec, deltas); + assertMeanAndStdev(intervalMs, deltas); + status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); - - assertMeanAndStdev(locationIntervalMs, deltas); } } + +/* + * TestGnssMeasurementIntervals_changeIntervals: + * This test ensures setCallback() can be called consecutively without close(). + * 1. Start measurement with 20s interval and wait for 1 measurement. + * 2. Start measurement with 1s interval and wait for 5 measurements. + * Verify the measurements were received at 1Hz. + * 3. Start measurement with 2s interval and wait for 5 measurements. + * Verify the measurements were received at 2s intervals. + */ +TEST_P(GnssHalTest, TestGnssMeasurementIntervals_changeIntervals) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 2) { + return; + } + const int kFirstGnssMeasurementTimeoutSeconds = 10; + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + auto callback = sp::make(); + std::vector deltas; + + // setCallback at 20s interval and wait for 1 measurement + startMeasurementWithInterval(20000, iGnssMeasurement, callback); + collectMeasurementIntervals(callback, /* numEvents= */ 1, kFirstGnssMeasurementTimeoutSeconds, + deltas); + + // setCallback at 1s interval and wait for 5 measurements + callback->gnss_data_cbq_.reset(); + deltas.clear(); + startMeasurementWithInterval(1000, iGnssMeasurement, callback); + collectMeasurementIntervals(callback, /* numEvents= */ 5, kFirstGnssMeasurementTimeoutSeconds, + deltas); + + // verify the measurements were received at 1Hz + assertMeanAndStdev(1000, deltas); + + // setCallback at 2s interval and wait for 5 measurements + callback->gnss_data_cbq_.reset(); + deltas.clear(); + startMeasurementWithInterval(2000, iGnssMeasurement, callback); + collectMeasurementIntervals(callback, /* numEvents= */ 5, kFirstGnssMeasurementTimeoutSeconds, + deltas); + + // verify the measurements were received at 2s intervals + assertMeanAndStdev(2000, deltas); + + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); +} + +/* + * TestGnssMeasurementIsFullTracking + * 1. Start measurement with enableFullTracking=true. Verify the received measurements have + * isFullTracking=true. + * 2. Start measurement with enableFullTracking = false. Verify the received measurements have + * isFullTracking=false. + * 3. Do step 1 again. + */ +TEST_P(GnssHalTest, TestGnssMeasurementIsFullTracking) { + // GnssData.isFullTracking is added in the interface version 3 + if (aidl_gnss_hal_->getInterfaceVersion() <= 2) { + return; + } + const int kFirstGnssMeasurementTimeoutSeconds = 10; + const int kNumMeasurementEvents = 5; + std::vector isFullTrackingList({true, false, true}); + + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + ALOGD("TestGnssMeasurementIsFullTracking"); + auto callback = sp::make(); + IGnssMeasurementInterface::Options options; + options.intervalMs = 1000; + + for (auto isFullTracking : isFullTrackingList) { + options.enableFullTracking = isFullTracking; + + callback->gnss_data_cbq_.reset(); + auto status = iGnssMeasurement->setCallbackWithOptions(callback, options); + checkGnssDataFields(callback, kNumMeasurementEvents, kFirstGnssMeasurementTimeoutSeconds, + isFullTracking); + } + + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); +} + +/* + * TestAccumulatedDeltaRange: + * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. + * 2. Start measurement with 1s interval and wait for up to 15 measurements. + * 3. Verify at least one measurement has a valid AccumulatedDeltaRange state. + */ +TEST_P(GnssHalTest, TestAccumulatedDeltaRange) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 2) { + return; + } + if ((aidl_gnss_cb_->last_capabilities_ & IGnssCallback::CAPABILITY_ACCUMULATED_DELTA_RANGE) == + 0) { + return; + } + + ALOGD("TestAccumulatedDeltaRange"); + + auto callback = sp::make(); + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + IGnssMeasurementInterface::Options options; + options.intervalMs = 1000; + options.enableFullTracking = true; + status = iGnssMeasurement->setCallbackWithOptions(callback, options); + ASSERT_TRUE(status.isOk()); + + bool accumulatedDeltaRangeFound = false; + const int kNumMeasurementEvents = 15; + + // setCallback at 1s interval and wait for 15 measurements + for (int i = 0; i < kNumMeasurementEvents; i++) { + GnssData lastGnssData; + ASSERT_TRUE(callback->gnss_data_cbq_.retrieve(lastGnssData, 10)); + EXPECT_EQ(callback->gnss_data_cbq_.calledCount(), i + 1); + ASSERT_TRUE(lastGnssData.measurements.size() > 0); + + // Validity check GnssData fields + checkGnssMeasurementClockFields(lastGnssData); + for (const auto& measurement : lastGnssData.measurements) { + if ((measurement.accumulatedDeltaRangeState & measurement.ADR_STATE_VALID) > 0) { + accumulatedDeltaRangeFound = true; + break; + } + } + if (accumulatedDeltaRangeFound) break; + } + ASSERT_TRUE(accumulatedDeltaRangeFound); + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); +} \ No newline at end of file diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index b896f04ddf..4cf17a66cd 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -57,6 +57,6 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", - "android.hardware.gnss-V2-ndk", + "android.hardware.gnss-V3-ndk", ], } diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index 4de49f376c..8303d93e54 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -102,7 +102,7 @@ GnssDataV2_0 Utils::getMockMeasurementV2_0() { .receivedSvTimeUncertaintyInNs = 15, .cN0DbHz = 30.0, .pseudorangeRateMps = -484.13739013671875, - .pseudorangeRateUncertaintyMps = 1.0379999876022339, + .pseudorangeRateUncertaintyMps = 0.1037999987602233, .accumulatedDeltaRangeState = (uint32_t)V1_0::IGnssMeasurementCallback:: GnssAccumulatedDeltaRangeState::ADR_STATE_UNKNOWN, .accumulatedDeltaRangeM = 0.0, @@ -147,7 +147,7 @@ GnssDataV2_0 Utils::getMockMeasurementV2_0() { return gnssData; } -GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { +GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs, const bool enableFullTracking) { aidl::android::hardware::gnss::GnssSignalType signalType = { .constellation = GnssConstellationType::GLONASS, .carrierFrequencyHz = 1.59975e+09, @@ -169,8 +169,8 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { .basebandCN0DbHz = 26.5, .agcLevelDb = 2.3, .pseudorangeRateMps = -484.13739013671875, - .pseudorangeRateUncertaintyMps = 1.0379999876022339, - .accumulatedDeltaRangeState = GnssMeasurement::ADR_STATE_UNKNOWN, + .pseudorangeRateUncertaintyMps = 0.1037999987602233, + .accumulatedDeltaRangeState = GnssMeasurement::ADR_STATE_VALID, .accumulatedDeltaRangeM = 1.52, .accumulatedDeltaRangeUncertaintyM = 2.43, .multipathIndicator = aidl::android::hardware::gnss::GnssMultipathIndicator::UNKNOWN, @@ -258,7 +258,8 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { GnssData gnssData = {.measurements = {measurement}, .clock = clock, .elapsedRealtime = timestamp, - .gnssAgcs = std::vector({gnssAgc1, gnssAgc2})}; + .gnssAgcs = std::vector({gnssAgc1, gnssAgc2}), + .isFullTracking = enableFullTracking}; return gnssData; } diff --git a/gnss/common/utils/default/include/Utils.h b/gnss/common/utils/default/include/Utils.h index ad8f539248..9be4a195d7 100644 --- a/gnss/common/utils/default/include/Utils.h +++ b/gnss/common/utils/default/include/Utils.h @@ -32,7 +32,7 @@ namespace common { struct Utils { static aidl::android::hardware::gnss::GnssData getMockMeasurement( - const bool enableCorrVecOutputs); + const bool enableCorrVecOutputs, const bool enableFullTracking); static V2_0::IGnssMeasurementCallback::GnssData getMockMeasurementV2_0(); static V2_1::IGnssMeasurementCallback::GnssData getMockMeasurementV2_1(); diff --git a/gnss/common/utils/vts/Android.bp b/gnss/common/utils/vts/Android.bp index f92e609f3c..b5325b2881 100644 --- a/gnss/common/utils/vts/Android.bp +++ b/gnss/common/utils/vts/Android.bp @@ -44,7 +44,7 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.measurement_corrections@1.1", - "android.hardware.gnss-V2-cpp", + "android.hardware.gnss-V3-cpp", ], static_libs: [ "libgtest", diff --git a/graphics/Android.bp b/graphics/Android.bp index 4ae7ec7c5e..2fbcb41c47 100644 --- a/graphics/Android.bp +++ b/graphics/Android.bp @@ -53,13 +53,13 @@ cc_defaults { cc_defaults { name: "android.hardware.graphics.composer3-ndk_static", static_libs: [ - "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.graphics.composer3-V2-ndk", ], } cc_defaults { name: "android.hardware.graphics.composer3-ndk_shared", shared_libs: [ - "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.graphics.composer3-V2-ndk", ], } diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp index 67c7fb5e29..a3a2c554ca 100644 --- a/graphics/allocator/aidl/Android.bp +++ b/graphics/allocator/aidl/Android.bp @@ -39,12 +39,20 @@ aidl_interface { min_sdk_version: "29", }, }, - frozen: false, + frozen: true, versions_with_info: [ { version: "1", imports: ["android.hardware.common-V2"], }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V4", + ], + }, + ], } diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/.hash b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/.hash new file mode 100644 index 0000000000..cd11a097e3 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/.hash @@ -0,0 +1 @@ +9499fec09c544e9de5be3c87125721600f8ade66 diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/AllocationError.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/AllocationError.aidl new file mode 100644 index 0000000000..e50d170b62 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/AllocationError.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.allocator; +@Backing(type="int") @VintfStability +enum AllocationError { + BAD_DESCRIPTOR, + NO_RESOURCES, + UNSUPPORTED, +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/AllocationResult.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/AllocationResult.aidl new file mode 100644 index 0000000000..73cfeb5422 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/AllocationResult.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.allocator; +@VintfStability +parcelable AllocationResult { + int stride; + android.hardware.common.NativeHandle[] buffers; +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/BufferDescriptorInfo.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/BufferDescriptorInfo.aidl new file mode 100644 index 0000000000..49c249742f --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/BufferDescriptorInfo.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.allocator; +@VintfStability +parcelable BufferDescriptorInfo { + byte[128] name; + int width; + int height; + int layerCount; + android.hardware.graphics.common.PixelFormat format = android.hardware.graphics.common.PixelFormat.UNSPECIFIED; + android.hardware.graphics.common.BufferUsage usage = android.hardware.graphics.common.BufferUsage.CPU_READ_NEVER; + long reservedSize; + android.hardware.graphics.common.ExtendableType[] additionalOptions; +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/IAllocator.aidl new file mode 100644 index 0000000000..66e49a70c0 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/2/android/hardware/graphics/allocator/IAllocator.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.allocator; +@VintfStability +interface IAllocator { + /** + * @deprecated As of android.hardware.graphics.allocator-V2 in combination with AIMAPPER_VERSION_5 this is deprecated & replaced with allocate2. If android.hardware.graphics.mapper@4 is still in use, however, this is still required to be implemented. + */ + android.hardware.graphics.allocator.AllocationResult allocate(in byte[] descriptor, in int count); + android.hardware.graphics.allocator.AllocationResult allocate2(in android.hardware.graphics.allocator.BufferDescriptorInfo descriptor, in int count); + boolean isSupported(in android.hardware.graphics.allocator.BufferDescriptorInfo descriptor); + String getIMapperLibrarySuffix(); +} diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index 84bc1afd1e..02334e85c2 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -39,8 +39,11 @@ aidl_interface { ], min_sdk_version: "29", }, + rust: { + enabled: true, + }, }, - frozen: false, + frozen: true, versions_with_info: [ { version: "1", @@ -60,5 +63,10 @@ aidl_interface { "android.hardware.common-V2", ], }, + { + version: "4", + imports: ["android.hardware.common-V2"], + }, + ], } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/.hash b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/.hash new file mode 100644 index 0000000000..ef17b34926 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/.hash @@ -0,0 +1 @@ +9bcf4b83485ce912dc39108201504f77b8c96cef diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/AlphaInterpretation.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/AlphaInterpretation.aidl new file mode 100644 index 0000000000..ea60283fe1 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/AlphaInterpretation.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum AlphaInterpretation { + COVERAGE = 0, + MASK = 1, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/BlendMode.aidl new file mode 100644 index 0000000000..d1f61beee8 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/BlendMode.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum BlendMode { + INVALID = 0, + NONE = 1, + PREMULTIPLIED = 2, + COVERAGE = 3, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/BufferUsage.aidl new file mode 100644 index 0000000000..d42a6d57b8 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/BufferUsage.aidl @@ -0,0 +1,65 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum BufferUsage { + CPU_READ_MASK = 0xf, + CPU_READ_NEVER = 0, + CPU_READ_RARELY = 2, + CPU_READ_OFTEN = 3, + CPU_WRITE_MASK = (0xf << 4) /* 240 */, + CPU_WRITE_NEVER = (0 << 4) /* 0 */, + CPU_WRITE_RARELY = (2 << 4) /* 32 */, + CPU_WRITE_OFTEN = (3 << 4) /* 48 */, + GPU_TEXTURE = (1 << 8) /* 256 */, + GPU_RENDER_TARGET = (1 << 9) /* 512 */, + COMPOSER_OVERLAY = (1 << 11) /* 2048 */, + COMPOSER_CLIENT_TARGET = (1 << 12) /* 4096 */, + PROTECTED = (1 << 14) /* 16384 */, + COMPOSER_CURSOR = (1 << 15) /* 32768 */, + VIDEO_ENCODER = (1 << 16) /* 65536 */, + CAMERA_OUTPUT = (1 << 17) /* 131072 */, + CAMERA_INPUT = (1 << 18) /* 262144 */, + RENDERSCRIPT = (1 << 20) /* 1048576 */, + VIDEO_DECODER = (1 << 22) /* 4194304 */, + SENSOR_DIRECT_DATA = (1 << 23) /* 8388608 */, + GPU_DATA_BUFFER = (1 << 24) /* 16777216 */, + GPU_CUBE_MAP = (1 << 25) /* 33554432 */, + GPU_MIPMAP_COMPLETE = (1 << 26) /* 67108864 */, + HW_IMAGE_ENCODER = (1 << 27) /* 134217728 */, + FRONT_BUFFER = (1L << 32) /* 4294967296 */, + VENDOR_MASK = (0xf << 28) /* -268435456 */, + VENDOR_MASK_HI = ((1L * 0xffff) << 48) /* -281474976710656 */, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ChromaSiting.aidl new file mode 100644 index 0000000000..b8af644604 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ChromaSiting.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum ChromaSiting { + NONE = 0, + UNKNOWN = 1, + SITED_INTERSTITIAL = 2, + COSITED_HORIZONTAL = 3, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ColorTransform.aidl new file mode 100644 index 0000000000..f74859b788 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ColorTransform.aidl @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum ColorTransform { + IDENTITY = 0, + ARBITRARY_MATRIX = 1, + VALUE_INVERSE = 2, + GRAYSCALE = 3, + CORRECT_PROTANOPIA = 4, + CORRECT_DEUTERANOPIA = 5, + CORRECT_TRITANOPIA = 6, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Compression.aidl new file mode 100644 index 0000000000..4f155e19a9 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Compression.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum Compression { + NONE = 0, + DISPLAY_STREAM_COMPRESSION = 1, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Cta861_3.aidl new file mode 100644 index 0000000000..ec90c9c64f --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Cta861_3.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Cta861_3 { + float maxContentLightLevel; + float maxFrameAverageLightLevel; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Dataspace.aidl new file mode 100644 index 0000000000..d9ff5aabed --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Dataspace.aidl @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum Dataspace { + UNKNOWN = 0x0, + ARBITRARY = 0x1, + STANDARD_SHIFT = 16, + STANDARD_MASK = (63 << 16) /* 4128768 */, + STANDARD_UNSPECIFIED = (0 << 16) /* 0 */, + STANDARD_BT709 = (1 << 16) /* 65536 */, + STANDARD_BT601_625 = (2 << 16) /* 131072 */, + STANDARD_BT601_625_UNADJUSTED = (3 << 16) /* 196608 */, + STANDARD_BT601_525 = (4 << 16) /* 262144 */, + STANDARD_BT601_525_UNADJUSTED = (5 << 16) /* 327680 */, + STANDARD_BT2020 = (6 << 16) /* 393216 */, + STANDARD_BT2020_CONSTANT_LUMINANCE = (7 << 16) /* 458752 */, + STANDARD_BT470M = (8 << 16) /* 524288 */, + STANDARD_FILM = (9 << 16) /* 589824 */, + STANDARD_DCI_P3 = (10 << 16) /* 655360 */, + STANDARD_ADOBE_RGB = (11 << 16) /* 720896 */, + TRANSFER_SHIFT = 22, + TRANSFER_MASK = (31 << 22) /* 130023424 */, + TRANSFER_UNSPECIFIED = (0 << 22) /* 0 */, + TRANSFER_LINEAR = (1 << 22) /* 4194304 */, + TRANSFER_SRGB = (2 << 22) /* 8388608 */, + TRANSFER_SMPTE_170M = (3 << 22) /* 12582912 */, + TRANSFER_GAMMA2_2 = (4 << 22) /* 16777216 */, + TRANSFER_GAMMA2_6 = (5 << 22) /* 20971520 */, + TRANSFER_GAMMA2_8 = (6 << 22) /* 25165824 */, + TRANSFER_ST2084 = (7 << 22) /* 29360128 */, + TRANSFER_HLG = (8 << 22) /* 33554432 */, + RANGE_SHIFT = 27, + RANGE_MASK = (7 << 27) /* 939524096 */, + RANGE_UNSPECIFIED = (0 << 27) /* 0 */, + RANGE_FULL = (1 << 27) /* 134217728 */, + RANGE_LIMITED = (2 << 27) /* 268435456 */, + RANGE_EXTENDED = (3 << 27) /* 402653184 */, + SRGB_LINEAR = (((1 << 16) | (1 << 22)) | (1 << 27)) /* 138477568 */, + SCRGB_LINEAR = (((1 << 16) | (1 << 22)) | (3 << 27)) /* 406913024 */, + SRGB = (((1 << 16) | (2 << 22)) | (1 << 27)) /* 142671872 */, + SCRGB = (((1 << 16) | (2 << 22)) | (3 << 27)) /* 411107328 */, + JFIF = (((2 << 16) | (3 << 22)) | (1 << 27)) /* 146931712 */, + BT601_625 = (((2 << 16) | (3 << 22)) | (2 << 27)) /* 281149440 */, + BT601_525 = (((4 << 16) | (3 << 22)) | (2 << 27)) /* 281280512 */, + BT709 = (((1 << 16) | (3 << 22)) | (2 << 27)) /* 281083904 */, + DCI_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, + DCI_P3 = (((10 << 16) | (5 << 22)) | (1 << 27)) /* 155844608 */, + DISPLAY_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, + DISPLAY_P3 = (((10 << 16) | (2 << 22)) | (1 << 27)) /* 143261696 */, + ADOBE_RGB = (((11 << 16) | (4 << 22)) | (1 << 27)) /* 151715840 */, + BT2020_LINEAR = (((6 << 16) | (1 << 22)) | (1 << 27)) /* 138805248 */, + BT2020 = (((6 << 16) | (3 << 22)) | (1 << 27)) /* 147193856 */, + BT2020_PQ = (((6 << 16) | (7 << 22)) | (1 << 27)) /* 163971072 */, + DEPTH = 0x1000, + SENSOR = 0x1001, + BT2020_ITU = (((6 << 16) | (3 << 22)) | (2 << 27)) /* 281411584 */, + BT2020_ITU_PQ = (((6 << 16) | (7 << 22)) | (2 << 27)) /* 298188800 */, + BT2020_ITU_HLG = (((6 << 16) | (8 << 22)) | (2 << 27)) /* 302383104 */, + BT2020_HLG = (((6 << 16) | (8 << 22)) | (1 << 27)) /* 168165376 */, + DISPLAY_BT2020 = (((6 << 16) | (2 << 22)) | (1 << 27)) /* 142999552 */, + DYNAMIC_DEPTH = 0x1002, + JPEG_APP_SEGMENTS = 0x1003, + HEIF = 0x1004, + JPEG_R = 0x1005, + BT709_FULL_RANGE = (((1 << 16) | (3 << 22)) | (1 << 27)) /* 146866176 */, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/DisplayDecorationSupport.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/DisplayDecorationSupport.aidl new file mode 100644 index 0000000000..27eff76432 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/DisplayDecorationSupport.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable DisplayDecorationSupport { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.AlphaInterpretation alphaInterpretation; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ExtendableType.aidl new file mode 100644 index 0000000000..5ff17752f7 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/ExtendableType.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable ExtendableType { + @utf8InCpp String name; + long value = 0; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/FRect.aidl new file mode 100644 index 0000000000..7972e111e2 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/FRect.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable FRect { + float left; + float top; + float right; + float bottom; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HardwareBuffer.aidl new file mode 100644 index 0000000000..1817769af2 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HardwareBuffer.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable HardwareBuffer { + android.hardware.graphics.common.HardwareBufferDescription description; + android.hardware.common.NativeHandle handle; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HardwareBufferDescription.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HardwareBufferDescription.aidl new file mode 100644 index 0000000000..70f46a1e6c --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HardwareBufferDescription.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable HardwareBufferDescription { + int width; + int height; + int layers; + android.hardware.graphics.common.PixelFormat format = android.hardware.graphics.common.PixelFormat.UNSPECIFIED; + android.hardware.graphics.common.BufferUsage usage = android.hardware.graphics.common.BufferUsage.CPU_READ_NEVER; + int stride; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Hdr.aidl new file mode 100644 index 0000000000..71927b6fbf --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Hdr.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum Hdr { + INVALID = 0, + DOLBY_VISION = 1, + HDR10 = 2, + HLG = 3, + HDR10_PLUS = 4, + DOLBY_VISION_4K30 = 5, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HdrConversionCapability.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HdrConversionCapability.aidl new file mode 100644 index 0000000000..b74f7d7ce5 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HdrConversionCapability.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +@VintfStability +parcelable HdrConversionCapability { + android.hardware.graphics.common.Hdr sourceType; + android.hardware.graphics.common.Hdr outputType; + boolean addsLatency; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HdrConversionStrategy.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HdrConversionStrategy.aidl new file mode 100644 index 0000000000..db785cf63f --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/HdrConversionStrategy.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +@VintfStability +union HdrConversionStrategy { + boolean passthrough = true; + android.hardware.graphics.common.Hdr[] autoAllowedHdrTypes; + android.hardware.graphics.common.Hdr forceHdrConversion; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Interlaced.aidl new file mode 100644 index 0000000000..e04d2ab2bd --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Interlaced.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum Interlaced { + NONE = 0, + TOP_BOTTOM = 1, + RIGHT_LEFT = 2, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PixelFormat.aidl new file mode 100644 index 0000000000..ed84a44b4f --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PixelFormat.aidl @@ -0,0 +1,71 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum PixelFormat { + UNSPECIFIED = 0, + RGBA_8888 = 0x1, + RGBX_8888 = 0x2, + RGB_888 = 0x3, + RGB_565 = 0x4, + BGRA_8888 = 0x5, + YCBCR_422_SP = 0x10, + YCRCB_420_SP = 0x11, + YCBCR_422_I = 0x14, + RGBA_FP16 = 0x16, + RAW16 = 0x20, + BLOB = 0x21, + IMPLEMENTATION_DEFINED = 0x22, + YCBCR_420_888 = 0x23, + RAW_OPAQUE = 0x24, + RAW10 = 0x25, + RAW12 = 0x26, + RGBA_1010102 = 0x2B, + Y8 = 0x20203859, + Y16 = 0x20363159, + YV12 = 0x32315659, + DEPTH_16 = 0x30, + DEPTH_24 = 0x31, + DEPTH_24_STENCIL_8 = 0x32, + DEPTH_32F = 0x33, + DEPTH_32F_STENCIL_8 = 0x34, + STENCIL_8 = 0x35, + YCBCR_P010 = 0x36, + HSV_888 = 0x37, + R_8 = 0x38, + R_16_UINT = 0x39, + RG_1616_UINT = 0x3a, + RGBA_10101010 = 0x3b, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayout.aidl new file mode 100644 index 0000000000..a09097511b --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayout.aidl @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable PlaneLayout { + android.hardware.graphics.common.PlaneLayoutComponent[] components; + long offsetInBytes; + long sampleIncrementInBits; + long strideInBytes; + long widthInSamples; + long heightInSamples; + long totalSizeInBytes; + long horizontalSubsampling; + long verticalSubsampling; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayoutComponent.aidl new file mode 100644 index 0000000000..0768240bf5 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayoutComponent.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable PlaneLayoutComponent { + android.hardware.graphics.common.ExtendableType type; + long offsetInBits; + long sizeInBits; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayoutComponentType.aidl new file mode 100644 index 0000000000..e3067515fd --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/PlaneLayoutComponentType.aidl @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum PlaneLayoutComponentType { + Y = (1 << 0) /* 1 */, + CB = (1 << 1) /* 2 */, + CR = (1 << 2) /* 4 */, + R = (1 << 10) /* 1024 */, + G = (1 << 11) /* 2048 */, + B = (1 << 12) /* 4096 */, + RAW = (1 << 20) /* 1048576 */, + A = (1 << 30) /* 1073741824 */, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Point.aidl new file mode 100644 index 0000000000..af4705a1e4 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Point.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Point { + int x; + int y; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Rect.aidl new file mode 100644 index 0000000000..463a68f973 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Rect.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Rect { + int left; + int top; + int right; + int bottom; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Smpte2086.aidl new file mode 100644 index 0000000000..dce9226c09 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Smpte2086.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Smpte2086 { + android.hardware.graphics.common.XyColor primaryRed; + android.hardware.graphics.common.XyColor primaryGreen; + android.hardware.graphics.common.XyColor primaryBlue; + android.hardware.graphics.common.XyColor whitePoint; + float maxLuminance; + float minLuminance; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/StandardMetadataType.aidl new file mode 100644 index 0000000000..6e2e1063c3 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/StandardMetadataType.aidl @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2019,libgralloctypes_helper The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum StandardMetadataType { + INVALID = 0, + BUFFER_ID = 1, + NAME = 2, + WIDTH = 3, + HEIGHT = 4, + LAYER_COUNT = 5, + PIXEL_FORMAT_REQUESTED = 6, + PIXEL_FORMAT_FOURCC = 7, + PIXEL_FORMAT_MODIFIER = 8, + USAGE = 9, + ALLOCATION_SIZE = 10, + PROTECTED_CONTENT = 11, + COMPRESSION = 12, + INTERLACED = 13, + CHROMA_SITING = 14, + PLANE_LAYOUTS = 15, + CROP = 16, + DATASPACE = 17, + BLEND_MODE = 18, + SMPTE2086 = 19, + CTA861_3 = 20, + SMPTE2094_40 = 21, + SMPTE2094_10 = 22, + STRIDE = 23, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Transform.aidl new file mode 100644 index 0000000000..dbed57dae6 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/Transform.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum Transform { + NONE = 0, + FLIP_H = (1 << 0) /* 1 */, + FLIP_V = (1 << 1) /* 2 */, + ROT_90 = (1 << 2) /* 4 */, + ROT_180 = (FLIP_H | FLIP_V) /* 3 */, + ROT_270 = ((FLIP_H | FLIP_V) | ROT_90) /* 7 */, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/XyColor.aidl new file mode 100644 index 0000000000..e300f25dad --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/4/android/hardware/graphics/common/XyColor.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable XyColor { + float x; + float y; +} 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 668b033174..563b6c1ac4 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 @@ -94,5 +94,6 @@ enum Dataspace { DYNAMIC_DEPTH = 4098, JPEG_APP_SEGMENTS = 4099, HEIF = 4100, + JPEG_R = 4101, BT709_FULL_RANGE = 146866176, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl index 128ef4917f..71927b6fbf 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl @@ -35,6 +35,7 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="int") @VintfStability enum Hdr { + INVALID = 0, DOLBY_VISION = 1, HDR10 = 2, HLG = 3, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionCapability.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionCapability.aidl new file mode 100644 index 0000000000..b74f7d7ce5 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionCapability.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +@VintfStability +parcelable HdrConversionCapability { + android.hardware.graphics.common.Hdr sourceType; + android.hardware.graphics.common.Hdr outputType; + boolean addsLatency; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionStrategy.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionStrategy.aidl new file mode 100644 index 0000000000..db785cf63f --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HdrConversionStrategy.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +@VintfStability +union HdrConversionStrategy { + boolean passthrough = true; + android.hardware.graphics.common.Hdr[] autoAllowedHdrTypes; + android.hardware.graphics.common.Hdr forceHdrConversion; +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl index 5e9360fced..3ff0a6534b 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl @@ -87,7 +87,7 @@ enum Dataspace { * Use the unadjusted KR = 0.2126, KB = 0.0722 luminance interpretation * for RGB conversion. */ - STANDARD_BT709 = 1 << 16, // 1 << STANDARD_SHIFT + STANDARD_BT709 = 1 << 16, // 1 << STANDARD_SHIFT /** * Primaries: x y @@ -377,11 +377,19 @@ enum Dataspace { RANGE_LIMITED = 2 << 27, // 2 << RANGE_SHIFT = 0x10000000 /** - * Extended range is used for scRGB. Intended for use with - * floating point pixel formats. [0.0 - 1.0] is the standard - * sRGB space. Values outside the range 0.0 - 1.0 can encode - * color outside the sRGB gamut. - * Used to blend / merge multiple dataspaces on a single display. + * Extended range can be used in combination with FP16 to communicate scRGB or with + * SurfaceControl's setExtendedRangeBrightness(SurfaceControl, float, float) + * to indicate an HDR range. + * + * When used with floating point pixel formats and #STANDARD_BT709 then [0.0 - 1.0] is the + * standard sRGB space and values outside the range [0.0 - 1.0] can encode + * color outside the sRGB gamut. [-0.5, 7.5] is the standard scRGB range. + * Used to blend/merge multiple dataspaces on a single display. + * + * As of Android U in combination with composer3's mixed SDR/HDR feature then this may + * be combined with SurfaceControl's setExtendedRangeBrightness(SurfaceControl, float, float) + * and other formats such as RGBA_8888 or RGBA_1010102 to communicate a variable HDR + * brightness range, which in turn will influence that layer's dimming ratio when composited */ RANGE_EXTENDED = 3 << 27, // 3 << RANGE_SHIFT = 0x18000000 @@ -397,7 +405,6 @@ enum Dataspace { */ SRGB_LINEAR = 1 << 16 | 1 << 22 | 1 << 27, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_FULL - /** * scRGB linear encoding: * @@ -412,7 +419,6 @@ enum Dataspace { */ SCRGB_LINEAR = 1 << 16 | 1 << 22 | 3 << 27, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED - /** * sRGB gamma encoding: * @@ -428,7 +434,6 @@ enum Dataspace { */ SRGB = 1 << 16 | 2 << 22 | 1 << 27, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_FULL - /** * scRGB: * @@ -470,8 +475,8 @@ enum Dataspace { * * Use limited range, SMPTE 170M transfer and BT.601_625 standard. */ - BT601_625 = 2 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT601_625 | TRANSFER_SMPTE_170M | RANGE_LIMITED - + BT601_625 = + 2 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT601_625 | TRANSFER_SMPTE_170M | RANGE_LIMITED /** * ITU-R Recommendation 601 (BT.601) - 525-line @@ -480,7 +485,8 @@ enum Dataspace { * * Use limited range, SMPTE 170M transfer and BT.601_525 standard. */ - BT601_525 = 4 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT601_525 | TRANSFER_SMPTE_170M | RANGE_LIMITED + BT601_525 = + 4 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT601_525 | TRANSFER_SMPTE_170M | RANGE_LIMITED /** * ITU-R Recommendation 709 (BT.709) @@ -491,7 +497,6 @@ enum Dataspace { */ BT709 = 1 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_LIMITED - /** * SMPTE EG 432-1 and SMPTE RP 431-2. * @@ -501,7 +506,6 @@ enum Dataspace { */ DCI_P3_LINEAR = 10 << 16 | 1 << 22 | 1 << 27, // STANDARD_DCI_P3 | TRANSFER_LINEAR | RANGE_FULL - /** * SMPTE EG 432-1 and SMPTE RP 431-2. * @@ -513,15 +517,14 @@ enum Dataspace { */ DCI_P3 = 10 << 16 | 5 << 22 | 1 << 27, // STANDARD_DCI_P3 | TRANSFER_GAMMA2_6 | RANGE_FULL - /** * Display P3 * * Display P3 uses same primaries and white-point as DCI-P3 * linear transfer function makes this the same as DCI_P3_LINEAR. */ - DISPLAY_P3_LINEAR = 10 << 16 | 1 << 22 | 1 << 27, // STANDARD_DCI_P3 | TRANSFER_LINEAR | RANGE_FULL - + DISPLAY_P3_LINEAR = + 10 << 16 | 1 << 22 | 1 << 27, // STANDARD_DCI_P3 | TRANSFER_LINEAR | RANGE_FULL /** * Display P3 @@ -531,7 +534,6 @@ enum Dataspace { */ DISPLAY_P3 = 10 << 16 | 2 << 22 | 1 << 27, // STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL - /** * Adobe RGB * @@ -541,7 +543,6 @@ enum Dataspace { */ ADOBE_RGB = 11 << 16 | 4 << 22 | 1 << 27, // STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL - /** * ITU-R Recommendation 2020 (BT.2020) * @@ -551,7 +552,6 @@ enum Dataspace { */ BT2020_LINEAR = 6 << 16 | 1 << 22 | 1 << 27, // STANDARD_BT2020 | TRANSFER_LINEAR | RANGE_FULL - /** * ITU-R Recommendation 2020 (BT.2020) * @@ -570,7 +570,6 @@ enum Dataspace { */ BT2020_PQ = 6 << 16 | 7 << 22 | 1 << 27, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL - /** * Data spaces for non-color formats */ @@ -611,7 +610,8 @@ enum Dataspace { * * Use limited range, SMPTE 170M transfer and BT2020 standard */ - BT2020_ITU = 6 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_LIMITED + BT2020_ITU = + 6 << 16 | 3 << 22 | 2 << 27, // STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_LIMITED /** * ITU-R Recommendation 2100 (BT.2100) @@ -621,7 +621,8 @@ enum Dataspace { * Use limited/full range, PQ/HLG transfer, and BT2020 standard * limited range is the preferred / normative definition for BT.2100 */ - BT2020_ITU_PQ = 6 << 16 | 7 << 22 | 2 << 27, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_LIMITED + BT2020_ITU_PQ = + 6 << 16 | 7 << 22 | 2 << 27, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_LIMITED BT2020_ITU_HLG = 6 << 16 | 8 << 22 | 2 << 27, // STANDARD_BT2020 | TRANSFER_HLG | RANGE_LIMITED BT2020_HLG = 6 << 16 | 8 << 22 | 1 << 27, // STANDARD_BT2020 | TRANSFER_HLG | RANGE_FULL @@ -667,6 +668,21 @@ enum Dataspace { */ HEIF = 0x1004, + /** + * Ultra HDR + * + * JPEG image with embedded 10-bit recovery map following the Ultra HDR specification. + * + * 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 + * Ultra HDR Image format specification. + * 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. + */ + JPEG_R = 0x1005, + /** * ITU-R Recommendation 709 (BT.709) * @@ -674,5 +690,6 @@ enum Dataspace { * * Use full range, SMPTE 170M transfer and BT.709 standard. */ - BT709_FULL_RANGE = 1 << 16 | 3 << 22 | 1 << 27, // STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_FULL + BT709_FULL_RANGE = + 1 << 16 | 3 << 22 | 1 << 27, // STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_FULL } diff --git a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl index 407b54f524..c9ba16b34f 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl @@ -23,6 +23,10 @@ package android.hardware.graphics.common; @VintfStability @Backing(type="int") enum Hdr { + /** + * Invalid HDR type + */ + INVALID = 0, /** * Device supports Dolby Vision HDR */ diff --git a/graphics/common/aidl/android/hardware/graphics/common/HdrConversionCapability.aidl b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionCapability.aidl new file mode 100644 index 0000000000..d8524a5b12 --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionCapability.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.common; + +import android.hardware.graphics.common.Hdr; + +/** + * Output parameter for IComposerClient.getHdrConversionCapabilities + */ +@VintfStability +parcelable HdrConversionCapability { + /** sourceType is the HDR type that can be converted to outputType */ + Hdr sourceType; + + /** + * outputType is the HDR type/ SDR that the source type can be converted to. The value INVALID + * is used to depict SDR outputType. + */ + + Hdr outputType; + + /** + * addsLatency is false if no latency added due to HDR conversion from sourceType to + * outputType, otherwise true. + */ + boolean addsLatency; +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/HdrConversionStrategy.aidl b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionStrategy.aidl new file mode 100644 index 0000000000..71beaa00da --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/HdrConversionStrategy.aidl @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.common; + +import android.hardware.graphics.common.Hdr; +/** + * Input parameter for IComposerClient.setHdrConversionStrategy + */ +@VintfStability +union HdrConversionStrategy { + /** + * When this parameter is set to true, HDR conversion is disabled by the + * implementation. The output HDR type will change dynamically to match the content. This value + * is never set to false, as other union values will be present in the false case. + */ + boolean passthrough = true; + + /** + * When this parameter is set, the output HDR type is selected by the + * implementation. The implementation is only allowed to set the output HDR type to the HDR + * types present in this list. If conversion to any of the autoHdrTypes types is not possible, + * the implementation should do no conversion. + */ + Hdr[] autoAllowedHdrTypes; + + /** + * When this parameter is set, the implementation should convert all + * content to this HDR type, when possible. If not possible, the functionality should be similar + * to passthrough=true. + */ + Hdr forceHdrConversion; +} diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp index 48226785d5..9444d89f80 100644 --- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp +++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp @@ -666,11 +666,13 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown()); } - NativeHandleWrapper allocate() { + NativeHandleWrapper allocate() { return allocate(mDisplayWidth, mDisplayHeight); } + + NativeHandleWrapper allocate(uint32_t width, uint32_t height) { uint64_t usage = static_cast(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN | BufferUsage::COMPOSER_OVERLAY); - return mGralloc->allocate(mDisplayWidth, mDisplayHeight, 1, PixelFormat::RGBA_8888, usage); + return mGralloc->allocate(width, height, 1, PixelFormat::RGBA_8888, usage); } void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); } @@ -883,6 +885,106 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER) { execute(); } +/** + * Test IComposerClient::Command::SET_LAYER_BUFFER with the behavior used for clearing buffer slots. + */ +TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER_multipleTimes) { + // A placeholder buffer used to clear buffer slots + auto clearSlotBuffer = allocate(1u, 1u); + + // + // Set the layer buffer to the first buffer + // + auto handle1 = allocate(); + ASSERT_NE(nullptr, handle1.get()); + IComposerClient::Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; + Layer layer; + ASSERT_NO_FATAL_FAILURE( + layer = mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount)); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE); + mWriter->setLayerDisplayFrame(displayFrame); + mWriter->setLayerBuffer(0, handle1.get(), -1); + mWriter->setLayerDataspace(Dataspace::UNKNOWN); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + GTEST_SUCCEED() << "Composition change requested, skipping test"; + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + // + // Set the layer buffer to the second buffer + // + auto handle2 = allocate(); + ASSERT_NE(nullptr, handle2.get()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE); + mWriter->setLayerDisplayFrame(displayFrame); + mWriter->setLayerBuffer(1, handle2.get(), -1); + mWriter->setLayerDataspace(Dataspace::UNKNOWN); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + GTEST_SUCCEED() << "Composition change requested, skipping test"; + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + // + // Set the layer buffer to the third buffer + // + auto handle3 = allocate(); + ASSERT_NE(nullptr, handle3.get()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE); + mWriter->setLayerDisplayFrame(displayFrame); + mWriter->setLayerBuffer(2, handle3.get(), -1); + mWriter->setLayerDataspace(Dataspace::UNKNOWN); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + GTEST_SUCCEED() << "Composition change requested, skipping test"; + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + // Ensure we can clear multiple buffer slots and then restore the active buffer at the end + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerBuffer(0, clearSlotBuffer.get(), -1); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerBuffer(1, clearSlotBuffer.get(), -1); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerBuffer(2, nullptr, -1); + mWriter->validateDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); +} + /** * Test IComposerClient::Command::SET_LAYER_SURFACE_DAMAGE. */ diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index e383ce20de..d11592f512 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -29,6 +29,7 @@ cc_library_static { "android.hardware.graphics.allocator-ndk_static", "android.hardware.graphics.composer3-ndk_static", "hidl_defaults", + "librenderengine_deps", ], srcs: [ "ComposerVts.cpp", @@ -41,7 +42,6 @@ cc_library_static { static_libs: [ "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", - "android.hardware.graphics.composer3-V1-ndk", "android.hardware.graphics.mapper@2.1-vts", "libarect", "libgtest", diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp index b706596df4..d4f028169f 100644 --- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp @@ -129,12 +129,12 @@ void ComposerClient::setReadbackBuffer(Display display, const native_handle_t* b void ComposerClient::getReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat, Dataspace* outDataspace) { mClient->getReadbackBufferAttributes( - display, - [&](const auto& tmpError, const auto& tmpOutPixelFormat, const auto& tmpOutDataspace) { - ASSERT_EQ(Error::NONE, tmpError) << "failed to get readback buffer attributes"; - *outPixelFormat = tmpOutPixelFormat; - *outDataspace = tmpOutDataspace; - }); + display, + [&](const auto& tmpError, const auto& tmpOutPixelFormat, const auto& tmpOutDataspace) { + ASSERT_EQ(Error::NONE, tmpError) << "failed to get readback buffer attributes"; + *outPixelFormat = tmpOutPixelFormat; + *outDataspace = tmpOutDataspace; + }); } void ComposerClient::getReadbackBufferFence(Display display, int32_t* outFence) { diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index 4a33fb5b42..1700b2ade9 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -71,14 +71,12 @@ void TestRenderEngine::drawLayers() { }); auto texture = std::make_shared( mGraphicBuffer, *mRenderEngine, renderengine::impl::ExternalTexture::Usage::WRITEABLE); - auto [status, readyFence] = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayers, texture, - true, std::move(bufferFence)) - .get(); - int fd = readyFence.release(); - if (fd != -1) { - ASSERT_EQ(0, sync_wait(fd, -1)); - ASSERT_EQ(0, close(fd)); + auto result = mRenderEngine + ->drawLayers(mDisplaySettings, compositionLayers, texture, true, + std::move(bufferFence)) + .get(); + if (result.ok()) { + result.value()->waitForever(LOG_TAG); } } diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index cdc7a93025..34763766da 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -29,8 +29,7 @@ cc_test { "VtsHalTargetTestDefaults", "android.hardware.graphics.allocator-ndk_static", "android.hardware.graphics.composer3-ndk_static", - // Needed for librenderengine - "skia_deps", + "librenderengine_deps", ], tidy_timeout_srcs: [ "VtsHalGraphicsComposerV2_2ReadbackTest.cpp", @@ -69,7 +68,6 @@ cc_test { "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer@2.2-vts", - "android.hardware.graphics.composer3-V1-ndk", "android.hardware.graphics.mapper@2.0-vts", "android.hardware.graphics.mapper@2.1-vts", "android.hardware.graphics.mapper@3.0-vts", diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp index 7e25a2e125..13ae089d65 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp @@ -66,16 +66,16 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam { mComposerCallback->setVsyncAllowed(false); mComposerClient->getRaw()->getReadbackBufferAttributes( - mPrimaryDisplay, - [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) { - mHasReadbackBuffer = tmpError == Error::NONE; - if (mHasReadbackBuffer) { - mReadbackPixelFormat = tmpPixelFormat; - mReadbackDataspace = tmpDataspace; - ASSERT_LT(static_cast(0), mReadbackPixelFormat); - ASSERT_NE(Dataspace::UNKNOWN, mReadbackDataspace); - } - }); + mPrimaryDisplay, + [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) { + mHasReadbackBuffer = tmpError == Error::NONE; + if (mHasReadbackBuffer) { + mReadbackPixelFormat = tmpPixelFormat; + mReadbackDataspace = tmpDataspace; + ASSERT_LT(static_cast(0), mReadbackPixelFormat); + ASSERT_NE(Dataspace::UNKNOWN, mReadbackDataspace); + } + }); mInvalidDisplayId = GetInvalidDisplayId(); } @@ -711,4 +711,4 @@ int main(int argc, char** argv) { } return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h b/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h index afc22d8719..5e9a2877f6 100644 --- a/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h +++ b/graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h @@ -87,6 +87,10 @@ class CommandWriterBase : public V2_2::CommandWriterBase { return; } + if (metadata.size() == 0) { + return; + } + // space for numElements commandLength += 1; diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h index f1d61f84c2..42996dd4b6 100644 --- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h +++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h @@ -82,7 +82,7 @@ class ComposerCommandEngine : public V2_2::hal::ComposerCommandEngine { std::vector metadata; - for (size_t i = 0; i < numBlobs; i++) { + for (size_t i = 0; i < numBlobs && length >= 2; i++) { IComposerClient::PerFrameMetadataKey key = static_cast(readSigned()); uint32_t blobSize = read(); diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp index fa294ff259..35225d9a03 100644 --- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp +++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp @@ -737,6 +737,39 @@ TEST_P(GraphicsComposerHidlTest, getLayerGenericMetadataKeys) { } } +/* + * Test that no two display configs are exactly the same. + */ +TEST_P(GraphicsComposerHidlTest, GetDisplayConfigNoRepetitions) { + for (const auto& display : mDisplays) { + std::vector configs = mComposerClient->getDisplayConfigs(display.get()); + for (int i = 0; i < configs.size(); i++) { + for (int j = i + 1; j < configs.size(); j++) { + const int32_t width1 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[i], IComposerClient::Attribute::WIDTH); + const int32_t height1 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[i], IComposerClient::Attribute::HEIGHT); + const int32_t vsyncPeriod1 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[i], IComposerClient::Attribute::VSYNC_PERIOD); + const int32_t group1 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[i], IComposerClient::Attribute::CONFIG_GROUP); + + const int32_t width2 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[j], IComposerClient::Attribute::WIDTH); + const int32_t height2 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[j], IComposerClient::Attribute::HEIGHT); + const int32_t vsyncPeriod2 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[j], IComposerClient::Attribute::VSYNC_PERIOD); + const int32_t group2 = mComposerClient->getDisplayAttribute_2_4( + display.get(), configs[j], IComposerClient::Attribute::CONFIG_GROUP); + + ASSERT_FALSE(width1 == width2 && height1 == height2 && + vsyncPeriod1 == vsyncPeriod2 && group1 == group2); + } + } + } +} + } // namespace } // namespace vts } // namespace V2_4 diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 3e2b79c743..40448ec43e 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -32,6 +32,7 @@ aidl_interface { support_system_process: true, }, frozen: true, + vndk_use_version: "1", srcs: [ "android/hardware/graphics/composer3/*.aidl", ], @@ -62,15 +63,23 @@ aidl_interface { "android.hardware.common-V2", ], }, + { + version: "2", + imports: [ + "android.hardware.graphics.common-V4", + "android.hardware.common-V2", + ], + }, + ], } cc_library_headers { name: "android.hardware.graphics.composer3-command-buffer", + defaults: ["android.hardware.graphics.composer3-ndk_shared"], vendor_available: true, shared_libs: [ - "android.hardware.graphics.composer3-V1-ndk", "android.hardware.common-V2-ndk", "libbase", "libfmq", @@ -88,12 +97,12 @@ cc_library_headers { cc_test { name: "android.hardware.graphics.composer3-hidl2aidl-asserts", + defaults: ["android.hardware.graphics.composer3-ndk_shared"], vendor_available: true, srcs: ["android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp"], shared_libs: [ "libbinder_ndk", "libhidlbase", - "android.hardware.graphics.composer3-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.4", ], diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/.hash b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/.hash new file mode 100644 index 0000000000..70d4ced84c --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/.hash @@ -0,0 +1 @@ +b6d53bcf537cbe89633b1622e2b065ea17291234 diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Buffer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Buffer.aidl new file mode 100644 index 0000000000..a33ad23323 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Buffer.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable Buffer { + int slot; + @nullable android.hardware.common.NativeHandle handle; + @nullable ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Capability.aidl new file mode 100644 index 0000000000..f02f8aaa77 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Capability.aidl @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum Capability { + INVALID = 0, + SIDEBAND_STREAM = 1, + SKIP_CLIENT_COLOR_TRANSFORM = 2, + PRESENT_FENCE_IS_NOT_RELIABLE = 3, + /** + * @deprecated - enabled by default. + */ + SKIP_VALIDATE = 4, + BOOT_DISPLAY_CONFIG = 5, + HDR_OUTPUT_CONVERSION_CONFIG = 6, + REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl new file mode 100644 index 0000000000..7e47ba8b5e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ChangedCompositionLayer { + long layer; + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl new file mode 100644 index 0000000000..9a5ca9700d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ChangedCompositionTypes { + long display; + android.hardware.graphics.composer3.ChangedCompositionLayer[] layers; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTarget.aidl new file mode 100644 index 0000000000..7632707ec2 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTarget.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ClientTarget { + android.hardware.graphics.composer3.Buffer buffer; + android.hardware.graphics.common.Dataspace dataspace; + android.hardware.graphics.common.Rect[] damage; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTargetProperty.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTargetProperty.aidl new file mode 100644 index 0000000000..d34d1b0ab8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTargetProperty.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ClientTargetProperty { + android.hardware.graphics.common.PixelFormat pixelFormat; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl new file mode 100644 index 0000000000..8fb6933c95 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ClientTargetPropertyWithBrightness { + long display; + android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty; + float brightness; + android.hardware.graphics.composer3.DimmingStage dimmingStage; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl new file mode 100644 index 0000000000..480a85c27f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ClockMonotonicTimestamp { + long timestampNanos; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Color.aidl new file mode 100644 index 0000000000..822290908e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Color.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable Color { + float r; + float g; + float b; + float a; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ColorMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ColorMode.aidl new file mode 100644 index 0000000000..53852b6270 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ColorMode.aidl @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum ColorMode { + NATIVE = 0, + STANDARD_BT601_625 = 1, + STANDARD_BT601_625_UNADJUSTED = 2, + STANDARD_BT601_525 = 3, + STANDARD_BT601_525_UNADJUSTED = 4, + STANDARD_BT709 = 5, + DCI_P3 = 6, + SRGB = 7, + ADOBE_RGB = 8, + DISPLAY_P3 = 9, + BT2020 = 10, + BT2100_PQ = 11, + BT2100_HLG = 12, + DISPLAY_BT2020 = 13, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/CommandError.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/CommandError.aidl new file mode 100644 index 0000000000..103bfdc689 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/CommandError.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable CommandError { + int commandIndex; + int errorCode; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/CommandResultPayload.aidl new file mode 100644 index 0000000000..6892f06180 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +union CommandResultPayload { + android.hardware.graphics.composer3.CommandError error; + android.hardware.graphics.composer3.ChangedCompositionTypes changedCompositionTypes; + android.hardware.graphics.composer3.DisplayRequest displayRequest; + android.hardware.graphics.composer3.PresentFence presentFence; + android.hardware.graphics.composer3.ReleaseFences releaseFences; + android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; + android.hardware.graphics.composer3.ClientTargetPropertyWithBrightness clientTargetProperty; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Composition.aidl new file mode 100644 index 0000000000..34d6822148 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/Composition.aidl @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum Composition { + INVALID = 0, + CLIENT = 1, + DEVICE = 2, + SOLID_COLOR = 3, + CURSOR = 4, + SIDEBAND = 5, + DISPLAY_DECORATION = 6, + REFRESH_RATE_INDICATOR = 7, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ContentType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ContentType.aidl new file mode 100644 index 0000000000..d87b7670dd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ContentType.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum ContentType { + NONE = 0, + GRAPHICS = 1, + PHOTO = 2, + CINEMA = 3, + GAME = 4, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DimmingStage.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DimmingStage.aidl new file mode 100644 index 0000000000..44457f8ec1 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DimmingStage.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum DimmingStage { + NONE = 0, + LINEAR = 1, + GAMMA_OETF = 2, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayAttribute.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayAttribute.aidl new file mode 100644 index 0000000000..8454c40dbe --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayAttribute.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum DisplayAttribute { + INVALID = 0, + WIDTH = 1, + HEIGHT = 2, + VSYNC_PERIOD = 3, + DPI_X = 4, + DPI_Y = 5, + CONFIG_GROUP = 7, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayBrightness.aidl new file mode 100644 index 0000000000..e765189b96 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayBrightness.aidl @@ -0,0 +1,39 @@ +/** + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayBrightness { + float brightness; + float brightnessNits; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayCapability.aidl new file mode 100644 index 0000000000..6eba887aef --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum DisplayCapability { + INVALID = 0, + SKIP_CLIENT_COLOR_TRANSFORM = 1, + DOZE = 2, + BRIGHTNESS = 3, + PROTECTED_CONTENTS = 4, + AUTO_LOW_LATENCY_MODE = 5, + SUSPEND = 6, + DISPLAY_IDLE_TIMER = 7, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayCommand.aidl new file mode 100644 index 0000000000..662240e96b --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayCommand { + long display; + android.hardware.graphics.composer3.LayerCommand[] layers; + @nullable float[] colorTransformMatrix; + @nullable android.hardware.graphics.composer3.DisplayBrightness brightness; + @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; + @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; + @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime; + boolean validateDisplay; + boolean acceptDisplayChanges; + boolean presentDisplay; + boolean presentOrValidateDisplay; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayConnectionType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayConnectionType.aidl new file mode 100644 index 0000000000..640f82a0cd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayConnectionType.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum DisplayConnectionType { + INTERNAL = 0, + EXTERNAL = 1, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayContentSample.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayContentSample.aidl new file mode 100644 index 0000000000..c62453634f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayContentSample.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayContentSample { + long frameCount; + long[] sampleComponent0; + long[] sampleComponent1; + long[] sampleComponent2; + long[] sampleComponent3; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl new file mode 100644 index 0000000000..7c6542f527 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayContentSamplingAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; + android.hardware.graphics.composer3.FormatColorComponent componentMask; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayIdentification.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayIdentification.aidl new file mode 100644 index 0000000000..a0cc9b097b --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayIdentification.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayIdentification { + byte port; + byte[] data; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayRequest.aidl new file mode 100644 index 0000000000..e6db116398 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayRequest { + long display; + int mask; + android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests; + const int FLIP_CLIENT_TARGET = (1 << 0) /* 1 */; + const int WRITE_CLIENT_TARGET_TO_OUTPUT = (1 << 1) /* 2 */; + @VintfStability + parcelable LayerRequest { + long layer; + int mask; + const int CLEAR_CLIENT_TARGET = (1 << 0) /* 1 */; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/FormatColorComponent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/FormatColorComponent.aidl new file mode 100644 index 0000000000..89dae83bbe --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/FormatColorComponent.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="byte") @VintfStability +enum FormatColorComponent { + FORMAT_COMPONENT_0 = (1 << 0) /* 1 */, + FORMAT_COMPONENT_1 = (1 << 1) /* 2 */, + FORMAT_COMPONENT_2 = (1 << 2) /* 4 */, + FORMAT_COMPONENT_3 = (1 << 3) /* 8 */, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/HdrCapabilities.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/HdrCapabilities.aidl new file mode 100644 index 0000000000..80141d3543 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/HdrCapabilities.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable HdrCapabilities { + android.hardware.graphics.common.Hdr[] types; + float maxLuminance; + float maxAverageLuminance; + float minLuminance; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposer.aidl new file mode 100644 index 0000000000..21b9ad88cd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposer.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +interface IComposer { + android.hardware.graphics.composer3.IComposerClient createClient(); + android.hardware.graphics.composer3.Capability[] getCapabilities(); + const int EX_NO_RESOURCES = 6; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposerCallback.aidl new file mode 100644 index 0000000000..2c08cbeffd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposerCallback.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +interface IComposerCallback { + void onHotplug(long display, boolean connected); + oneway void onRefresh(long display); + oneway void onSeamlessPossible(long display); + oneway void onVsync(long display, long timestamp, int vsyncPeriodNanos); + oneway void onVsyncPeriodTimingChanged(long display, in android.hardware.graphics.composer3.VsyncPeriodChangeTimeline updatedTimeline); + oneway void onVsyncIdle(long display); + oneway void onRefreshRateChangedDebug(in android.hardware.graphics.composer3.RefreshRateChangedDebugData data); +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposerClient.aidl new file mode 100644 index 0000000000..cb85a88995 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/IComposerClient.aidl @@ -0,0 +1,93 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +interface IComposerClient { + long createLayer(long display, int bufferSlotCount); + android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); + void destroyLayer(long display, long layer); + void destroyVirtualDisplay(long display); + android.hardware.graphics.composer3.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.DisplayCommand[] commands); + int getActiveConfig(long display); + android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); + float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); + int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); + android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); + int[] getDisplayConfigs(long display); + android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display); + android.hardware.graphics.composer3.DisplayIdentification getDisplayIdentificationData(long display); + String getDisplayName(long display); + int getDisplayVsyncPeriod(long display); + android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); + android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); + android.hardware.graphics.common.Transform getDisplayPhysicalOrientation(long display); + android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); + int getMaxVirtualDisplayCount(); + android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); + android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display); + @nullable ParcelFileDescriptor getReadbackBufferFence(long display); + android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode); + android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display); + @nullable android.hardware.graphics.common.DisplayDecorationSupport getDisplayDecorationSupport(long display); + void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback); + void setActiveConfig(long display, int config); + android.hardware.graphics.composer3.VsyncPeriodChangeTimeline setActiveConfigWithConstraints(long display, int config, in android.hardware.graphics.composer3.VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); + void setBootDisplayConfig(long display, int config); + void clearBootDisplayConfig(long display); + int getPreferredBootDisplayConfig(long display); + void setAutoLowLatencyMode(long display, boolean on); + void setClientTargetSlotCount(long display, int clientTargetSlotCount); + void setColorMode(long display, android.hardware.graphics.composer3.ColorMode mode, android.hardware.graphics.composer3.RenderIntent intent); + void setContentType(long display, android.hardware.graphics.composer3.ContentType type); + void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames); + void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); + void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence); + void setVsyncEnabled(long display, boolean enabled); + void setIdleTimerEnabled(long display, int timeoutMs); + android.hardware.graphics.composer3.OverlayProperties getOverlaySupport(); + android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities(); + android.hardware.graphics.common.Hdr setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy); + void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); + const int EX_BAD_CONFIG = 1; + const int EX_BAD_DISPLAY = 2; + const int EX_BAD_LAYER = 3; + const int EX_BAD_PARAMETER = 4; + const int EX_RESERVED = 5; + const int EX_NO_RESOURCES = 6; + const int EX_NOT_VALIDATED = 7; + const int EX_UNSUPPORTED = 8; + const int EX_SEAMLESS_NOT_ALLOWED = 9; + const int EX_SEAMLESS_NOT_POSSIBLE = 10; + const int INVALID_CONFIGURATION = 0x7fffffff; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/LayerBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/LayerBrightness.aidl new file mode 100644 index 0000000000..a726cc12bf --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/LayerBrightness.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable LayerBrightness { + float brightness; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/LayerCommand.aidl new file mode 100644 index 0000000000..6d32218af1 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/LayerCommand.aidl @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable LayerCommand { + long layer; + @nullable android.hardware.graphics.common.Point cursorPosition; + @nullable android.hardware.graphics.composer3.Buffer buffer; + @nullable android.hardware.graphics.common.Rect[] damage; + @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; + @nullable android.hardware.graphics.composer3.Color color; + @nullable android.hardware.graphics.composer3.ParcelableComposition composition; + @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace; + @nullable android.hardware.graphics.common.Rect displayFrame; + @nullable android.hardware.graphics.composer3.PlaneAlpha planeAlpha; + @nullable android.hardware.common.NativeHandle sidebandStream; + @nullable android.hardware.graphics.common.FRect sourceCrop; + @nullable android.hardware.graphics.composer3.ParcelableTransform transform; + @nullable android.hardware.graphics.common.Rect[] visibleRegion; + @nullable android.hardware.graphics.composer3.ZOrder z; + @nullable float[] colorTransform; + @nullable android.hardware.graphics.composer3.LayerBrightness brightness; + @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; + @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; + @nullable android.hardware.graphics.common.Rect[] blockingRegion; + @nullable int[] bufferSlotsToClear; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/OverlayProperties.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/OverlayProperties.aidl new file mode 100644 index 0000000000..7d31ea3b1e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/OverlayProperties.aidl @@ -0,0 +1,45 @@ +/** + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable OverlayProperties { + android.hardware.graphics.composer3.OverlayProperties.SupportedBufferCombinations[] combinations; + boolean supportMixedColorSpaces; + parcelable SupportedBufferCombinations { + android.hardware.graphics.common.PixelFormat[] pixelFormats; + android.hardware.graphics.common.Dataspace[] standards; + android.hardware.graphics.common.Dataspace[] transfers; + android.hardware.graphics.common.Dataspace[] ranges; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableBlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableBlendMode.aidl new file mode 100644 index 0000000000..f1fee5f376 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableBlendMode.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ParcelableBlendMode { + android.hardware.graphics.common.BlendMode blendMode; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableComposition.aidl new file mode 100644 index 0000000000..98fbb665e2 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableComposition.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ParcelableComposition { + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableDataspace.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableDataspace.aidl new file mode 100644 index 0000000000..76ecf85b9f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableDataspace.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ParcelableDataspace { + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableTransform.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableTransform.aidl new file mode 100644 index 0000000000..b673656438 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ParcelableTransform.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ParcelableTransform { + android.hardware.graphics.common.Transform transform; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadata.aidl new file mode 100644 index 0000000000..cd1f351381 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadata.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable PerFrameMetadata { + android.hardware.graphics.composer3.PerFrameMetadataKey key; + float value; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl new file mode 100644 index 0000000000..c1e74d9e3d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable PerFrameMetadataBlob { + android.hardware.graphics.composer3.PerFrameMetadataKey key; + byte[] blob; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl new file mode 100644 index 0000000000..10a7deef0a --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum PerFrameMetadataKey { + DISPLAY_RED_PRIMARY_X, + DISPLAY_RED_PRIMARY_Y, + DISPLAY_GREEN_PRIMARY_X, + DISPLAY_GREEN_PRIMARY_Y, + DISPLAY_BLUE_PRIMARY_X, + DISPLAY_BLUE_PRIMARY_Y, + WHITE_POINT_X, + WHITE_POINT_Y, + MAX_LUMINANCE, + MIN_LUMINANCE, + MAX_CONTENT_LIGHT_LEVEL, + MAX_FRAME_AVERAGE_LIGHT_LEVEL, + HDR10_PLUS_SEI, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PlaneAlpha.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PlaneAlpha.aidl new file mode 100644 index 0000000000..c48c2a8a34 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PlaneAlpha.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable PlaneAlpha { + float alpha; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PowerMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PowerMode.aidl new file mode 100644 index 0000000000..f587d4dfa8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PowerMode.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum PowerMode { + OFF = 0, + DOZE = 1, + DOZE_SUSPEND = 3, + ON = 2, + ON_SUSPEND = 4, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PresentFence.aidl new file mode 100644 index 0000000000..3bb09cdb34 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PresentFence.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable PresentFence { + long display; + ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PresentOrValidate.aidl new file mode 100644 index 0000000000..dbfac2259d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable PresentOrValidate { + long display; + android.hardware.graphics.composer3.PresentOrValidate.Result result; + @VintfStability + enum Result { + Validated, + Presented, + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl new file mode 100644 index 0000000000..bb51bdc04a --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ReadbackBufferAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl new file mode 100644 index 0000000000..2b9801a4aa --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl @@ -0,0 +1,39 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable RefreshRateChangedDebugData { + long display; + int vsyncPeriodNanos; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ReleaseFences.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ReleaseFences.aidl new file mode 100644 index 0000000000..d623661250 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ReleaseFences.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ReleaseFences { + long display; + android.hardware.graphics.composer3.ReleaseFences.Layer[] layers; + @VintfStability + parcelable Layer { + long layer; + ParcelFileDescriptor fence; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/RenderIntent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/RenderIntent.aidl new file mode 100644 index 0000000000..5670c10655 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/RenderIntent.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum RenderIntent { + COLORIMETRIC = 0, + ENHANCE = 1, + TONE_MAP_COLORIMETRIC = 2, + TONE_MAP_ENHANCE = 3, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VirtualDisplay.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VirtualDisplay.aidl new file mode 100644 index 0000000000..886be2e3d0 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VirtualDisplay.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable VirtualDisplay { + long display; + android.hardware.graphics.common.PixelFormat format; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl new file mode 100644 index 0000000000..df38c11f58 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable VsyncPeriodChangeConstraints { + long desiredTimeNanos; + boolean seamlessRequired; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl new file mode 100644 index 0000000000..9fb3999e3e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable VsyncPeriodChangeTimeline { + long newVsyncAppliedTimeNanos; + boolean refreshRequired; + long refreshTimeNanos; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ZOrder.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ZOrder.aidl new file mode 100644 index 0000000000..ea96ea3a69 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/2/android/hardware/graphics/composer3/ZOrder.aidl @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable ZOrder { + int z; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl index b89f7d5105..f02f8aaa77 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl @@ -38,6 +38,11 @@ enum Capability { SIDEBAND_STREAM = 1, SKIP_CLIENT_COLOR_TRANSFORM = 2, PRESENT_FENCE_IS_NOT_RELIABLE = 3, + /** + * @deprecated - enabled by default. + */ SKIP_VALIDATE = 4, BOOT_DISPLAY_CONFIG = 5, + HDR_OUTPUT_CONVERSION_CONFIG = 6, + REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7, } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl index d2d8f0486a..34d6822148 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl @@ -41,4 +41,5 @@ enum Composition { CURSOR = 4, SIDEBAND = 5, DISPLAY_DECORATION = 6, + REFRESH_RATE_INDICATOR = 7, } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl index 13462ce298..00598eb9b1 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -37,12 +37,12 @@ parcelable DisplayRequest { long display; int mask; android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests; - const int FLIP_CLIENT_TARGET = 1; - const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2; + const int FLIP_CLIENT_TARGET = (1 << 0); + const int WRITE_CLIENT_TARGET_TO_OUTPUT = (1 << 1); @VintfStability parcelable LayerRequest { long layer; int mask; - const int CLEAR_CLIENT_TARGET = 1; + const int CLEAR_CLIENT_TARGET = (1 << 0); } } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl index 4b737de0c8..1990350fa7 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl @@ -34,8 +34,8 @@ package android.hardware.graphics.composer3; @Backing(type="byte") @VintfStability enum FormatColorComponent { - FORMAT_COMPONENT_0 = 1, - FORMAT_COMPONENT_1 = 2, - FORMAT_COMPONENT_2 = 4, - FORMAT_COMPONENT_3 = 8, + FORMAT_COMPONENT_0 = (1 << 0), + FORMAT_COMPONENT_1 = (1 << 1), + FORMAT_COMPONENT_2 = (1 << 2), + FORMAT_COMPONENT_3 = (1 << 3), } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl index 21620e7f31..2c08cbeffd 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl @@ -40,4 +40,5 @@ interface IComposerCallback { oneway void onVsync(long display, long timestamp, int vsyncPeriodNanos); oneway void onVsyncPeriodTimingChanged(long display, in android.hardware.graphics.composer3.VsyncPeriodChangeTimeline updatedTimeline); oneway void onVsyncIdle(long display); + oneway void onRefreshRateChangedDebug(in android.hardware.graphics.composer3.RefreshRateChangedDebugData data); } 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 b49f239ed0..cb85a88995 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 @@ -75,6 +75,10 @@ interface IComposerClient { void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence); void setVsyncEnabled(long display, boolean enabled); void setIdleTimerEnabled(long display, int timeoutMs); + android.hardware.graphics.composer3.OverlayProperties getOverlaySupport(); + android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities(); + android.hardware.graphics.common.Hdr setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy); + void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); const int EX_BAD_CONFIG = 1; const int EX_BAD_DISPLAY = 2; const int EX_BAD_LAYER = 3; @@ -85,5 +89,5 @@ interface IComposerClient { const int EX_UNSUPPORTED = 8; const int EX_SEAMLESS_NOT_ALLOWED = 9; const int EX_SEAMLESS_NOT_POSSIBLE = 10; - const int INVALID_CONFIGURATION = 2147483647; + const int INVALID_CONFIGURATION = 0x7fffffff; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl index 0c5fac9640..6d32218af1 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl @@ -54,4 +54,5 @@ parcelable LayerCommand { @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; @nullable android.hardware.graphics.common.Rect[] blockingRegion; + @nullable int[] bufferSlotsToClear; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl new file mode 100644 index 0000000000..7d31ea3b1e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OverlayProperties.aidl @@ -0,0 +1,45 @@ +/** + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable OverlayProperties { + android.hardware.graphics.composer3.OverlayProperties.SupportedBufferCombinations[] combinations; + boolean supportMixedColorSpaces; + parcelable SupportedBufferCombinations { + android.hardware.graphics.common.PixelFormat[] pixelFormats; + android.hardware.graphics.common.Dataspace[] standards; + android.hardware.graphics.common.Dataspace[] transfers; + android.hardware.graphics.common.Dataspace[] ranges; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl index 8722f878fe..10a7deef0a 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl @@ -34,17 +34,17 @@ package android.hardware.graphics.composer3; @Backing(type="int") @VintfStability enum PerFrameMetadataKey { - DISPLAY_RED_PRIMARY_X = 0, - DISPLAY_RED_PRIMARY_Y = 1, - DISPLAY_GREEN_PRIMARY_X = 2, - DISPLAY_GREEN_PRIMARY_Y = 3, - DISPLAY_BLUE_PRIMARY_X = 4, - DISPLAY_BLUE_PRIMARY_Y = 5, - WHITE_POINT_X = 6, - WHITE_POINT_Y = 7, - MAX_LUMINANCE = 8, - MIN_LUMINANCE = 9, - MAX_CONTENT_LIGHT_LEVEL = 10, - MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11, - HDR10_PLUS_SEI = 12, + DISPLAY_RED_PRIMARY_X, + DISPLAY_RED_PRIMARY_Y, + DISPLAY_GREEN_PRIMARY_X, + DISPLAY_GREEN_PRIMARY_Y, + DISPLAY_BLUE_PRIMARY_X, + DISPLAY_BLUE_PRIMARY_Y, + WHITE_POINT_X, + WHITE_POINT_Y, + MAX_LUMINANCE, + MIN_LUMINANCE, + MAX_CONTENT_LIGHT_LEVEL, + MAX_FRAME_AVERAGE_LIGHT_LEVEL, + HDR10_PLUS_SEI, } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl index e6ddeba784..dbfac2259d 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -38,7 +38,7 @@ parcelable PresentOrValidate { android.hardware.graphics.composer3.PresentOrValidate.Result result; @VintfStability enum Result { - Validated = 0, - Presented = 1, + Validated, + Presented, } } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl new file mode 100644 index 0000000000..2b9801a4aa --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl @@ -0,0 +1,39 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable RefreshRateChangedDebugData { + long display; + int vsyncPeriodNanos; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index 2f9eab937c..4638610955 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -55,6 +55,7 @@ enum Capability { * For this capability to be worthwhile the device implementation of * presentDisplay should fail as fast as possible in the case a * validateDisplay step is needed. + * @deprecated - enabled by default. */ SKIP_VALIDATE = 4, @@ -66,4 +67,23 @@ enum Capability { * @see IComposerClient.getPreferredBootDisplayConfig */ BOOT_DISPLAY_CONFIG = 5, + + /** + * Specifies that the device supports HDR output conversion. + * + * @see IComposerClient.getHdrConversionCapabilities + * @see IComposerClient.setHdrConversionStrategy + */ + HDR_OUTPUT_CONVERSION_CONFIG = 6, + + /** + * Specifies that the device supports the callback onRefreshRateChangedDebug + * to pass information about the refresh rate. + * The refresh rate from the callback is used to update the refresh rate + * overlay indicator. + * + * @see IComposerClient.setRefreshRateChangedCallbackDebugEnabled + * @see IComposerCallback.onRefreshRateChangedDebug + */ + REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl index ddd45b7fdd..9e8c7682b4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl @@ -23,7 +23,6 @@ import android.hardware.graphics.composer3.Composition; parcelable ChangedCompositionTypes { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl index 18b219ce05..0bd72a37ae 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl @@ -23,7 +23,6 @@ import android.hardware.graphics.composer3.DimmingStage; parcelable ClientTargetPropertyWithBrightness { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index 82b218be3f..37912b0069 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -86,4 +86,14 @@ enum Composition { * to either DEVICE or CLIENT. */ DISPLAY_DECORATION = 6, + + /** + * This composition type is similar to DEVICE, with a single difference, + * that indicates to HWC that this layer update is not considered an activity + * of any sort. For example, If HWC maintains a timer for activity to switch + * the display mode from a power save mode, it should not reset that timer. + * + * Upon validateDisplay, the device may request a change from this type to CLIENT. + */ + REFRESH_RATE_INDICATOR = 7, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index b6df147df8..4f69aeeab7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -26,7 +26,6 @@ import android.hardware.graphics.composer3.LayerCommand; parcelable DisplayCommand { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl index 27fe1e6ed7..3a50b6e3b2 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -34,7 +34,6 @@ parcelable DisplayRequest { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl index 67954d4cc5..f4384b7a5a 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl @@ -16,6 +16,7 @@ package android.hardware.graphics.composer3; +import android.hardware.graphics.composer3.RefreshRateChangedDebugData; import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline; @VintfStability @@ -96,4 +97,25 @@ interface IComposerCallback { * @param display is the display whose vsync cadence changed due to panel idle mode. */ oneway void onVsyncIdle(long display); + + /** + * Notifies the client the vsyncPeriod of the display changed. + * Whether or not to call this callback is managed by + * IComposerClient.setRefreshRateChangedCallbackDebugEnabled + * + * Immediate callback is required after the setRefreshRateChangedCallbackDebugEnabled + * called. + * When the panel refresh rate changes, as a result of a setActiveConfig or + * setActiveConfigWithConstraints, this callback should be called with the new panel + * refresh rate. In addition, when the panel refresh rate is changed by other means, + * such as idleness or DOZE power state, this callback should be called as well. + * + * This callback is used for debug purposes, and not for scheduling frames, + * therefore synchronization is not required. + * + * @see IComposerClient.setRefreshRateChangedCallbackDebugEnabled + * + * @param data is the data for the callback when refresh rate changed. + */ + oneway void onRefreshRateChangedDebug(in RefreshRateChangedDebugData data); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index a4ea64f815..4e77f86cf4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -17,6 +17,9 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.common.DisplayDecorationSupport; +import android.hardware.graphics.common.Hdr; +import android.hardware.graphics.common.HdrConversionCapability; +import android.hardware.graphics.common.HdrConversionStrategy; import android.hardware.graphics.common.Transform; import android.hardware.graphics.composer3.ClientTargetProperty; import android.hardware.graphics.composer3.ColorMode; @@ -32,6 +35,7 @@ import android.hardware.graphics.composer3.DisplayIdentification; import android.hardware.graphics.composer3.FormatColorComponent; import android.hardware.graphics.composer3.HdrCapabilities; import android.hardware.graphics.composer3.IComposerCallback; +import android.hardware.graphics.composer3.OverlayProperties; import android.hardware.graphics.composer3.PerFrameMetadataKey; import android.hardware.graphics.composer3.PowerMode; import android.hardware.graphics.composer3.ReadbackBufferAttributes; @@ -814,4 +818,50 @@ interface IComposerClient { * */ void setIdleTimerEnabled(long display, int timeoutMs); + + /** + * Hardware overlays is a technique to composite different buffers directly to the screen + * while bypassing GPU composition. + * + * This function returns what the device's overlays support. + * + * @exception EX_UNSUPPORTED when not supported by the underlying HAL + * + * @return the overlay properties of the device. + */ + OverlayProperties getOverlaySupport(); + + /** + * Returns the array of HDR conversion capability. Each HdrConversionCapability depicts that + * HDR conversion is possible from sourceType to outputType. This doesn't change after + * initialization. + * + * @exception EX_UNSUPPORTED when not supported by the underlying HAL + * + * @see setHdrConversionStrategy + */ + HdrConversionCapability[] getHdrConversionCapabilities(); + + /** + * Sets the of HDR conversion strategy. + * + * @return the chosen HDR type in case HdrConversionStrategy has autoAllowedHdrTypes set. In + * other cases, return HDR type INVALID. + * @exception EX_UNSUPPORTED when not supported by the underlying HAL + * + * @see getHdrConversionCapabilities + */ + Hdr setHdrConversionStrategy(in HdrConversionStrategy conversionStrategy); + + /* + * Sets either the callback for the refresh rate change is enabled or disabled + * for the provided display. + * + * @see IComposerCallback.onRefreshRateChangedDebug + * + * @param display is the display on which the callback is enabled on. + * @param enabled true when refresh rate callback is enabled, + * false when refresh rate callback is disabled. + */ + void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index f3b67a99b3..fd50be9cfe 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -258,4 +258,11 @@ parcelable LayerCommand { * the screen. */ @nullable Rect[] blockingRegion; + + /** + * Specifies which buffer slots should be cleared of buffer references + * because these buffers will no longer be used and the memory should + * be freed. + */ + @nullable int[] bufferSlotsToClear; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl new file mode 100644 index 0000000000..c25eea484f --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/OverlayProperties.aidl @@ -0,0 +1,45 @@ +/** + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable OverlayProperties { + parcelable SupportedBufferCombinations { + // List of pixelformats, standards, transfers and ranges dataspaces that can be used + // together. + // The pixelformats, standards, transfers and ranges stored inside are valid + // combinations. + // Dataspace identifies three components of colors - standard, transfer and + // range. + android.hardware.graphics.common.PixelFormat[] pixelFormats; + android.hardware.graphics.common.Dataspace[] standards; + android.hardware.graphics.common.Dataspace[] transfers; + android.hardware.graphics.common.Dataspace[] ranges; + } + // Array of all valid pixelformat, standard, transfer and range combinations. + // If all supported formats work with all standards, transfers and ranges, + // then this list may only have 1 entry. + // If some dataspaces, e.g. scRGB (STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED), + // only work with specific formats, then this list may contain more than 1 entry. + // If some ranges, e.g. RANGE_LIMITED, only work with specific + // formats/standards/transfers, then this list may contain more than 1 entry. + SupportedBufferCombinations[] combinations; + + // True if the DPU is able to color manage at least two overlays + // with different input colorspaces, false otherwise. + boolean supportMixedColorSpaces; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl index 244b4e5af3..b757656e09 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl @@ -20,7 +20,6 @@ package android.hardware.graphics.composer3; parcelable PresentFence { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl index 5ae8940be0..e15dbf21dd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -20,7 +20,6 @@ package android.hardware.graphics.composer3; parcelable PresentOrValidate { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl new file mode 100644 index 0000000000..c1f78d6f5e --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl @@ -0,0 +1,30 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable RefreshRateChangedDebugData { + /** + * The display for which the debug data is for. + */ + long display; + + /** + * The display vsync period in nanoseconds. + */ + int vsyncPeriodNanos; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl index 459a04265f..58649d5bc8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl @@ -20,7 +20,6 @@ package android.hardware.graphics.composer3; parcelable ReleaseFences { /** * The display which this commands refers to. - * @see IComposer.createDisplay */ long display; @VintfStability diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h index 27dce76377..76ba24b0b2 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h @@ -19,8 +19,8 @@ #include #include #include +#include #include -#include #include #include @@ -41,8 +41,15 @@ namespace aidl::android::hardware::graphics::composer3 { class ComposerClientReader { public: + explicit ComposerClientReader(std::optional display = {}) : mDisplay(display) {} + ~ComposerClientReader() { resetData(); } + ComposerClientReader(ComposerClientReader&&) = default; + + ComposerClientReader(const ComposerClientReader&) = delete; + ComposerClientReader& operator=(const ComposerClientReader&) = delete; + // Parse and execute commands from the command queue. The commands are // actually return values from the server and will be saved in ReturnData. void parse(std::vector&& results) { @@ -85,6 +92,7 @@ class ComposerClientReader { void hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, uint32_t* outNumLayerRequestMasks) const { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); if (found == mReturnData.end()) { *outNumChangedCompositionTypes = 0; @@ -100,6 +108,7 @@ class ComposerClientReader { // Get and clear saved changed composition types. std::vector takeChangedCompositionTypes(int64_t display) { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); if (found == mReturnData.end()) { return {}; @@ -111,6 +120,7 @@ class ComposerClientReader { // Get and clear saved display requests. DisplayRequest takeDisplayRequests(int64_t display) { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); if (found == mReturnData.end()) { return {}; @@ -122,6 +132,7 @@ class ComposerClientReader { // Get and clear saved release fences. std::vector takeReleaseFences(int64_t display) { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); if (found == mReturnData.end()) { return {}; @@ -133,6 +144,7 @@ class ComposerClientReader { // Get and clear saved present fence. ndk::ScopedFileDescriptor takePresentFence(int64_t display) { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); if (found == mReturnData.end()) { return {}; @@ -144,6 +156,7 @@ class ComposerClientReader { // Get what stage succeeded during PresentOrValidate: Present or Validate std::optional takePresentOrValidateStage(int64_t display) { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); if (found == mReturnData.end()) { return std::nullopt; @@ -154,6 +167,7 @@ class ComposerClientReader { // Get the client target properties requested by hardware composer. ClientTargetPropertyWithBrightness takeClientTargetProperty(int64_t display) { + LOG_ALWAYS_FATAL_IF(mDisplay && display != *mDisplay); auto found = mReturnData.find(display); // If not found, return the default values. @@ -177,32 +191,38 @@ class ComposerClientReader { void parseSetError(CommandError&& error) { mErrors.emplace_back(error); } void parseSetChangedCompositionTypes(ChangedCompositionTypes&& changedCompositionTypes) { + LOG_ALWAYS_FATAL_IF(mDisplay && changedCompositionTypes.display != *mDisplay); auto& data = mReturnData[changedCompositionTypes.display]; data.changedLayers = std::move(changedCompositionTypes.layers); } void parseSetDisplayRequests(DisplayRequest&& displayRequest) { + LOG_ALWAYS_FATAL_IF(mDisplay && displayRequest.display != *mDisplay); auto& data = mReturnData[displayRequest.display]; data.displayRequests = std::move(displayRequest); } void parseSetPresentFence(PresentFence&& presentFence) { + LOG_ALWAYS_FATAL_IF(mDisplay && presentFence.display != *mDisplay); auto& data = mReturnData[presentFence.display]; data.presentFence = std::move(presentFence.fence); } void parseSetReleaseFences(ReleaseFences&& releaseFences) { + LOG_ALWAYS_FATAL_IF(mDisplay && releaseFences.display != *mDisplay); auto& data = mReturnData[releaseFences.display]; data.releasedLayers = std::move(releaseFences.layers); } void parseSetPresentOrValidateDisplayResult(const PresentOrValidate&& presentOrValidate) { + LOG_ALWAYS_FATAL_IF(mDisplay && presentOrValidate.display != *mDisplay); auto& data = mReturnData[presentOrValidate.display]; data.presentOrValidateState = std::move(presentOrValidate.result); } void parseSetClientTargetProperty( const ClientTargetPropertyWithBrightness&& clientTargetProperty) { + LOG_ALWAYS_FATAL_IF(mDisplay && clientTargetProperty.display != *mDisplay); auto& data = mReturnData[clientTargetProperty.display]; data.clientTargetProperty = std::move(clientTargetProperty); } @@ -222,6 +242,7 @@ class ComposerClientReader { std::vector mErrors; std::unordered_map mReturnData; + const std::optional mDisplay; }; } // namespace aidl::android::hardware::graphics::composer3 diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h index 1d81f7b602..2e902e548b 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -19,8 +19,6 @@ #include #include #include -#include -#include #include #include @@ -59,19 +57,18 @@ using aidl::android::hardware::common::NativeHandle; namespace aidl::android::hardware::graphics::composer3 { -class ComposerClientWriter { +class ComposerClientWriter final { public: static constexpr std::optional kNoTimestamp = std::nullopt; - ComposerClientWriter() { reset(); } + explicit ComposerClientWriter(int64_t display) : mDisplay(display) { reset(); } - virtual ~ComposerClientWriter() { reset(); } + ~ComposerClientWriter() { reset(); } - void reset() { - mDisplayCommand.reset(); - mLayerCommand.reset(); - mCommands.clear(); - } + ComposerClientWriter(ComposerClientWriter&&) = default; + + ComposerClientWriter(const ComposerClientWriter&) = delete; + ComposerClientWriter& operator=(const ComposerClientWriter&) = delete; void setColorTransform(int64_t display, const float* matrix) { std::vector matVec; @@ -88,7 +85,7 @@ class ComposerClientWriter { void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, int acquireFence, Dataspace dataspace, const std::vector& damage) { ClientTarget clientTargetCommand; - clientTargetCommand.buffer = getBuffer(slot, target, acquireFence); + clientTargetCommand.buffer = getBufferCommand(slot, target, acquireFence); clientTargetCommand.dataspace = dataspace; clientTargetCommand.damage.assign(damage.begin(), damage.end()); getDisplayCommand(display).clientTarget.emplace(std::move(clientTargetCommand)); @@ -97,7 +94,7 @@ class ComposerClientWriter { void setOutputBuffer(int64_t display, uint32_t slot, const native_handle_t* buffer, int releaseFence) { getDisplayCommand(display).virtualDisplayOutputBuffer.emplace( - getBuffer(slot, buffer, releaseFence)); + getBufferCommand(slot, buffer, releaseFence)); } void validateDisplay(int64_t display, @@ -129,7 +126,20 @@ class ComposerClientWriter { void setLayerBuffer(int64_t display, int64_t layer, uint32_t slot, const native_handle_t* buffer, int acquireFence) { - getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence); + getLayerCommand(display, layer).buffer = getBufferCommand(slot, buffer, acquireFence); + } + + void setLayerBufferWithNewCommand(int64_t display, int64_t layer, uint32_t slot, + const native_handle_t* buffer, int acquireFence) { + flushLayerCommand(); + getLayerCommand(display, layer).buffer = getBufferCommand(slot, buffer, acquireFence); + flushLayerCommand(); + } + + void setLayerBufferSlotsToClear(int64_t display, int64_t layer, + const std::vector& slotsToClear) { + getLayerCommand(display, layer) + .bufferSlotsToClear.emplace(slotsToClear.begin(), slotsToClear.end()); } void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector& damage) { @@ -219,18 +229,21 @@ class ComposerClientWriter { getLayerCommand(display, layer).blockingRegion.emplace(blocking.begin(), blocking.end()); } - const std::vector& getPendingCommands() { + std::vector takePendingCommands() { flushLayerCommand(); flushDisplayCommand(); - return mCommands; + std::vector moved = std::move(mCommands); + mCommands.clear(); + return moved; } private: std::optional mDisplayCommand; std::optional mLayerCommand; std::vector mCommands; + const int64_t mDisplay; - Buffer getBuffer(uint32_t slot, const native_handle_t* bufferHandle, int fence) { + Buffer getBufferCommand(uint32_t slot, const native_handle_t* bufferHandle, int fence) { Buffer bufferCommand; bufferCommand.slot = static_cast(slot); if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); @@ -254,6 +267,7 @@ class ComposerClientWriter { DisplayCommand& getDisplayCommand(int64_t display) { if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) { + LOG_ALWAYS_FATAL_IF(display != mDisplay); flushLayerCommand(); flushDisplayCommand(); mDisplayCommand.emplace(); @@ -271,6 +285,12 @@ class ComposerClientWriter { } return *mLayerCommand; } + + void reset() { + mDisplayCommand.reset(); + mLayerCommand.reset(); + mCommands.clear(); + } }; } // namespace aidl::android::hardware::graphics::composer3 diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp index 84fd76af71..88b5de41bb 100644 --- a/graphics/composer/aidl/vts/Android.bp +++ b/graphics/composer/aidl/vts/Android.bp @@ -28,8 +28,9 @@ cc_test { defaults: [ "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", - // Needed for librenderengine - "skia_deps", + "librenderengine_deps", + "android.hardware.graphics.common-ndk_static", + "android.hardware.graphics.composer3-ndk_static", ], srcs: [ "VtsHalGraphicsComposer3_TargetTest.cpp", @@ -67,8 +68,6 @@ cc_test { "android.hardware.graphics.composer3-command-buffer", ], static_libs: [ - "android.hardware.graphics.composer3-V1-ndk", - "android.hardware.graphics.common-V4-ndk", "android.hardware.graphics.common@1.2", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", diff --git a/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp index d53494325a..7b3a2b431f 100644 --- a/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp +++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp @@ -29,6 +29,11 @@ void GraphicsComposerCallback::setVsyncAllowed(bool allowed) { mVsyncAllowed = allowed; } +void GraphicsComposerCallback::setRefreshRateChangedDebugDataEnabledCallbackAllowed(bool allowed) { + std::scoped_lock lock(mMutex); + mRefreshRateChangedDebugDataEnabledCallbackAllowed = allowed; +} + std::vector GraphicsComposerCallback::getDisplays() const { std::scoped_lock lock(mMutex); return mDisplays; @@ -79,6 +84,21 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { return ret; } +std::vector +GraphicsComposerCallback::takeListOfRefreshRateChangedDebugData() { + std::scoped_lock lock(mMutex); + + std::vector ret; + ret.swap(mRefreshRateChangedDebugData); + + return ret; +} + +int32_t GraphicsComposerCallback::getInvalidRefreshRateDebugEnabledCallbackCount() const { + std::scoped_lock lock(mMutex); + return mInvalidRefreshRateDebugEnabledCallbackCount; +} + ::ndk::ScopedAStatus GraphicsComposerCallback::onHotplug(int64_t in_display, bool in_connected) { std::scoped_lock lock(mMutex); @@ -124,6 +144,19 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus GraphicsComposerCallback::onRefreshRateChangedDebug( + const RefreshRateChangedDebugData& data) { + std::scoped_lock lock(mMutex); + + const auto it = std::find(mDisplays.begin(), mDisplays.end(), data.display); + if (mRefreshRateChangedDebugDataEnabledCallbackAllowed && it != mDisplays.end()) { + mRefreshRateChangedDebugData.push_back(data); + } else { + mInvalidRefreshRateDebugEnabledCallbackCount++; + } + return ::ndk::ScopedAStatus::ok(); +} + ::ndk::ScopedAStatus GraphicsComposerCallback::onVsyncPeriodTimingChanged( int64_t in_display, const ::aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline& diff --git a/graphics/composer/aidl/vts/GraphicsComposerCallback.h b/graphics/composer/aidl/vts/GraphicsComposerCallback.h index e54da346f5..13e992a4e1 100644 --- a/graphics/composer/aidl/vts/GraphicsComposerCallback.h +++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.h @@ -26,6 +26,8 @@ class GraphicsComposerCallback : public BnComposerCallback { public: void setVsyncAllowed(bool allowed); + void setRefreshRateChangedDebugDataEnabledCallbackAllowed(bool allowed); + std::vector getDisplays() const; int32_t getInvalidHotplugCount() const; @@ -44,6 +46,10 @@ class GraphicsComposerCallback : public BnComposerCallback { std::optional takeLastVsyncPeriodChangeTimeline(); + std::vector takeListOfRefreshRateChangedDebugData(); + + int32_t getInvalidRefreshRateDebugEnabledCallbackCount() const; + private: virtual ::ndk::ScopedAStatus onHotplug(int64_t in_display, bool in_connected) override; virtual ::ndk::ScopedAStatus onRefresh(int64_t in_display) override; @@ -55,15 +61,21 @@ class GraphicsComposerCallback : public BnComposerCallback { const ::aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline& in_updatedTimeline) override; virtual ::ndk::ScopedAStatus onVsyncIdle(int64_t in_display) override; + virtual ::ndk::ScopedAStatus onRefreshRateChangedDebug( + const RefreshRateChangedDebugData&) override; mutable std::mutex mMutex; // the set of all currently connected displays std::vector mDisplays GUARDED_BY(mMutex); // true only when vsync is enabled bool mVsyncAllowed GUARDED_BY(mMutex) = true; + // true only when RefreshRateChangedCallbackDebugEnabled is set to true. + bool mRefreshRateChangedDebugDataEnabledCallbackAllowed GUARDED_BY(mMutex) = false; std::optional mTimeline GUARDED_BY(mMutex); + std::vector mRefreshRateChangedDebugData GUARDED_BY(mMutex); + int32_t mVsyncIdleCount GUARDED_BY(mMutex) = 0; int64_t mVsyncIdleTime GUARDED_BY(mMutex) = 0; @@ -73,6 +85,7 @@ class GraphicsComposerCallback : public BnComposerCallback { int32_t mInvalidVsyncCount GUARDED_BY(mMutex) = 0; int32_t mInvalidVsyncPeriodChangeCount GUARDED_BY(mMutex) = 0; int32_t mInvalidSeamlessPossibleCount GUARDED_BY(mMutex) = 0; + int32_t mInvalidRefreshRateDebugEnabledCallbackCount GUARDED_BY(mMutex) = 0; }; } // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp index 71b011cb12..66779c8cad 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp @@ -66,14 +66,12 @@ void TestRenderEngine::drawLayers() { auto texture = std::make_shared<::android::renderengine::impl::ExternalTexture>( mGraphicBuffer, *mRenderEngine, ::android::renderengine::impl::ExternalTexture::Usage::WRITEABLE); - auto [status, readyFence] = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayers, texture, - true, std::move(bufferFence)) - .get(); - int fd = readyFence.release(); - if (fd != -1) { - ASSERT_EQ(0, sync_wait(fd, -1)); - ASSERT_EQ(0, close(fd)); + auto result = mRenderEngine + ->drawLayers(mDisplaySettings, compositionLayers, texture, true, + std::move(bufferFence)) + .get(); + if (result.ok()) { + result.value()->waitForever(LOG_TAG); } } diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp index dd4161e836..25b0ca0a17 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp @@ -58,6 +58,12 @@ bool VtsComposerClient::tearDown() { return verifyComposerCallbackParams() && destroyAllLayers(); } +std::pair VtsComposerClient::getInterfaceVersion() { + int32_t version = 1; + auto status = mComposerClient->getInterfaceVersion(&version); + return {std::move(status), version}; +} + std::pair VtsComposerClient::createVirtualDisplay( int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount) { VirtualDisplay outVirtualDisplay; @@ -113,6 +119,24 @@ ScopedAStatus VtsComposerClient::setActiveConfig(VtsDisplay* vtsDisplay, int32_t return updateDisplayProperties(vtsDisplay, config); } +ScopedAStatus VtsComposerClient::setPeakRefreshRateConfig(VtsDisplay* vtsDisplay) { + const auto displayId = vtsDisplay->getDisplayId(); + auto [activeStatus, activeConfig] = getActiveConfig(displayId); + EXPECT_TRUE(activeStatus.isOk()); + auto peakDisplayConfig = vtsDisplay->getDisplayConfig(activeConfig); + auto peakConfig = activeConfig; + + const auto displayConfigs = vtsDisplay->getDisplayConfigs(); + for (const auto [config, displayConfig] : displayConfigs) { + if (displayConfig.configGroup == peakDisplayConfig.configGroup && + displayConfig.vsyncPeriod < peakDisplayConfig.vsyncPeriod) { + peakDisplayConfig = displayConfig; + peakConfig = config; + } + } + return setActiveConfig(vtsDisplay, peakConfig); +} + std::pair VtsComposerClient::getDisplayAttribute( int64_t display, int32_t config, DisplayAttribute displayAttribute) { int32_t outDisplayAttribute; @@ -331,6 +355,20 @@ std::pair VtsComposerClient::getPreferredBootDisplayConf return {mComposerClient->getPreferredBootDisplayConfig(display, &outConfig), outConfig}; } +std::pair> +VtsComposerClient::getHdrConversionCapabilities() { + std::vector hdrConversionCapability; + return {mComposerClient->getHdrConversionCapabilities(&hdrConversionCapability), + hdrConversionCapability}; +} + +std::pair VtsComposerClient::setHdrConversionStrategy( + const common::HdrConversionStrategy& conversionStrategy) { + common::Hdr preferredHdrOutputType; + return {mComposerClient->setHdrConversionStrategy(conversionStrategy, &preferredHdrOutputType), + preferredHdrOutputType}; +} + std::pair VtsComposerClient::getDisplayPhysicalOrientation( int64_t display) { common::Transform outDisplayOrientation; @@ -338,6 +376,11 @@ std::pair VtsComposerClient::getDisplayPhysica outDisplayOrientation}; } +std::pair VtsComposerClient::getOverlaySupport() { + OverlayProperties properties; + return {mComposerClient->getOverlaySupport(&properties), properties}; +} + ScopedAStatus VtsComposerClient::setIdleTimerEnabled(int64_t display, int32_t timeoutMs) { return mComposerClient->setIdleTimerEnabled(display, timeoutMs); } @@ -350,6 +393,17 @@ int64_t VtsComposerClient::getVsyncIdleTime() { return mComposerCallback->getVsyncIdleTime(); } +ndk::ScopedAStatus VtsComposerClient::setRefreshRateChangedCallbackDebugEnabled(int64_t display, + bool enabled) { + mComposerCallback->setRefreshRateChangedDebugDataEnabledCallbackAllowed(enabled); + return mComposerClient->setRefreshRateChangedCallbackDebugEnabled(display, enabled); +} + +std::vector +VtsComposerClient::takeListOfRefreshRateChangedDebugData() { + return mComposerCallback->takeListOfRefreshRateChangedDebugData(); +} + int64_t VtsComposerClient::getInvalidDisplayId() { // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to @@ -514,6 +568,10 @@ bool VtsComposerClient::verifyComposerCallbackParams() { ALOGE("Invalid seamless possible count"); isValid = false; } + if (mComposerCallback->getInvalidRefreshRateDebugEnabledCallbackCount() != 0) { + ALOGE("Invalid refresh rate debug enabled callback count"); + isValid = false; + } } return isValid; } diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h index 74c5da5dc6..ea3318c2ce 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.h +++ b/graphics/composer/aidl/vts/VtsComposerClient.h @@ -35,6 +35,7 @@ #include #include #include +#include #include "GraphicsComposerCallback.h" using aidl::android::hardware::graphics::common::Dataspace; @@ -60,6 +61,8 @@ class VtsComposerClient { bool tearDown(); + std::pair getInterfaceVersion(); + std::pair createVirtualDisplay(int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount); @@ -74,6 +77,8 @@ class VtsComposerClient { ScopedAStatus setActiveConfig(VtsDisplay* vtsDisplay, int32_t config); + ScopedAStatus setPeakRefreshRateConfig(VtsDisplay* vtsDisplay); + std::pair getDisplayAttribute(int64_t display, int32_t config, DisplayAttribute displayAttribute); @@ -160,6 +165,12 @@ class VtsComposerClient { std::pair getPreferredBootDisplayConfig(int64_t display); + std::pair> + getHdrConversionCapabilities(); + + std::pair setHdrConversionStrategy( + const common::HdrConversionStrategy& conversionStrategy); + std::pair getDisplayPhysicalOrientation(int64_t display); ScopedAStatus setIdleTimerEnabled(int64_t display, int32_t timeoutMs); @@ -172,6 +183,12 @@ class VtsComposerClient { std::pair> getDisplays(); + std::pair getOverlaySupport(); + + ndk::ScopedAStatus setRefreshRateChangedCallbackDebugEnabled(int64_t display, bool enabled); + + std::vector takeListOfRefreshRateChangedDebugData(); + private: ScopedAStatus addDisplayConfig(VtsDisplay* vtsDisplay, int32_t config); ScopedAStatus updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config); @@ -231,15 +248,17 @@ class VtsDisplay { }; void addDisplayConfig(int32_t config, DisplayConfig displayConfig) { - displayConfigs.insert({config, displayConfig}); + mDisplayConfigs.insert({config, displayConfig}); } - DisplayConfig getDisplayConfig(int32_t config) { return displayConfigs.find(config)->second; } + DisplayConfig getDisplayConfig(int32_t config) { return mDisplayConfigs.find(config)->second; } + + std::unordered_map getDisplayConfigs() { return mDisplayConfigs; } private: int64_t mDisplayId; int32_t mDisplayWidth; int32_t mDisplayHeight; - std::unordered_map displayConfigs; + std::unordered_map mDisplayConfigs; }; } // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 46dde09dd4..b0472209dc 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -53,6 +53,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { const auto& [status, displays] = mComposerClient->getDisplays(); ASSERT_TRUE(status.isOk()); mDisplays = displays; + mWriter.reset(new ComposerClientWriter(getPrimaryDisplayId())); setTestColorModes(); @@ -200,15 +201,14 @@ class GraphicsCompositionTestBase : public ::testing::Test { void writeLayers(const std::vector>& layers) { for (const auto& layer : layers) { - layer->write(mWriter); + layer->write(*mWriter); } execute(); } void execute() { - const auto& commands = mWriter.getPendingCommands(); + auto commands = mWriter->takePendingCommands(); if (commands.empty()) { - mWriter.reset(); return; } @@ -216,7 +216,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); mReader.parse(std::move(results)); - mWriter.reset(); } bool getHasReadbackBuffer() { @@ -236,7 +235,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { std::vector mDisplays; // use the slot count usually set by SF std::vector mTestColorModes; - ComposerClientWriter mWriter; + std::unique_ptr mWriter; ComposerClientReader mReader; std::unique_ptr mTestRenderEngine; common::PixelFormat mPixelFormat; @@ -297,7 +296,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); // if hwc cannot handle and asks for composition change, // just succeed the test @@ -306,7 +305,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -349,14 +348,14 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { getDisplayHeight(), common::PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); std::vector> layers = {layer}; writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { @@ -365,7 +364,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -395,7 +394,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { layer->setColor(BLUE); layer->setDisplayFrame(coloredSquare); layer->setZOrder(10); - layer->write(mWriter); + layer->write(*mWriter); // This following buffer call should have no effect const auto usage = static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | @@ -403,8 +402,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage); ASSERT_TRUE(graphicBufferStatus); const auto& buffer = graphicBuffer->handle; - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, buffer, - /*acquireFence*/ -1); + mWriter->setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, buffer, + /*acquireFence*/ -1); // expected color for each pixel std::vector expectedColors( @@ -415,7 +414,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { @@ -423,7 +422,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -533,7 +532,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { getDisplayHeight(), PixelFormat::RGBA_FP16); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); std::vector> layers = {layer}; @@ -542,7 +541,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); @@ -572,17 +571,17 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { int32_t clientFence; const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence); ASSERT_EQ(::android::OK, unlockStatus); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, - clientDataspace, std::vector(1, damage)); - layer->setToClientComposition(mWriter); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, + clientDataspace, std::vector(1, damage)); + layer->setToClientComposition(*mWriter); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -631,9 +630,9 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { deviceLayer->setDisplayFrame({0, 0, static_cast(deviceLayer->getWidth()), static_cast(deviceLayer->getHeight())}); deviceLayer->setZOrder(10); - deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); ASSERT_NO_FATAL_FAILURE(deviceLayer->setBuffer(deviceColors)); - deviceLayer->write(mWriter); + deviceLayer->write(*mWriter); PixelFormat clientFormat = PixelFormat::RGBA_8888; auto clientUsage = static_cast( @@ -651,8 +650,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { getDisplayHeight()}; clientLayer->setDisplayFrame(clientFrame); clientLayer->setZOrder(0); - clientLayer->write(mWriter); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + clientLayer->write(*mWriter); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); @@ -678,16 +677,16 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { int32_t clientFence; const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence); ASSERT_EQ(::android::OK, unlockStatus); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, - clientDataspace, std::vector(1, clientFrame)); - clientLayer->setToClientComposition(mWriter); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, + clientDataspace, std::vector(1, clientFrame)); + clientLayer->setToClientComposition(*mWriter); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -718,7 +717,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); std::vector> layers = {layer}; @@ -729,14 +728,14 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -757,11 +756,11 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -798,7 +797,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); @@ -806,7 +805,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -846,7 +845,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); layer->setSourceCrop({0, static_cast(getDisplayHeight() / 2), static_cast(getDisplayWidth()), static_cast(getDisplayHeight())}); @@ -862,14 +861,14 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -920,13 +919,13 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -942,11 +941,11 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -980,7 +979,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { // Preconditions to successfully run are knowing the max brightness and successfully applying // the max brightness ASSERT_GT(maxBrightnessNits, 0.f); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f, maxBrightnessNits); + mWriter->setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f, maxBrightnessNits); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1030,7 +1029,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED() @@ -1038,7 +1037,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { << toString(mode); continue; } - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1088,7 +1087,7 @@ class GraphicsBlendModeCompositionTest getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(Dataspace::UNKNOWN, mWriter); + layer->setDataspace(Dataspace::UNKNOWN, *mWriter); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors)); layer->setBlendMode(blendMode); @@ -1165,14 +1164,14 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1210,14 +1209,14 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -1250,14 +1249,14 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -1323,7 +1322,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_H); - mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); std::vector expectedColors( static_cast(getDisplayWidth() * getDisplayHeight())); @@ -1334,14 +1333,14 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1369,7 +1368,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_V); - mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); std::vector expectedColors( static_cast(getDisplayWidth() * getDisplayHeight())); @@ -1380,14 +1379,14 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -1414,7 +1413,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::ROT_180); - mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); std::vector expectedColors( static_cast(getDisplayWidth() * getDisplayHeight())); @@ -1426,14 +1425,14 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + mWriter->presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 047109e35f..18d36e4c14 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include #include #include @@ -32,9 +33,11 @@ #include #include #include +#include #include #include #include +#include #include "GraphicsComposerCallback.h" #include "VtsComposerClient.h" @@ -115,6 +118,12 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { [&](const Capability& activeCapability) { return activeCapability == capability; }); } + int getInterfaceVersion() { + const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion(); + EXPECT_TRUE(versionStatus.isOk()); + return version; + } + const VtsDisplay& getPrimaryDisplay() const { return mDisplays[0]; } int64_t getPrimaryDisplayId() const { return getPrimaryDisplay().getDisplayId(); } @@ -618,6 +627,80 @@ TEST_P(GraphicsComposerAidlTest, BootDisplayConfig_Unsupported) { } } +TEST_P(GraphicsComposerAidlTest, GetHdrConversionCapabilities) { + if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) { + GTEST_SUCCEED() << "HDR output conversion not supported"; + return; + } + const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities(); + EXPECT_TRUE(status.isOk()); +} + +TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Passthrough) { + if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) { + GTEST_SUCCEED() << "HDR output conversion not supported"; + return; + } + common::HdrConversionStrategy hdrConversionStrategy; + hdrConversionStrategy.set(true); + const auto& [status, preferredHdrOutputType] = + mComposerClient->setHdrConversionStrategy(hdrConversionStrategy); + EXPECT_TRUE(status.isOk()); + EXPECT_EQ(common::Hdr::INVALID, preferredHdrOutputType); +} + +TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Force) { + if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) { + GTEST_SUCCEED() << "HDR output conversion not supported"; + return; + } + const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities(); + const auto& [status2, hdrCapabilities] = + mComposerClient->getHdrCapabilities(getPrimaryDisplayId()); + const auto& hdrTypes = hdrCapabilities.types; + for (auto conversionCapability : conversionCapabilities) { + if (conversionCapability.outputType != common::Hdr::INVALID) { + if (std::find(hdrTypes.begin(), hdrTypes.end(), conversionCapability.outputType) == + hdrTypes.end()) { + continue; + } + common::HdrConversionStrategy hdrConversionStrategy; + hdrConversionStrategy.set( + conversionCapability.outputType); + const auto& [statusSet, preferredHdrOutputType] = + mComposerClient->setHdrConversionStrategy(hdrConversionStrategy); + EXPECT_TRUE(statusSet.isOk()); + EXPECT_EQ(common::Hdr::INVALID, preferredHdrOutputType); + } + } +} + +TEST_P(GraphicsComposerAidlTest, SetHdrConversionStrategy_Auto) { + if (!hasCapability(Capability::HDR_OUTPUT_CONVERSION_CONFIG)) { + GTEST_SUCCEED() << "HDR output conversion not supported"; + return; + } + const auto& [status, conversionCapabilities] = mComposerClient->getHdrConversionCapabilities(); + const auto& [status2, hdrCapabilities] = + mComposerClient->getHdrCapabilities(getPrimaryDisplayId()); + if (hdrCapabilities.types.size() <= 0) { + return; + } + std::vector autoHdrTypes; + for (auto conversionCapability : conversionCapabilities) { + if (conversionCapability.outputType != common::Hdr::INVALID) { + autoHdrTypes.push_back(conversionCapability.outputType); + } + } + common::HdrConversionStrategy hdrConversionStrategy; + hdrConversionStrategy.set( + autoHdrTypes); + const auto& [statusSet, preferredHdrOutputType] = + mComposerClient->setHdrConversionStrategy(hdrConversionStrategy); + EXPECT_TRUE(statusSet.isOk()); + EXPECT_NE(common::Hdr::INVALID, preferredHdrOutputType); +} + TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) { auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true); EXPECT_FALSE(status.isOk()); @@ -808,6 +891,39 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayName) { EXPECT_TRUE(status.isOk()); } +TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) { + if (getInterfaceVersion() <= 1) { + GTEST_SUCCEED() << "Device does not support the new API for overlay support"; + return; + } + + const auto& [status, properties] = mComposerClient->getOverlaySupport(); + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + GTEST_SUCCEED() << "getOverlaySupport is not supported"; + return; + } + + ASSERT_TRUE(status.isOk()); + for (const auto& i : properties.combinations) { + for (const auto standard : i.standards) { + const auto val = static_cast(standard) & + static_cast(common::Dataspace::STANDARD_MASK); + ASSERT_TRUE(val == static_cast(standard)); + } + for (const auto transfer : i.transfers) { + const auto val = static_cast(transfer) & + static_cast(common::Dataspace::TRANSFER_MASK); + ASSERT_TRUE(val == static_cast(transfer)); + } + for (const auto range : i.ranges) { + const auto val = static_cast(range) & + static_cast(common::Dataspace::RANGE_MASK); + ASSERT_TRUE(val == static_cast(range)); + } + } +} + TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) { const auto& [status, _] = mComposerClient->getDisplayPhysicalOrientation(getInvalidDisplayId()); @@ -1065,17 +1181,21 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } void execute() { - const auto& commands = mWriter.getPendingCommands(); - if (commands.empty()) { - mWriter.reset(); - return; + std::vector payloads; + for (auto& [_, writer] : mWriters) { + auto commands = writer.takePendingCommands(); + if (commands.empty()) { + continue; + } + + auto [status, results] = mComposerClient->executeCommands(commands); + ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); + + payloads.reserve(payloads.size() + results.size()); + payloads.insert(payloads.end(), std::make_move_iterator(results.begin()), + std::make_move_iterator(results.end())); } - - auto [status, results] = mComposerClient->executeCommands(commands); - ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); - - mReader.parse(std::move(results)); - mWriter.reset(); + mReader.parse(std::move(payloads)); } static inline auto toTimePoint(nsecs_t time) { @@ -1111,17 +1231,29 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } } - sp allocate(::android::PixelFormat pixelFormat) { + bool checkIfCallbackRefreshRateChangedDebugEnabledReceived( + std::function filter) { + const auto list = mComposerClient->takeListOfRefreshRateChangedDebugData(); + return std::any_of(list.begin(), list.end(), [&](auto refreshRateChangedDebugData) { + return filter(refreshRateChangedDebugData); + }); + } + + sp allocate(uint32_t width, uint32_t height, + ::android::PixelFormat pixelFormat) { return sp::make( - static_cast(getPrimaryDisplay().getDisplayWidth()), - static_cast(getPrimaryDisplay().getDisplayHeight()), pixelFormat, - /*layerCount*/ 1U, - (static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | - static_cast(common::BufferUsage::CPU_READ_OFTEN) | - static_cast(common::BufferUsage::COMPOSER_OVERLAY)), + width, height, pixelFormat, /*layerCount*/ 1U, + static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::COMPOSER_OVERLAY), "VtsHalGraphicsComposer3_TargetTest"); } + sp allocate(::android::PixelFormat pixelFormat) { + return allocate(static_cast(getPrimaryDisplay().getDisplayWidth()), + static_cast(getPrimaryDisplay().getDisplayHeight()), pixelFormat); + } + void sendRefreshFrame(const VtsDisplay& display, const VsyncPeriodChangeTimeline* timeline) { if (timeline != nullptr) { // Refresh time should be before newVsyncAppliedTimeNanos @@ -1139,6 +1271,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto& [status, layer] = mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount); EXPECT_TRUE(status.isOk()); + auto& writer = getWriter(display.getDisplayId()); { const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); ASSERT_NE(nullptr, buffer); @@ -1147,15 +1280,15 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { configureLayer(display, layer, Composition::DEVICE, display.getFrameRect(), display.getCrop()); - mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, - /*acquireFence*/ -1); - mWriter.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN); + writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + writer.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN); - mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(display.getDisplayId()); + writer.presentDisplay(display.getDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1164,15 +1297,15 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); ASSERT_NE(nullptr, buffer->handle); - mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, - /*acquireFence*/ -1); - mWriter.setLayerSurfaceDamage(display.getDisplayId(), layer, - std::vector(1, {0, 0, 10, 10})); - mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + writer.setLayerSurfaceDamage(display.getDisplayId(), layer, + std::vector(1, {0, 0, 10, 10})); + writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(display.getDisplayId()); + writer.presentDisplay(display.getDisplayId()); execute(); } @@ -1181,11 +1314,12 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { sp<::android::Fence> presentAndGetFence( std::optional expectedPresentTime) { - mWriter.validateDisplay(getPrimaryDisplayId(), expectedPresentTime); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.validateDisplay(getPrimaryDisplayId(), expectedPresentTime); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + writer.presentDisplay(getPrimaryDisplayId()); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); @@ -1208,7 +1342,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return vsyncPeriod; } - int64_t createOnScreenLayer() { + int64_t createOnScreenLayer(Composition composition = Composition::DEVICE) { const auto& [status, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(status.isOk()); @@ -1216,11 +1350,25 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { getPrimaryDisplay().getDisplayHeight()}; FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(), (float)getPrimaryDisplay().getDisplayHeight()}; - configureLayer(getPrimaryDisplay(), layer, Composition::DEVICE, displayFrame, cropRect); - mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN); + configureLayer(getPrimaryDisplay(), layer, composition, displayFrame, cropRect); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN); return layer; } + void sendBufferUpdate(int64_t layer) { + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer->handle); + + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + + const sp<::android::Fence> presentFence = + presentAndGetFence(ComposerClientWriter::kNoTimestamp); + presentFence->waitForever(LOG_TAG); + } + bool hasDisplayCapability(int64_t display, DisplayCapability cap) { const auto& [status, capabilities] = mComposerClient->getDisplayCapabilities(display); EXPECT_TRUE(status.isOk()); @@ -1317,8 +1465,9 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { ASSERT_NE(nullptr, buffer2); const auto layer = createOnScreenLayer(); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer1->handle, - /*acquireFence*/ -1); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer1->handle, + /*acquireFence*/ -1); const sp<::android::Fence> presentFence1 = presentAndGetFence(ComposerClientWriter::kNoTimestamp); presentFence1->waitForever(LOG_TAG); @@ -1328,8 +1477,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { expectedPresentTime += *framesDelay * vsyncPeriod; } - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer2->handle, - /*acquireFence*/ -1); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer2->handle, + /*acquireFence*/ -1); const auto setExpectedPresentTime = [&]() -> std::optional { if (!framesDelay.has_value()) { return ComposerClientWriter::kNoTimestamp; @@ -1350,17 +1499,18 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { void configureLayer(const VtsDisplay& display, int64_t layer, Composition composition, const Rect& displayFrame, const FRect& cropRect) { - mWriter.setLayerCompositionType(display.getDisplayId(), layer, composition); - mWriter.setLayerDisplayFrame(display.getDisplayId(), layer, displayFrame); - mWriter.setLayerPlaneAlpha(display.getDisplayId(), layer, /*alpha*/ 1); - mWriter.setLayerSourceCrop(display.getDisplayId(), layer, cropRect); - mWriter.setLayerTransform(display.getDisplayId(), layer, static_cast(0)); - mWriter.setLayerVisibleRegion(display.getDisplayId(), layer, - std::vector(1, displayFrame)); - mWriter.setLayerZOrder(display.getDisplayId(), layer, /*z*/ 10); - mWriter.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::NONE); - mWriter.setLayerSurfaceDamage(display.getDisplayId(), layer, - std::vector(1, displayFrame)); + auto& writer = getWriter(display.getDisplayId()); + writer.setLayerCompositionType(display.getDisplayId(), layer, composition); + writer.setLayerDisplayFrame(display.getDisplayId(), layer, displayFrame); + writer.setLayerPlaneAlpha(display.getDisplayId(), layer, /*alpha*/ 1); + writer.setLayerSourceCrop(display.getDisplayId(), layer, cropRect); + writer.setLayerTransform(display.getDisplayId(), layer, static_cast(0)); + writer.setLayerVisibleRegion(display.getDisplayId(), layer, + std::vector(1, displayFrame)); + writer.setLayerZOrder(display.getDisplayId(), layer, /*z*/ 10); + writer.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::NONE); + writer.setLayerSurfaceDamage(display.getDisplayId(), layer, + std::vector(1, displayFrame)); } // clang-format off const std::array kIdentity = {{ @@ -1371,12 +1521,20 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { }}; // clang-format on - ComposerClientWriter mWriter; + ComposerClientWriter& getWriter(int64_t display) { + auto [it, _] = mWriters.try_emplace(display, display); + return it->second; + } + ComposerClientReader mReader; + + private: + std::unordered_map mWriters; }; TEST_P(GraphicsComposerAidlCommandTest, SetColorTransform) { - mWriter.setColorTransform(getPrimaryDisplayId(), kIdentity.data()); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setColorTransform(getPrimaryDisplayId(), kIdentity.data()); execute(); } @@ -1384,7 +1542,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { const auto& [status, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(status.isOk()); - mWriter.setLayerColorTransform(getPrimaryDisplayId(), layer, kIdentity.data()); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerColorTransform(getPrimaryDisplayId(), layer, kIdentity.data()); execute(); const auto errors = mReader.takeErrors(); @@ -1400,8 +1559,9 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { ASSERT_TRUE(status.isOk()); bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::BRIGHTNESS) != capabilities.end(); + auto& writer = getWriter(getPrimaryDisplayId()); if (!brightnessSupport) { - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); execute(); const auto errors = mReader.takeErrors(); EXPECT_EQ(1, errors.size()); @@ -1410,23 +1570,23 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { return; } - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f, -1.f); execute(); { const auto errors = mReader.takeErrors(); @@ -1434,7 +1594,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f, -1.f); + writer.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f, -1.f); execute(); { const auto errors = mReader.takeErrors(); @@ -1447,8 +1607,9 @@ TEST_P(GraphicsComposerAidlCommandTest, SetClientTarget) { EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kBufferSlotCount) .isOk()); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, nullptr, /*acquireFence*/ -1, - Dataspace::UNKNOWN, std::vector()); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, nullptr, /*acquireFence*/ -1, + Dataspace::UNKNOWN, std::vector()); execute(); } @@ -1468,24 +1629,28 @@ TEST_P(GraphicsComposerAidlCommandTest, SetOutputBuffer) { const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle = buffer->handle; - mWriter.setOutputBuffer(display.display, /*slot*/ 0, handle, /*releaseFence*/ -1); + auto& writer = getWriter(display.display); + writer.setOutputBuffer(display.display, /*slot*/ 0, handle, /*releaseFence*/ -1); execute(); } TEST_P(GraphicsComposerAidlCommandTest, ValidDisplay) { - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); } TEST_P(GraphicsComposerAidlCommandTest, AcceptDisplayChanges) { - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); - mWriter.acceptDisplayChanges(getPrimaryDisplayId()); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.acceptDisplayChanges(getPrimaryDisplayId()); execute(); } TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) { - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); - mWriter.presentDisplay(getPrimaryDisplayId()); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.presentDisplay(getPrimaryDisplayId()); execute(); } @@ -1506,6 +1671,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { const auto& [renderIntentsStatus, renderIntents] = mComposerClient->getRenderIntents(getPrimaryDisplayId(), ColorMode::NATIVE); EXPECT_TRUE(renderIntentsStatus.isOk()); + auto& writer = getWriter(getPrimaryDisplayId()); for (auto intent : renderIntents) { EXPECT_TRUE(mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, intent) .isOk()); @@ -1523,10 +1689,10 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(), (float)getPrimaryDisplay().getDisplayHeight()}; configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, - /*acquireFence*/ -1); - mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, + /*acquireFence*/ -1); + writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; @@ -1534,18 +1700,18 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(getPrimaryDisplayId()); + writer.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle2 = buffer2->handle; ASSERT_NE(nullptr, handle2); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle2, - /*acquireFence*/ -1); - mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, - std::vector(1, {0, 0, 10, 10})); - mWriter.presentDisplay(getPrimaryDisplayId()); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle2, + /*acquireFence*/ -1); + writer.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, + std::vector(1, {0, 0, 10, 10})); + writer.presentDisplay(getPrimaryDisplayId()); execute(); } } @@ -1559,15 +1725,16 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) { const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1); Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(), getPrimaryDisplay().getDisplayHeight()}; FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(), (float)getPrimaryDisplay().getDisplayHeight()}; configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect); - mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); @@ -1575,15 +1742,15 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } - mWriter.presentDisplay(getPrimaryDisplayId()); + writer.presentDisplay(getPrimaryDisplayId()); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 1, /*y*/ 1); + writer.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 1, /*y*/ 1); execute(); - mWriter.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0); - mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); - mWriter.presentDisplay(getPrimaryDisplayId()); + writer.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + writer.presentDisplay(getPrimaryDisplayId()); execute(); } @@ -1595,10 +1762,109 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerBuffer) { const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1); execute(); } +TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferSlotsToClear) { + // Older HAL versions use a backwards compatible way of clearing buffer slots + const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion(); + ASSERT_TRUE(versionStatus.isOk()); + if (version <= 1) { + GTEST_SUCCEED() << "HAL at version 1 or lower does not have " + "LayerCommand::bufferSlotsToClear."; + return; + } + + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); + auto& writer = getWriter(getPrimaryDisplayId()); + + // setup 3 buffers in the buffer cache, with the last buffer being active + // then emulate the Android platform code that clears all 3 buffer slots + + const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer1); + const auto handle1 = buffer1->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer2); + const auto handle2 = buffer2->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer3); + const auto handle3 = buffer3->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 2, handle3, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + // Ensure we can clear all 3 buffer slots, even the active buffer - it is assumed the + // current active buffer's slot will be cleared, but still remain the active buffer and no + // errors will occur. + writer.setLayerBufferSlotsToClear(getPrimaryDisplayId(), layer, {0, 1, 2}); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + +TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferMultipleTimes) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); + auto& writer = getWriter(getPrimaryDisplayId()); + + // Setup 3 buffers in the buffer cache, with the last buffer being active. Then, emulate the + // Android platform code that clears all 3 buffer slots by setting all but the active buffer + // slot to a placeholder buffer, and then restoring the active buffer. + + // This is used on HALs that don't support setLayerBufferSlotsToClear (version <= 3.1). + + const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer1); + const auto handle1 = buffer1->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer2); + const auto handle2 = buffer2->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer3); + const auto handle3 = buffer3->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 2, handle3, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + // Older versions of the HAL clear all but the active buffer slot with a placeholder buffer, + // and then restoring the current active buffer at the end + auto clearSlotBuffer = allocate(1u, 1u, ::android::PIXEL_FORMAT_RGB_888); + ASSERT_NE(nullptr, clearSlotBuffer); + auto clearSlotBufferHandle = clearSlotBuffer->handle; + + // clear buffer slots 0 and 1 with new layer commands... and then... + writer.setLayerBufferWithNewCommand(getPrimaryDisplayId(), layer, /* slot */ 0, + clearSlotBufferHandle, /*acquireFence*/ -1); + writer.setLayerBufferWithNewCommand(getPrimaryDisplayId(), layer, /* slot */ 1, + clearSlotBufferHandle, /*acquireFence*/ -1); + // ...reset the layer buffer to the current active buffer slot with a final new command + writer.setLayerBufferWithNewCommand(getPrimaryDisplayId(), layer, /*slot*/ 2, nullptr, + /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) { const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); @@ -1607,15 +1873,16 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) { Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector(1, empty)); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector(1, empty)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector(1, unit)); + writer.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector(1, unit)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector()); + writer.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1628,15 +1895,16 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlockingRegion) { Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector(1, empty)); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector(1, empty)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector(1, unit)); + writer.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector(1, unit)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector()); + writer.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1646,15 +1914,16 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlendMode) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::NONE); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::NONE); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::PREMULTIPLIED); + writer.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::PREMULTIPLIED); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::COVERAGE); + writer.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::COVERAGE); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1664,11 +1933,12 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerColor) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerColor(getPrimaryDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f}); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerColor(getPrimaryDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f}); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerColor(getPrimaryDisplayId(), layer, Color{0.0f, 0.0f, 0.0f, 0.0f}); + writer.setLayerColor(getPrimaryDisplayId(), layer, Color{0.0f, 0.0f, 0.0f, 0.0f}); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1678,19 +1948,20 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCompositionType) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CLIENT); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CLIENT); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::DEVICE); + writer.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::DEVICE); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::SOLID_COLOR); + writer.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::SOLID_COLOR); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CURSOR); + writer.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CURSOR); execute(); } @@ -1721,9 +1992,10 @@ TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) { configureLayer(display, layer, Composition::DISPLAY_DECORATION, display.getFrameRect(), display.getCrop()); - mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle, - /*acquireFence*/ -1); - mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); + auto& writer = getWriter(display.getDisplayId()); + writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle, + /*acquireFence*/ -1); + writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (support) { ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1740,7 +2012,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerDataspace) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); execute(); } @@ -1749,7 +2022,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerDisplayFrame) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerDisplayFrame(getPrimaryDisplayId(), layer, Rect{0, 0, 1, 1}); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerDisplayFrame(getPrimaryDisplayId(), layer, Rect{0, 0, 1, 1}); execute(); } @@ -1758,11 +2032,12 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerPlaneAlpha) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 0.0f); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 0.0f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 1.0f); + writer.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 1.0f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1781,7 +2056,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerSidebandStream) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerSidebandStream(getPrimaryDisplayId(), layer, handle); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerSidebandStream(getPrimaryDisplayId(), layer, handle); execute(); } @@ -1790,7 +2066,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerSourceCrop) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerSourceCrop(getPrimaryDisplayId(), layer, FRect{0.0f, 0.0f, 1.0f, 1.0f}); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerSourceCrop(getPrimaryDisplayId(), layer, FRect{0.0f, 0.0f, 1.0f, 1.0f}); execute(); } @@ -1799,39 +2076,40 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerTransform) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, static_cast(0)); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerTransform(getPrimaryDisplayId(), layer, static_cast(0)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_H); + writer.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_H); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_V); + writer.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_V); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_90); + writer.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_90); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_180); + writer.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_180); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_270); + writer.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_270); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, - static_cast(static_cast(Transform::FLIP_H) | - static_cast(Transform::ROT_90))); + writer.setLayerTransform(getPrimaryDisplayId(), layer, + static_cast(static_cast(Transform::FLIP_H) | + static_cast(Transform::ROT_90))); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(getPrimaryDisplayId(), layer, - static_cast(static_cast(Transform::FLIP_V) | - static_cast(Transform::ROT_90))); + writer.setLayerTransform(getPrimaryDisplayId(), layer, + static_cast(static_cast(Transform::FLIP_V) | + static_cast(Transform::ROT_90))); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1844,15 +2122,16 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerVisibleRegion) { Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector(1, empty)); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector(1, empty)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector(1, unit)); + writer.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector(1, unit)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector()); + writer.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1862,11 +2141,12 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerZOrder) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 10); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 10); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 0); + writer.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 0); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1888,6 +2168,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) { * white (D65) 0.3127 0.3290 */ + auto& writer = getWriter(getPrimaryDisplayId()); std::vector aidlMetadata; aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X, 0.680f}); aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y, 0.320f}); @@ -1901,7 +2182,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) { aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f}); aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0}); aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0}); - mWriter.setLayerPerFrameMetadata(getPrimaryDisplayId(), layer, aidlMetadata); + writer.setLayerPerFrameMetadata(getPrimaryDisplayId(), layer, aidlMetadata); execute(); const auto errors = mReader.takeErrors(); @@ -1918,19 +2199,20 @@ TEST_P(GraphicsComposerAidlCommandTest, setLayerBrightness) { const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); - mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, 0.2f); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBrightness(getPrimaryDisplayId(), layer, 0.2f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, 1.f); + writer.setLayerBrightness(getPrimaryDisplayId(), layer, 1.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, 0.f); + writer.setLayerBrightness(getPrimaryDisplayId(), layer, 0.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, -1.f); + writer.setLayerBrightness(getPrimaryDisplayId(), layer, -1.f); execute(); { const auto errors = mReader.takeErrors(); @@ -1938,7 +2220,7 @@ TEST_P(GraphicsComposerAidlCommandTest, setLayerBrightness) { EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } - mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, std::nanf("")); + writer.setLayerBrightness(getPrimaryDisplayId(), layer, std::nanf("")); execute(); { const auto errors = mReader.takeErrors(); @@ -2103,8 +2385,9 @@ TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Timeout_2) { ASSERT_NE(nullptr, buffer->handle); const auto layer = createOnScreenLayer(); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer->handle, - /*acquireFence*/ -1); + auto& writer = getWriter(getPrimaryDisplayId()); + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); int32_t vsyncIdleCount = mComposerClient->getVsyncIdleCount(); auto earlyVsyncIdleTime = systemTime() + std::chrono::nanoseconds(2s).count(); EXPECT_TRUE( @@ -2122,6 +2405,245 @@ TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Timeout_2) { EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); } +TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Unsupported) { + if (getInterfaceVersion() <= 1) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " + "not supported on older version of the service"; + return; + } + if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { + auto status = mComposerClient->setRefreshRateChangedCallbackDebugEnabled( + getPrimaryDisplayId(), /*enabled*/ true); + EXPECT_FALSE(status.isOk()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); + + status = mComposerClient->setRefreshRateChangedCallbackDebugEnabled(getPrimaryDisplayId(), + /*enabled*/ false); + EXPECT_FALSE(status.isOk()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); + } +} + +TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Enabled) { + if (getInterfaceVersion() <= 1) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " + "not supported on older version of the service"; + return; + } + if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported"; + return; + } + + const auto displayId = getPrimaryDisplayId(); + EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk()); + // Enable the callback + ASSERT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, + /*enabled*/ true) + .isOk()); + std::this_thread::sleep_for(100ms); + + const auto displayFilter = [displayId](auto refreshRateChangedDebugData) { + return displayId == refreshRateChangedDebugData.display; + }; + + // Check that we immediately got a callback + EXPECT_TRUE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter)); + + ASSERT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, + /*enabled*/ false) + .isOk()); +} + +TEST_P(GraphicsComposerAidlCommandTest, + SetRefreshRateChangedCallbackDebugEnabled_noCallbackWhenIdle) { + if (getInterfaceVersion() <= 1) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " + "not supported on older version of the service"; + return; + } + if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported"; + return; + } + + auto display = getEditablePrimaryDisplay(); + const auto displayId = display.getDisplayId(); + + if (!hasDisplayCapability(displayId, DisplayCapability::DISPLAY_IDLE_TIMER)) { + GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; + return; + } + + EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk()); + EXPECT_TRUE(mComposerClient->setPeakRefreshRateConfig(&display).isOk()); + + ASSERT_TRUE(mComposerClient->setIdleTimerEnabled(displayId, /*timeoutMs*/ 500).isOk()); + // Enable the callback + ASSERT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, + /*enabled*/ true) + .isOk()); + + const auto displayFilter = [displayId](auto refreshRateChangedDebugData) { + return displayId == refreshRateChangedDebugData.display; + }; + + int retryCount = 3; + do { + // Wait for 1s so that we enter the idle state + std::this_thread::sleep_for(1s); + if (!checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter)) { + // DID NOT receive a callback, we are in the idle state. + break; + } + } while (--retryCount > 0); + + if (retryCount == 0) { + GTEST_SUCCEED() << "Unable to enter the idle mode"; + return; + } + + // Send the REFRESH_RATE_INDICATOR update + ASSERT_NO_FATAL_FAILURE( + sendBufferUpdate(createOnScreenLayer(Composition::REFRESH_RATE_INDICATOR))); + std::this_thread::sleep_for(1s); + EXPECT_FALSE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter)) + << "A callback should not be received for REFRESH_RATE_INDICATOR"; + + EXPECT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, + /*enabled*/ false) + .isOk()); +} + +TEST_P(GraphicsComposerAidlCommandTest, + SetRefreshRateChangedCallbackDebugEnabled_SetActiveConfigWithConstraints) { + if (getInterfaceVersion() <= 1) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " + "not supported on older version of the service"; + return; + } + if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { + GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported"; + return; + } + + VsyncPeriodChangeConstraints constraints; + constraints.seamlessRequired = false; + constraints.desiredTimeNanos = systemTime(); + + for (VtsDisplay& display : mDisplays) { + const auto displayId = display.getDisplayId(); + EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk()); + + // Enable the callback + ASSERT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, /*enabled*/ true) + .isOk()); + + forEachTwoConfigs(displayId, [&](int32_t config1, int32_t config2) { + const int32_t vsyncPeriod1 = display.getDisplayConfig(config1).vsyncPeriod; + const int32_t vsyncPeriod2 = display.getDisplayConfig(config2).vsyncPeriod; + + if (vsyncPeriod1 == vsyncPeriod2) { + return; // continue + } + + EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk()); + sendRefreshFrame(display, nullptr); + + const auto& [status, timeline] = + mComposerClient->setActiveConfigWithConstraints(&display, config2, constraints); + EXPECT_TRUE(status.isOk()); + + if (timeline.refreshRequired) { + sendRefreshFrame(display, &timeline); + } + + const auto callbackFilter = [displayId, + vsyncPeriod2](auto refreshRateChangedDebugData) { + constexpr int kVsyncThreshold = 1000; + return displayId == refreshRateChangedDebugData.display && + std::abs(vsyncPeriod2 - refreshRateChangedDebugData.vsyncPeriodNanos) <= + kVsyncThreshold; + }; + + int retryCount = 3; + do { + std::this_thread::sleep_for(100ms); + if (checkIfCallbackRefreshRateChangedDebugEnabledReceived(callbackFilter)) { + GTEST_SUCCEED() << "Received a callback successfully"; + break; + } + } while (--retryCount > 0); + + if (retryCount == 0) { + GTEST_FAIL() << "failed to get a callback for the display " << displayId + << " with config " << config2; + } + }); + + EXPECT_TRUE( + mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, /*enabled*/ false) + .isOk()); + } +} + +/* + * Test that no two display configs are exactly the same. + */ +TEST_P(GraphicsComposerAidlTest, GetDisplayConfigNoRepetitions) { + for (const auto& display : mDisplays) { + const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); + for (std::vector::size_type i = 0; i < configs.size(); i++) { + for (std::vector::size_type j = i + 1; j < configs.size(); j++) { + const auto& [widthStatus1, width1] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[i], DisplayAttribute::WIDTH); + const auto& [heightStatus1, height1] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[i], DisplayAttribute::HEIGHT); + const auto& [vsyncPeriodStatus1, vsyncPeriod1] = + mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[i], + DisplayAttribute::VSYNC_PERIOD); + const auto& [groupStatus1, group1] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[i], DisplayAttribute::CONFIG_GROUP); + + const auto& [widthStatus2, width2] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[j], DisplayAttribute::WIDTH); + const auto& [heightStatus2, height2] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[j], DisplayAttribute::HEIGHT); + const auto& [vsyncPeriodStatus2, vsyncPeriod2] = + mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[j], + DisplayAttribute::VSYNC_PERIOD); + const auto& [groupStatus2, group2] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[j], DisplayAttribute::CONFIG_GROUP); + + ASSERT_FALSE(width1 == width2 && height1 == height2 && + vsyncPeriod1 == vsyncPeriod2 && group1 == group2); + } + } + } +} + +/** + * Test Capability::SKIP_VALIDATE + * + * Capability::SKIP_VALIDATE has been deprecated and should not be enabled. + */ +TEST_P(GraphicsComposerAidlCommandTest, SkipValidateDeprecatedTest) { + if (getInterfaceVersion() <= 1) { + GTEST_SUCCEED() << "HAL at version 1 or lower can contain Capability::SKIP_VALIDATE."; + return; + } + ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE)) + << "Found Capability::SKIP_VALIDATE capability."; +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandTest, diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp index d808559c86..51e871b2d6 100644 --- a/graphics/mapper/4.0/utils/vts/Android.bp +++ b/graphics/mapper/4.0/utils/vts/Android.bp @@ -37,7 +37,6 @@ cc_library_static { ], static_libs: [ "android.hardware.graphics.allocator@4.0", - "android.hardware.graphics.common-V4-ndk", "android.hardware.graphics.mapper@4.0", "libaidlcommonsupport", ], diff --git a/graphics/mapper/4.0/vts/functional/Android.bp b/graphics/mapper/4.0/vts/functional/Android.bp index ebdc4ec7e8..6208ae9ab2 100644 --- a/graphics/mapper/4.0/vts/functional/Android.bp +++ b/graphics/mapper/4.0/vts/functional/Android.bp @@ -33,7 +33,6 @@ cc_test { ], srcs: ["VtsHalGraphicsMapperV4_0TargetTest.cpp"], static_libs: [ - "android.hardware.graphics.common-V4-ndk", "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", "libgralloctypes", diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 0ddb2363c0..03d9041fd2 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -954,7 +954,6 @@ TEST_P(GraphicsMapperHidlTest, Lock_RAW10) { EXPECT_EQ(PlaneLayoutComponentType::RAW, static_cast(planeLayoutComponent.type.value)); EXPECT_EQ(0, planeLayoutComponent.offsetInBits % 8); - EXPECT_EQ(-1, planeLayoutComponent.sizeInBits); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } @@ -996,7 +995,6 @@ TEST_P(GraphicsMapperHidlTest, Lock_RAW12) { EXPECT_EQ(PlaneLayoutComponentType::RAW, static_cast(planeLayoutComponent.type.value)); EXPECT_EQ(0, planeLayoutComponent.offsetInBits % 8); - EXPECT_EQ(-1, planeLayoutComponent.sizeInBits); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } diff --git a/graphics/mapper/stable-c/Android.bp b/graphics/mapper/stable-c/Android.bp index d40e160207..1d01a02707 100644 --- a/graphics/mapper/stable-c/Android.bp +++ b/graphics/mapper/stable-c/Android.bp @@ -33,6 +33,32 @@ cc_library_headers { export_header_lib_headers: [ "libarect_headers", ], + // TODO(b/214400477) Remove apex_available + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], + min_sdk_version: "29", +} + +cc_library_shared { + name: "libimapper_stablec_abicheck", + visibility: ["//visibility:private"], + defaults: [ + "android.hardware.graphics.allocator-ndk_shared", + "android.hardware.graphics.common-ndk_shared", + ], + header_libs: [ + "libimapper_stablec", + ], + srcs: [ + "imapper5_abicheck.cpp", + ], + header_abi_checker: { + enabled: true, + symbol_file: "imapper.map.txt", + }, } cc_library_headers { @@ -47,6 +73,13 @@ cc_library_headers { "libbase_headers", "libimapper_stablec", ], + // TODO(b/214400477) Remove apex_available + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], + min_sdk_version: "29", } cc_test { diff --git a/graphics/mapper/stable-c/imapper.map.txt b/graphics/mapper/stable-c/imapper.map.txt new file mode 100644 index 0000000000..43abd33a1a --- /dev/null +++ b/graphics/mapper/stable-c/imapper.map.txt @@ -0,0 +1,4 @@ +LIBIMAPPER { # introduced=UpsideDownCake + global: + AIMapper_loadIMapper; +} diff --git a/graphics/mapper/stable-c/imapper5_abicheck.cpp b/graphics/mapper/stable-c/imapper5_abicheck.cpp new file mode 100644 index 0000000000..92f7198807 --- /dev/null +++ b/graphics/mapper/stable-c/imapper5_abicheck.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +AIMapper_Error AIMapper_loadIMapper(AIMapper* _Nullable* _Nonnull outImplementation) { + static AIMapper mapper = {AIMAPPER_VERSION_5, {}}; + *outImplementation = &mapper; + return AIMAPPER_ERROR_NONE; +} \ No newline at end of file diff --git a/graphics/mapper/stable-c/implutils/include/android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h b/graphics/mapper/stable-c/implutils/include/android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h index 3dba86d254..0e6d3dcc6a 100644 --- a/graphics/mapper/stable-c/implutils/include/android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h +++ b/graphics/mapper/stable-c/implutils/include/android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h @@ -567,6 +567,8 @@ DEFINE_TYPE(STRIDE, uint32_t); #undef DEFINE_TYPE +#if defined(__cplusplus) && __cplusplus >= 202002L + template void invokeWithStandardMetadata(F&& f, StandardMetadataType type, std::index_sequence) { // Setup the jump table, mapping from each type to a springboard that invokes the template @@ -621,4 +623,6 @@ AIMapper_Error applyStandardMetadata(StandardMetadataType type, const void* _Non return retVal; } +#endif + } // namespace android::hardware::graphics::mapper \ No newline at end of file diff --git a/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h b/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h index 0de88cd4c6..75e436d5d3 100644 --- a/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h +++ b/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h @@ -26,10 +26,8 @@ #pragma once +#include #include -#include -#include -#include #include #include diff --git a/health/aidl/Android.bp b/health/aidl/Android.bp index 6d4f914b07..e288f179bb 100644 --- a/health/aidl/Android.bp +++ b/health/aidl/Android.bp @@ -42,7 +42,13 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], + frozen: true, } diff --git a/health/aidl/aidl_api/android.hardware.health/2/.hash b/health/aidl/aidl_api/android.hardware.health/2/.hash new file mode 100644 index 0000000000..384f780caa --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/.hash @@ -0,0 +1 @@ +d92c40b74b56341959d2ad70271145fdbd70b5c7 diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryCapacityLevel.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryCapacityLevel.aidl new file mode 100644 index 0000000000..4d705887e5 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryCapacityLevel.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@Backing(type="int") @VintfStability +enum BatteryCapacityLevel { + UNSUPPORTED = (-1) /* -1 */, + UNKNOWN, + CRITICAL, + LOW, + NORMAL, + HIGH, + FULL, +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryChargingPolicy.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryChargingPolicy.aidl new file mode 100644 index 0000000000..42fbf95090 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryChargingPolicy.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@Backing(type="int") @VintfStability +enum BatteryChargingPolicy { + INVALID = 0, + DEFAULT = 1, + LONG_LIFE = 2, + ADAPTIVE = 3, +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryChargingState.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryChargingState.aidl new file mode 100644 index 0000000000..e21eb28133 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryChargingState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@Backing(type="int") @VintfStability +enum BatteryChargingState { + INVALID = 0, + NORMAL = 1, + TOO_COLD = 2, + TOO_HOT = 3, + LONG_LIFE = 4, + ADAPTIVE = 5, +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryHealth.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryHealth.aidl new file mode 100644 index 0000000000..8d13198440 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryHealth.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@Backing(type="int") @VintfStability +enum BatteryHealth { + UNKNOWN = 1, + GOOD = 2, + OVERHEAT = 3, + DEAD = 4, + OVER_VOLTAGE = 5, + UNSPECIFIED_FAILURE = 6, + COLD = 7, + FAIR = 8, + NOT_AVAILABLE = 11, + INCONSISTENT = 12, +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryHealthData.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryHealthData.aidl new file mode 100644 index 0000000000..2dd01b146f --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryHealthData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@VintfStability +parcelable BatteryHealthData { + long batteryManufacturingDateSeconds; + long batteryFirstUsageSeconds; + long batteryStateOfHealth; +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryStatus.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryStatus.aidl new file mode 100644 index 0000000000..340b2ecc3f --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/BatteryStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@Backing(type="int") @VintfStability +enum BatteryStatus { + UNKNOWN = 1, + CHARGING = 2, + DISCHARGING = 3, + NOT_CHARGING = 4, + FULL = 5, +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/DiskStats.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/DiskStats.aidl new file mode 100644 index 0000000000..5aa58900bb --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/DiskStats.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@VintfStability +parcelable DiskStats { + long reads; + long readMerges; + long readSectors; + long readTicks; + long writes; + long writeMerges; + long writeSectors; + long writeTicks; + long ioInFlight; + long ioTicks; + long ioInQueue; +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/HealthInfo.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/HealthInfo.aidl new file mode 100644 index 0000000000..bfa14758f3 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/HealthInfo.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@VintfStability +parcelable HealthInfo { + boolean chargerAcOnline; + boolean chargerUsbOnline; + boolean chargerWirelessOnline; + boolean chargerDockOnline; + int maxChargingCurrentMicroamps; + int maxChargingVoltageMicrovolts; + android.hardware.health.BatteryStatus batteryStatus; + android.hardware.health.BatteryHealth batteryHealth; + boolean batteryPresent; + int batteryLevel; + int batteryVoltageMillivolts; + int batteryTemperatureTenthsCelsius; + int batteryCurrentMicroamps; + int batteryCycleCount; + int batteryFullChargeUah; + int batteryChargeCounterUah; + String batteryTechnology; + int batteryCurrentAverageMicroamps; + android.hardware.health.DiskStats[] diskStats; + android.hardware.health.StorageInfo[] storageInfos; + android.hardware.health.BatteryCapacityLevel batteryCapacityLevel; + long batteryChargeTimeToFullNowSeconds; + int batteryFullChargeDesignCapacityUah; + android.hardware.health.BatteryChargingState chargingState; + android.hardware.health.BatteryChargingPolicy chargingPolicy; + @nullable android.hardware.health.BatteryHealthData batteryHealthData; + const int BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = (-1) /* -1 */; +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/IHealth.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/IHealth.aidl new file mode 100644 index 0000000000..b49dfffbe4 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/IHealth.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@VintfStability +interface IHealth { + void registerCallback(in android.hardware.health.IHealthInfoCallback callback); + void unregisterCallback(in android.hardware.health.IHealthInfoCallback callback); + void update(); + int getChargeCounterUah(); + int getCurrentNowMicroamps(); + int getCurrentAverageMicroamps(); + int getCapacity(); + long getEnergyCounterNwh(); + android.hardware.health.BatteryStatus getChargeStatus(); + android.hardware.health.StorageInfo[] getStorageInfo(); + android.hardware.health.DiskStats[] getDiskStats(); + android.hardware.health.HealthInfo getHealthInfo(); + void setChargingPolicy(android.hardware.health.BatteryChargingPolicy in_value); + android.hardware.health.BatteryChargingPolicy getChargingPolicy(); + android.hardware.health.BatteryHealthData getBatteryHealthData(); + const int STATUS_UNKNOWN = 2; + const int STATUS_CALLBACK_DIED = 4; +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/IHealthInfoCallback.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/IHealthInfoCallback.aidl new file mode 100644 index 0000000000..1b6366fa7a --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/IHealthInfoCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@VintfStability +interface IHealthInfoCallback { + oneway void healthInfoChanged(in android.hardware.health.HealthInfo info); +} diff --git a/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/StorageInfo.aidl b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/StorageInfo.aidl new file mode 100644 index 0000000000..eaae5a6110 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/2/android/hardware/health/StorageInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.health; +@VintfStability +parcelable StorageInfo { + int eol; + int lifetimeA; + int lifetimeB; + String version; +} diff --git a/identity/aidl/Android.bp b/identity/aidl/Android.bp index 6a25e628dc..da70406055 100644 --- a/identity/aidl/Android.bp +++ b/identity/aidl/Android.bp @@ -18,7 +18,7 @@ aidl_interface { "android.hardware.security.rkp-V3", ], stability: "vintf", - frozen: false, + frozen: true, backend: { java: { platform_apis: true, @@ -56,6 +56,13 @@ aidl_interface { "android.hardware.security.rkp-V3", ], }, + { + version: "5", + imports: [ + "android.hardware.keymaster-V3", + "android.hardware.security.rkp-V3", + ], + }, ], diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/.hash b/identity/aidl/aidl_api/android.hardware.identity/5/.hash new file mode 100644 index 0000000000..158dc4fbbd --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/.hash @@ -0,0 +1 @@ +63f77d853b84219479b25418b1ce6fd1553f30db diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/Certificate.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/Certificate.aidl new file mode 100644 index 0000000000..83e1797386 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/Certificate.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable Certificate { + byte[] encodedCertificate; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/CipherSuite.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/CipherSuite.aidl new file mode 100644 index 0000000000..e6ec04e805 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/CipherSuite.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@Backing(type="int") @VintfStability +enum CipherSuite { + CIPHERSUITE_ECDHE_HKDF_ECDSA_WITH_AES_256_GCM_SHA256 = 1, +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/HardwareInformation.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/HardwareInformation.aidl new file mode 100644 index 0000000000..9b96ea8a68 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/HardwareInformation.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable HardwareInformation { + @utf8InCpp String credentialStoreName; + @utf8InCpp String credentialStoreAuthorName; + int dataChunkSize; + boolean isDirectAccess; + @utf8InCpp String[] supportedDocTypes; + boolean isRemoteKeyProvisioningSupported = false; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IIdentityCredential.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IIdentityCredential.aidl new file mode 100644 index 0000000000..4f2fe0bbe2 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IIdentityCredential.aidl @@ -0,0 +1,55 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IIdentityCredential { + /** + * @deprecated use deleteCredentalWithChallenge() instead. + */ + byte[] deleteCredential(); + byte[] createEphemeralKeyPair(); + void setReaderEphemeralPublicKey(in byte[] publicKey); + long createAuthChallenge(); + void startRetrieval(in android.hardware.identity.SecureAccessControlProfile[] accessControlProfiles, in android.hardware.keymaster.HardwareAuthToken authToken, in byte[] itemsRequest, in byte[] signingKeyBlob, in byte[] sessionTranscript, in byte[] readerSignature, in int[] requestCounts); + void startRetrieveEntryValue(in @utf8InCpp String nameSpace, in @utf8InCpp String name, in int entrySize, in int[] accessControlProfileIds); + byte[] retrieveEntryValue(in byte[] encryptedContent); + @SuppressWarnings(value={"out-array"}) void finishRetrieval(out byte[] mac, out byte[] deviceNameSpaces); + @SuppressWarnings(value={"out-array"}) android.hardware.identity.Certificate generateSigningKeyPair(out byte[] signingKeyBlob); + void setRequestedNamespaces(in android.hardware.identity.RequestNamespace[] requestNamespaces); + void setVerificationToken(in android.hardware.keymaster.VerificationToken verificationToken); + byte[] deleteCredentialWithChallenge(in byte[] challenge); + byte[] proveOwnership(in byte[] challenge); + android.hardware.identity.IWritableIdentityCredential updateCredential(); + @SuppressWarnings(value={"out-array"}) void finishRetrievalWithSignature(out byte[] mac, out byte[] deviceNameSpaces, out byte[] ecdsaSignature); +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IIdentityCredentialStore.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IIdentityCredentialStore.aidl new file mode 100644 index 0000000000..31ca8b10f3 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IIdentityCredentialStore.aidl @@ -0,0 +1,55 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IIdentityCredentialStore { + android.hardware.identity.HardwareInformation getHardwareInformation(); + android.hardware.identity.IWritableIdentityCredential createCredential(in @utf8InCpp String docType, in boolean testCredential); + android.hardware.identity.IIdentityCredential getCredential(in android.hardware.identity.CipherSuite cipherSuite, in byte[] credentialData); + android.hardware.identity.IPresentationSession createPresentationSession(in android.hardware.identity.CipherSuite cipherSuite); + android.hardware.security.keymint.IRemotelyProvisionedComponent getRemotelyProvisionedComponent(); + const int STATUS_OK = 0; + const int STATUS_FAILED = 1; + const int STATUS_CIPHER_SUITE_NOT_SUPPORTED = 2; + const int STATUS_INVALID_DATA = 3; + const int STATUS_INVALID_AUTH_TOKEN = 4; + const int STATUS_INVALID_ITEMS_REQUEST_MESSAGE = 5; + const int STATUS_READER_SIGNATURE_CHECK_FAILED = 6; + const int STATUS_EPHEMERAL_PUBLIC_KEY_NOT_FOUND = 7; + const int STATUS_USER_AUTHENTICATION_FAILED = 8; + const int STATUS_READER_AUTHENTICATION_FAILED = 9; + const int STATUS_NO_ACCESS_CONTROL_PROFILES = 10; + const int STATUS_NOT_IN_REQUEST_MESSAGE = 11; + const int STATUS_SESSION_TRANSCRIPT_MISMATCH = 12; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IPresentationSession.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IPresentationSession.aidl new file mode 100644 index 0000000000..705dc292c5 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IPresentationSession.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IPresentationSession { + byte[] getEphemeralKeyPair(); + long getAuthChallenge(); + void setReaderEphemeralPublicKey(in byte[] publicKey); + void setSessionTranscript(in byte[] sessionTranscript); + android.hardware.identity.IIdentityCredential getCredential(in byte[] credentialData); +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IWritableIdentityCredential.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IWritableIdentityCredential.aidl new file mode 100644 index 0000000000..5377349a52 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/IWritableIdentityCredential.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IWritableIdentityCredential { + android.hardware.identity.Certificate[] getAttestationCertificate(in byte[] attestationApplicationId, in byte[] attestationChallenge); + void startPersonalization(in int accessControlProfileCount, in int[] entryCounts); + android.hardware.identity.SecureAccessControlProfile addAccessControlProfile(in int id, in android.hardware.identity.Certificate readerCertificate, in boolean userAuthenticationRequired, in long timeoutMillis, in long secureUserId); + void beginAddEntry(in int[] accessControlProfileIds, in @utf8InCpp String nameSpace, in @utf8InCpp String name, in int entrySize); + byte[] addEntryValue(in byte[] content); + @SuppressWarnings(value={"out-array"}) void finishAddingEntries(out byte[] credentialData, out byte[] proofOfProvisioningSignature); + void setExpectedProofOfProvisioningSize(in int expectedProofOfProvisioningSize); + void setRemotelyProvisionedAttestationKey(in byte[] attestationKeyBlob, in byte[] attestationCertificate); +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/RequestDataItem.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/RequestDataItem.aidl new file mode 100644 index 0000000000..cec8e0c94d --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/RequestDataItem.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable RequestDataItem { + @utf8InCpp String name; + long size; + int[] accessControlProfileIds; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/RequestNamespace.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/RequestNamespace.aidl new file mode 100644 index 0000000000..05b9ec295f --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/RequestNamespace.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable RequestNamespace { + @utf8InCpp String namespaceName; + android.hardware.identity.RequestDataItem[] items; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/SecureAccessControlProfile.aidl b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/SecureAccessControlProfile.aidl new file mode 100644 index 0000000000..2003594eb4 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/5/android/hardware/identity/SecureAccessControlProfile.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable SecureAccessControlProfile { + int id; + android.hardware.identity.Certificate readerCertificate; + boolean userAuthenticationRequired; + long timeoutMillis; + long secureUserId; + byte[] mac; +} diff --git a/input/classifier/1.0/vts/functional/Android.bp b/input/classifier/1.0/vts/functional/Android.bp index 5ff1457dcd..22346ed8b4 100644 --- a/input/classifier/1.0/vts/functional/Android.bp +++ b/input/classifier/1.0/vts/functional/Android.bp @@ -25,6 +25,7 @@ package { cc_test { name: "VtsHalInputClassifierV1_0TargetTest", + cpp_std: "c++20", defaults: ["VtsHalTargetTestDefaults"], srcs: [ ":inputconstants_aidl", diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp index 5aa820c3b6..95a14b286b 100644 --- a/input/common/aidl/Android.bp +++ b/input/common/aidl/Android.bp @@ -12,7 +12,6 @@ aidl_interface { host_supported: true, vendor_available: true, srcs: ["android/hardware/input/common/*.aidl"], - frozen: true, stability: "vintf", backend: { cpp: { diff --git a/keymaster/aidl/Android.bp b/keymaster/aidl/Android.bp index a3800c1105..0f2debdfaa 100644 --- a/keymaster/aidl/Android.bp +++ b/keymaster/aidl/Android.bp @@ -32,5 +32,11 @@ aidl_interface { version: "3", imports: [], }, + { + version: "4", + imports: [], + }, + ], + frozen: true, } diff --git a/keymaster/aidl/aidl_api/android.hardware.keymaster/4/.hash b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/.hash new file mode 100644 index 0000000000..cfa2965ba0 --- /dev/null +++ b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/.hash @@ -0,0 +1 @@ +d60ca1bb57f94508910cac7b8910c85e2a49a11f diff --git a/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/HardwareAuthToken.aidl b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/HardwareAuthToken.aidl new file mode 100644 index 0000000000..6e84e98628 --- /dev/null +++ b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/HardwareAuthToken.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.keymaster; +/* @hide */ +@VintfStability +parcelable HardwareAuthToken { + long challenge; + long userId; + long authenticatorId; + android.hardware.keymaster.HardwareAuthenticatorType authenticatorType = android.hardware.keymaster.HardwareAuthenticatorType.NONE; + android.hardware.keymaster.Timestamp timestamp; + byte[] mac; +} diff --git a/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/HardwareAuthenticatorType.aidl b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/HardwareAuthenticatorType.aidl new file mode 100644 index 0000000000..9526bed622 --- /dev/null +++ b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/HardwareAuthenticatorType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.keymaster; +/* @hide */ +@Backing(type="int") @VintfStability +enum HardwareAuthenticatorType { + NONE = 0, + PASSWORD = (1 << 0) /* 1 */, + FINGERPRINT = (1 << 1) /* 2 */, + ANY = 0xFFFFFFFF, +} diff --git a/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/SecurityLevel.aidl b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/SecurityLevel.aidl new file mode 100644 index 0000000000..d32ef6882c --- /dev/null +++ b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/SecurityLevel.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.keymaster; +/* @hide */ +@Backing(type="int") @VintfStability +enum SecurityLevel { + SOFTWARE = 0, + TRUSTED_ENVIRONMENT = 1, + STRONGBOX = 2, +} diff --git a/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/Timestamp.aidl b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/Timestamp.aidl new file mode 100644 index 0000000000..5b7b37affa --- /dev/null +++ b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/Timestamp.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.keymaster; +/* @hide */ +@VintfStability +parcelable Timestamp { + long milliSeconds; +} diff --git a/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/VerificationToken.aidl b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/VerificationToken.aidl new file mode 100644 index 0000000000..10fa5e11f5 --- /dev/null +++ b/keymaster/aidl/aidl_api/android.hardware.keymaster/4/android/hardware/keymaster/VerificationToken.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.keymaster; +/* @hide */ +@VintfStability +parcelable VerificationToken { + long challenge; + android.hardware.keymaster.Timestamp timestamp; + android.hardware.keymaster.SecurityLevel securityLevel = android.hardware.keymaster.SecurityLevel.SOFTWARE; + byte[] mac; +} diff --git a/media/bufferpool/aidl/Android.bp b/media/bufferpool/aidl/Android.bp index b01cdbecdc..8caf525ffe 100644 --- a/media/bufferpool/aidl/Android.bp +++ b/media/bufferpool/aidl/Android.bp @@ -47,4 +47,15 @@ aidl_interface { min_sdk_version: "29", }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + }, + ], + frozen: true, + } diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/.hash b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/.hash new file mode 100644 index 0000000000..f59137745c --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/.hash @@ -0,0 +1 @@ +b44598709e65cdb5184a8956aac5495b5dec6c0a diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/Buffer.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/Buffer.aidl new file mode 100644 index 0000000000..4ea0bba7fc --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/Buffer.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@VintfStability +parcelable Buffer { + int id; + android.hardware.common.NativeHandle buffer; +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferInvalidationMessage.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferInvalidationMessage.aidl new file mode 100644 index 0000000000..181286c197 --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferInvalidationMessage.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@FixedSize @VintfStability +parcelable BufferInvalidationMessage { + int messageId; + int fromBufferId; + int toBufferId; +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferStatus.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferStatus.aidl new file mode 100644 index 0000000000..13174ffe09 --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferStatus.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@Backing(type="int") @VintfStability +enum BufferStatus { + NOT_USED = 0, + USED = 1, + TRANSFER_TO = 2, + TRANSFER_FROM = 3, + TRANSFER_TIMEOUT = 4, + TRANSFER_LOST = 5, + TRANSFER_FETCH = 6, + TRANSFER_OK = 7, + TRANSFER_ERROR = 8, + INVALIDATION_ACK = 9, +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferStatusMessage.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferStatusMessage.aidl new file mode 100644 index 0000000000..7e79a368d1 --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/BufferStatusMessage.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@FixedSize @VintfStability +parcelable BufferStatusMessage { + long transactionId; + int bufferId; + android.hardware.media.bufferpool2.BufferStatus status; + long connectionId; + long targetConnectionId; + long timestampUs; +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IAccessor.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IAccessor.aidl new file mode 100644 index 0000000000..4053797dcf --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IAccessor.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@VintfStability +interface IAccessor { + android.hardware.media.bufferpool2.IAccessor.ConnectionInfo connect(in android.hardware.media.bufferpool2.IObserver observer); + @VintfStability + parcelable ConnectionInfo { + android.hardware.media.bufferpool2.IConnection connection; + long connectionId; + int msgId; + android.hardware.common.fmq.MQDescriptor toFmqDesc; + android.hardware.common.fmq.MQDescriptor fromFmqDesc; + } +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IClientManager.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IClientManager.aidl new file mode 100644 index 0000000000..5899a403a6 --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IClientManager.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@VintfStability +interface IClientManager { + android.hardware.media.bufferpool2.IClientManager.Registration registerSender(in android.hardware.media.bufferpool2.IAccessor bufferPool); + @VintfStability + parcelable Registration { + long connectionId; + boolean isNew = true; + } +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IConnection.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IConnection.aidl new file mode 100644 index 0000000000..844e920df0 --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IConnection.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@VintfStability +interface IConnection { + android.hardware.media.bufferpool2.IConnection.FetchResult[] fetch(in android.hardware.media.bufferpool2.IConnection.FetchInfo[] fetchInfos); + void sync(); + parcelable FetchInfo { + long transactionId; + int bufferId; + } + union FetchResult { + android.hardware.media.bufferpool2.Buffer buffer; + int failure; + } +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IObserver.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IObserver.aidl new file mode 100644 index 0000000000..2d8cffe70c --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/IObserver.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@VintfStability +interface IObserver { + oneway void onMessage(in long connectionId, in int msgId); +} diff --git a/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/ResultStatus.aidl b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/ResultStatus.aidl new file mode 100644 index 0000000000..4bc3889e3f --- /dev/null +++ b/media/bufferpool/aidl/aidl_api/android.hardware.media.bufferpool2/1/android/hardware/media/bufferpool2/ResultStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.bufferpool2; +@VintfStability +parcelable ResultStatus { + const int OK = 0; + const int NO_MEMORY = 1; + const int ALREADY_EXISTS = 2; + const int NOT_FOUND = 3; + const int CRITICAL_ERROR = 4; +} diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 1347f60580..f0b458a0f4 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -25,7 +25,10 @@ package { cc_defaults { name: "neuralnetworks_utils_hal_aidl_defaults", - defaults: ["neuralnetworks_utils_defaults"], + defaults: [ + "android.hardware.graphics.common-ndk_static", + "neuralnetworks_utils_defaults", + ], srcs: [ // AIDL utils that a driver may depend on. "src/BufferTracker.cpp", @@ -38,7 +41,6 @@ cc_defaults { export_include_dirs: ["include"], cflags: ["-Wthread-safety"], static_libs: [ - "android.hardware.graphics.common-V4-ndk", "libaidlcommonsupport", "libarect", "neuralnetworks_types", @@ -90,9 +92,9 @@ cc_library_static { // AIDL features can include this cc_defaults to avoid managing dependency versions explicitly. cc_defaults { name: "neuralnetworks_use_latest_utils_hal_aidl", + defaults: ["android.hardware.graphics.common-ndk_static"], static_libs: [ "android.hardware.common-V2-ndk", - "android.hardware.graphics.common-V4-ndk", "android.hardware.neuralnetworks-V4-ndk", "neuralnetworks_utils_hal_aidl", ], diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp index 70b1203031..082572d34c 100644 --- a/power/aidl/Android.bp +++ b/power/aidl/Android.bp @@ -49,7 +49,12 @@ aidl_interface { version: "3", imports: [], }, + { + version: "4", + imports: [], + }, ], + frozen: true, } diff --git a/power/aidl/aidl_api/android.hardware.power/4/.hash b/power/aidl/aidl_api/android.hardware.power/4/.hash new file mode 100644 index 0000000000..10f7e2cd2f --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/.hash @@ -0,0 +1 @@ +141ac3bb33bb4f524de020669f12599c18cdd67f diff --git a/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/Boost.aidl b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/Boost.aidl new file mode 100644 index 0000000000..8ee15eff7f --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/Boost.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@Backing(type="int") @VintfStability +enum Boost { + INTERACTION, + DISPLAY_UPDATE_IMMINENT, + ML_ACC, + AUDIO_LAUNCH, + CAMERA_LAUNCH, + CAMERA_SHOT, +} diff --git a/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/IPower.aidl b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/IPower.aidl new file mode 100644 index 0000000000..ae03313f11 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/IPower.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@VintfStability +interface IPower { + oneway void setMode(in android.hardware.power.Mode type, in boolean enabled); + boolean isModeSupported(in android.hardware.power.Mode type); + oneway void setBoost(in android.hardware.power.Boost type, in int durationMs); + boolean isBoostSupported(in android.hardware.power.Boost type); + android.hardware.power.IPowerHintSession createHintSession(in int tgid, in int uid, in int[] threadIds, in long durationNanos); + long getHintSessionPreferredRate(); +} diff --git a/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/IPowerHintSession.aidl new file mode 100644 index 0000000000..e6809da92c --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/IPowerHintSession.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@VintfStability +interface IPowerHintSession { + oneway void updateTargetWorkDuration(long targetDurationNanos); + oneway void reportActualWorkDuration(in android.hardware.power.WorkDuration[] durations); + oneway void pause(); + oneway void resume(); + oneway void close(); + oneway void sendHint(android.hardware.power.SessionHint hint); + void setThreads(in int[] threadIds); +} diff --git a/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/Mode.aidl b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/Mode.aidl new file mode 100644 index 0000000000..efbb300f8d --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/Mode.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@Backing(type="int") @VintfStability +enum Mode { + DOUBLE_TAP_TO_WAKE, + LOW_POWER, + SUSTAINED_PERFORMANCE, + FIXED_PERFORMANCE, + VR, + LAUNCH, + EXPENSIVE_RENDERING, + INTERACTIVE, + DEVICE_IDLE, + DISPLAY_INACTIVE, + AUDIO_STREAMING_LOW_LATENCY, + CAMERA_STREAMING_SECURE, + CAMERA_STREAMING_LOW, + CAMERA_STREAMING_MID, + CAMERA_STREAMING_HIGH, + GAME, + GAME_LOADING, +} diff --git a/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/SessionHint.aidl b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/SessionHint.aidl new file mode 100644 index 0000000000..9c1f381543 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/SessionHint.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@Backing(type="int") @VintfStability +enum SessionHint { + CPU_LOAD_UP = 0, + CPU_LOAD_DOWN = 1, + CPU_LOAD_RESET = 2, + CPU_LOAD_RESUME = 3, + POWER_EFFICIENCY = 4, +} diff --git a/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/WorkDuration.aidl b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/WorkDuration.aidl new file mode 100644 index 0000000000..e86cd40ec2 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/4/android/hardware/power/WorkDuration.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@VintfStability +parcelable WorkDuration { + long timeStampNanos; + long durationNanos; +} diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl index 1d3ecb7eee..e6809da92c 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl @@ -39,4 +39,6 @@ interface IPowerHintSession { oneway void pause(); oneway void resume(); oneway void close(); + oneway void sendHint(android.hardware.power.SessionHint hint); + void setThreads(in int[] threadIds); } 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 new file mode 100644 index 0000000000..9c1f381543 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@Backing(type="int") @VintfStability +enum SessionHint { + CPU_LOAD_UP = 0, + CPU_LOAD_DOWN = 1, + CPU_LOAD_RESET = 2, + CPU_LOAD_RESUME = 3, + POWER_EFFICIENCY = 4, +} diff --git a/power/aidl/android/hardware/power/IPowerHintSession.aidl b/power/aidl/android/hardware/power/IPowerHintSession.aidl index c289448855..7db0ea1d54 100644 --- a/power/aidl/android/hardware/power/IPowerHintSession.aidl +++ b/power/aidl/android/hardware/power/IPowerHintSession.aidl @@ -16,10 +16,11 @@ package android.hardware.power; +import android.hardware.power.SessionHint; import android.hardware.power.WorkDuration; @VintfStability -oneway interface IPowerHintSession { +interface IPowerHintSession { /** * Updates the desired duration of a previously-created thread group. * @@ -28,7 +29,7 @@ oneway interface IPowerHintSession { * * @param targetDurationNanos the new desired duration in nanoseconds */ - void updateTargetWorkDuration(long targetDurationNanos); + oneway void updateTargetWorkDuration(long targetDurationNanos); /** * Reports the actual duration of a thread group. @@ -40,20 +41,44 @@ oneway interface IPowerHintSession { * @param actualDurationMicros how long the thread group took to complete its * last task in nanoseconds */ - void reportActualWorkDuration(in WorkDuration[] durations); + oneway void reportActualWorkDuration(in WorkDuration[] durations); /** * Pause the session when the application is not allowed to send hint in framework. */ - void pause(); + oneway void pause(); /** * Resume the session when the application is allowed to send hint in framework. */ - void resume(); + oneway void resume(); /** * Close the session to release resources. */ - void close(); + oneway void close(); + + /** + * Gives information to the PowerHintSession about upcoming or unexpected + * changes in load to supplement the normal updateTarget/reportActual cycle. + * + * @param hint The hint to provide to the PowerHintSession + */ + oneway void sendHint(SessionHint hint); + + /** + * Sets a list of threads to the power hint session. This operation will replace + * the current list of threads with the given list of threads. If there's already + * boost for the replaced threads, a reset must be performed for the replaced + * threads. Note that this is not an oneway method. + * + * @param threadIds The list of threads to be associated + * with this session. + * + * @throws ScopedAStatus Status of the operation. If status code is not + * STATUS_OK, getMessage() must be populated with the human-readable + * error message. If the list of thread ids is empty, EX_ILLEGAL_ARGUMENT + * must be thrown. + */ + void setThreads(in int[] threadIds); } diff --git a/power/aidl/android/hardware/power/SessionHint.aidl b/power/aidl/android/hardware/power/SessionHint.aidl new file mode 100644 index 0000000000..a172e12746 --- /dev/null +++ b/power/aidl/android/hardware/power/SessionHint.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.power; + +@VintfStability +@Backing(type="int") +enum SessionHint { + /** + * This hint indicates an increase in CPU workload intensity. It means that + * this hint session needs extra CPU resources to meet the target duration. + * This hint must be sent before reporting the actual duration to the session. + */ + CPU_LOAD_UP = 0, + + /** + * This hint indicates a decrease in CPU workload intensity. It means that + * this hint session can reduce CPU resources and still meet the target duration. + */ + CPU_LOAD_DOWN = 1, + + /** + * This hint indicates an upcoming CPU workload that is completely changed and + * unknown. It means that the hint session should reset CPU resources to a known + * baseline to prepare for an arbitrary load, and must wake up if inactive. + */ + CPU_LOAD_RESET = 2, + + /** + * This hint indicates that the most recent CPU workload is resuming after a + * period of inactivity. It means that the hint session should allocate similar + * CPU resources to what was used previously, and must wake up if inactive. + */ + CPU_LOAD_RESUME = 3, + + /** + * This hint indicates that this power hint session should be applied with a + * power-efficient-first scheduling strategy. This means the work of this + * power hint session is noncritical despite its CPU intensity. + */ + POWER_EFFICIENCY = 4, +} diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp index b321394c12..da91ee6690 100644 --- a/power/aidl/default/Android.bp +++ b/power/aidl/default/Android.bp @@ -30,7 +30,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.power-V3-ndk", + "android.hardware.power-V4-ndk", ], srcs: [ "main.cpp", diff --git a/power/aidl/default/PowerHintSession.cpp b/power/aidl/default/PowerHintSession.cpp index 17fd26aeed..f395800e8c 100644 --- a/power/aidl/default/PowerHintSession.cpp +++ b/power/aidl/default/PowerHintSession.cpp @@ -47,4 +47,16 @@ ScopedAStatus PowerHintSession::close() { return ScopedAStatus::ok(); } +ScopedAStatus PowerHintSession::sendHint(SessionHint /* hint */) { + return ScopedAStatus::ok(); +} + +ScopedAStatus PowerHintSession::setThreads(const std::vector& threadIds) { + if (threadIds.size() == 0) { + LOG(ERROR) << "Error: threadIds.size() shouldn't be " << threadIds.size(); + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + return ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::power::impl::example diff --git a/power/aidl/default/PowerHintSession.h b/power/aidl/default/PowerHintSession.h index b7bf54ce23..1d74716461 100644 --- a/power/aidl/default/PowerHintSession.h +++ b/power/aidl/default/PowerHintSession.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include namespace aidl::android::hardware::power::impl::example { @@ -30,6 +31,8 @@ class PowerHintSession : public BnPowerHintSession { ndk::ScopedAStatus pause() override; ndk::ScopedAStatus resume() override; ndk::ScopedAStatus close() override; + ndk::ScopedAStatus sendHint(SessionHint hint) override; + ndk::ScopedAStatus setThreads(const std::vector& threadIds) override; }; } // namespace aidl::android::hardware::power::impl::example diff --git a/power/aidl/default/power-default.xml b/power/aidl/default/power-default.xml index 927ba22dbf..f5dd6b957c 100644 --- a/power/aidl/default/power-default.xml +++ b/power/aidl/default/power-default.xml @@ -1,7 +1,7 @@ android.hardware.power - 3 + 4 IPower/default diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp index 4e8f517950..56c98bd2d8 100644 --- a/power/aidl/vts/Android.bp +++ b/power/aidl/vts/Android.bp @@ -32,7 +32,7 @@ cc_test { "libbinder_ndk", ], static_libs: [ - "android.hardware.power-V3-ndk", + "android.hardware.power-V4-ndk", ], test_suites: [ "general-tests", diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp index b81dd8f669..c2216f8cf6 100644 --- a/power/aidl/vts/VtsHalPowerTargetTest.cpp +++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp @@ -34,12 +34,16 @@ using android::hardware::power::Boost; using android::hardware::power::IPower; using android::hardware::power::IPowerHintSession; using android::hardware::power::Mode; +using android::hardware::power::SessionHint; using android::hardware::power::WorkDuration; const std::vector kBoosts{ndk::enum_range().begin(), ndk::enum_range().end()}; const std::vector kModes{ndk::enum_range().begin(), ndk::enum_range().end()}; +const std::vector kSessionHints{ndk::enum_range().begin(), + ndk::enum_range().end()}; + const std::vector kInvalidBoosts = { static_cast(static_cast(kBoosts.front()) - 1), static_cast(static_cast(kBoosts.back()) + 1), @@ -50,6 +54,11 @@ const std::vector kInvalidModes = { static_cast(static_cast(kModes.back()) + 1), }; +const std::vector kInvalidSessionHints = { + static_cast(static_cast(kSessionHints.front()) - 1), + static_cast(static_cast(kSessionHints.back()) + 1), +}; + class DurationWrapper : public WorkDuration { public: DurationWrapper(int64_t dur, int64_t time) { @@ -91,6 +100,10 @@ const uint64_t kCompatibilityMatrix5ApiLevel = 30; // target-level=7 compatibility_matrix file. const uint64_t kCompatibilityMatrix7ApiLevel = 33; +// DEVICEs launching with Android 14 MUST meet the requirements for the +// target-level=8 compatibility_matrix file. +const uint64_t kCompatibilityMatrix8ApiLevel = 34; + inline bool isUnknownOrUnsupported(const ndk::ScopedAStatus& status) { return status.getStatus() == STATUS_UNKNOWN_TRANSACTION || status.getExceptionCode() == EX_UNSUPPORTED_OPERATION; @@ -218,6 +231,41 @@ TEST_P(PowerAidl, updateAndReportDurations) { ASSERT_TRUE(session->reportActualWorkDuration(kDurations).isOk()); } +TEST_P(PowerAidl, sendSessionHint) { + std::shared_ptr session; + auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session); + if (!status.isOk()) { + EXPECT_TRUE(isUnknownOrUnsupported(status)); + return; + } + for (const auto& sessionHint : kSessionHints) { + ASSERT_TRUE(session->sendHint(sessionHint).isOk()); + } + for (const auto& sessionHint : kInvalidSessionHints) { + ASSERT_TRUE(session->sendHint(sessionHint).isOk()); + } +} + +TEST_P(PowerAidl, setThreads) { + std::shared_ptr session; + auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session); + if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) { + EXPECT_TRUE(isUnknownOrUnsupported(status)); + GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond."; + } + ASSERT_TRUE(status.isOk()); + + status = session->setThreads(kEmptyTids); + if (mApiLevel < kCompatibilityMatrix8ApiLevel && isUnknownOrUnsupported(status)) { + GTEST_SKIP() << "DEVICE not launching with Android 14 and beyond."; + } + ASSERT_FALSE(status.isOk()); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + + status = session->setThreads(kSelfTids); + ASSERT_TRUE(status.isOk()); +} + // FIXED_PERFORMANCE mode is required for all devices which ship on Android 11 // or later TEST_P(PowerAidl, hasFixedPerformance) { @@ -236,6 +284,7 @@ INSTANTIATE_TEST_SUITE_P(Power, PowerAidl, ::android::PrintInstanceNameToString); } // namespace +} // namespace aidl::android::hardware::power int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); @@ -243,5 +292,3 @@ int main(int argc, char** argv) { ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); } - -} // namespace aidl::android::hardware::power diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index 08bcc289e0..09f845b8ab 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -16,7 +16,7 @@ aidl_interface { stability: "vintf", backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -27,6 +27,11 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], } @@ -38,10 +43,10 @@ aidl_interface { srcs: ["android/hardware/radio/config/*.aidl"], frozen: true, stability: "vintf", - imports: ["android.hardware.radio-V1"], + imports: ["android.hardware.radio-V2"], backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -52,6 +57,11 @@ aidl_interface { version: "1", imports: ["android.hardware.radio-V1"], }, + { + version: "2", + imports: ["android.hardware.radio-V2"], + }, + ], } @@ -62,10 +72,10 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/data/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V1"], + imports: ["android.hardware.radio-V2"], backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -76,7 +86,13 @@ aidl_interface { version: "1", imports: ["android.hardware.radio-V1"], }, + { + version: "2", + imports: ["android.hardware.radio-V2"], + }, + ], + frozen: true, } @@ -86,10 +102,10 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/messaging/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V1"], + imports: ["android.hardware.radio-V2"], backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -100,7 +116,13 @@ aidl_interface { version: "1", imports: ["android.hardware.radio-V1"], }, + { + version: "2", + imports: ["android.hardware.radio-V2"], + }, + ], + frozen: true, } @@ -110,10 +132,10 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/modem/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V1"], + imports: ["android.hardware.radio-V2"], backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -124,7 +146,13 @@ aidl_interface { version: "1", imports: ["android.hardware.radio-V1"], }, + { + version: "2", + imports: ["android.hardware.radio-V2"], + }, + ], + frozen: true, } @@ -134,10 +162,10 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/network/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V1"], + imports: ["android.hardware.radio-V2"], backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -148,7 +176,13 @@ aidl_interface { version: "1", imports: ["android.hardware.radio-V1"], }, + { + version: "2", + imports: ["android.hardware.radio-V2"], + }, + ], + frozen: true, } @@ -171,6 +205,13 @@ aidl_interface { min_sdk_version: "Tiramisu", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, } @@ -181,12 +222,12 @@ aidl_interface { srcs: ["android/hardware/radio/sim/*.aidl"], stability: "vintf", imports: [ - "android.hardware.radio-V1", - "android.hardware.radio.config-V1", + "android.hardware.radio-V2", + "android.hardware.radio.config-V2", ], backend: { cpp: { - enabled: false, + enabled: true, }, java: { sdk_version: "module_current", @@ -200,7 +241,16 @@ aidl_interface { "android.hardware.radio.config-V1", ], }, + { + version: "2", + imports: [ + "android.hardware.radio-V2", + "android.hardware.radio.config-V2", + ], + }, + ], + frozen: true, } @@ -210,7 +260,39 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/voice/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V1"], + imports: ["android.hardware.radio-V2"], + backend: { + cpp: { + enabled: true, + }, + java: { + sdk_version: "module_current", + }, + }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + { + version: "2", + imports: ["android.hardware.radio-V2"], + }, + + ], + frozen: true, + +} + +aidl_interface { + name: "android.hardware.radio.ims.media", + vendor_available: true, + srcs: ["android/hardware/radio/ims/media/*.aidl"], + stability: "vintf", + imports: [ + "android.hardware.radio-V2", + "android.hardware.radio.data-V2", + ], backend: { cpp: { enabled: false, @@ -222,8 +304,36 @@ aidl_interface { versions_with_info: [ { version: "1", - imports: ["android.hardware.radio-V1"], + imports: [ + "android.hardware.radio-V2", + "android.hardware.radio.data-V2", + ], }, ], + frozen: true, + +} + +aidl_interface { + name: "android.hardware.radio.ims", + vendor_available: true, + srcs: ["android/hardware/radio/ims/*.aidl"], + stability: "vintf", + imports: ["android.hardware.radio-V2"], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + }, + }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V2"], + }, + ], + frozen: true, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.config/2/.hash new file mode 100644 index 0000000000..a3998322b3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/.hash @@ -0,0 +1 @@ +0be135cf3de9586d6aabb58cb6af0ba425431743 diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfig.aidl new file mode 100644 index 0000000000..a48a89b458 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfig.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * This interface is used by telephony and telecom to talk to cellular radio for the purpose of + * radio configuration, and it is not associated with any specific modem or slot. + * All the functions have minimum one parameter: + * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the + * duration of a method call. If clients provide colliding serials (including passing the same + * serial to different methods), multiple responses (one for each method call) must still be served. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@VintfStability +interface IRadioConfig { + oneway void getHalDeviceCapabilities(in int serial); + oneway void getNumOfLiveModems(in int serial); + oneway void getPhoneCapability(in int serial); + oneway void getSimSlotsStatus(in int serial); + oneway void setNumOfLiveModems(in int serial, in byte numOfLiveModems); + oneway void setPreferredDataModem(in int serial, in byte modemId); + 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); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfigIndication.aidl new file mode 100644 index 0000000000..994e337c04 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfigIndication.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@VintfStability +interface IRadioConfigIndication { + oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfigResponse.aidl new file mode 100644 index 0000000000..038b0aeb58 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@VintfStability +interface IRadioConfigResponse { + oneway void getHalDeviceCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in boolean modemReducedFeatureSet1); + oneway void getNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info, in byte numOfLiveModems); + oneway void getPhoneCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.PhoneCapability phoneCapability); + oneway void getSimSlotsStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.SimSlotStatus[] slotStatus); + oneway void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl new file mode 100644 index 0000000000..74017e407a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum MultipleEnabledProfilesMode { + NONE, + MEP_A1, + MEP_A2, + MEP_B, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/PhoneCapability.aidl new file mode 100644 index 0000000000..db3a4c65f3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/PhoneCapability.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@JavaDerive(toString=true) @VintfStability +parcelable PhoneCapability { + byte maxActiveData; + byte maxActiveInternetData; + boolean isInternetLingeringSupported; + byte[] logicalModemIds; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SimPortInfo.aidl new file mode 100644 index 0000000000..b5d31ada35 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SimPortInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@JavaDerive(toString=true) @VintfStability +parcelable SimPortInfo { + String iccId; + int logicalSlotId; + boolean portActive; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SimSlotStatus.aidl new file mode 100644 index 0000000000..c264dfd3cf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SimSlotStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@JavaDerive(toString=true) @VintfStability +parcelable SimSlotStatus { + int cardState; + String atr; + String eid; + android.hardware.radio.config.SimPortInfo[] portInfo; + android.hardware.radio.config.MultipleEnabledProfilesMode supportedMepMode = android.hardware.radio.config.MultipleEnabledProfilesMode.NONE; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SlotPortMapping.aidl new file mode 100644 index 0000000000..31271eed8d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/2/android/hardware/radio/config/SlotPortMapping.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@JavaDerive(toString=true) @VintfStability +parcelable SlotPortMapping { + int physicalSlotId; + int portId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl new file mode 100644 index 0000000000..74017e407a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum MultipleEnabledProfilesMode { + NONE, + MEP_A1, + MEP_A2, + MEP_B, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl index be4c08064a..c264dfd3cf 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl @@ -38,4 +38,5 @@ parcelable SimSlotStatus { String atr; String eid; android.hardware.radio.config.SimPortInfo[] portInfo; + android.hardware.radio.config.MultipleEnabledProfilesMode supportedMepMode = android.hardware.radio.config.MultipleEnabledProfilesMode.NONE; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.data/2/.hash new file mode 100644 index 0000000000..566a4752e1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/.hash @@ -0,0 +1 @@ +cb458326b02e0e87143f24118543e8cc7d6a9e8e diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/ApnAuthType.aidl new file mode 100644 index 0000000000..a33ad6e338 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/ApnAuthType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ApnAuthType { + NO_PAP_NO_CHAP, + PAP_NO_CHAP, + NO_PAP_CHAP, + PAP_CHAP, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/ApnTypes.aidl new file mode 100644 index 0000000000..9133c7b2cb --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/ApnTypes.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ApnTypes { + NONE = 0, + DEFAULT = (1 << 0) /* 1 */, + MMS = (1 << 1) /* 2 */, + SUPL = (1 << 2) /* 4 */, + DUN = (1 << 3) /* 8 */, + HIPRI = (1 << 4) /* 16 */, + FOTA = (1 << 5) /* 32 */, + IMS = (1 << 6) /* 64 */, + CBS = (1 << 7) /* 128 */, + IA = (1 << 8) /* 256 */, + EMERGENCY = (1 << 9) /* 512 */, + MCX = (1 << 10) /* 1024 */, + XCAP = (1 << 11) /* 2048 */, + VSIM = (1 << 12) /* 4096 */, + BIP = (1 << 13) /* 8192 */, + ENTERPRISE = (1 << 14) /* 16384 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataCallFailCause.aidl new file mode 100644 index 0000000000..28d122d986 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataCallFailCause.aidl @@ -0,0 +1,381 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum DataCallFailCause { + NONE = 0, + OPERATOR_BARRED = 0x08, + NAS_SIGNALLING = 0x0E, + INSUFFICIENT_RESOURCES = 0x1A, + MISSING_UNKNOWN_APN = 0x1B, + UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, + USER_AUTHENTICATION = 0x1D, + ACTIVATION_REJECT_GGSN = 0x1E, + ACTIVATION_REJECT_UNSPECIFIED = 0x1F, + SERVICE_OPTION_NOT_SUPPORTED = 0x20, + SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, + SERVICE_OPTION_OUT_OF_ORDER = 0x22, + NSAPI_IN_USE = 0x23, + REGULAR_DEACTIVATION = 0x24, + QOS_NOT_ACCEPTED = 0x25, + NETWORK_FAILURE = 0x26, + UMTS_REACTIVATION_REQ = 0x27, + FEATURE_NOT_SUPP = 0x28, + TFT_SEMANTIC_ERROR = 0x29, + TFT_SYTAX_ERROR = 0x2A, + UNKNOWN_PDP_CONTEXT = 0x2B, + FILTER_SEMANTIC_ERROR = 0x2C, + FILTER_SYTAX_ERROR = 0x2D, + PDP_WITHOUT_ACTIVE_TFT = 0x2E, + ONLY_IPV4_ALLOWED = 0x32, + ONLY_IPV6_ALLOWED = 0x33, + ONLY_SINGLE_BEARER_ALLOWED = 0x34, + ESM_INFO_NOT_RECEIVED = 0x35, + PDN_CONN_DOES_NOT_EXIST = 0x36, + MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37, + MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41, + UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42, + INVALID_TRANSACTION_ID = 0x51, + MESSAGE_INCORRECT_SEMANTIC = 0x5F, + INVALID_MANDATORY_INFO = 0x60, + MESSAGE_TYPE_UNSUPPORTED = 0x61, + MSG_TYPE_NONCOMPATIBLE_STATE = 0x62, + UNKNOWN_INFO_ELEMENT = 0x63, + CONDITIONAL_IE_ERROR = 0x64, + MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65, + PROTOCOL_ERRORS = 0x6F, + APN_TYPE_CONFLICT = 0x70, + INVALID_PCSCF_ADDR = 0x71, + INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72, + EMM_ACCESS_BARRED = 0x73, + EMERGENCY_IFACE_ONLY = 0x74, + IFACE_MISMATCH = 0x75, + COMPANION_IFACE_IN_USE = 0x76, + IP_ADDRESS_MISMATCH = 0x77, + IFACE_AND_POL_FAMILY_MISMATCH = 0x78, + EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79, + AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A, + OEM_DCFAILCAUSE_1 = 0x1001, + OEM_DCFAILCAUSE_2 = 0x1002, + OEM_DCFAILCAUSE_3 = 0x1003, + OEM_DCFAILCAUSE_4 = 0x1004, + OEM_DCFAILCAUSE_5 = 0x1005, + OEM_DCFAILCAUSE_6 = 0x1006, + OEM_DCFAILCAUSE_7 = 0x1007, + OEM_DCFAILCAUSE_8 = 0x1008, + OEM_DCFAILCAUSE_9 = 0x1009, + OEM_DCFAILCAUSE_10 = 0x100A, + OEM_DCFAILCAUSE_11 = 0x100B, + OEM_DCFAILCAUSE_12 = 0x100C, + OEM_DCFAILCAUSE_13 = 0x100D, + OEM_DCFAILCAUSE_14 = 0x100E, + OEM_DCFAILCAUSE_15 = 0x100F, + VOICE_REGISTRATION_FAIL = (-1) /* -1 */, + DATA_REGISTRATION_FAIL = (-2) /* -2 */, + SIGNAL_LOST = (-3) /* -3 */, + PREF_RADIO_TECH_CHANGED = (-4) /* -4 */, + RADIO_POWER_OFF = (-5) /* -5 */, + TETHERED_CALL_ACTIVE = (-6) /* -6 */, + ERROR_UNSPECIFIED = 0xffff, + LLC_SNDCP = 0x19, + ACTIVATION_REJECTED_BCM_VIOLATION = 0x30, + COLLISION_WITH_NETWORK_INITIATED_REQUEST = 0x38, + ONLY_IPV4V6_ALLOWED = 0x39, + ONLY_NON_IP_ALLOWED = 0x3A, + UNSUPPORTED_QCI_VALUE = 0x3B, + BEARER_HANDLING_NOT_SUPPORTED = 0x3C, + INVALID_DNS_ADDR = 0x7B, + INVALID_PCSCF_OR_DNS_ADDRESS = 0x7C, + CALL_PREEMPT_BY_EMERGENCY_APN = 0x7F, + UE_INITIATED_DETACH_OR_DISCONNECT = 0x80, + MIP_FA_REASON_UNSPECIFIED = 0x7D0, + MIP_FA_ADMIN_PROHIBITED = 0x7D1, + MIP_FA_INSUFFICIENT_RESOURCES = 0x7D2, + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7D3, + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 0x7D4, + MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 0x7D5, + MIP_FA_MALFORMED_REQUEST = 0x7D6, + MIP_FA_MALFORMED_REPLY = 0x7D7, + MIP_FA_ENCAPSULATION_UNAVAILABLE = 0x7D8, + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 0x7D9, + MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 0x7DA, + MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 0x7DB, + MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 0x7DC, + MIP_FA_MISSING_NAI = 0x7DD, + MIP_FA_MISSING_HOME_AGENT = 0x7DE, + MIP_FA_MISSING_HOME_ADDRESS = 0x7DF, + MIP_FA_UNKNOWN_CHALLENGE = 0x7E0, + MIP_FA_MISSING_CHALLENGE = 0x7E1, + MIP_FA_STALE_CHALLENGE = 0x7E2, + MIP_HA_REASON_UNSPECIFIED = 0x7E3, + MIP_HA_ADMIN_PROHIBITED = 0x7E4, + MIP_HA_INSUFFICIENT_RESOURCES = 0x7E5, + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7E6, + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 0x7E7, + MIP_HA_REGISTRATION_ID_MISMATCH = 0x7E8, + MIP_HA_MALFORMED_REQUEST = 0x7E9, + MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 0x7EA, + MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 0x7EB, + MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 0x7EC, + MIP_HA_ENCAPSULATION_UNAVAILABLE = 0x7ED, + CLOSE_IN_PROGRESS = 0x7EE, + NETWORK_INITIATED_TERMINATION = 0x7EF, + MODEM_APP_PREEMPTED = 0x7F0, + PDN_IPV4_CALL_DISALLOWED = 0x7F1, + PDN_IPV4_CALL_THROTTLED = 0x7F2, + PDN_IPV6_CALL_DISALLOWED = 0x7F3, + PDN_IPV6_CALL_THROTTLED = 0x7F4, + MODEM_RESTART = 0x7F5, + PDP_PPP_NOT_SUPPORTED = 0x7F6, + UNPREFERRED_RAT = 0x7F7, + PHYSICAL_LINK_CLOSE_IN_PROGRESS = 0x7F8, + APN_PENDING_HANDOVER = 0x7F9, + PROFILE_BEARER_INCOMPATIBLE = 0x7FA, + SIM_CARD_CHANGED = 0x7FB, + LOW_POWER_MODE_OR_POWERING_DOWN = 0x7FC, + APN_DISABLED = 0x7FD, + MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE, + IPV6_ADDRESS_TRANSFER_FAILED = 0x7FF, + TRAT_SWAP_FAILED = 0x800, + EHRPD_TO_HRPD_FALLBACK = 0x801, + MIP_CONFIG_FAILURE = 0x802, + PDN_INACTIVITY_TIMER_EXPIRED = 0x803, + MAX_IPV4_CONNECTIONS = 0x804, + MAX_IPV6_CONNECTIONS = 0x805, + APN_MISMATCH = 0x806, + IP_VERSION_MISMATCH = 0x807, + DUN_CALL_DISALLOWED = 0x808, + INTERNAL_EPC_NONEPC_TRANSITION = 0x809, + INTERFACE_IN_USE = 0x80A, + APN_DISALLOWED_ON_ROAMING = 0x80B, + APN_PARAMETERS_CHANGED = 0x80C, + NULL_APN_DISALLOWED = 0x80D, + THERMAL_MITIGATION = 0x80E, + DATA_SETTINGS_DISABLED = 0x80F, + DATA_ROAMING_SETTINGS_DISABLED = 0x810, + DDS_SWITCHED = 0x811, + FORBIDDEN_APN_NAME = 0x812, + DDS_SWITCH_IN_PROGRESS = 0x813, + CALL_DISALLOWED_IN_ROAMING = 0x814, + NON_IP_NOT_SUPPORTED = 0x815, + PDN_NON_IP_CALL_THROTTLED = 0x816, + PDN_NON_IP_CALL_DISALLOWED = 0x817, + CDMA_LOCK = 0x818, + CDMA_INTERCEPT = 0x819, + CDMA_REORDER = 0x81A, + CDMA_RELEASE_DUE_TO_SO_REJECTION = 0x81B, + CDMA_INCOMING_CALL = 0x81C, + CDMA_ALERT_STOP = 0x81D, + CHANNEL_ACQUISITION_FAILURE = 0x81E, + MAX_ACCESS_PROBE = 0x81F, + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 0x820, + NO_RESPONSE_FROM_BASE_STATION = 0x821, + REJECTED_BY_BASE_STATION = 0x822, + CONCURRENT_SERVICES_INCOMPATIBLE = 0x823, + NO_CDMA_SERVICE = 0x824, + RUIM_NOT_PRESENT = 0x825, + CDMA_RETRY_ORDER = 0x826, + ACCESS_BLOCK = 0x827, + ACCESS_BLOCK_ALL = 0x828, + IS707B_MAX_ACCESS_PROBES = 0x829, + THERMAL_EMERGENCY = 0x82A, + CONCURRENT_SERVICES_NOT_ALLOWED = 0x82B, + INCOMING_CALL_REJECTED = 0x82C, + NO_SERVICE_ON_GATEWAY = 0x82D, + NO_GPRS_CONTEXT = 0x82E, + ILLEGAL_MS = 0x82F, + ILLEGAL_ME = 0x830, + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x831, + GPRS_SERVICES_NOT_ALLOWED = 0x832, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x833, + IMPLICITLY_DETACHED = 0x834, + PLMN_NOT_ALLOWED = 0x835, + LOCATION_AREA_NOT_ALLOWED = 0x836, + GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x837, + PDP_DUPLICATE = 0x838, + UE_RAT_CHANGE = 0x839, + CONGESTION = 0x83A, + NO_PDP_CONTEXT_ACTIVATED = 0x83B, + ACCESS_CLASS_DSAC_REJECTION = 0x83C, + PDP_ACTIVATE_MAX_RETRY_FAILED = 0x83D, + RADIO_ACCESS_BEARER_FAILURE = 0x83E, + ESM_UNKNOWN_EPS_BEARER_CONTEXT = 0x83F, + DRB_RELEASED_BY_RRC = 0x840, + CONNECTION_RELEASED = 0x841, + EMM_DETACHED = 0x842, + EMM_ATTACH_FAILED = 0x843, + EMM_ATTACH_STARTED = 0x844, + LTE_NAS_SERVICE_REQUEST_FAILED = 0x845, + DUPLICATE_BEARER_ID = 0x846, + ESM_COLLISION_SCENARIOS = 0x847, + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 0x848, + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 0x849, + ESM_BAD_OTA_MESSAGE = 0x84A, + ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 0x84B, + ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 0x84C, + DS_EXPLICIT_DEACTIVATION = 0x84D, + ESM_LOCAL_CAUSE_NONE = 0x84E, + LTE_THROTTLING_NOT_REQUIRED = 0x84F, + ACCESS_CONTROL_LIST_CHECK_FAILURE = 0x850, + SERVICE_NOT_ALLOWED_ON_PLMN = 0x851, + EMM_T3417_EXPIRED = 0x852, + EMM_T3417_EXT_EXPIRED = 0x853, + RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 0x854, + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 0x855, + RRC_UPLINK_CONNECTION_RELEASE = 0x856, + RRC_UPLINK_RADIO_LINK_FAILURE = 0x857, + RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 0x858, + RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 0x859, + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 0x85A, + RRC_CONNECTION_ACCESS_BARRED = 0x85B, + RRC_CONNECTION_CELL_RESELECTION = 0x85C, + RRC_CONNECTION_CONFIG_FAILURE = 0x85D, + RRC_CONNECTION_TIMER_EXPIRED = 0x85E, + RRC_CONNECTION_LINK_FAILURE = 0x85F, + RRC_CONNECTION_CELL_NOT_CAMPED = 0x860, + RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 0x861, + RRC_CONNECTION_REJECT_BY_NETWORK = 0x862, + RRC_CONNECTION_NORMAL_RELEASE = 0x863, + RRC_CONNECTION_RADIO_LINK_FAILURE = 0x864, + RRC_CONNECTION_REESTABLISHMENT_FAILURE = 0x865, + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 0x866, + RRC_CONNECTION_ABORT_REQUEST = 0x867, + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 0x868, + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 0x869, + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 0x86A, + ESM_PROCEDURE_TIME_OUT = 0x86B, + INVALID_CONNECTION_ID = 0x86C, + MAXIMIUM_NSAPIS_EXCEEDED = 0x86D, + INVALID_PRIMARY_NSAPI = 0x86E, + CANNOT_ENCODE_OTA_MESSAGE = 0x86F, + RADIO_ACCESS_BEARER_SETUP_FAILURE = 0x870, + PDP_ESTABLISH_TIMEOUT_EXPIRED = 0x871, + PDP_MODIFY_TIMEOUT_EXPIRED = 0x872, + PDP_INACTIVE_TIMEOUT_EXPIRED = 0x873, + PDP_LOWERLAYER_ERROR = 0x874, + PDP_MODIFY_COLLISION = 0x875, + /** + * @deprecated use MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED instead. + */ + MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, + MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, + NAS_REQUEST_REJECTED_BY_NETWORK = 0x877, + RRC_CONNECTION_INVALID_REQUEST = 0x878, + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 0x879, + RRC_CONNECTION_RF_UNAVAILABLE = 0x87A, + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 0x87B, + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 0x87C, + RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 0x87D, + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 0x87E, + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 0x87F, + IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 0x880, + IMEI_NOT_ACCEPTED = 0x881, + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x882, + EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 0x883, + MSC_TEMPORARILY_NOT_REACHABLE = 0x884, + CS_DOMAIN_NOT_AVAILABLE = 0x885, + ESM_FAILURE = 0x886, + MAC_FAILURE = 0x887, + SYNCHRONIZATION_FAILURE = 0x888, + UE_SECURITY_CAPABILITIES_MISMATCH = 0x889, + SECURITY_MODE_REJECTED = 0x88A, + UNACCEPTABLE_NON_EPS_AUTHENTICATION = 0x88B, + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 0x88C, + NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x88D, + INVALID_EMM_STATE = 0x88E, + NAS_LAYER_FAILURE = 0x88F, + MULTIPLE_PDP_CALL_NOT_ALLOWED = 0x890, + EMBMS_NOT_ENABLED = 0x891, + IRAT_HANDOVER_FAILED = 0x892, + EMBMS_REGULAR_DEACTIVATION = 0x893, + TEST_LOOPBACK_REGULAR_DEACTIVATION = 0x894, + LOWER_LAYER_REGISTRATION_FAILURE = 0x895, + DATA_PLAN_EXPIRED = 0x896, + UMTS_HANDOVER_TO_IWLAN = 0x897, + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 0x898, + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 0x899, + EVDO_HDR_CHANGED = 0x89A, + EVDO_HDR_EXITED = 0x89B, + EVDO_HDR_NO_SESSION = 0x89C, + EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 0x89D, + EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 0x89E, + FAILED_TO_ACQUIRE_COLOCATED_HDR = 0x89F, + OTASP_COMMIT_IN_PROGRESS = 0x8A0, + NO_HYBRID_HDR_SERVICE = 0x8A1, + HDR_NO_LOCK_GRANTED = 0x8A2, + DBM_OR_SMS_IN_PROGRESS = 0x8A3, + HDR_FADE = 0x8A4, + HDR_ACCESS_FAILURE = 0x8A5, + UNSUPPORTED_1X_PREV = 0x8A6, + LOCAL_END = 0x8A7, + NO_SERVICE = 0x8A8, + FADE = 0x8A9, + NORMAL_RELEASE = 0x8AA, + ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 0x8AB, + REDIRECTION_OR_HANDOFF_IN_PROGRESS = 0x8AC, + EMERGENCY_MODE = 0x8AD, + PHONE_IN_USE = 0x8AE, + INVALID_MODE = 0x8AF, + INVALID_SIM_STATE = 0x8B0, + NO_COLLOCATED_HDR = 0x8B1, + UE_IS_ENTERING_POWERSAVE_MODE = 0x8B2, + DUAL_SWITCH = 0x8B3, + PPP_TIMEOUT = 0x8B4, + PPP_AUTH_FAILURE = 0x8B5, + PPP_OPTION_MISMATCH = 0x8B6, + PPP_PAP_FAILURE = 0x8B7, + PPP_CHAP_FAILURE = 0x8B8, + PPP_CLOSE_IN_PROGRESS = 0x8B9, + LIMITED_TO_IPV4 = 0x8BA, + LIMITED_TO_IPV6 = 0x8BB, + VSNCP_TIMEOUT = 0x8BC, + VSNCP_GEN_ERROR = 0x8BD, + VSNCP_APN_UNAUTHORIZED = 0x8BE, + VSNCP_PDN_LIMIT_EXCEEDED = 0x8BF, + VSNCP_NO_PDN_GATEWAY_ADDRESS = 0x8C0, + VSNCP_PDN_GATEWAY_UNREACHABLE = 0x8C1, + VSNCP_PDN_GATEWAY_REJECT = 0x8C2, + VSNCP_INSUFFICIENT_PARAMETERS = 0x8C3, + VSNCP_RESOURCE_UNAVAILABLE = 0x8C4, + VSNCP_ADMINISTRATIVELY_PROHIBITED = 0x8C5, + VSNCP_PDN_ID_IN_USE = 0x8C6, + VSNCP_SUBSCRIBER_LIMITATION = 0x8C7, + VSNCP_PDN_EXISTS_FOR_THIS_APN = 0x8C8, + VSNCP_RECONNECT_NOT_ALLOWED = 0x8C9, + IPV6_PREFIX_UNAVAILABLE = 0x8CA, + HANDOFF_PREFERENCE_CHANGED = 0x8CB, + SLICE_REJECTED = 0x8CC, + MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, + ALL_MATCHING_RULES_FAILED = 0x8CE, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataProfileInfo.aidl new file mode 100644 index 0000000000..0136fa4a5a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataProfileInfo.aidl @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable DataProfileInfo { + int profileId; + String apn; + android.hardware.radio.data.PdpProtocolType protocol; + android.hardware.radio.data.PdpProtocolType roamingProtocol; + android.hardware.radio.data.ApnAuthType authType; + String user; + String password; + int type; + int maxConnsTime; + int maxConns; + int waitTime; + boolean enabled; + int supportedApnTypesBitmap; + int bearerBitmap; + int mtuV4; + int mtuV6; + boolean preferred; + boolean persistent; + boolean alwaysOn; + android.hardware.radio.data.TrafficDescriptor trafficDescriptor; + const int ID_DEFAULT = 0; + const int ID_TETHERED = 1; + const int ID_IMS = 2; + const int ID_FOTA = 3; + const int ID_CBS = 4; + const int ID_OEM_BASE = 1000; + const int ID_INVALID = 0xFFFFFFFF; + const int TYPE_COMMON = 0; + const int TYPE_3GPP = 1; + const int TYPE_3GPP2 = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataRequestReason.aidl new file mode 100644 index 0000000000..0ddaff1662 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataRequestReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum DataRequestReason { + NORMAL = 1, + SHUTDOWN = 2, + HANDOVER = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataThrottlingAction.aidl new file mode 100644 index 0000000000..e80a764046 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/DataThrottlingAction.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability +enum DataThrottlingAction { + NO_DATA_THROTTLING, + THROTTLE_SECONDARY_CARRIER, + THROTTLE_ANCHOR_CARRIER, + HOLD, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/EpsQos.aidl new file mode 100644 index 0000000000..5b9aaa0b1e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/EpsQos.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable EpsQos { + int qci; + android.hardware.radio.data.QosBandwidth downlink; + android.hardware.radio.data.QosBandwidth uplink; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioData.aidl new file mode 100644 index 0000000000..7b572f1f8e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioData.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@VintfStability +interface IRadioData { + oneway void allocatePduSessionId(in int serial); + oneway void cancelHandover(in int serial, in int callId); + oneway void deactivateDataCall(in int serial, in int cid, in android.hardware.radio.data.DataRequestReason reason); + oneway void getDataCallList(in int serial); + oneway void getSlicingConfig(in int serial); + oneway void releasePduSessionId(in int serial, in int id); + oneway void responseAcknowledgement(); + oneway void setDataAllowed(in int serial, in boolean allow); + oneway void setDataProfile(in int serial, in android.hardware.radio.data.DataProfileInfo[] profiles); + oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); + oneway void setInitialAttachApn(in int serial, in @nullable android.hardware.radio.data.DataProfileInfo dataProfileInfo); + oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication); + oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed); + oneway void startHandover(in int serial, in int callId); + oneway void startKeepalive(in int serial, in android.hardware.radio.data.KeepaliveRequest keepalive); + oneway void stopKeepalive(in int serial, in int sessionHandle); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioDataIndication.aidl new file mode 100644 index 0000000000..0ffa1f7ddf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioDataIndication.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@VintfStability +interface IRadioDataIndication { + oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList); + oneway void keepaliveStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.KeepaliveStatus status); + oneway void pcoData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.PcoDataInfo pco); + oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); + oneway void slicingConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SlicingConfig slicingConfig); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioDataResponse.aidl new file mode 100644 index 0000000000..4edc17d4ad --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/IRadioDataResponse.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@VintfStability +interface IRadioDataResponse { + oneway void acknowledgeRequest(in int serial); + oneway void allocatePduSessionIdResponse(in android.hardware.radio.RadioResponseInfo info, in int id); + oneway void cancelHandoverResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deactivateDataCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getDataCallListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.SetupDataCallResult[] dcResponse); + oneway void getSlicingConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.SlicingConfig slicingConfig); + oneway void releasePduSessionIdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataAllowedResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataProfileResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataThrottlingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setInitialAttachApnResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setupDataCallResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.SetupDataCallResult dcResponse); + oneway void startHandoverResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startKeepaliveResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.KeepaliveStatus status); + oneway void stopKeepaliveResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/KeepaliveRequest.aidl new file mode 100644 index 0000000000..592a54a90c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/KeepaliveRequest.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable KeepaliveRequest { + int type; + byte[] sourceAddress; + int sourcePort; + byte[] destinationAddress; + int destinationPort; + int maxKeepaliveIntervalMillis; + int cid; + const int TYPE_NATT_IPV4 = 0; + const int TYPE_NATT_IPV6 = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/KeepaliveStatus.aidl new file mode 100644 index 0000000000..82b0fc8ec1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/KeepaliveStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable KeepaliveStatus { + int sessionHandle; + int code; + const int CODE_ACTIVE = 0; + const int CODE_INACTIVE = 1; + const int CODE_PENDING = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/LinkAddress.aidl new file mode 100644 index 0000000000..77d637b9b9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/LinkAddress.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable LinkAddress { + String address; + int addressProperties; + long deprecationTime; + long expirationTime; + const int ADDRESS_PROPERTY_NONE = 0; + const int ADDRESS_PROPERTY_DEPRECATED = 0x20; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/NrQos.aidl new file mode 100644 index 0000000000..660a531275 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/NrQos.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable NrQos { + int fiveQi; + android.hardware.radio.data.QosBandwidth downlink; + android.hardware.radio.data.QosBandwidth uplink; + byte qfi; + /** + * @deprecated use averagingWindowMillis; + */ + char averagingWindowMs; + int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN /* -1 */; + const byte FLOW_ID_RANGE_MIN = 1; + const byte FLOW_ID_RANGE_MAX = 63; + const int AVERAGING_WINDOW_UNKNOWN = (-1) /* -1 */; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/OsAppId.aidl new file mode 100644 index 0000000000..8595d5206d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/OsAppId.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable OsAppId { + byte[] osAppId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PcoDataInfo.aidl new file mode 100644 index 0000000000..033b12f4ee --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PcoDataInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable PcoDataInfo { + int cid; + String bearerProto; + int pcoId; + byte[] contents; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PdpProtocolType.aidl new file mode 100644 index 0000000000..1e5970d8e3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PdpProtocolType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum PdpProtocolType { + UNKNOWN = (-1) /* -1 */, + IP = 0, + IPV6 = 1, + IPV4V6 = 2, + PPP = 3, + NON_IP = 4, + UNSTRUCTURED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PortRange.aidl new file mode 100644 index 0000000000..470a9c11b3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/PortRange.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable PortRange { + int start; + int end; + const int PORT_RANGE_MIN = 20; + const int PORT_RANGE_MAX = 65535; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/Qos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/Qos.aidl new file mode 100644 index 0000000000..ca06e4112b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/Qos.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +union Qos { + boolean noinit; + android.hardware.radio.data.EpsQos eps; + android.hardware.radio.data.NrQos nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosBandwidth.aidl new file mode 100644 index 0000000000..6d4b7a9f49 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosBandwidth.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable QosBandwidth { + int maxBitrateKbps; + int guaranteedBitrateKbps; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilter.aidl new file mode 100644 index 0000000000..a3d4ced840 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilter.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable QosFilter { + String[] localAddresses; + String[] remoteAddresses; + @nullable android.hardware.radio.data.PortRange localPort; + @nullable android.hardware.radio.data.PortRange remotePort; + byte protocol; + android.hardware.radio.data.QosFilterTypeOfService tos; + android.hardware.radio.data.QosFilterIpv6FlowLabel flowLabel; + android.hardware.radio.data.QosFilterIpsecSpi spi; + byte direction; + int precedence; + const byte DIRECTION_DOWNLINK = 0; + const byte DIRECTION_UPLINK = 1; + const byte DIRECTION_BIDIRECTIONAL = 2; + const byte PROTOCOL_UNSPECIFIED = (-1) /* -1 */; + const byte PROTOCOL_TCP = 6; + const byte PROTOCOL_UDP = 17; + const byte PROTOCOL_ESP = 50; + const byte PROTOCOL_AH = 51; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterIpsecSpi.aidl new file mode 100644 index 0000000000..4b75340276 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterIpsecSpi.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +union QosFilterIpsecSpi { + boolean noinit; + int value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl new file mode 100644 index 0000000000..3fb34ea375 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +union QosFilterIpv6FlowLabel { + boolean noinit; + int value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterTypeOfService.aidl new file mode 100644 index 0000000000..fa85b5acc3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosFilterTypeOfService.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +union QosFilterTypeOfService { + boolean noinit; + byte value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosSession.aidl new file mode 100644 index 0000000000..bbfdd2d48c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/QosSession.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable QosSession { + int qosSessionId; + android.hardware.radio.data.Qos qos; + android.hardware.radio.data.QosFilter[] qosFilters; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/RouteSelectionDescriptor.aidl new file mode 100644 index 0000000000..acbdbd0fd5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable RouteSelectionDescriptor { + byte precedence; + android.hardware.radio.data.PdpProtocolType sessionType; + byte sscMode; + android.hardware.radio.data.SliceInfo[] sliceInfo; + String[] dnn; + const byte SSC_MODE_UNKNOWN = (-1) /* -1 */; + const byte SSC_MODE_1 = 1; + const byte SSC_MODE_2 = 2; + const byte SSC_MODE_3 = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SetupDataCallResult.aidl new file mode 100644 index 0000000000..83f9db61ac --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SetupDataCallResult.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable SetupDataCallResult { + android.hardware.radio.data.DataCallFailCause cause; + long suggestedRetryTime; + int cid; + int active; + android.hardware.radio.data.PdpProtocolType type; + String ifname; + android.hardware.radio.data.LinkAddress[] addresses; + String[] dnses; + String[] gateways; + String[] pcscf; + int mtuV4; + int mtuV6; + android.hardware.radio.data.Qos defaultQos; + android.hardware.radio.data.QosSession[] qosSessions; + byte handoverFailureMode; + int pduSessionId; + @nullable android.hardware.radio.data.SliceInfo sliceInfo; + android.hardware.radio.data.TrafficDescriptor[] trafficDescriptors; + const int DATA_CONNECTION_STATUS_INACTIVE = 0; + const int DATA_CONNECTION_STATUS_DORMANT = 1; + const int DATA_CONNECTION_STATUS_ACTIVE = 2; + const byte HANDOVER_FAILURE_MODE_LEGACY = 0; + const byte HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SliceInfo.aidl new file mode 100644 index 0000000000..efe48165ee --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SliceInfo.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable SliceInfo { + byte sliceServiceType; + int sliceDifferentiator; + byte mappedHplmnSst; + int mappedHplmnSd; + byte status; + const byte SERVICE_TYPE_NONE = 0; + const byte SERVICE_TYPE_EMBB = 1; + const byte SERVICE_TYPE_URLLC = 2; + const byte SERVICE_TYPE_MIOT = 3; + const byte STATUS_UNKNOWN = 0; + const byte STATUS_CONFIGURED = 1; + const byte STATUS_ALLOWED = 2; + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_PLMN = 3; + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_REG_AREA = 4; + const byte STATUS_DEFAULT_CONFIGURED = 5; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SlicingConfig.aidl new file mode 100644 index 0000000000..b00febebaf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/SlicingConfig.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable SlicingConfig { + android.hardware.radio.data.UrspRule[] urspRules; + android.hardware.radio.data.SliceInfo[] sliceInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/TrafficDescriptor.aidl new file mode 100644 index 0000000000..d7b0654970 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/TrafficDescriptor.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable TrafficDescriptor { + @nullable String dnn; + @nullable android.hardware.radio.data.OsAppId osAppId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/UrspRule.aidl new file mode 100644 index 0000000000..7002fd118c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/2/android/hardware/radio/data/UrspRule.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.data; +@JavaDerive(toString=true) @VintfStability +parcelable UrspRule { + int precedence; + android.hardware.radio.data.TrafficDescriptor[] trafficDescriptors; + android.hardware.radio.data.RouteSelectionDescriptor[] routeSelectionDescriptor; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl index 86272c22eb..a33ad6e338 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl @@ -34,8 +34,8 @@ package android.hardware.radio.data; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnAuthType { - NO_PAP_NO_CHAP = 0, - PAP_NO_CHAP = 1, - NO_PAP_CHAP = 2, - PAP_CHAP = 3, + NO_PAP_NO_CHAP, + PAP_NO_CHAP, + NO_PAP_CHAP, + PAP_CHAP, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl index 1518a5749e..45d22c853f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl @@ -35,19 +35,19 @@ package android.hardware.radio.data; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnTypes { NONE = 0, - DEFAULT = 1, - MMS = 2, - SUPL = 4, - DUN = 8, - HIPRI = 16, - FOTA = 32, - IMS = 64, - CBS = 128, - IA = 256, - EMERGENCY = 512, - MCX = 1024, - XCAP = 2048, - VSIM = 4096, - BIP = 8192, - ENTERPRISE = 16384, + DEFAULT = (1 << 0), + MMS = (1 << 1), + SUPL = (1 << 2), + DUN = (1 << 3), + HIPRI = (1 << 4), + FOTA = (1 << 5), + IMS = (1 << 6), + CBS = (1 << 7), + IA = (1 << 8), + EMERGENCY = (1 << 9), + MCX = (1 << 10), + XCAP = (1 << 11), + VSIM = (1 << 12), + BIP = (1 << 13), + ENTERPRISE = (1 << 14), } 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 d7d6983236..8a3fd4f4cd 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 @@ -35,343 +35,347 @@ package android.hardware.radio.data; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataCallFailCause { NONE = 0, - OPERATOR_BARRED = 8, - NAS_SIGNALLING = 14, - INSUFFICIENT_RESOURCES = 26, - MISSING_UNKNOWN_APN = 27, - UNKNOWN_PDP_ADDRESS_TYPE = 28, - USER_AUTHENTICATION = 29, - ACTIVATION_REJECT_GGSN = 30, - ACTIVATION_REJECT_UNSPECIFIED = 31, - SERVICE_OPTION_NOT_SUPPORTED = 32, - SERVICE_OPTION_NOT_SUBSCRIBED = 33, - SERVICE_OPTION_OUT_OF_ORDER = 34, - NSAPI_IN_USE = 35, - REGULAR_DEACTIVATION = 36, - QOS_NOT_ACCEPTED = 37, - NETWORK_FAILURE = 38, - UMTS_REACTIVATION_REQ = 39, - FEATURE_NOT_SUPP = 40, - TFT_SEMANTIC_ERROR = 41, - TFT_SYTAX_ERROR = 42, - UNKNOWN_PDP_CONTEXT = 43, - FILTER_SEMANTIC_ERROR = 44, - FILTER_SYTAX_ERROR = 45, - PDP_WITHOUT_ACTIVE_TFT = 46, - ONLY_IPV4_ALLOWED = 50, - ONLY_IPV6_ALLOWED = 51, - ONLY_SINGLE_BEARER_ALLOWED = 52, - ESM_INFO_NOT_RECEIVED = 53, - PDN_CONN_DOES_NOT_EXIST = 54, - MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55, - MAX_ACTIVE_PDP_CONTEXT_REACHED = 65, - UNSUPPORTED_APN_IN_CURRENT_PLMN = 66, - INVALID_TRANSACTION_ID = 81, - MESSAGE_INCORRECT_SEMANTIC = 95, - INVALID_MANDATORY_INFO = 96, - MESSAGE_TYPE_UNSUPPORTED = 97, - MSG_TYPE_NONCOMPATIBLE_STATE = 98, - UNKNOWN_INFO_ELEMENT = 99, - CONDITIONAL_IE_ERROR = 100, - MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101, - PROTOCOL_ERRORS = 111, - APN_TYPE_CONFLICT = 112, - INVALID_PCSCF_ADDR = 113, - INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114, - EMM_ACCESS_BARRED = 115, - EMERGENCY_IFACE_ONLY = 116, - IFACE_MISMATCH = 117, - COMPANION_IFACE_IN_USE = 118, - IP_ADDRESS_MISMATCH = 119, - IFACE_AND_POL_FAMILY_MISMATCH = 120, - EMM_ACCESS_BARRED_INFINITE_RETRY = 121, - AUTH_FAILURE_ON_EMERGENCY_CALL = 122, - OEM_DCFAILCAUSE_1 = 4097, - OEM_DCFAILCAUSE_2 = 4098, - OEM_DCFAILCAUSE_3 = 4099, - OEM_DCFAILCAUSE_4 = 4100, - OEM_DCFAILCAUSE_5 = 4101, - OEM_DCFAILCAUSE_6 = 4102, - OEM_DCFAILCAUSE_7 = 4103, - OEM_DCFAILCAUSE_8 = 4104, - OEM_DCFAILCAUSE_9 = 4105, - OEM_DCFAILCAUSE_10 = 4106, - OEM_DCFAILCAUSE_11 = 4107, - OEM_DCFAILCAUSE_12 = 4108, - OEM_DCFAILCAUSE_13 = 4109, - OEM_DCFAILCAUSE_14 = 4110, - OEM_DCFAILCAUSE_15 = 4111, - VOICE_REGISTRATION_FAIL = -1, - DATA_REGISTRATION_FAIL = -2, - SIGNAL_LOST = -3, - PREF_RADIO_TECH_CHANGED = -4, - RADIO_POWER_OFF = -5, - TETHERED_CALL_ACTIVE = -6, - ERROR_UNSPECIFIED = 65535, - LLC_SNDCP = 25, - ACTIVATION_REJECTED_BCM_VIOLATION = 48, - COLLISION_WITH_NETWORK_INITIATED_REQUEST = 56, - ONLY_IPV4V6_ALLOWED = 57, - ONLY_NON_IP_ALLOWED = 58, - UNSUPPORTED_QCI_VALUE = 59, - BEARER_HANDLING_NOT_SUPPORTED = 60, - INVALID_DNS_ADDR = 123, - INVALID_PCSCF_OR_DNS_ADDRESS = 124, - CALL_PREEMPT_BY_EMERGENCY_APN = 127, - UE_INITIATED_DETACH_OR_DISCONNECT = 128, - MIP_FA_REASON_UNSPECIFIED = 2000, - MIP_FA_ADMIN_PROHIBITED = 2001, - MIP_FA_INSUFFICIENT_RESOURCES = 2002, - MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2003, - MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 2004, - MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 2005, - MIP_FA_MALFORMED_REQUEST = 2006, - MIP_FA_MALFORMED_REPLY = 2007, - MIP_FA_ENCAPSULATION_UNAVAILABLE = 2008, - MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 2009, - MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 2010, - MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 2011, - MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 2012, - MIP_FA_MISSING_NAI = 2013, - MIP_FA_MISSING_HOME_AGENT = 2014, - MIP_FA_MISSING_HOME_ADDRESS = 2015, - MIP_FA_UNKNOWN_CHALLENGE = 2016, - MIP_FA_MISSING_CHALLENGE = 2017, - MIP_FA_STALE_CHALLENGE = 2018, - MIP_HA_REASON_UNSPECIFIED = 2019, - MIP_HA_ADMIN_PROHIBITED = 2020, - MIP_HA_INSUFFICIENT_RESOURCES = 2021, - MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2022, - MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 2023, - MIP_HA_REGISTRATION_ID_MISMATCH = 2024, - MIP_HA_MALFORMED_REQUEST = 2025, - MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 2026, - MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 2027, - MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 2028, - MIP_HA_ENCAPSULATION_UNAVAILABLE = 2029, - CLOSE_IN_PROGRESS = 2030, - NETWORK_INITIATED_TERMINATION = 2031, - MODEM_APP_PREEMPTED = 2032, - PDN_IPV4_CALL_DISALLOWED = 2033, - PDN_IPV4_CALL_THROTTLED = 2034, - PDN_IPV6_CALL_DISALLOWED = 2035, - PDN_IPV6_CALL_THROTTLED = 2036, - MODEM_RESTART = 2037, - PDP_PPP_NOT_SUPPORTED = 2038, - UNPREFERRED_RAT = 2039, - PHYSICAL_LINK_CLOSE_IN_PROGRESS = 2040, - APN_PENDING_HANDOVER = 2041, - PROFILE_BEARER_INCOMPATIBLE = 2042, - SIM_CARD_CHANGED = 2043, - LOW_POWER_MODE_OR_POWERING_DOWN = 2044, - APN_DISABLED = 2045, - MAX_PPP_INACTIVITY_TIMER_EXPIRED = 2046, - IPV6_ADDRESS_TRANSFER_FAILED = 2047, - TRAT_SWAP_FAILED = 2048, - EHRPD_TO_HRPD_FALLBACK = 2049, - MIP_CONFIG_FAILURE = 2050, - PDN_INACTIVITY_TIMER_EXPIRED = 2051, - MAX_IPV4_CONNECTIONS = 2052, - MAX_IPV6_CONNECTIONS = 2053, - APN_MISMATCH = 2054, - IP_VERSION_MISMATCH = 2055, - DUN_CALL_DISALLOWED = 2056, - INTERNAL_EPC_NONEPC_TRANSITION = 2057, - INTERFACE_IN_USE = 2058, - APN_DISALLOWED_ON_ROAMING = 2059, - APN_PARAMETERS_CHANGED = 2060, - NULL_APN_DISALLOWED = 2061, - THERMAL_MITIGATION = 2062, - DATA_SETTINGS_DISABLED = 2063, - DATA_ROAMING_SETTINGS_DISABLED = 2064, - DDS_SWITCHED = 2065, - FORBIDDEN_APN_NAME = 2066, - DDS_SWITCH_IN_PROGRESS = 2067, - CALL_DISALLOWED_IN_ROAMING = 2068, - NON_IP_NOT_SUPPORTED = 2069, - PDN_NON_IP_CALL_THROTTLED = 2070, - PDN_NON_IP_CALL_DISALLOWED = 2071, - CDMA_LOCK = 2072, - CDMA_INTERCEPT = 2073, - CDMA_REORDER = 2074, - CDMA_RELEASE_DUE_TO_SO_REJECTION = 2075, - CDMA_INCOMING_CALL = 2076, - CDMA_ALERT_STOP = 2077, - CHANNEL_ACQUISITION_FAILURE = 2078, - MAX_ACCESS_PROBE = 2079, - CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 2080, - NO_RESPONSE_FROM_BASE_STATION = 2081, - REJECTED_BY_BASE_STATION = 2082, - CONCURRENT_SERVICES_INCOMPATIBLE = 2083, - NO_CDMA_SERVICE = 2084, - RUIM_NOT_PRESENT = 2085, - CDMA_RETRY_ORDER = 2086, - ACCESS_BLOCK = 2087, - ACCESS_BLOCK_ALL = 2088, - IS707B_MAX_ACCESS_PROBES = 2089, - THERMAL_EMERGENCY = 2090, - CONCURRENT_SERVICES_NOT_ALLOWED = 2091, - INCOMING_CALL_REJECTED = 2092, - NO_SERVICE_ON_GATEWAY = 2093, - NO_GPRS_CONTEXT = 2094, - ILLEGAL_MS = 2095, - ILLEGAL_ME = 2096, - GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 2097, - GPRS_SERVICES_NOT_ALLOWED = 2098, - MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 2099, - IMPLICITLY_DETACHED = 2100, - PLMN_NOT_ALLOWED = 2101, - LOCATION_AREA_NOT_ALLOWED = 2102, - GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 2103, - PDP_DUPLICATE = 2104, - UE_RAT_CHANGE = 2105, - CONGESTION = 2106, - NO_PDP_CONTEXT_ACTIVATED = 2107, - ACCESS_CLASS_DSAC_REJECTION = 2108, - PDP_ACTIVATE_MAX_RETRY_FAILED = 2109, - RADIO_ACCESS_BEARER_FAILURE = 2110, - ESM_UNKNOWN_EPS_BEARER_CONTEXT = 2111, - DRB_RELEASED_BY_RRC = 2112, - CONNECTION_RELEASED = 2113, - EMM_DETACHED = 2114, - EMM_ATTACH_FAILED = 2115, - EMM_ATTACH_STARTED = 2116, - LTE_NAS_SERVICE_REQUEST_FAILED = 2117, - DUPLICATE_BEARER_ID = 2118, - ESM_COLLISION_SCENARIOS = 2119, - ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 2120, - ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 2121, - ESM_BAD_OTA_MESSAGE = 2122, - ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 2123, - ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 2124, - DS_EXPLICIT_DEACTIVATION = 2125, - ESM_LOCAL_CAUSE_NONE = 2126, - LTE_THROTTLING_NOT_REQUIRED = 2127, - ACCESS_CONTROL_LIST_CHECK_FAILURE = 2128, - SERVICE_NOT_ALLOWED_ON_PLMN = 2129, - EMM_T3417_EXPIRED = 2130, - EMM_T3417_EXT_EXPIRED = 2131, - RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 2132, - RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 2133, - RRC_UPLINK_CONNECTION_RELEASE = 2134, - RRC_UPLINK_RADIO_LINK_FAILURE = 2135, - RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 2136, - RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 2137, - RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 2138, - RRC_CONNECTION_ACCESS_BARRED = 2139, - RRC_CONNECTION_CELL_RESELECTION = 2140, - RRC_CONNECTION_CONFIG_FAILURE = 2141, - RRC_CONNECTION_TIMER_EXPIRED = 2142, - RRC_CONNECTION_LINK_FAILURE = 2143, - RRC_CONNECTION_CELL_NOT_CAMPED = 2144, - RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 2145, - RRC_CONNECTION_REJECT_BY_NETWORK = 2146, - RRC_CONNECTION_NORMAL_RELEASE = 2147, - RRC_CONNECTION_RADIO_LINK_FAILURE = 2148, - RRC_CONNECTION_REESTABLISHMENT_FAILURE = 2149, - RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 2150, - RRC_CONNECTION_ABORT_REQUEST = 2151, - RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 2152, - NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 2153, - NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 2154, - ESM_PROCEDURE_TIME_OUT = 2155, - INVALID_CONNECTION_ID = 2156, - MAXIMIUM_NSAPIS_EXCEEDED = 2157, - INVALID_PRIMARY_NSAPI = 2158, - CANNOT_ENCODE_OTA_MESSAGE = 2159, - RADIO_ACCESS_BEARER_SETUP_FAILURE = 2160, - PDP_ESTABLISH_TIMEOUT_EXPIRED = 2161, - PDP_MODIFY_TIMEOUT_EXPIRED = 2162, - PDP_INACTIVE_TIMEOUT_EXPIRED = 2163, - PDP_LOWERLAYER_ERROR = 2164, - PDP_MODIFY_COLLISION = 2165, - MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 2166, - NAS_REQUEST_REJECTED_BY_NETWORK = 2167, - RRC_CONNECTION_INVALID_REQUEST = 2168, - RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 2169, - RRC_CONNECTION_RF_UNAVAILABLE = 2170, - RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 2171, - RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 2172, - RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 2173, - RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 2174, - RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 2175, - IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 2176, - IMEI_NOT_ACCEPTED = 2177, - EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 2178, - EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 2179, - MSC_TEMPORARILY_NOT_REACHABLE = 2180, - CS_DOMAIN_NOT_AVAILABLE = 2181, - ESM_FAILURE = 2182, - MAC_FAILURE = 2183, - SYNCHRONIZATION_FAILURE = 2184, - UE_SECURITY_CAPABILITIES_MISMATCH = 2185, - SECURITY_MODE_REJECTED = 2186, - UNACCEPTABLE_NON_EPS_AUTHENTICATION = 2187, - CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 2188, - NO_EPS_BEARER_CONTEXT_ACTIVATED = 2189, - INVALID_EMM_STATE = 2190, - NAS_LAYER_FAILURE = 2191, - MULTIPLE_PDP_CALL_NOT_ALLOWED = 2192, - EMBMS_NOT_ENABLED = 2193, - IRAT_HANDOVER_FAILED = 2194, - EMBMS_REGULAR_DEACTIVATION = 2195, - TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196, - LOWER_LAYER_REGISTRATION_FAILURE = 2197, - DATA_PLAN_EXPIRED = 2198, - UMTS_HANDOVER_TO_IWLAN = 2199, - EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 2200, - EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 2201, - EVDO_HDR_CHANGED = 2202, - EVDO_HDR_EXITED = 2203, - EVDO_HDR_NO_SESSION = 2204, - EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 2205, - EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 2206, - FAILED_TO_ACQUIRE_COLOCATED_HDR = 2207, - OTASP_COMMIT_IN_PROGRESS = 2208, - NO_HYBRID_HDR_SERVICE = 2209, - HDR_NO_LOCK_GRANTED = 2210, - DBM_OR_SMS_IN_PROGRESS = 2211, - HDR_FADE = 2212, - HDR_ACCESS_FAILURE = 2213, - UNSUPPORTED_1X_PREV = 2214, - LOCAL_END = 2215, - NO_SERVICE = 2216, - FADE = 2217, - NORMAL_RELEASE = 2218, - ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219, - REDIRECTION_OR_HANDOFF_IN_PROGRESS = 2220, - EMERGENCY_MODE = 2221, - PHONE_IN_USE = 2222, - INVALID_MODE = 2223, - INVALID_SIM_STATE = 2224, - NO_COLLOCATED_HDR = 2225, - UE_IS_ENTERING_POWERSAVE_MODE = 2226, - DUAL_SWITCH = 2227, - PPP_TIMEOUT = 2228, - PPP_AUTH_FAILURE = 2229, - PPP_OPTION_MISMATCH = 2230, - PPP_PAP_FAILURE = 2231, - PPP_CHAP_FAILURE = 2232, - PPP_CLOSE_IN_PROGRESS = 2233, - LIMITED_TO_IPV4 = 2234, - LIMITED_TO_IPV6 = 2235, - VSNCP_TIMEOUT = 2236, - VSNCP_GEN_ERROR = 2237, - VSNCP_APN_UNAUTHORIZED = 2238, - VSNCP_PDN_LIMIT_EXCEEDED = 2239, - VSNCP_NO_PDN_GATEWAY_ADDRESS = 2240, - VSNCP_PDN_GATEWAY_UNREACHABLE = 2241, - VSNCP_PDN_GATEWAY_REJECT = 2242, - VSNCP_INSUFFICIENT_PARAMETERS = 2243, - VSNCP_RESOURCE_UNAVAILABLE = 2244, - VSNCP_ADMINISTRATIVELY_PROHIBITED = 2245, - VSNCP_PDN_ID_IN_USE = 2246, - VSNCP_SUBSCRIBER_LIMITATION = 2247, - VSNCP_PDN_EXISTS_FOR_THIS_APN = 2248, - VSNCP_RECONNECT_NOT_ALLOWED = 2249, - IPV6_PREFIX_UNAVAILABLE = 2250, - HANDOFF_PREFERENCE_CHANGED = 2251, - SLICE_REJECTED = 2252, - MATCH_ALL_RULE_NOT_ALLOWED = 2253, - ALL_MATCHING_RULES_FAILED = 2254, + OPERATOR_BARRED = 0x08, + NAS_SIGNALLING = 0x0E, + INSUFFICIENT_RESOURCES = 0x1A, + MISSING_UNKNOWN_APN = 0x1B, + UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, + USER_AUTHENTICATION = 0x1D, + ACTIVATION_REJECT_GGSN = 0x1E, + ACTIVATION_REJECT_UNSPECIFIED = 0x1F, + SERVICE_OPTION_NOT_SUPPORTED = 0x20, + SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, + SERVICE_OPTION_OUT_OF_ORDER = 0x22, + NSAPI_IN_USE = 0x23, + REGULAR_DEACTIVATION = 0x24, + QOS_NOT_ACCEPTED = 0x25, + NETWORK_FAILURE = 0x26, + UMTS_REACTIVATION_REQ = 0x27, + FEATURE_NOT_SUPP = 0x28, + TFT_SEMANTIC_ERROR = 0x29, + TFT_SYTAX_ERROR = 0x2A, + UNKNOWN_PDP_CONTEXT = 0x2B, + FILTER_SEMANTIC_ERROR = 0x2C, + FILTER_SYTAX_ERROR = 0x2D, + PDP_WITHOUT_ACTIVE_TFT = 0x2E, + ONLY_IPV4_ALLOWED = 0x32, + ONLY_IPV6_ALLOWED = 0x33, + ONLY_SINGLE_BEARER_ALLOWED = 0x34, + ESM_INFO_NOT_RECEIVED = 0x35, + PDN_CONN_DOES_NOT_EXIST = 0x36, + MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37, + MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41, + UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42, + INVALID_TRANSACTION_ID = 0x51, + MESSAGE_INCORRECT_SEMANTIC = 0x5F, + INVALID_MANDATORY_INFO = 0x60, + MESSAGE_TYPE_UNSUPPORTED = 0x61, + MSG_TYPE_NONCOMPATIBLE_STATE = 0x62, + UNKNOWN_INFO_ELEMENT = 0x63, + CONDITIONAL_IE_ERROR = 0x64, + MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65, + PROTOCOL_ERRORS = 0x6F, + APN_TYPE_CONFLICT = 0x70, + INVALID_PCSCF_ADDR = 0x71, + INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72, + EMM_ACCESS_BARRED = 0x73, + EMERGENCY_IFACE_ONLY = 0x74, + IFACE_MISMATCH = 0x75, + COMPANION_IFACE_IN_USE = 0x76, + IP_ADDRESS_MISMATCH = 0x77, + IFACE_AND_POL_FAMILY_MISMATCH = 0x78, + EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79, + AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A, + OEM_DCFAILCAUSE_1 = 0x1001, + OEM_DCFAILCAUSE_2 = 0x1002, + OEM_DCFAILCAUSE_3 = 0x1003, + OEM_DCFAILCAUSE_4 = 0x1004, + OEM_DCFAILCAUSE_5 = 0x1005, + OEM_DCFAILCAUSE_6 = 0x1006, + OEM_DCFAILCAUSE_7 = 0x1007, + OEM_DCFAILCAUSE_8 = 0x1008, + OEM_DCFAILCAUSE_9 = 0x1009, + OEM_DCFAILCAUSE_10 = 0x100A, + OEM_DCFAILCAUSE_11 = 0x100B, + OEM_DCFAILCAUSE_12 = 0x100C, + OEM_DCFAILCAUSE_13 = 0x100D, + OEM_DCFAILCAUSE_14 = 0x100E, + OEM_DCFAILCAUSE_15 = 0x100F, + VOICE_REGISTRATION_FAIL = (-1), + DATA_REGISTRATION_FAIL = (-2), + SIGNAL_LOST = (-3), + PREF_RADIO_TECH_CHANGED = (-4), + RADIO_POWER_OFF = (-5), + TETHERED_CALL_ACTIVE = (-6), + ERROR_UNSPECIFIED = 0xffff, + LLC_SNDCP = 0x19, + ACTIVATION_REJECTED_BCM_VIOLATION = 0x30, + COLLISION_WITH_NETWORK_INITIATED_REQUEST = 0x38, + ONLY_IPV4V6_ALLOWED = 0x39, + ONLY_NON_IP_ALLOWED = 0x3A, + UNSUPPORTED_QCI_VALUE = 0x3B, + BEARER_HANDLING_NOT_SUPPORTED = 0x3C, + INVALID_DNS_ADDR = 0x7B, + INVALID_PCSCF_OR_DNS_ADDRESS = 0x7C, + CALL_PREEMPT_BY_EMERGENCY_APN = 0x7F, + UE_INITIATED_DETACH_OR_DISCONNECT = 0x80, + MIP_FA_REASON_UNSPECIFIED = 0x7D0, + MIP_FA_ADMIN_PROHIBITED = 0x7D1, + MIP_FA_INSUFFICIENT_RESOURCES = 0x7D2, + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7D3, + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 0x7D4, + MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 0x7D5, + MIP_FA_MALFORMED_REQUEST = 0x7D6, + MIP_FA_MALFORMED_REPLY = 0x7D7, + MIP_FA_ENCAPSULATION_UNAVAILABLE = 0x7D8, + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 0x7D9, + MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 0x7DA, + MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 0x7DB, + MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 0x7DC, + MIP_FA_MISSING_NAI = 0x7DD, + MIP_FA_MISSING_HOME_AGENT = 0x7DE, + MIP_FA_MISSING_HOME_ADDRESS = 0x7DF, + MIP_FA_UNKNOWN_CHALLENGE = 0x7E0, + MIP_FA_MISSING_CHALLENGE = 0x7E1, + MIP_FA_STALE_CHALLENGE = 0x7E2, + MIP_HA_REASON_UNSPECIFIED = 0x7E3, + MIP_HA_ADMIN_PROHIBITED = 0x7E4, + MIP_HA_INSUFFICIENT_RESOURCES = 0x7E5, + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7E6, + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 0x7E7, + MIP_HA_REGISTRATION_ID_MISMATCH = 0x7E8, + MIP_HA_MALFORMED_REQUEST = 0x7E9, + MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 0x7EA, + MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 0x7EB, + MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 0x7EC, + MIP_HA_ENCAPSULATION_UNAVAILABLE = 0x7ED, + CLOSE_IN_PROGRESS = 0x7EE, + NETWORK_INITIATED_TERMINATION = 0x7EF, + MODEM_APP_PREEMPTED = 0x7F0, + PDN_IPV4_CALL_DISALLOWED = 0x7F1, + PDN_IPV4_CALL_THROTTLED = 0x7F2, + PDN_IPV6_CALL_DISALLOWED = 0x7F3, + PDN_IPV6_CALL_THROTTLED = 0x7F4, + MODEM_RESTART = 0x7F5, + PDP_PPP_NOT_SUPPORTED = 0x7F6, + UNPREFERRED_RAT = 0x7F7, + PHYSICAL_LINK_CLOSE_IN_PROGRESS = 0x7F8, + APN_PENDING_HANDOVER = 0x7F9, + PROFILE_BEARER_INCOMPATIBLE = 0x7FA, + SIM_CARD_CHANGED = 0x7FB, + LOW_POWER_MODE_OR_POWERING_DOWN = 0x7FC, + APN_DISABLED = 0x7FD, + MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE, + IPV6_ADDRESS_TRANSFER_FAILED = 0x7FF, + TRAT_SWAP_FAILED = 0x800, + EHRPD_TO_HRPD_FALLBACK = 0x801, + MIP_CONFIG_FAILURE = 0x802, + PDN_INACTIVITY_TIMER_EXPIRED = 0x803, + MAX_IPV4_CONNECTIONS = 0x804, + MAX_IPV6_CONNECTIONS = 0x805, + APN_MISMATCH = 0x806, + IP_VERSION_MISMATCH = 0x807, + DUN_CALL_DISALLOWED = 0x808, + INTERNAL_EPC_NONEPC_TRANSITION = 0x809, + INTERFACE_IN_USE = 0x80A, + APN_DISALLOWED_ON_ROAMING = 0x80B, + APN_PARAMETERS_CHANGED = 0x80C, + NULL_APN_DISALLOWED = 0x80D, + THERMAL_MITIGATION = 0x80E, + DATA_SETTINGS_DISABLED = 0x80F, + DATA_ROAMING_SETTINGS_DISABLED = 0x810, + DDS_SWITCHED = 0x811, + FORBIDDEN_APN_NAME = 0x812, + DDS_SWITCH_IN_PROGRESS = 0x813, + CALL_DISALLOWED_IN_ROAMING = 0x814, + NON_IP_NOT_SUPPORTED = 0x815, + PDN_NON_IP_CALL_THROTTLED = 0x816, + PDN_NON_IP_CALL_DISALLOWED = 0x817, + CDMA_LOCK = 0x818, + CDMA_INTERCEPT = 0x819, + CDMA_REORDER = 0x81A, + CDMA_RELEASE_DUE_TO_SO_REJECTION = 0x81B, + CDMA_INCOMING_CALL = 0x81C, + CDMA_ALERT_STOP = 0x81D, + CHANNEL_ACQUISITION_FAILURE = 0x81E, + MAX_ACCESS_PROBE = 0x81F, + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 0x820, + NO_RESPONSE_FROM_BASE_STATION = 0x821, + REJECTED_BY_BASE_STATION = 0x822, + CONCURRENT_SERVICES_INCOMPATIBLE = 0x823, + NO_CDMA_SERVICE = 0x824, + RUIM_NOT_PRESENT = 0x825, + CDMA_RETRY_ORDER = 0x826, + ACCESS_BLOCK = 0x827, + ACCESS_BLOCK_ALL = 0x828, + IS707B_MAX_ACCESS_PROBES = 0x829, + THERMAL_EMERGENCY = 0x82A, + CONCURRENT_SERVICES_NOT_ALLOWED = 0x82B, + INCOMING_CALL_REJECTED = 0x82C, + NO_SERVICE_ON_GATEWAY = 0x82D, + NO_GPRS_CONTEXT = 0x82E, + ILLEGAL_MS = 0x82F, + ILLEGAL_ME = 0x830, + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x831, + GPRS_SERVICES_NOT_ALLOWED = 0x832, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x833, + IMPLICITLY_DETACHED = 0x834, + PLMN_NOT_ALLOWED = 0x835, + LOCATION_AREA_NOT_ALLOWED = 0x836, + GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x837, + PDP_DUPLICATE = 0x838, + UE_RAT_CHANGE = 0x839, + CONGESTION = 0x83A, + NO_PDP_CONTEXT_ACTIVATED = 0x83B, + ACCESS_CLASS_DSAC_REJECTION = 0x83C, + PDP_ACTIVATE_MAX_RETRY_FAILED = 0x83D, + RADIO_ACCESS_BEARER_FAILURE = 0x83E, + ESM_UNKNOWN_EPS_BEARER_CONTEXT = 0x83F, + DRB_RELEASED_BY_RRC = 0x840, + CONNECTION_RELEASED = 0x841, + EMM_DETACHED = 0x842, + EMM_ATTACH_FAILED = 0x843, + EMM_ATTACH_STARTED = 0x844, + LTE_NAS_SERVICE_REQUEST_FAILED = 0x845, + DUPLICATE_BEARER_ID = 0x846, + ESM_COLLISION_SCENARIOS = 0x847, + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 0x848, + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 0x849, + ESM_BAD_OTA_MESSAGE = 0x84A, + ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 0x84B, + ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 0x84C, + DS_EXPLICIT_DEACTIVATION = 0x84D, + ESM_LOCAL_CAUSE_NONE = 0x84E, + LTE_THROTTLING_NOT_REQUIRED = 0x84F, + ACCESS_CONTROL_LIST_CHECK_FAILURE = 0x850, + SERVICE_NOT_ALLOWED_ON_PLMN = 0x851, + EMM_T3417_EXPIRED = 0x852, + EMM_T3417_EXT_EXPIRED = 0x853, + RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 0x854, + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 0x855, + RRC_UPLINK_CONNECTION_RELEASE = 0x856, + RRC_UPLINK_RADIO_LINK_FAILURE = 0x857, + RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 0x858, + RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 0x859, + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 0x85A, + RRC_CONNECTION_ACCESS_BARRED = 0x85B, + RRC_CONNECTION_CELL_RESELECTION = 0x85C, + RRC_CONNECTION_CONFIG_FAILURE = 0x85D, + RRC_CONNECTION_TIMER_EXPIRED = 0x85E, + RRC_CONNECTION_LINK_FAILURE = 0x85F, + RRC_CONNECTION_CELL_NOT_CAMPED = 0x860, + RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 0x861, + RRC_CONNECTION_REJECT_BY_NETWORK = 0x862, + RRC_CONNECTION_NORMAL_RELEASE = 0x863, + RRC_CONNECTION_RADIO_LINK_FAILURE = 0x864, + RRC_CONNECTION_REESTABLISHMENT_FAILURE = 0x865, + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 0x866, + RRC_CONNECTION_ABORT_REQUEST = 0x867, + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 0x868, + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 0x869, + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 0x86A, + ESM_PROCEDURE_TIME_OUT = 0x86B, + INVALID_CONNECTION_ID = 0x86C, + MAXIMIUM_NSAPIS_EXCEEDED = 0x86D, + INVALID_PRIMARY_NSAPI = 0x86E, + CANNOT_ENCODE_OTA_MESSAGE = 0x86F, + RADIO_ACCESS_BEARER_SETUP_FAILURE = 0x870, + PDP_ESTABLISH_TIMEOUT_EXPIRED = 0x871, + PDP_MODIFY_TIMEOUT_EXPIRED = 0x872, + PDP_INACTIVE_TIMEOUT_EXPIRED = 0x873, + PDP_LOWERLAYER_ERROR = 0x874, + PDP_MODIFY_COLLISION = 0x875, + /** + * @deprecated use MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED instead. + */ + MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, + MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, + NAS_REQUEST_REJECTED_BY_NETWORK = 0x877, + RRC_CONNECTION_INVALID_REQUEST = 0x878, + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 0x879, + RRC_CONNECTION_RF_UNAVAILABLE = 0x87A, + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 0x87B, + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 0x87C, + RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 0x87D, + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 0x87E, + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 0x87F, + IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 0x880, + IMEI_NOT_ACCEPTED = 0x881, + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x882, + EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 0x883, + MSC_TEMPORARILY_NOT_REACHABLE = 0x884, + CS_DOMAIN_NOT_AVAILABLE = 0x885, + ESM_FAILURE = 0x886, + MAC_FAILURE = 0x887, + SYNCHRONIZATION_FAILURE = 0x888, + UE_SECURITY_CAPABILITIES_MISMATCH = 0x889, + SECURITY_MODE_REJECTED = 0x88A, + UNACCEPTABLE_NON_EPS_AUTHENTICATION = 0x88B, + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 0x88C, + NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x88D, + INVALID_EMM_STATE = 0x88E, + NAS_LAYER_FAILURE = 0x88F, + MULTIPLE_PDP_CALL_NOT_ALLOWED = 0x890, + EMBMS_NOT_ENABLED = 0x891, + IRAT_HANDOVER_FAILED = 0x892, + EMBMS_REGULAR_DEACTIVATION = 0x893, + TEST_LOOPBACK_REGULAR_DEACTIVATION = 0x894, + LOWER_LAYER_REGISTRATION_FAILURE = 0x895, + DATA_PLAN_EXPIRED = 0x896, + UMTS_HANDOVER_TO_IWLAN = 0x897, + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 0x898, + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 0x899, + EVDO_HDR_CHANGED = 0x89A, + EVDO_HDR_EXITED = 0x89B, + EVDO_HDR_NO_SESSION = 0x89C, + EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 0x89D, + EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 0x89E, + FAILED_TO_ACQUIRE_COLOCATED_HDR = 0x89F, + OTASP_COMMIT_IN_PROGRESS = 0x8A0, + NO_HYBRID_HDR_SERVICE = 0x8A1, + HDR_NO_LOCK_GRANTED = 0x8A2, + DBM_OR_SMS_IN_PROGRESS = 0x8A3, + HDR_FADE = 0x8A4, + HDR_ACCESS_FAILURE = 0x8A5, + UNSUPPORTED_1X_PREV = 0x8A6, + LOCAL_END = 0x8A7, + NO_SERVICE = 0x8A8, + FADE = 0x8A9, + NORMAL_RELEASE = 0x8AA, + ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 0x8AB, + REDIRECTION_OR_HANDOFF_IN_PROGRESS = 0x8AC, + EMERGENCY_MODE = 0x8AD, + PHONE_IN_USE = 0x8AE, + INVALID_MODE = 0x8AF, + INVALID_SIM_STATE = 0x8B0, + NO_COLLOCATED_HDR = 0x8B1, + UE_IS_ENTERING_POWERSAVE_MODE = 0x8B2, + DUAL_SWITCH = 0x8B3, + PPP_TIMEOUT = 0x8B4, + PPP_AUTH_FAILURE = 0x8B5, + PPP_OPTION_MISMATCH = 0x8B6, + PPP_PAP_FAILURE = 0x8B7, + PPP_CHAP_FAILURE = 0x8B8, + PPP_CLOSE_IN_PROGRESS = 0x8B9, + LIMITED_TO_IPV4 = 0x8BA, + LIMITED_TO_IPV6 = 0x8BB, + VSNCP_TIMEOUT = 0x8BC, + VSNCP_GEN_ERROR = 0x8BD, + VSNCP_APN_UNAUTHORIZED = 0x8BE, + VSNCP_PDN_LIMIT_EXCEEDED = 0x8BF, + VSNCP_NO_PDN_GATEWAY_ADDRESS = 0x8C0, + VSNCP_PDN_GATEWAY_UNREACHABLE = 0x8C1, + VSNCP_PDN_GATEWAY_REJECT = 0x8C2, + VSNCP_INSUFFICIENT_PARAMETERS = 0x8C3, + VSNCP_RESOURCE_UNAVAILABLE = 0x8C4, + VSNCP_ADMINISTRATIVELY_PROHIBITED = 0x8C5, + VSNCP_PDN_ID_IN_USE = 0x8C6, + VSNCP_SUBSCRIBER_LIMITATION = 0x8C7, + VSNCP_PDN_EXISTS_FOR_THIS_APN = 0x8C8, + VSNCP_RECONNECT_NOT_ALLOWED = 0x8C9, + IPV6_PREFIX_UNAVAILABLE = 0x8CA, + HANDOFF_PREFERENCE_CHANGED = 0x8CB, + SLICE_REJECTED = 0x8CC, + MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, + ALL_MATCHING_RULES_FAILED = 0x8CE, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl index 16fada1d76..0136fa4a5a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl @@ -60,7 +60,7 @@ parcelable DataProfileInfo { const int ID_FOTA = 3; const int ID_CBS = 4; const int ID_OEM_BASE = 1000; - const int ID_INVALID = -1; + const int ID_INVALID = 0xFFFFFFFF; const int TYPE_COMMON = 0; const int TYPE_3GPP = 1; const int TYPE_3GPP2 = 2; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl index 4f976cd593..e80a764046 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl @@ -34,8 +34,8 @@ package android.hardware.radio.data; @Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum DataThrottlingAction { - NO_DATA_THROTTLING = 0, - THROTTLE_SECONDARY_CARRIER = 1, - THROTTLE_ANCHOR_CARRIER = 2, - HOLD = 3, + NO_DATA_THROTTLING, + THROTTLE_SECONDARY_CARRIER, + THROTTLE_ANCHOR_CARRIER, + HOLD, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl index 48e646ea22..77d637b9b9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl @@ -39,5 +39,5 @@ parcelable LinkAddress { long deprecationTime; long expirationTime; const int ADDRESS_PROPERTY_NONE = 0; - const int ADDRESS_PROPERTY_DEPRECATED = 32; + const int ADDRESS_PROPERTY_DEPRECATED = 0x20; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl index 62f6204038..be859b79de 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl @@ -38,7 +38,12 @@ parcelable NrQos { android.hardware.radio.data.QosBandwidth downlink; android.hardware.radio.data.QosBandwidth uplink; byte qfi; + /** + * @deprecated use averagingWindowMillis; + */ char averagingWindowMs; + int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN; const byte FLOW_ID_RANGE_MIN = 1; const byte FLOW_ID_RANGE_MAX = 63; + const int AVERAGING_WINDOW_UNKNOWN = (-1); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl index 9771e5ccc1..d1c4a62a31 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.data; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PdpProtocolType { - UNKNOWN = -1, + UNKNOWN = (-1), IP = 0, IPV6 = 1, IPV4V6 = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl index e22b359163..de45cc5f32 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl @@ -47,7 +47,7 @@ parcelable QosFilter { const byte DIRECTION_DOWNLINK = 0; const byte DIRECTION_UPLINK = 1; const byte DIRECTION_BIDIRECTIONAL = 2; - const byte PROTOCOL_UNSPECIFIED = -1; + const byte PROTOCOL_UNSPECIFIED = (-1); const byte PROTOCOL_TCP = 6; const byte PROTOCOL_UDP = 17; const byte PROTOCOL_ESP = 50; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl index 434ee7d102..d83df81a38 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -39,7 +39,7 @@ parcelable RouteSelectionDescriptor { byte sscMode; android.hardware.radio.data.SliceInfo[] sliceInfo; String[] dnn; - const byte SSC_MODE_UNKNOWN = -1; + const byte SSC_MODE_UNKNOWN = (-1); const byte SSC_MODE_1 = 1; const byte SSC_MODE_2 = 2; const byte SSC_MODE_3 = 3; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/.hash new file mode 100644 index 0000000000..c57de3309d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/.hash @@ -0,0 +1 @@ +af4dcb2aeff14e1352901a2a240c03d0a5377da9 diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AmrMode.aidl new file mode 100644 index 0000000000..37e3b256f3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AmrMode.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum AmrMode { + AMR_MODE_0 = (1 << 0) /* 1 */, + AMR_MODE_1 = (1 << 1) /* 2 */, + AMR_MODE_2 = (1 << 2) /* 4 */, + AMR_MODE_3 = (1 << 3) /* 8 */, + AMR_MODE_4 = (1 << 4) /* 16 */, + AMR_MODE_5 = (1 << 5) /* 32 */, + AMR_MODE_6 = (1 << 6) /* 64 */, + AMR_MODE_7 = (1 << 7) /* 128 */, + AMR_MODE_8 = (1 << 8) /* 256 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AmrParams.aidl new file mode 100644 index 0000000000..36edb7f8c4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AmrParams.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable AmrParams { + android.hardware.radio.ims.media.AmrMode amrMode; + boolean octetAligned; + int maxRedundancyMillis; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AnbrMode.aidl new file mode 100644 index 0000000000..c108c07033 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/AnbrMode.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@JavaDerive(toString=true) @VintfStability +parcelable AnbrMode { + android.hardware.radio.ims.media.CodecMode anbrUplinkMode; + android.hardware.radio.ims.media.CodecMode anbrDownlinkMode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CallQuality.aidl new file mode 100644 index 0000000000..fff6e1c3c2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CallQuality.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable CallQuality { + int downlinkCallQualityLevel; + int uplinkCallQualityLevel; + int callDuration; + int numRtpPacketsTransmitted; + int numRtpPacketsReceived; + int numRtpPacketsTransmittedLost; + int numRtpPacketsNotReceived; + int averageRelativeJitter; + int maxRelativeJitter; + int averageRoundTripTime; + int codecType; + boolean rtpInactivityDetected; + boolean rxSilenceDetected; + boolean txSilenceDetected; + int numVoiceFrames; + int numNoDataFrames; + int numDroppedRtpPackets; + long minPlayoutDelayMillis; + long maxPlayoutDelayMillis; + int numRtpSidPacketsReceived; + int numRtpDuplicatePackets; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecMode.aidl new file mode 100644 index 0000000000..0e9140f023 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@JavaDerive(toString=true) @VintfStability +union CodecMode { + boolean noinit; + android.hardware.radio.ims.media.AmrMode amr; + android.hardware.radio.ims.media.EvsMode evs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecParams.aidl new file mode 100644 index 0000000000..3da2dbd9ef --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecParams.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable CodecParams { + android.hardware.radio.ims.media.CodecType codecType; + byte rxPayloadTypeNumber; + byte txPayloadTypeNumber; + byte samplingRateKHz; + boolean dtxEnabled; + android.hardware.radio.ims.media.CodecSpecificParams codecSpecificParams; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecSpecificParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecSpecificParams.aidl new file mode 100644 index 0000000000..08e3f0f15e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecSpecificParams.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +union CodecSpecificParams { + android.hardware.radio.ims.media.AmrParams amr; + android.hardware.radio.ims.media.EvsParams evs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecType.aidl new file mode 100644 index 0000000000..e4193cd6a2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/CodecType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum CodecType { + AMR = (1 << 0) /* 1 */, + AMR_WB = (1 << 1) /* 2 */, + EVS = (1 << 2) /* 4 */, + PCMA = (1 << 3) /* 8 */, + PCMU = (1 << 4) /* 16 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/DtmfParams.aidl new file mode 100644 index 0000000000..5523fd87ca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/DtmfParams.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable DtmfParams { + byte rxPayloadTypeNumber; + byte txPayloadTypeNumber; + byte samplingRateKHz; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsBandwidth.aidl new file mode 100644 index 0000000000..db3eb2941a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsBandwidth.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum EvsBandwidth { + NONE = 0, + NARROW_BAND = (1 << 0) /* 1 */, + WIDE_BAND = (1 << 1) /* 2 */, + SUPER_WIDE_BAND = (1 << 2) /* 4 */, + FULL_BAND = (1 << 3) /* 8 */, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsMode.aidl similarity index 67% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl rename to radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsMode.aidl index badc29c454..fb1f14da3a 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsMode.aidl @@ -31,29 +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; +package android.hardware.radio.ims.media; @Backing(type="int") @VintfStability -enum Obd2SparkIgnitionMonitors { - COMPONENTS_AVAILABLE = 1, - COMPONENTS_INCOMPLETE = 2, - FUEL_SYSTEM_AVAILABLE = 4, - FUEL_SYSTEM_INCOMPLETE = 8, - MISFIRE_AVAILABLE = 16, - MISFIRE_INCOMPLETE = 32, - EGR_AVAILABLE = 64, - EGR_INCOMPLETE = 128, - OXYGEN_SENSOR_HEATER_AVAILABLE = 256, - OXYGEN_SENSOR_HEATER_INCOMPLETE = 512, - OXYGEN_SENSOR_AVAILABLE = 1024, - OXYGEN_SENSOR_INCOMPLETE = 2048, - AC_REFRIGERANT_AVAILABLE = 4096, - AC_REFRIGERANT_INCOMPLETE = 8192, - SECONDARY_AIR_SYSTEM_AVAILABLE = 16384, - SECONDARY_AIR_SYSTEM_INCOMPLETE = 32768, - EVAPORATIVE_SYSTEM_AVAILABLE = 65536, - EVAPORATIVE_SYSTEM_INCOMPLETE = 131072, - HEATED_CATALYST_AVAILABLE = 262144, - HEATED_CATALYST_INCOMPLETE = 524288, - CATALYST_AVAILABLE = 1048576, - CATALYST_INCOMPLETE = 2097152, +enum EvsMode { + EVS_MODE_0 = (1 << 0) /* 1 */, + EVS_MODE_1 = (1 << 1) /* 2 */, + EVS_MODE_2 = (1 << 2) /* 4 */, + EVS_MODE_3 = (1 << 3) /* 8 */, + EVS_MODE_4 = (1 << 4) /* 16 */, + EVS_MODE_5 = (1 << 5) /* 32 */, + EVS_MODE_6 = (1 << 6) /* 64 */, + EVS_MODE_7 = (1 << 7) /* 128 */, + EVS_MODE_8 = (1 << 8) /* 256 */, + EVS_MODE_9 = (1 << 9) /* 512 */, + EVS_MODE_10 = (1 << 10) /* 1024 */, + EVS_MODE_11 = (1 << 11) /* 2048 */, + EVS_MODE_12 = (1 << 12) /* 4096 */, + EVS_MODE_13 = (1 << 13) /* 8192 */, + EVS_MODE_14 = (1 << 14) /* 16384 */, + EVS_MODE_15 = (1 << 15) /* 32768 */, + EVS_MODE_16 = (1 << 16) /* 65536 */, + EVS_MODE_17 = (1 << 17) /* 131072 */, + EVS_MODE_18 = (1 << 18) /* 262144 */, + EVS_MODE_19 = (1 << 19) /* 524288 */, + EVS_MODE_20 = (1 << 20) /* 1048576 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsParams.aidl new file mode 100644 index 0000000000..735eb082ab --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/EvsParams.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable EvsParams { + android.hardware.radio.ims.media.EvsBandwidth bandwidth; + android.hardware.radio.ims.media.EvsMode evsMode; + byte channelAwareMode; + boolean useHeaderFullOnly; + boolean useEvsModeSwitch; + byte codecModeRequest; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMedia.aidl new file mode 100644 index 0000000000..30793e5eb2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMedia.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMedia { + oneway void setListener(in android.hardware.radio.ims.media.IImsMediaListener mediaListener); + oneway void openSession(int sessionId, in android.hardware.radio.ims.media.LocalEndPoint localEndPoint, in android.hardware.radio.ims.media.RtpConfig config); + oneway void closeSession(int sessionId); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaListener.aidl new file mode 100644 index 0000000000..40f7107cdf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaListener.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMediaListener { + oneway void onOpenSessionSuccess(int sessionId, android.hardware.radio.ims.media.IImsMediaSession session); + oneway void onOpenSessionFailure(int sessionId, android.hardware.radio.ims.media.RtpError error); + oneway void onSessionClosed(int sessionId); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaSession.aidl new file mode 100644 index 0000000000..ea9f3a4282 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaSession.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMediaSession { + oneway void setListener(in android.hardware.radio.ims.media.IImsMediaSessionListener sessionListener); + oneway void modifySession(in android.hardware.radio.ims.media.RtpConfig config); + oneway void sendDtmf(char dtmfDigit, int duration); + oneway void startDtmf(char dtmfDigit); + oneway void stopDtmf(); + oneway void sendHeaderExtension(in List extensions); + oneway void setMediaQualityThreshold(in android.hardware.radio.ims.media.MediaQualityThreshold threshold); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl new file mode 100644 index 0000000000..cb221df830 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMediaSessionListener { + oneway void onModifySessionResponse(in android.hardware.radio.ims.media.RtpConfig config, android.hardware.radio.ims.media.RtpError error); + oneway void onFirstMediaPacketReceived(in android.hardware.radio.ims.media.RtpConfig config); + oneway void onHeaderExtensionReceived(in List extensions); + oneway void notifyMediaQualityStatus(in android.hardware.radio.ims.media.MediaQualityStatus quality); + oneway void triggerAnbrQuery(in android.hardware.radio.ims.media.RtpConfig config); + oneway void onDtmfReceived(char dtmfDigit, int durationMs); + oneway void onCallQualityChanged(in android.hardware.radio.ims.media.CallQuality callQuality); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/LocalEndPoint.aidl new file mode 100644 index 0000000000..6ec51569af --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/LocalEndPoint.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable LocalEndPoint { + ParcelFileDescriptor rtpFd; + ParcelFileDescriptor rtcpFd; + int modemId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaDirection.aidl new file mode 100644 index 0000000000..0e9eaee31b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaDirection.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum MediaDirection { + NO_FLOW = 0, + RTP_TX = (1 << 0) /* 1 */, + RTP_RX = (1 << 1) /* 2 */, + RTCP_TX = (1 << 2) /* 4 */, + RTCP_RX = (1 << 3) /* 8 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaQualityStatus.aidl new file mode 100644 index 0000000000..4accf5315b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaQualityStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable MediaQualityStatus { + int rtpInactivityTimeMillis; + int rtcpInactivityTimeMillis; + int rtpPacketLossRate; + int rtpJitterMillis; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaQualityThreshold.aidl new file mode 100644 index 0000000000..31cf3739a7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/MediaQualityThreshold.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable MediaQualityThreshold { + int[] rtpInactivityTimerMillis; + int rtcpInactivityTimerMillis; + int rtpPacketLossDurationMillis; + int rtpHysteresisTimeInMillis; + int[] rtpPacketLossRate; + int[] rtpJitterMillis; + boolean notifyCurrentStatus; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtcpConfig.aidl new file mode 100644 index 0000000000..6a76d85cd8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtcpConfig.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtcpConfig { + String canonicalName; + int transmitPort; + int transmitIntervalSec; + int rtcpXrBlocks; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl new file mode 100644 index 0000000000..289c810b87 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum RtcpXrReportBlockType { + RTCPXR_NONE = 0, + RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0) /* 1 */, + RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = (1 << 1) /* 2 */, + RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = (1 << 2) /* 4 */, + RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = (1 << 3) /* 8 */, + RTCPXR_DLRR_REPORT_BLOCK = (1 << 4) /* 16 */, + RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = (1 << 5) /* 32 */, + RTCPXR_VOIP_METRICS_REPORT_BLOCK = (1 << 6) /* 64 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpAddress.aidl new file mode 100644 index 0000000000..35357d179a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpAddress.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpAddress { + String ipAddress; + int portNumber; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpConfig.aidl new file mode 100644 index 0000000000..8a826f6b5f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpConfig.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpConfig { + int direction; + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.ims.media.RtpAddress remoteAddress; + android.hardware.radio.ims.media.RtpSessionParams sessionParams; + android.hardware.radio.ims.media.RtcpConfig rtcpConfig; + android.hardware.radio.ims.media.AnbrMode anbrModeParams; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpError.aidl new file mode 100644 index 0000000000..41b0aeb287 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpError.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum RtpError { + NONE = 0, + INVALID_PARAM = 1, + NOT_READY = 2, + NO_MEMORY = 3, + NO_RESOURCES = 4, + PORT_UNAVAILABLE = 5, + NOT_SUPPORTED = 6, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpHeaderExtension.aidl new file mode 100644 index 0000000000..83b8a314e3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpHeaderExtension.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpHeaderExtension { + int localId; + byte[] data; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpSessionParams.aidl new file mode 100644 index 0000000000..13a7487f73 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/1/android/hardware/radio/ims/media/RtpSessionParams.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpSessionParams { + byte pTimeMillis; + int maxPtimeMillis; + byte dscp; + android.hardware.radio.ims.media.DtmfParams dtmfParams; + android.hardware.radio.ims.media.CodecParams codecParams; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl new file mode 100644 index 0000000000..37e3b256f3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum AmrMode { + AMR_MODE_0 = (1 << 0) /* 1 */, + AMR_MODE_1 = (1 << 1) /* 2 */, + AMR_MODE_2 = (1 << 2) /* 4 */, + AMR_MODE_3 = (1 << 3) /* 8 */, + AMR_MODE_4 = (1 << 4) /* 16 */, + AMR_MODE_5 = (1 << 5) /* 32 */, + AMR_MODE_6 = (1 << 6) /* 64 */, + AMR_MODE_7 = (1 << 7) /* 128 */, + AMR_MODE_8 = (1 << 8) /* 256 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl new file mode 100644 index 0000000000..36edb7f8c4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable AmrParams { + android.hardware.radio.ims.media.AmrMode amrMode; + boolean octetAligned; + int maxRedundancyMillis; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl new file mode 100644 index 0000000000..c108c07033 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@JavaDerive(toString=true) @VintfStability +parcelable AnbrMode { + android.hardware.radio.ims.media.CodecMode anbrUplinkMode; + android.hardware.radio.ims.media.CodecMode anbrDownlinkMode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl new file mode 100644 index 0000000000..fff6e1c3c2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable CallQuality { + int downlinkCallQualityLevel; + int uplinkCallQualityLevel; + int callDuration; + int numRtpPacketsTransmitted; + int numRtpPacketsReceived; + int numRtpPacketsTransmittedLost; + int numRtpPacketsNotReceived; + int averageRelativeJitter; + int maxRelativeJitter; + int averageRoundTripTime; + int codecType; + boolean rtpInactivityDetected; + boolean rxSilenceDetected; + boolean txSilenceDetected; + int numVoiceFrames; + int numNoDataFrames; + int numDroppedRtpPackets; + long minPlayoutDelayMillis; + long maxPlayoutDelayMillis; + int numRtpSidPacketsReceived; + int numRtpDuplicatePackets; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl new file mode 100644 index 0000000000..0e9140f023 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@JavaDerive(toString=true) @VintfStability +union CodecMode { + boolean noinit; + android.hardware.radio.ims.media.AmrMode amr; + android.hardware.radio.ims.media.EvsMode evs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl new file mode 100644 index 0000000000..3da2dbd9ef --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable CodecParams { + android.hardware.radio.ims.media.CodecType codecType; + byte rxPayloadTypeNumber; + byte txPayloadTypeNumber; + byte samplingRateKHz; + boolean dtxEnabled; + android.hardware.radio.ims.media.CodecSpecificParams codecSpecificParams; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl new file mode 100644 index 0000000000..08e3f0f15e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +union CodecSpecificParams { + android.hardware.radio.ims.media.AmrParams amr; + android.hardware.radio.ims.media.EvsParams evs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl new file mode 100644 index 0000000000..e4193cd6a2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum CodecType { + AMR = (1 << 0) /* 1 */, + AMR_WB = (1 << 1) /* 2 */, + EVS = (1 << 2) /* 4 */, + PCMA = (1 << 3) /* 8 */, + PCMU = (1 << 4) /* 16 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl new file mode 100644 index 0000000000..5523fd87ca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable DtmfParams { + byte rxPayloadTypeNumber; + byte txPayloadTypeNumber; + byte samplingRateKHz; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl new file mode 100644 index 0000000000..db3eb2941a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum EvsBandwidth { + NONE = 0, + NARROW_BAND = (1 << 0) /* 1 */, + WIDE_BAND = (1 << 1) /* 2 */, + SUPER_WIDE_BAND = (1 << 2) /* 4 */, + FULL_BAND = (1 << 3) /* 8 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl new file mode 100644 index 0000000000..fb1f14da3a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum EvsMode { + EVS_MODE_0 = (1 << 0) /* 1 */, + EVS_MODE_1 = (1 << 1) /* 2 */, + EVS_MODE_2 = (1 << 2) /* 4 */, + EVS_MODE_3 = (1 << 3) /* 8 */, + EVS_MODE_4 = (1 << 4) /* 16 */, + EVS_MODE_5 = (1 << 5) /* 32 */, + EVS_MODE_6 = (1 << 6) /* 64 */, + EVS_MODE_7 = (1 << 7) /* 128 */, + EVS_MODE_8 = (1 << 8) /* 256 */, + EVS_MODE_9 = (1 << 9) /* 512 */, + EVS_MODE_10 = (1 << 10) /* 1024 */, + EVS_MODE_11 = (1 << 11) /* 2048 */, + EVS_MODE_12 = (1 << 12) /* 4096 */, + EVS_MODE_13 = (1 << 13) /* 8192 */, + EVS_MODE_14 = (1 << 14) /* 16384 */, + EVS_MODE_15 = (1 << 15) /* 32768 */, + EVS_MODE_16 = (1 << 16) /* 65536 */, + EVS_MODE_17 = (1 << 17) /* 131072 */, + EVS_MODE_18 = (1 << 18) /* 262144 */, + EVS_MODE_19 = (1 << 19) /* 524288 */, + EVS_MODE_20 = (1 << 20) /* 1048576 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl new file mode 100644 index 0000000000..735eb082ab --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable EvsParams { + android.hardware.radio.ims.media.EvsBandwidth bandwidth; + android.hardware.radio.ims.media.EvsMode evsMode; + byte channelAwareMode; + boolean useHeaderFullOnly; + boolean useEvsModeSwitch; + byte codecModeRequest; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl new file mode 100644 index 0000000000..30793e5eb2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMedia { + oneway void setListener(in android.hardware.radio.ims.media.IImsMediaListener mediaListener); + oneway void openSession(int sessionId, in android.hardware.radio.ims.media.LocalEndPoint localEndPoint, in android.hardware.radio.ims.media.RtpConfig config); + oneway void closeSession(int sessionId); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl new file mode 100644 index 0000000000..40f7107cdf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMediaListener { + oneway void onOpenSessionSuccess(int sessionId, android.hardware.radio.ims.media.IImsMediaSession session); + oneway void onOpenSessionFailure(int sessionId, android.hardware.radio.ims.media.RtpError error); + oneway void onSessionClosed(int sessionId); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl new file mode 100644 index 0000000000..ea9f3a4282 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMediaSession { + oneway void setListener(in android.hardware.radio.ims.media.IImsMediaSessionListener sessionListener); + oneway void modifySession(in android.hardware.radio.ims.media.RtpConfig config); + oneway void sendDtmf(char dtmfDigit, int duration); + oneway void startDtmf(char dtmfDigit); + oneway void stopDtmf(); + oneway void sendHeaderExtension(in List extensions); + oneway void setMediaQualityThreshold(in android.hardware.radio.ims.media.MediaQualityThreshold threshold); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl new file mode 100644 index 0000000000..cb221df830 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +interface IImsMediaSessionListener { + oneway void onModifySessionResponse(in android.hardware.radio.ims.media.RtpConfig config, android.hardware.radio.ims.media.RtpError error); + oneway void onFirstMediaPacketReceived(in android.hardware.radio.ims.media.RtpConfig config); + oneway void onHeaderExtensionReceived(in List extensions); + oneway void notifyMediaQualityStatus(in android.hardware.radio.ims.media.MediaQualityStatus quality); + oneway void triggerAnbrQuery(in android.hardware.radio.ims.media.RtpConfig config); + oneway void onDtmfReceived(char dtmfDigit, int durationMs); + oneway void onCallQualityChanged(in android.hardware.radio.ims.media.CallQuality callQuality); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl new file mode 100644 index 0000000000..6ec51569af --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable LocalEndPoint { + ParcelFileDescriptor rtpFd; + ParcelFileDescriptor rtcpFd; + int modemId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl new file mode 100644 index 0000000000..0e9eaee31b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum MediaDirection { + NO_FLOW = 0, + RTP_TX = (1 << 0) /* 1 */, + RTP_RX = (1 << 1) /* 2 */, + RTCP_TX = (1 << 2) /* 4 */, + RTCP_RX = (1 << 3) /* 8 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl new file mode 100644 index 0000000000..4accf5315b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable MediaQualityStatus { + int rtpInactivityTimeMillis; + int rtcpInactivityTimeMillis; + int rtpPacketLossRate; + int rtpJitterMillis; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl new file mode 100644 index 0000000000..31cf3739a7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable MediaQualityThreshold { + int[] rtpInactivityTimerMillis; + int rtcpInactivityTimerMillis; + int rtpPacketLossDurationMillis; + int rtpHysteresisTimeInMillis; + int[] rtpPacketLossRate; + int[] rtpJitterMillis; + boolean notifyCurrentStatus; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl new file mode 100644 index 0000000000..6a76d85cd8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtcpConfig { + String canonicalName; + int transmitPort; + int transmitIntervalSec; + int rtcpXrBlocks; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl new file mode 100644 index 0000000000..289c810b87 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum RtcpXrReportBlockType { + RTCPXR_NONE = 0, + RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0) /* 1 */, + RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = (1 << 1) /* 2 */, + RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = (1 << 2) /* 4 */, + RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = (1 << 3) /* 8 */, + RTCPXR_DLRR_REPORT_BLOCK = (1 << 4) /* 16 */, + RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = (1 << 5) /* 32 */, + RTCPXR_VOIP_METRICS_REPORT_BLOCK = (1 << 6) /* 64 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl new file mode 100644 index 0000000000..35357d179a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpAddress { + String ipAddress; + int portNumber; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl new file mode 100644 index 0000000000..8a826f6b5f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpConfig { + int direction; + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.ims.media.RtpAddress remoteAddress; + android.hardware.radio.ims.media.RtpSessionParams sessionParams; + android.hardware.radio.ims.media.RtcpConfig rtcpConfig; + android.hardware.radio.ims.media.AnbrMode anbrModeParams; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl new file mode 100644 index 0000000000..41b0aeb287 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@Backing(type="int") @VintfStability +enum RtpError { + NONE = 0, + INVALID_PARAM = 1, + NOT_READY = 2, + NO_MEMORY = 3, + NO_RESOURCES = 4, + PORT_UNAVAILABLE = 5, + NOT_SUPPORTED = 6, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl new file mode 100644 index 0000000000..83b8a314e3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpHeaderExtension { + int localId; + byte[] data; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl new file mode 100644 index 0000000000..13a7487f73 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims.media; +@VintfStability +parcelable RtpSessionParams { + byte pTimeMillis; + int maxPtimeMillis; + byte dscp; + android.hardware.radio.ims.media.DtmfParams dtmfParams; + android.hardware.radio.ims.media.CodecParams codecParams; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.ims/1/.hash new file mode 100644 index 0000000000..9d5f5c1649 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/.hash @@ -0,0 +1 @@ +b09f8d98a60fbe74cefaca7aea9903ab5450110a diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ConnectionFailureInfo.aidl new file mode 100644 index 0000000000..90e75f96e1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ConnectionFailureInfo.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable ConnectionFailureInfo { + android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason failureReason; + int causeCode; + int waitTimeMillis; + @Backing(type="int") @VintfStability + enum ConnectionFailureReason { + REASON_ACCESS_DENIED = 1, + REASON_NAS_FAILURE = 2, + REASON_RACH_FAILURE = 3, + REASON_RLC_FAILURE = 4, + REASON_RRC_REJECT = 5, + REASON_RRC_TIMEOUT = 6, + REASON_NO_SERVICE = 7, + REASON_PDN_NOT_AVAILABLE = 8, + REASON_RF_BUSY = 9, + REASON_UNSPECIFIED = 0xFFFF, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/EpsFallbackReason.aidl new file mode 100644 index 0000000000..ebea9034ec --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/EpsFallbackReason.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EpsFallbackReason { + NO_NETWORK_TRIGGER = 1, + NO_NETWORK_RESPONSE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioIms.aidl new file mode 100644 index 0000000000..4df870969d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioIms.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@VintfStability +interface IRadioIms { + oneway void setSrvccCallInfo(int serial, in android.hardware.radio.ims.SrvccCall[] srvccCalls); + oneway void updateImsRegistrationInfo(int serial, in android.hardware.radio.ims.ImsRegistration imsRegistration); + oneway void startImsTraffic(int serial, int token, android.hardware.radio.ims.ImsTrafficType imsTrafficType, android.hardware.radio.AccessNetwork accessNetworkType, android.hardware.radio.ims.ImsCall.Direction trafficDirection); + oneway void stopImsTraffic(int serial, int token); + oneway void triggerEpsFallback(int serial, in android.hardware.radio.ims.EpsFallbackReason reason); + oneway void setResponseFunctions(in android.hardware.radio.ims.IRadioImsResponse radioImsResponse, in android.hardware.radio.ims.IRadioImsIndication radioImsIndication); + oneway void sendAnbrQuery(int serial, android.hardware.radio.ims.ImsStreamType mediaType, android.hardware.radio.ims.ImsStreamDirection direction, int bitsPerSecond); + oneway void updateImsCallStatus(int serial, in android.hardware.radio.ims.ImsCall[] imsCalls); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioImsIndication.aidl new file mode 100644 index 0000000000..ef6b4cc9ca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioImsIndication.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@VintfStability +interface IRadioImsIndication { + oneway void onConnectionSetupFailure(in android.hardware.radio.RadioIndicationType type, int token, in android.hardware.radio.ims.ConnectionFailureInfo info); + oneway void notifyAnbr(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.ims.ImsStreamType mediaType, in android.hardware.radio.ims.ImsStreamDirection direction, int bitsPerSecond); + oneway void triggerImsDeregistration(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.ims.ImsDeregistrationReason reason); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioImsResponse.aidl new file mode 100644 index 0000000000..053ba46864 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/IRadioImsResponse.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@VintfStability +interface IRadioImsResponse { + oneway void setSrvccCallInfoResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void updateImsRegistrationInfoResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startImsTrafficResponse(in android.hardware.radio.RadioResponseInfo info, in @nullable android.hardware.radio.ims.ConnectionFailureInfo failureInfo); + oneway void stopImsTrafficResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void triggerEpsFallbackResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendAnbrQueryResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void updateImsCallStatusResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsCall.aidl new file mode 100644 index 0000000000..6e14830012 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsCall.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable ImsCall { + int index; + android.hardware.radio.ims.ImsCall.CallType callType; + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.ims.ImsCall.CallState callState; + android.hardware.radio.ims.ImsCall.Direction direction; + boolean isHeldByRemote; + @Backing(type="int") + enum CallType { + NORMAL, + EMERGENCY, + } + @Backing(type="int") + enum CallState { + ACTIVE, + HOLDING, + DIALING, + ALERTING, + INCOMING, + WAITING, + DISCONNECTING, + DISCONNECTED, + } + @Backing(type="int") + enum Direction { + INCOMING, + OUTGOING, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsDeregistrationReason.aidl new file mode 100644 index 0000000000..b04e5598c7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsDeregistrationReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsDeregistrationReason { + REASON_SIM_REMOVED = 1, + REASON_SIM_REFRESH = 2, + REASON_ALLOWED_NETWORK_TYPES_CHANGED = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsRegistration.aidl new file mode 100644 index 0000000000..7ed6bafc43 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsRegistration.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable ImsRegistration { + android.hardware.radio.ims.ImsRegistrationState regState; + android.hardware.radio.AccessNetwork accessNetworkType; + android.hardware.radio.ims.SuggestedAction suggestedAction; + int capabilities; + const int IMS_MMTEL_CAPABILITY_NONE = 0; + const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0) /* 1 */; + const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1) /* 2 */; + const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2) /* 4 */; + const int IMS_RCS_CAPABILITIES = (1 << 3) /* 8 */; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsRegistrationState.aidl new file mode 100644 index 0000000000..6302b4798d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsRegistrationState.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsRegistrationState { + NOT_REGISTERED, + REGISTERED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsStreamDirection.aidl new file mode 100644 index 0000000000..cf2e4f1d89 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsStreamDirection.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsStreamDirection { + UPLINK = 1, + DOWNLINK = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsStreamType.aidl new file mode 100644 index 0000000000..10c477f938 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsStreamType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @VintfStability +enum ImsStreamType { + AUDIO = 1, + VIDEO = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsTrafficType.aidl new file mode 100644 index 0000000000..b1a0b770cd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/ImsTrafficType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsTrafficType { + EMERGENCY, + EMERGENCY_SMS, + VOICE, + VIDEO, + SMS, + REGISTRATION, + UT_XCAP, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/SrvccCall.aidl new file mode 100644 index 0000000000..5119b0ff02 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/SrvccCall.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable SrvccCall { + int index; + android.hardware.radio.ims.SrvccCall.CallType callType; + int callState; + android.hardware.radio.ims.SrvccCall.CallSubState callSubstate; + android.hardware.radio.ims.SrvccCall.ToneType ringbackToneType; + boolean isMpty; + boolean isMT; + String number; + int numPresentation; + String name; + int namePresentation; + @Backing(type="int") @VintfStability + enum CallType { + NORMAL, + EMERGENCY, + } + @Backing(type="int") @VintfStability + enum CallSubState { + NONE, + PREALERTING, + } + @Backing(type="int") @VintfStability + enum ToneType { + NONE, + LOCAL, + NETWORK, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/SuggestedAction.aidl new file mode 100644 index 0000000000..bbe170e445 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/1/android/hardware/radio/ims/SuggestedAction.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum SuggestedAction { + NONE, + TRIGGER_PLMN_BLOCK, + TRIGGER_PLMN_BLOCK_WITH_TIMEOUT, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl new file mode 100644 index 0000000000..90e75f96e1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable ConnectionFailureInfo { + android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason failureReason; + int causeCode; + int waitTimeMillis; + @Backing(type="int") @VintfStability + enum ConnectionFailureReason { + REASON_ACCESS_DENIED = 1, + REASON_NAS_FAILURE = 2, + REASON_RACH_FAILURE = 3, + REASON_RLC_FAILURE = 4, + REASON_RRC_REJECT = 5, + REASON_RRC_TIMEOUT = 6, + REASON_NO_SERVICE = 7, + REASON_PDN_NOT_AVAILABLE = 8, + REASON_RF_BUSY = 9, + REASON_UNSPECIFIED = 0xFFFF, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl new file mode 100644 index 0000000000..ebea9034ec --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EpsFallbackReason { + NO_NETWORK_TRIGGER = 1, + NO_NETWORK_RESPONSE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl new file mode 100644 index 0000000000..4df870969d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@VintfStability +interface IRadioIms { + oneway void setSrvccCallInfo(int serial, in android.hardware.radio.ims.SrvccCall[] srvccCalls); + oneway void updateImsRegistrationInfo(int serial, in android.hardware.radio.ims.ImsRegistration imsRegistration); + oneway void startImsTraffic(int serial, int token, android.hardware.radio.ims.ImsTrafficType imsTrafficType, android.hardware.radio.AccessNetwork accessNetworkType, android.hardware.radio.ims.ImsCall.Direction trafficDirection); + oneway void stopImsTraffic(int serial, int token); + oneway void triggerEpsFallback(int serial, in android.hardware.radio.ims.EpsFallbackReason reason); + oneway void setResponseFunctions(in android.hardware.radio.ims.IRadioImsResponse radioImsResponse, in android.hardware.radio.ims.IRadioImsIndication radioImsIndication); + oneway void sendAnbrQuery(int serial, android.hardware.radio.ims.ImsStreamType mediaType, android.hardware.radio.ims.ImsStreamDirection direction, int bitsPerSecond); + oneway void updateImsCallStatus(int serial, in android.hardware.radio.ims.ImsCall[] imsCalls); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl new file mode 100644 index 0000000000..ef6b4cc9ca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@VintfStability +interface IRadioImsIndication { + oneway void onConnectionSetupFailure(in android.hardware.radio.RadioIndicationType type, int token, in android.hardware.radio.ims.ConnectionFailureInfo info); + oneway void notifyAnbr(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.ims.ImsStreamType mediaType, in android.hardware.radio.ims.ImsStreamDirection direction, int bitsPerSecond); + oneway void triggerImsDeregistration(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.ims.ImsDeregistrationReason reason); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl new file mode 100644 index 0000000000..053ba46864 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@VintfStability +interface IRadioImsResponse { + oneway void setSrvccCallInfoResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void updateImsRegistrationInfoResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startImsTrafficResponse(in android.hardware.radio.RadioResponseInfo info, in @nullable android.hardware.radio.ims.ConnectionFailureInfo failureInfo); + oneway void stopImsTrafficResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void triggerEpsFallbackResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendAnbrQueryResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void updateImsCallStatusResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl new file mode 100644 index 0000000000..6e14830012 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable ImsCall { + int index; + android.hardware.radio.ims.ImsCall.CallType callType; + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.ims.ImsCall.CallState callState; + android.hardware.radio.ims.ImsCall.Direction direction; + boolean isHeldByRemote; + @Backing(type="int") + enum CallType { + NORMAL, + EMERGENCY, + } + @Backing(type="int") + enum CallState { + ACTIVE, + HOLDING, + DIALING, + ALERTING, + INCOMING, + WAITING, + DISCONNECTING, + DISCONNECTED, + } + @Backing(type="int") + enum Direction { + INCOMING, + OUTGOING, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl new file mode 100644 index 0000000000..b04e5598c7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsDeregistrationReason { + REASON_SIM_REMOVED = 1, + REASON_SIM_REFRESH = 2, + REASON_ALLOWED_NETWORK_TYPES_CHANGED = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl new file mode 100644 index 0000000000..be5e0045e3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable ImsRegistration { + android.hardware.radio.ims.ImsRegistrationState regState; + android.hardware.radio.AccessNetwork accessNetworkType; + android.hardware.radio.ims.SuggestedAction suggestedAction; + int capabilities; + const int IMS_MMTEL_CAPABILITY_NONE = 0; + const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0); + const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1); + const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2); + const int IMS_RCS_CAPABILITIES = (1 << 3); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl new file mode 100644 index 0000000000..6302b4798d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsRegistrationState { + NOT_REGISTERED, + REGISTERED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl new file mode 100644 index 0000000000..cf2e4f1d89 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsStreamDirection { + UPLINK = 1, + DOWNLINK = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl new file mode 100644 index 0000000000..10c477f938 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @VintfStability +enum ImsStreamType { + AUDIO = 1, + VIDEO = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl new file mode 100644 index 0000000000..b1a0b770cd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ImsTrafficType { + EMERGENCY, + EMERGENCY_SMS, + VOICE, + VIDEO, + SMS, + REGISTRATION, + UT_XCAP, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl new file mode 100644 index 0000000000..5119b0ff02 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@JavaDerive(toString=true) @VintfStability +parcelable SrvccCall { + int index; + android.hardware.radio.ims.SrvccCall.CallType callType; + int callState; + android.hardware.radio.ims.SrvccCall.CallSubState callSubstate; + android.hardware.radio.ims.SrvccCall.ToneType ringbackToneType; + boolean isMpty; + boolean isMT; + String number; + int numPresentation; + String name; + int namePresentation; + @Backing(type="int") @VintfStability + enum CallType { + NORMAL, + EMERGENCY, + } + @Backing(type="int") @VintfStability + enum CallSubState { + NONE, + PREALERTING, + } + @Backing(type="int") @VintfStability + enum ToneType { + NONE, + LOCAL, + NETWORK, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl new file mode 100644 index 0000000000..bbe170e445 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.ims; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum SuggestedAction { + NONE, + TRIGGER_PLMN_BLOCK, + TRIGGER_PLMN_BLOCK_WITH_TIMEOUT, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/.hash new file mode 100644 index 0000000000..280bdb1678 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/.hash @@ -0,0 +1 @@ +50aefda34c9dd40090c8d5925e71d5b84530c3d0 diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..39e2be2f63 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaBroadcastSmsConfigInfo { + int serviceCategory; + int language; + boolean selected; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsAck.aidl new file mode 100644 index 0000000000..befdbdefb6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsAck.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSmsAck { + boolean errorClass; + int smsCauseCode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsAddress.aidl new file mode 100644 index 0000000000..ab29c775dd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsAddress.aidl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSmsAddress { + int digitMode; + boolean isNumberModeDataNetwork; + int numberType; + int numberPlan; + byte[] digits; + const int DIGIT_MODE_FOUR_BIT = 0; + const int DIGIT_MODE_EIGHT_BIT = 1; + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_TELEPHONY = 1; + const int NUMBER_PLAN_RESERVED_2 = 2; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_RESERVED_5 = 5; + const int NUMBER_PLAN_RESERVED_6 = 6; + const int NUMBER_PLAN_RESERVED_7 = 7; + const int NUMBER_PLAN_RESERVED_8 = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PLAN_RESERVED_10 = 10; + const int NUMBER_PLAN_RESERVED_11 = 11; + const int NUMBER_PLAN_RESERVED_12 = 12; + const int NUMBER_PLAN_RESERVED_13 = 13; + const int NUMBER_PLAN_RESERVED_14 = 14; + const int NUMBER_PLAN_RESERVED_15 = 15; + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1; + const int NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2; + const int NUMBER_TYPE_NETWORK = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; + const int NUMBER_TYPE_ALPHANUMERIC = 5; + const int NUMBER_TYPE_ABBREVIATED = 6; + const int NUMBER_TYPE_RESERVED_7 = 7; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsMessage.aidl new file mode 100644 index 0000000000..867596c81b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsMessage.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSmsMessage { + int teleserviceId; + boolean isServicePresent; + int serviceCategory; + android.hardware.radio.messaging.CdmaSmsAddress address; + android.hardware.radio.messaging.CdmaSmsSubaddress subAddress; + byte[] bearerData; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl new file mode 100644 index 0000000000..d67fe8c577 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSmsSubaddress { + int subaddressType; + boolean odd; + byte[] digits; + const int SUBADDRESS_TYPE_NSAP = 0; + const int SUBADDRESS_TYPE_USER_SPECIFIED = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl new file mode 100644 index 0000000000..b0a7f98dc6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSmsWriteArgs { + int status; + android.hardware.radio.messaging.CdmaSmsMessage message; + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..46604cabe6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable GsmBroadcastSmsConfigInfo { + int fromServiceId; + int toServiceId; + int fromCodeScheme; + int toCodeScheme; + boolean selected; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/GsmSmsMessage.aidl new file mode 100644 index 0000000000..4df7fd2508 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/GsmSmsMessage.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable GsmSmsMessage { + String smscPdu; + String pdu; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessaging.aidl new file mode 100644 index 0000000000..dfec59ae45 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessaging.aidl @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@VintfStability +interface IRadioMessaging { + oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu); + oneway void acknowledgeLastIncomingCdmaSms(in int serial, in android.hardware.radio.messaging.CdmaSmsAck smsAck); + oneway void acknowledgeLastIncomingGsmSms(in int serial, in boolean success, in android.hardware.radio.messaging.SmsAcknowledgeFailCause cause); + oneway void deleteSmsOnRuim(in int serial, in int index); + oneway void deleteSmsOnSim(in int serial, in int index); + oneway void getCdmaBroadcastConfig(in int serial); + oneway void getGsmBroadcastConfig(in int serial); + oneway void getSmscAddress(in int serial); + oneway void reportSmsMemoryStatus(in int serial, in boolean available); + oneway void responseAcknowledgement(); + oneway void sendCdmaSms(in int serial, in android.hardware.radio.messaging.CdmaSmsMessage sms); + oneway void sendCdmaSmsExpectMore(in int serial, in android.hardware.radio.messaging.CdmaSmsMessage sms); + oneway void sendImsSms(in int serial, in android.hardware.radio.messaging.ImsSmsMessage message); + oneway void sendSms(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message); + oneway void sendSmsExpectMore(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message); + oneway void setCdmaBroadcastActivation(in int serial, in boolean activate); + oneway void setCdmaBroadcastConfig(in int serial, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configInfo); + oneway void setGsmBroadcastActivation(in int serial, in boolean activate); + oneway void setGsmBroadcastConfig(in int serial, in android.hardware.radio.messaging.GsmBroadcastSmsConfigInfo[] configInfo); + oneway void setResponseFunctions(in android.hardware.radio.messaging.IRadioMessagingResponse radioMessagingResponse, in android.hardware.radio.messaging.IRadioMessagingIndication radioMessagingIndication); + oneway void setSmscAddress(in int serial, in String smsc); + oneway void writeSmsToRuim(in int serial, in android.hardware.radio.messaging.CdmaSmsWriteArgs cdmaSms); + oneway void writeSmsToSim(in int serial, in android.hardware.radio.messaging.SmsWriteArgs smsWriteArgs); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessagingIndication.aidl new file mode 100644 index 0000000000..8f7824f515 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessagingIndication.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@VintfStability +interface IRadioMessagingIndication { + oneway void cdmaNewSms(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.messaging.CdmaSmsMessage msg); + oneway void cdmaRuimSmsStorageFull(in android.hardware.radio.RadioIndicationType type); + oneway void newBroadcastSms(in android.hardware.radio.RadioIndicationType type, in byte[] data); + oneway void newSms(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); + oneway void newSmsOnSim(in android.hardware.radio.RadioIndicationType type, in int recordNumber); + oneway void newSmsStatusReport(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); + oneway void simSmsStorageFull(in android.hardware.radio.RadioIndicationType type); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessagingResponse.aidl new file mode 100644 index 0000000000..c3af7a684c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/IRadioMessagingResponse.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@VintfStability +interface IRadioMessagingResponse { + oneway void acknowledgeIncomingGsmSmsWithPduResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeLastIncomingCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeLastIncomingGsmSmsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeRequest(in int serial); + oneway void deleteSmsOnRuimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deleteSmsOnSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configs); + oneway void getGsmBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.GsmBroadcastSmsConfigInfo[] configs); + oneway void getSmscAddressResponse(in android.hardware.radio.RadioResponseInfo info, in String smsc); + oneway void reportSmsMemoryStatusResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendCdmaSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendImsSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void setCdmaBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setGsmBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setGsmBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSmscAddressResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void writeSmsToRuimResponse(in android.hardware.radio.RadioResponseInfo info, in int index); + oneway void writeSmsToSimResponse(in android.hardware.radio.RadioResponseInfo info, in int index); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/ImsSmsMessage.aidl new file mode 100644 index 0000000000..85f62b781d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/ImsSmsMessage.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable ImsSmsMessage { + android.hardware.radio.RadioTechnologyFamily tech; + boolean retry; + int messageRef; + android.hardware.radio.messaging.CdmaSmsMessage[] cdmaMessage; + android.hardware.radio.messaging.GsmSmsMessage[] gsmMessage; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SendSmsResult.aidl new file mode 100644 index 0000000000..32f7a5cb71 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SendSmsResult.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable SendSmsResult { + int messageRef; + String ackPDU; + int errorCode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl new file mode 100644 index 0000000000..d061c9ea17 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum SmsAcknowledgeFailCause { + MEMORY_CAPACITY_EXCEEDED = 0xD3, + UNSPECIFIED_ERROR = 0XFF, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SmsWriteArgs.aidl new file mode 100644 index 0000000000..489cc07068 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/2/android/hardware/radio/messaging/SmsWriteArgs.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.messaging; +@JavaDerive(toString=true) @VintfStability +parcelable SmsWriteArgs { + int status; + String pdu; + String smsc; + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl index 019b18539f..d061c9ea17 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.messaging; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SmsAcknowledgeFailCause { - MEMORY_CAPACITY_EXCEEDED = 211, - UNSPECIFIED_ERROR = 255, + MEMORY_CAPACITY_EXCEEDED = 0xD3, + UNSPECIFIED_ERROR = 0XFF, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.modem/2/.hash new file mode 100644 index 0000000000..46183203c4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/.hash @@ -0,0 +1 @@ +09927560afccc75a063944fbbab3af48099261ca diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ActivityStatsInfo.aidl new file mode 100644 index 0000000000..7e22ee046e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ActivityStatsInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable ActivityStatsInfo { + int sleepModeTimeMs; + int idleModeTimeMs; + android.hardware.radio.modem.ActivityStatsTechSpecificInfo[] techSpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl new file mode 100644 index 0000000000..08ed9a529e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable ActivityStatsTechSpecificInfo { + android.hardware.radio.AccessNetwork rat; + int frequencyRange; + int[] txmModetimeMs; + int rxModeTimeMs; + const int FREQUENCY_RANGE_UNKNOWN = 0; + const int FREQUENCY_RANGE_LOW = 1; + const int FREQUENCY_RANGE_MID = 2; + const int FREQUENCY_RANGE_HIGH = 3; + const int FREQUENCY_RANGE_MMWAVE = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/DeviceStateType.aidl new file mode 100644 index 0000000000..acc0b22bb8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/DeviceStateType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum DeviceStateType { + POWER_SAVE_MODE, + CHARGING_STATE, + LOW_DATA_EXPECTED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfig.aidl new file mode 100644 index 0000000000..3a0ec2514b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfig.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable HardwareConfig { + int type; + String uuid; + int state; + android.hardware.radio.modem.HardwareConfigModem[] modem; + android.hardware.radio.modem.HardwareConfigSim[] sim; + const int STATE_ENABLED = 0; + const int STATE_STANDBY = 1; + const int STATE_DISABLED = 2; + const int TYPE_MODEM = 0; + const int TYPE_SIM = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfigModem.aidl new file mode 100644 index 0000000000..62bb160fc4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfigModem.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable HardwareConfigModem { + int rilModel; + android.hardware.radio.RadioTechnology rat; + int maxVoiceCalls; + int maxDataCalls; + int maxStandby; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfigSim.aidl new file mode 100644 index 0000000000..5810982975 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/HardwareConfigSim.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable HardwareConfigSim { + String modemUuid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModem.aidl new file mode 100644 index 0000000000..8546be789b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModem.aidl @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@VintfStability +interface IRadioModem { + oneway void enableModem(in int serial, in boolean on); + oneway void getBasebandVersion(in int serial); + /** + * @deprecated use getImei(int serial) + */ + oneway void getDeviceIdentity(in int serial); + oneway void getHardwareConfig(in int serial); + oneway void getModemActivityInfo(in int serial); + oneway void getModemStackStatus(in int serial); + oneway void getRadioCapability(in int serial); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ + oneway void nvReadItem(in int serial, in android.hardware.radio.modem.NvItem itemId); + oneway void nvResetConfig(in int serial, in android.hardware.radio.modem.ResetNvType resetType); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ + oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ + oneway void nvWriteItem(in int serial, in android.hardware.radio.modem.NvWriteItem item); + oneway void requestShutdown(in int serial); + oneway void responseAcknowledgement(); + oneway void sendDeviceState(in int serial, in android.hardware.radio.modem.DeviceStateType deviceStateType, in boolean state); + oneway void setRadioCapability(in int serial, in android.hardware.radio.modem.RadioCapability rc); + oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall); + oneway void setResponseFunctions(in android.hardware.radio.modem.IRadioModemResponse radioModemResponse, in android.hardware.radio.modem.IRadioModemIndication radioModemIndication); + oneway void getImei(in int serial); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModemIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModemIndication.aidl new file mode 100644 index 0000000000..514ff9a03e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModemIndication.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@VintfStability +interface IRadioModemIndication { + oneway void hardwareConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.HardwareConfig[] configs); + oneway void modemReset(in android.hardware.radio.RadioIndicationType type, in String reason); + oneway void radioCapabilityIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.RadioCapability rc); + oneway void radioStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.RadioState radioState); + oneway void rilConnected(in android.hardware.radio.RadioIndicationType type); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModemResponse.aidl new file mode 100644 index 0000000000..5955439666 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/IRadioModemResponse.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@VintfStability +interface IRadioModemResponse { + oneway void acknowledgeRequest(in int serial); + oneway void enableModemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getBasebandVersionResponse(in android.hardware.radio.RadioResponseInfo info, in String version); + /** + * @deprecated use getImeiResponse(RadioResponseInfo responseInfo, ImeiInfo imeiInfo) + */ + oneway void getDeviceIdentityResponse(in android.hardware.radio.RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid); + oneway void getHardwareConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.HardwareConfig[] config); + oneway void getModemActivityInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.ActivityStatsInfo activityInfo); + oneway void getModemStackStatusResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void getRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ + oneway void nvReadItemResponse(in android.hardware.radio.RadioResponseInfo info, in String result); + oneway void nvResetConfigResponse(in android.hardware.radio.RadioResponseInfo info); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ + oneway void nvWriteCdmaPrlResponse(in android.hardware.radio.RadioResponseInfo info); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ + oneway void nvWriteItemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void requestShutdownResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendDeviceStateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc); + oneway void setRadioPowerResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getImeiResponse(in android.hardware.radio.RadioResponseInfo responseInfo, in @nullable android.hardware.radio.modem.ImeiInfo imeiInfo); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ImeiInfo.aidl new file mode 100644 index 0000000000..f8776ec412 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ImeiInfo.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable ImeiInfo { + android.hardware.radio.modem.ImeiInfo.ImeiType type; + String imei; + String svn; + @Backing(type="int") @VintfStability + enum ImeiType { + PRIMARY = 1, + SECONDARY = 2, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/NvItem.aidl new file mode 100644 index 0000000000..b80d7acde1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/NvItem.aidl @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +/** + * @deprecated NV APIs are deprecated starting from Android U. + */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum NvItem { + CDMA_MEID = 1, + CDMA_MIN = 2, + CDMA_MDN = 3, + CDMA_ACCOLC = 4, + DEVICE_MSL = 11, + RTN_RECONDITIONED_STATUS = 12, + RTN_ACTIVATION_DATE = 13, + RTN_LIFE_TIMER = 14, + RTN_LIFE_CALLS = 15, + RTN_LIFE_DATA_TX = 16, + RTN_LIFE_DATA_RX = 17, + OMADM_HFA_LEVEL = 18, + MIP_PROFILE_NAI = 31, + MIP_PROFILE_HOME_ADDRESS = 32, + MIP_PROFILE_AAA_AUTH = 33, + MIP_PROFILE_HA_AUTH = 34, + MIP_PROFILE_PRI_HA_ADDR = 35, + MIP_PROFILE_SEC_HA_ADDR = 36, + MIP_PROFILE_REV_TUN_PREF = 37, + MIP_PROFILE_HA_SPI = 38, + MIP_PROFILE_AAA_SPI = 39, + MIP_PROFILE_MN_HA_SS = 40, + MIP_PROFILE_MN_AAA_SS = 41, + CDMA_PRL_VERSION = 51, + CDMA_BC10 = 52, + CDMA_BC14 = 53, + CDMA_SO68 = 54, + CDMA_SO73_COP0 = 55, + CDMA_SO73_COP1TO7 = 56, + CDMA_1X_ADVANCED_ENABLED = 57, + CDMA_EHRPD_ENABLED = 58, + CDMA_EHRPD_FORCED = 59, + LTE_BAND_ENABLE_25 = 71, + LTE_BAND_ENABLE_26 = 72, + LTE_BAND_ENABLE_41 = 73, + LTE_SCAN_PRIORITY_25 = 74, + LTE_SCAN_PRIORITY_26 = 75, + LTE_SCAN_PRIORITY_41 = 76, + LTE_HIDDEN_BAND_PRIORITY_25 = 77, + LTE_HIDDEN_BAND_PRIORITY_26 = 78, + LTE_HIDDEN_BAND_PRIORITY_41 = 79, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/NvWriteItem.aidl new file mode 100644 index 0000000000..6a786bc419 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/NvWriteItem.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +/** + * @deprecated NV APIs are deprecated starting from Android U. + */ +@JavaDerive(toString=true) @VintfStability +parcelable NvWriteItem { + android.hardware.radio.modem.NvItem itemId; + String value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/RadioCapability.aidl new file mode 100644 index 0000000000..f2e2858590 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/RadioCapability.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable RadioCapability { + int session; + int phase; + int raf; + String logicalModemUuid; + int status; + const int PHASE_CONFIGURED = 0; + const int PHASE_START = 1; + const int PHASE_APPLY = 2; + const int PHASE_UNSOL_RSP = 3; + const int PHASE_FINISH = 4; + const int STATUS_NONE = 0; + const int STATUS_SUCCESS = 1; + const int STATUS_FAIL = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/RadioState.aidl new file mode 100644 index 0000000000..57f29410c5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/RadioState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioState { + OFF = 0, + UNAVAILABLE = 1, + ON = 10, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ResetNvType.aidl new file mode 100644 index 0000000000..37622b1312 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/2/android/hardware/radio/modem/ResetNvType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ResetNvType { + RELOAD, + ERASE, + FACTORY_RESET, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl index 4e8c6d7545..acc0b22bb8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.modem; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DeviceStateType { - POWER_SAVE_MODE = 0, - CHARGING_STATE = 1, - LOW_DATA_EXPECTED = 2, + POWER_SAVE_MODE, + CHARGING_STATE, + LOW_DATA_EXPECTED, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl index 41eff51773..8546be789b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl @@ -36,14 +36,26 @@ package android.hardware.radio.modem; interface IRadioModem { oneway void enableModem(in int serial, in boolean on); oneway void getBasebandVersion(in int serial); + /** + * @deprecated use getImei(int serial) + */ oneway void getDeviceIdentity(in int serial); oneway void getHardwareConfig(in int serial); oneway void getModemActivityInfo(in int serial); oneway void getModemStackStatus(in int serial); oneway void getRadioCapability(in int serial); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ oneway void nvReadItem(in int serial, in android.hardware.radio.modem.NvItem itemId); oneway void nvResetConfig(in int serial, in android.hardware.radio.modem.ResetNvType resetType); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ oneway void nvWriteItem(in int serial, in android.hardware.radio.modem.NvWriteItem item); oneway void requestShutdown(in int serial); oneway void responseAcknowledgement(); @@ -51,4 +63,5 @@ interface IRadioModem { oneway void setRadioCapability(in int serial, in android.hardware.radio.modem.RadioCapability rc); oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall); oneway void setResponseFunctions(in android.hardware.radio.modem.IRadioModemResponse radioModemResponse, in android.hardware.radio.modem.IRadioModemIndication radioModemIndication); + oneway void getImei(in int serial); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl index dcaff45017..5955439666 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl @@ -37,17 +37,30 @@ interface IRadioModemResponse { oneway void acknowledgeRequest(in int serial); oneway void enableModemResponse(in android.hardware.radio.RadioResponseInfo info); oneway void getBasebandVersionResponse(in android.hardware.radio.RadioResponseInfo info, in String version); + /** + * @deprecated use getImeiResponse(RadioResponseInfo responseInfo, ImeiInfo imeiInfo) + */ oneway void getDeviceIdentityResponse(in android.hardware.radio.RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid); oneway void getHardwareConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.HardwareConfig[] config); oneway void getModemActivityInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.ActivityStatsInfo activityInfo); oneway void getModemStackStatusResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); oneway void getRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ oneway void nvReadItemResponse(in android.hardware.radio.RadioResponseInfo info, in String result); oneway void nvResetConfigResponse(in android.hardware.radio.RadioResponseInfo info); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ oneway void nvWriteCdmaPrlResponse(in android.hardware.radio.RadioResponseInfo info); + /** + * @deprecated NV APIs are deprecated starting from Android U. + */ oneway void nvWriteItemResponse(in android.hardware.radio.RadioResponseInfo info); oneway void requestShutdownResponse(in android.hardware.radio.RadioResponseInfo info); oneway void sendDeviceStateResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc); oneway void setRadioPowerResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getImeiResponse(in android.hardware.radio.RadioResponseInfo responseInfo, in @nullable android.hardware.radio.modem.ImeiInfo imeiInfo); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl new file mode 100644 index 0000000000..f8776ec412 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.modem; +@JavaDerive(toString=true) @VintfStability +parcelable ImeiInfo { + android.hardware.radio.modem.ImeiInfo.ImeiType type; + String imei; + String svn; + @Backing(type="int") @VintfStability + enum ImeiType { + PRIMARY = 1, + SECONDARY = 2, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl index 3e276434ac..b80d7acde1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl @@ -32,6 +32,9 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/** + * @deprecated NV APIs are deprecated starting from Android U. + */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NvItem { CDMA_MEID = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl index 17b7de0a74..6a786bc419 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl @@ -32,6 +32,9 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/** + * @deprecated NV APIs are deprecated starting from Android U. + */ @JavaDerive(toString=true) @VintfStability parcelable NvWriteItem { android.hardware.radio.modem.NvItem itemId; 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 e3b5796cfc..37622b1312 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 @@ -34,7 +34,7 @@ package android.hardware.radio.modem; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ResetNvType { - RELOAD = 0, - ERASE = 1, - FACTORY_RESET = 2, + RELOAD, + ERASE, + FACTORY_RESET, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.network/2/.hash new file mode 100644 index 0000000000..d3889fa9b0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/.hash @@ -0,0 +1 @@ +1b6608f238bd0b1c642df315621a7b605eafc883 diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl new file mode 100644 index 0000000000..28d886256d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +union AccessTechnologySpecificInfo { + boolean noinit; + android.hardware.radio.network.Cdma2000RegistrationInfo cdmaInfo; + android.hardware.radio.network.EutranRegistrationInfo eutranInfo; + android.hardware.radio.network.NrVopsInfo ngranNrVopsInfo; + boolean geranDtmSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/BarringInfo.aidl new file mode 100644 index 0000000000..e105b39101 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/BarringInfo.aidl @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable BarringInfo { + int serviceType; + int barringType; + @nullable android.hardware.radio.network.BarringTypeSpecificInfo barringTypeSpecificInfo; + const int BARRING_TYPE_NONE = 0; + const int BARRING_TYPE_CONDITIONAL = 1; + const int BARRING_TYPE_UNCONDITIONAL = 2; + const int SERVICE_TYPE_CS_SERVICE = 0; + const int SERVICE_TYPE_PS_SERVICE = 1; + const int SERVICE_TYPE_CS_VOICE = 2; + const int SERVICE_TYPE_MO_SIGNALLING = 3; + const int SERVICE_TYPE_MO_DATA = 4; + const int SERVICE_TYPE_CS_FALLBACK = 5; + const int SERVICE_TYPE_MMTEL_VOICE = 6; + const int SERVICE_TYPE_MMTEL_VIDEO = 7; + const int SERVICE_TYPE_EMERGENCY = 8; + const int SERVICE_TYPE_SMS = 9; + const int SERVICE_TYPE_OPERATOR_1 = 1001; + const int SERVICE_TYPE_OPERATOR_2 = 1002; + const int SERVICE_TYPE_OPERATOR_3 = 1003; + const int SERVICE_TYPE_OPERATOR_4 = 1004; + const int SERVICE_TYPE_OPERATOR_5 = 1005; + const int SERVICE_TYPE_OPERATOR_6 = 1006; + const int SERVICE_TYPE_OPERATOR_7 = 1007; + const int SERVICE_TYPE_OPERATOR_8 = 1008; + const int SERVICE_TYPE_OPERATOR_9 = 1009; + const int SERVICE_TYPE_OPERATOR_10 = 1010; + const int SERVICE_TYPE_OPERATOR_11 = 1011; + const int SERVICE_TYPE_OPERATOR_12 = 1012; + const int SERVICE_TYPE_OPERATOR_13 = 1013; + const int SERVICE_TYPE_OPERATOR_14 = 1014; + const int SERVICE_TYPE_OPERATOR_15 = 1015; + const int SERVICE_TYPE_OPERATOR_16 = 1016; + const int SERVICE_TYPE_OPERATOR_17 = 1017; + const int SERVICE_TYPE_OPERATOR_18 = 1018; + const int SERVICE_TYPE_OPERATOR_19 = 1019; + const int SERVICE_TYPE_OPERATOR_20 = 1020; + const int SERVICE_TYPE_OPERATOR_21 = 1021; + const int SERVICE_TYPE_OPERATOR_22 = 1022; + const int SERVICE_TYPE_OPERATOR_23 = 1023; + const int SERVICE_TYPE_OPERATOR_24 = 1024; + const int SERVICE_TYPE_OPERATOR_25 = 1025; + const int SERVICE_TYPE_OPERATOR_26 = 1026; + const int SERVICE_TYPE_OPERATOR_27 = 1027; + const int SERVICE_TYPE_OPERATOR_28 = 1028; + const int SERVICE_TYPE_OPERATOR_29 = 1029; + const int SERVICE_TYPE_OPERATOR_30 = 1030; + const int SERVICE_TYPE_OPERATOR_31 = 1031; + const int SERVICE_TYPE_OPERATOR_32 = 1032; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/BarringTypeSpecificInfo.aidl new file mode 100644 index 0000000000..a81363339e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/BarringTypeSpecificInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable BarringTypeSpecificInfo { + int factor; + int timeSeconds; + boolean isBarred; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl new file mode 100644 index 0000000000..e8fb79ec98 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable Cdma2000RegistrationInfo { + boolean cssSupported; + int roamingIndicator; + int systemIsInPrl; + int defaultRoamingIndicator; + const int PRL_INDICATOR_NOT_REGISTERED = (-1) /* -1 */; + const int PRL_INDICATOR_NOT_IN_PRL = 0; + const int PRL_INDICATOR_IN_PRL = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CdmaRoamingType.aidl new file mode 100644 index 0000000000..2a4db70cab --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CdmaRoamingType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum CdmaRoamingType { + HOME_NETWORK, + AFFILIATED_ROAM, + ANY_ROAM, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CdmaSignalStrength.aidl new file mode 100644 index 0000000000..e2f97bf98f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CdmaSignalStrength.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSignalStrength { + int dbm; + int ecio; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellConnectionStatus.aidl new file mode 100644 index 0000000000..5ce3b3e613 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellConnectionStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum CellConnectionStatus { + NONE, + PRIMARY_SERVING, + SECONDARY_SERVING, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentity.aidl new file mode 100644 index 0000000000..2ee92dee29 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentity.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +union CellIdentity { + boolean noinit; + android.hardware.radio.network.CellIdentityGsm gsm; + android.hardware.radio.network.CellIdentityWcdma wcdma; + android.hardware.radio.network.CellIdentityTdscdma tdscdma; + android.hardware.radio.network.CellIdentityCdma cdma; + android.hardware.radio.network.CellIdentityLte lte; + android.hardware.radio.network.CellIdentityNr nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityCdma.aidl new file mode 100644 index 0000000000..d659a2891c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityCdma.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellIdentityCdma { + int networkId; + int systemId; + int baseStationId; + int longitude; + int latitude; + android.hardware.radio.network.OperatorInfo operatorNames; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityGsm.aidl new file mode 100644 index 0000000000..d3193be072 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityGsm.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellIdentityGsm { + String mcc; + String mnc; + int lac; + int cid; + int arfcn; + byte bsic; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityLte.aidl new file mode 100644 index 0000000000..2ae7b43e2d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityLte.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellIdentityLte { + String mcc; + String mnc; + int ci; + int pci; + int tac; + int earfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + int bandwidth; + String[] additionalPlmns; + @nullable android.hardware.radio.network.ClosedSubscriberGroupInfo csgInfo; + android.hardware.radio.network.EutranBands[] bands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityNr.aidl new file mode 100644 index 0000000000..b30af506d8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityNr.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellIdentityNr { + String mcc; + String mnc; + long nci; + int pci; + int tac; + int nrarfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; + android.hardware.radio.network.NgranBands[] bands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityTdscdma.aidl new file mode 100644 index 0000000000..e99d14771c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityTdscdma.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellIdentityTdscdma { + String mcc; + String mnc; + int lac; + int cid; + int cpid; + int uarfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; + @nullable android.hardware.radio.network.ClosedSubscriberGroupInfo csgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityWcdma.aidl new file mode 100644 index 0000000000..12001fcd67 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellIdentityWcdma.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellIdentityWcdma { + String mcc; + String mnc; + int lac; + int cid; + int psc; + int uarfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; + @nullable android.hardware.radio.network.ClosedSubscriberGroupInfo csgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfo.aidl new file mode 100644 index 0000000000..467c6b77cc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfo { + boolean registered; + android.hardware.radio.network.CellConnectionStatus connectionStatus; + android.hardware.radio.network.CellInfoRatSpecificInfo ratSpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoCdma.aidl new file mode 100644 index 0000000000..e3bf46b918 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoCdma.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfoCdma { + android.hardware.radio.network.CellIdentityCdma cellIdentityCdma; + android.hardware.radio.network.CdmaSignalStrength signalStrengthCdma; + android.hardware.radio.network.EvdoSignalStrength signalStrengthEvdo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoGsm.aidl new file mode 100644 index 0000000000..84dcd07d72 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoGsm.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfoGsm { + android.hardware.radio.network.CellIdentityGsm cellIdentityGsm; + android.hardware.radio.network.GsmSignalStrength signalStrengthGsm; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoLte.aidl new file mode 100644 index 0000000000..221340b06a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoLte.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfoLte { + android.hardware.radio.network.CellIdentityLte cellIdentityLte; + android.hardware.radio.network.LteSignalStrength signalStrengthLte; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoNr.aidl new file mode 100644 index 0000000000..b392c1d2c7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoNr.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfoNr { + android.hardware.radio.network.CellIdentityNr cellIdentityNr; + android.hardware.radio.network.NrSignalStrength signalStrengthNr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl new file mode 100644 index 0000000000..4ab0640b29 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +union CellInfoRatSpecificInfo { + android.hardware.radio.network.CellInfoGsm gsm; + android.hardware.radio.network.CellInfoWcdma wcdma; + android.hardware.radio.network.CellInfoTdscdma tdscdma; + android.hardware.radio.network.CellInfoLte lte; + android.hardware.radio.network.CellInfoNr nr; + android.hardware.radio.network.CellInfoCdma cdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoTdscdma.aidl new file mode 100644 index 0000000000..138b35ce62 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoTdscdma.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfoTdscdma { + android.hardware.radio.network.CellIdentityTdscdma cellIdentityTdscdma; + android.hardware.radio.network.TdscdmaSignalStrength signalStrengthTdscdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoWcdma.aidl new file mode 100644 index 0000000000..cf7b135c63 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/CellInfoWcdma.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable CellInfoWcdma { + android.hardware.radio.network.CellIdentityWcdma cellIdentityWcdma; + android.hardware.radio.network.WcdmaSignalStrength signalStrengthWcdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl new file mode 100644 index 0000000000..fe734c8f78 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable ClosedSubscriberGroupInfo { + boolean csgIndication; + String homeNodebName; + int csgIdentity; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/Domain.aidl new file mode 100644 index 0000000000..2daeadd7fd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/Domain.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum Domain { + CS = (1 << 0) /* 1 */, + PS = (1 << 1) /* 2 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyMode.aidl new file mode 100644 index 0000000000..071e6b5012 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EmergencyMode { + EMERGENCY_WWAN = 1, + EMERGENCY_WLAN = 2, + EMERGENCY_CALLBACK = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl new file mode 100644 index 0000000000..2797affc01 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable EmergencyNetworkScanTrigger { + android.hardware.radio.AccessNetwork[] accessNetwork; + android.hardware.radio.network.EmergencyScanType scanType; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyRegResult.aidl new file mode 100644 index 0000000000..7d99a53c7b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyRegResult.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable EmergencyRegResult { + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.network.RegState regState; + android.hardware.radio.network.Domain emcDomain; + boolean isVopsSupported; + boolean isEmcBearerSupported; + byte nwProvidedEmc; + byte nwProvidedEmf; + String mcc = ""; + String mnc = ""; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyScanType.aidl new file mode 100644 index 0000000000..5e86c76a43 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EmergencyScanType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EmergencyScanType { + NO_PREFERENCE = 0, + LIMITED_SERVICE = 1, + FULL_SERVICE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EutranBands.aidl new file mode 100644 index 0000000000..57fac3f5d7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EutranBands.aidl @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EutranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_17 = 17, + BAND_18 = 18, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_23 = 23, + BAND_24 = 24, + BAND_25 = 25, + BAND_26 = 26, + BAND_27 = 27, + BAND_28 = 28, + BAND_30 = 30, + BAND_31 = 31, + BAND_33 = 33, + BAND_34 = 34, + BAND_35 = 35, + BAND_36 = 36, + BAND_37 = 37, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_42 = 42, + BAND_43 = 43, + BAND_44 = 44, + BAND_45 = 45, + BAND_46 = 46, + BAND_47 = 47, + BAND_48 = 48, + BAND_65 = 65, + BAND_66 = 66, + BAND_68 = 68, + BAND_70 = 70, + BAND_49 = 49, + BAND_50 = 50, + BAND_51 = 51, + BAND_52 = 52, + BAND_53 = 53, + BAND_71 = 71, + BAND_72 = 72, + BAND_73 = 73, + BAND_74 = 74, + BAND_85 = 85, + BAND_87 = 87, + BAND_88 = 88, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EutranRegistrationInfo.aidl new file mode 100644 index 0000000000..2321cac467 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable EutranRegistrationInfo { + android.hardware.radio.network.LteVopsInfo lteVopsInfo; + android.hardware.radio.network.NrIndicators nrIndicators; + android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType; + int extraInfo; + const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0) /* 1 */; + const int EXTRA_SMS_ONLY = (1 << 1) /* 2 */; + enum AttachResultType { + NONE, + EPS_ONLY, + COMBINED, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EvdoSignalStrength.aidl new file mode 100644 index 0000000000..7c567119f8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/EvdoSignalStrength.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable EvdoSignalStrength { + int dbm; + int ecio; + int signalNoiseRatio; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/GeranBands.aidl new file mode 100644 index 0000000000..135935ff8f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/GeranBands.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum GeranBands { + BAND_T380 = 1, + BAND_T410 = 2, + BAND_450 = 3, + BAND_480 = 4, + BAND_710 = 5, + BAND_750 = 6, + BAND_T810 = 7, + BAND_850 = 8, + BAND_P900 = 9, + BAND_E900 = 10, + BAND_R900 = 11, + BAND_DCS1800 = 12, + BAND_PCS1900 = 13, + BAND_ER900 = 14, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/GsmSignalStrength.aidl new file mode 100644 index 0000000000..2b53b39317 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/GsmSignalStrength.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable GsmSignalStrength { + int signalStrength; + int bitErrorRate; + int timingAdvance; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetwork.aidl new file mode 100644 index 0000000000..382ddd846c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetwork.aidl @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@VintfStability +interface IRadioNetwork { + oneway void getAllowedNetworkTypesBitmap(in int serial); + oneway void getAvailableBandModes(in int serial); + oneway void getAvailableNetworks(in int serial); + oneway void getBarringInfo(in int serial); + oneway void getCdmaRoamingPreference(in int serial); + oneway void getCellInfoList(in int serial); + oneway void getDataRegistrationState(in int serial); + /** + * @deprecated Deprecated starting from Android U. + */ + oneway void getImsRegistrationState(in int serial); + oneway void getNetworkSelectionMode(in int serial); + oneway void getOperator(in int serial); + oneway void getSignalStrength(in int serial); + oneway void getSystemSelectionChannels(in int serial); + oneway void getVoiceRadioTechnology(in int serial); + oneway void getVoiceRegistrationState(in int serial); + oneway void isNrDualConnectivityEnabled(in int serial); + oneway void responseAcknowledgement(); + oneway void setAllowedNetworkTypesBitmap(in int serial, in int networkTypeBitmap); + oneway void setBandMode(in int serial, in android.hardware.radio.network.RadioBandMode mode); + oneway void setBarringPassword(in int serial, in String facility, in String oldPassword, in String newPassword); + oneway void setCdmaRoamingPreference(in int serial, in android.hardware.radio.network.CdmaRoamingType type); + oneway void setCellInfoListRate(in int serial, in int rate); + oneway void setIndicationFilter(in int serial, in int indicationFilter); + oneway void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps, in int[] thresholdsUplinkKbps, in android.hardware.radio.AccessNetwork accessNetwork); + oneway void setLocationUpdates(in int serial, in boolean enable); + oneway void setNetworkSelectionModeAutomatic(in int serial); + oneway void setNetworkSelectionModeManual(in int serial, in String operatorNumeric, in android.hardware.radio.AccessNetwork ran); + oneway void setNrDualConnectivityState(in int serial, in android.hardware.radio.network.NrDualConnectivityState nrDualConnectivityState); + oneway void setResponseFunctions(in android.hardware.radio.network.IRadioNetworkResponse radioNetworkResponse, in android.hardware.radio.network.IRadioNetworkIndication radioNetworkIndication); + oneway void setSignalStrengthReportingCriteria(in int serial, in android.hardware.radio.network.SignalThresholdInfo[] signalThresholdInfos); + oneway void setSuppServiceNotifications(in int serial, in boolean enable); + oneway void setSystemSelectionChannels(in int serial, in boolean specifyChannels, in android.hardware.radio.network.RadioAccessSpecifier[] specifiers); + oneway void startNetworkScan(in int serial, in android.hardware.radio.network.NetworkScanRequest request); + oneway void stopNetworkScan(in int serial); + oneway void supplyNetworkDepersonalization(in int serial, in String netPin); + oneway void setUsageSetting(in int serial, in android.hardware.radio.network.UsageSetting usageSetting); + oneway void getUsageSetting(in int serial); + oneway void setEmergencyMode(int serial, in android.hardware.radio.network.EmergencyMode emcModeType); + oneway void triggerEmergencyNetworkScan(int serial, in android.hardware.radio.network.EmergencyNetworkScanTrigger request); + oneway void cancelEmergencyNetworkScan(int serial, boolean resetScan); + oneway void exitEmergencyMode(in int serial); + oneway void setNullCipherAndIntegrityEnabled(in int serial, in boolean enabled); + oneway void isNullCipherAndIntegrityEnabled(in int serial); + oneway void isN1ModeEnabled(in int serial); + oneway void setN1ModeEnabled(in int serial, boolean enable); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetworkIndication.aidl new file mode 100644 index 0000000000..0f017ea8ba --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@VintfStability +interface IRadioNetworkIndication { + oneway void barringInfoChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in android.hardware.radio.network.BarringInfo[] barringInfos); + oneway void cdmaPrlChanged(in android.hardware.radio.RadioIndicationType type, in int version); + oneway void cellInfoList(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellInfo[] records); + oneway void currentLinkCapacityEstimate(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.LinkCapacityEstimate lce); + oneway void currentPhysicalChannelConfigs(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.PhysicalChannelConfig[] configs); + oneway void currentSignalStrength(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SignalStrength signalStrength); + oneway void imsNetworkStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void networkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.NetworkScanResult result); + oneway void networkStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void nitzTimeReceived(in android.hardware.radio.RadioIndicationType type, in String nitzTime, in long receivedTimeMs, in long ageMs); + oneway void registrationFailed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in String chosenPlmn, in int domain, in int causeCode, in int additionalCauseCode); + oneway void restrictedStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.PhoneRestrictedState state); + oneway void suppSvcNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SuppSvcNotification suppSvc); + oneway void voiceRadioTechChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioTechnology rat); + oneway void emergencyNetworkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.EmergencyRegResult result); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetworkResponse.aidl new file mode 100644 index 0000000000..bfe8fa3f67 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@VintfStability +interface IRadioNetworkResponse { + oneway void acknowledgeRequest(in int serial); + oneway void getAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in int networkTypeBitmap); + oneway void getAvailableBandModesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RadioBandMode[] bandModes); + oneway void getAvailableNetworksResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.OperatorInfo[] networkInfos); + oneway void getBarringInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CellIdentity cellIdentity, in android.hardware.radio.network.BarringInfo[] barringInfos); + oneway void getCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CdmaRoamingType type); + oneway void getCellInfoListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CellInfo[] cellInfo); + oneway void getDataRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RegStateResult dataRegResponse); + /** + * @deprecated Deprecated starting from Android U. + */ + oneway void getImsRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isRegistered, in android.hardware.radio.RadioTechnologyFamily ratFamily); + oneway void getNetworkSelectionModeResponse(in android.hardware.radio.RadioResponseInfo info, in boolean manual); + oneway void getOperatorResponse(in android.hardware.radio.RadioResponseInfo info, in String longName, in String shortName, in String numeric); + oneway void getSignalStrengthResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.SignalStrength signalStrength); + oneway void getSystemSelectionChannelsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RadioAccessSpecifier[] specifiers); + oneway void getVoiceRadioTechnologyResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioTechnology rat); + oneway void getVoiceRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RegStateResult voiceRegResponse); + oneway void isNrDualConnectivityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void setAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setBandModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setBarringPasswordResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCellInfoListRateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setIndicationFilterResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setLinkCapacityReportingCriteriaResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setLocationUpdatesResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNetworkSelectionModeAutomaticResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNetworkSelectionModeManualResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNrDualConnectivityStateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSignalStrengthReportingCriteriaResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSuppServiceNotificationsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSystemSelectionChannelsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void supplyNetworkDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void setUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.UsageSetting usageSetting); + oneway void setEmergencyModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.EmergencyRegResult regState); + oneway void triggerEmergencyNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void exitEmergencyModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void cancelEmergencyNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void isNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void isN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled); + oneway void setN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IndicationFilter.aidl new file mode 100644 index 0000000000..cd538c86ef --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/IndicationFilter.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum IndicationFilter { + NONE = 0, + ALL = (~0) /* -1 */, + SIGNAL_STRENGTH = (1 << 0) /* 1 */, + FULL_NETWORK_STATE = (1 << 1) /* 2 */, + DATA_CALL_DORMANCY_CHANGED = (1 << 2) /* 4 */, + LINK_CAPACITY_ESTIMATE = (1 << 3) /* 8 */, + PHYSICAL_CHANNEL_CONFIG = (1 << 4) /* 16 */, + REGISTRATION_FAILURE = (1 << 5) /* 32 */, + BARRING_INFO = (1 << 6) /* 64 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LceDataInfo.aidl new file mode 100644 index 0000000000..27b16c11fb --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LceDataInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable LceDataInfo { + int lastHopCapacityKbps; + byte confidenceLevel; + boolean lceSuspended; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LinkCapacityEstimate.aidl new file mode 100644 index 0000000000..5707b8e990 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LinkCapacityEstimate.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable LinkCapacityEstimate { + int downlinkCapacityKbps; + int uplinkCapacityKbps; + int secondaryDownlinkCapacityKbps; + int secondaryUplinkCapacityKbps; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LteSignalStrength.aidl new file mode 100644 index 0000000000..b5b8579305 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LteSignalStrength.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable LteSignalStrength { + int signalStrength; + int rsrp; + int rsrq; + int rssnr; + int cqi; + int timingAdvance; + int cqiTableIndex; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LteVopsInfo.aidl new file mode 100644 index 0000000000..6d8dd4e83a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/LteVopsInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable LteVopsInfo { + boolean isVopsSupported; + boolean isEmcBearerSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NetworkScanRequest.aidl new file mode 100644 index 0000000000..6039740167 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NetworkScanRequest.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable NetworkScanRequest { + int type; + int interval; + android.hardware.radio.network.RadioAccessSpecifier[] specifiers; + int maxSearchTime; + boolean incrementalResults; + int incrementalResultsPeriodicity; + String[] mccMncs; + const int RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MIN = 1; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MAX = 10; + const int MAX_SEARCH_TIME_RANGE_MIN = 60; + const int MAX_SEARCH_TIME_RANGE_MAX = 3600; + const int SCAN_INTERVAL_RANGE_MIN = 5; + const int SCAN_INTERVAL_RANGE_MAX = 300; + const int SCAN_TYPE_ONE_SHOT = 0; + const int SCAN_TYPE_PERIODIC = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NetworkScanResult.aidl new file mode 100644 index 0000000000..4e392d0c5c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NetworkScanResult.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable NetworkScanResult { + int status; + android.hardware.radio.RadioError error; + android.hardware.radio.network.CellInfo[] networkInfos; + const int SCAN_STATUS_PARTIAL = 1; + const int SCAN_STATUS_COMPLETE = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NgranBands.aidl new file mode 100644 index 0000000000..590469076a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NgranBands.aidl @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum NgranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_5 = 5, + BAND_7 = 7, + BAND_8 = 8, + BAND_12 = 12, + BAND_14 = 14, + BAND_18 = 18, + BAND_20 = 20, + BAND_25 = 25, + BAND_26 = 26, + BAND_28 = 28, + BAND_29 = 29, + BAND_30 = 30, + BAND_34 = 34, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_46 = 46, + BAND_48 = 48, + BAND_50 = 50, + BAND_51 = 51, + BAND_53 = 53, + BAND_65 = 65, + BAND_66 = 66, + BAND_70 = 70, + BAND_71 = 71, + BAND_74 = 74, + BAND_75 = 75, + BAND_76 = 76, + BAND_77 = 77, + BAND_78 = 78, + BAND_79 = 79, + BAND_80 = 80, + BAND_81 = 81, + BAND_82 = 82, + BAND_83 = 83, + BAND_84 = 84, + BAND_86 = 86, + BAND_89 = 89, + BAND_90 = 90, + BAND_91 = 91, + BAND_92 = 92, + BAND_93 = 93, + BAND_94 = 94, + BAND_95 = 95, + BAND_96 = 96, + BAND_257 = 257, + BAND_258 = 258, + BAND_260 = 260, + BAND_261 = 261, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrDualConnectivityState.aidl new file mode 100644 index 0000000000..62c2a56c8d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrDualConnectivityState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability +enum NrDualConnectivityState { + ENABLE = 1, + DISABLE = 2, + DISABLE_IMMEDIATE = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrIndicators.aidl new file mode 100644 index 0000000000..88429f6f38 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrIndicators.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable NrIndicators { + boolean isEndcAvailable; + boolean isDcNrRestricted; + boolean isNrAvailable; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrSignalStrength.aidl new file mode 100644 index 0000000000..7d6ab8234a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrSignalStrength.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable NrSignalStrength { + int ssRsrp; + int ssRsrq; + int ssSinr; + int csiRsrp; + int csiRsrq; + int csiSinr; + int csiCqiTableIndex; + byte[] csiCqiReport; + int timingAdvance = 0x7FFFFFFF; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrVopsInfo.aidl new file mode 100644 index 0000000000..e5a0a700ca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/NrVopsInfo.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable NrVopsInfo { + byte vopsSupported; + byte emcSupported; + byte emfSupported; + const byte EMC_INDICATOR_NOT_SUPPORTED = 0; + const byte EMC_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + const byte EMC_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + const byte EMC_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + const byte EMF_INDICATOR_NOT_SUPPORTED = 0; + const byte EMF_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + const byte EMF_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + const byte EMF_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + const byte VOPS_INDICATOR_VOPS_NOT_SUPPORTED = 0; + const byte VOPS_INDICATOR_VOPS_OVER_3GPP = 1; + const byte VOPS_INDICATOR_VOPS_OVER_NON_3GPP = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/OperatorInfo.aidl new file mode 100644 index 0000000000..034150e61f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/OperatorInfo.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable OperatorInfo { + String alphaLong; + String alphaShort; + String operatorNumeric; + int status; + const int STATUS_UNKNOWN = 0; + const int STATUS_AVAILABLE = 1; + const int STATUS_CURRENT = 2; + const int STATUS_FORBIDDEN = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhoneRestrictedState.aidl new file mode 100644 index 0000000000..4e3e39eab0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhoneRestrictedState.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum PhoneRestrictedState { + NONE = 0x00, + CS_EMERGENCY = 0x01, + CS_NORMAL = 0x02, + CS_ALL = 0x04, + PS_ALL = 0x10, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhysicalChannelConfig.aidl new file mode 100644 index 0000000000..928c6b728c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhysicalChannelConfig.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable PhysicalChannelConfig { + android.hardware.radio.network.CellConnectionStatus status; + android.hardware.radio.RadioTechnology rat; + int downlinkChannelNumber; + int uplinkChannelNumber; + int cellBandwidthDownlinkKhz; + int cellBandwidthUplinkKhz; + int[] contextIds; + int physicalCellId; + android.hardware.radio.network.PhysicalChannelConfigBand band; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhysicalChannelConfigBand.aidl new file mode 100644 index 0000000000..efc64a6930 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/PhysicalChannelConfigBand.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +union PhysicalChannelConfigBand { + boolean noinit; + android.hardware.radio.network.GeranBands geranBand; + android.hardware.radio.network.UtranBands utranBand; + android.hardware.radio.network.EutranBands eutranBand; + android.hardware.radio.network.NgranBands ngranBand; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioAccessSpecifier.aidl new file mode 100644 index 0000000000..1566bb5224 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioAccessSpecifier.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable RadioAccessSpecifier { + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.network.RadioAccessSpecifierBands bands; + int[] channels; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioAccessSpecifierBands.aidl new file mode 100644 index 0000000000..a6ac12a28a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioAccessSpecifierBands.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +union RadioAccessSpecifierBands { + boolean noinit; + android.hardware.radio.network.GeranBands[] geranBands; + android.hardware.radio.network.UtranBands[] utranBands; + android.hardware.radio.network.EutranBands[] eutranBands; + android.hardware.radio.network.NgranBands[] ngranBands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioBandMode.aidl new file mode 100644 index 0000000000..74696fbfbf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RadioBandMode.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioBandMode { + BAND_MODE_UNSPECIFIED, + BAND_MODE_EURO, + BAND_MODE_USA, + BAND_MODE_JPN, + BAND_MODE_AUS, + BAND_MODE_AUS_2, + BAND_MODE_CELL_800, + BAND_MODE_PCS, + BAND_MODE_JTACS, + BAND_MODE_KOREA_PCS, + BAND_MODE_5_450M, + BAND_MODE_IMT2000, + BAND_MODE_7_700M_2, + BAND_MODE_8_1800M, + BAND_MODE_9_900M, + BAND_MODE_10_800M_2, + BAND_MODE_EURO_PAMR_400M, + BAND_MODE_AWS, + BAND_MODE_USA_2500M, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegState.aidl new file mode 100644 index 0000000000..711c9ac3a6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegState.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RegState { + NOT_REG_MT_NOT_SEARCHING_OP = 0, + REG_HOME = 1, + NOT_REG_MT_SEARCHING_OP = 2, + REG_DENIED = 3, + UNKNOWN = 4, + REG_ROAMING = 5, + NOT_REG_MT_NOT_SEARCHING_OP_EM = 10, + NOT_REG_MT_SEARCHING_OP_EM = 12, + REG_DENIED_EM = 13, + UNKNOWN_EM = 14, + REG_EM = 20, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegStateResult.aidl new file mode 100644 index 0000000000..f0a03aea4f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegStateResult.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable RegStateResult { + android.hardware.radio.network.RegState regState; + android.hardware.radio.RadioTechnology rat; + android.hardware.radio.network.RegistrationFailCause reasonForDenial; + android.hardware.radio.network.CellIdentity cellIdentity; + String registeredPlmn; + android.hardware.radio.network.AccessTechnologySpecificInfo accessTechnologySpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegistrationFailCause.aidl new file mode 100644 index 0000000000..8acf8ab22d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/RegistrationFailCause.aidl @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RegistrationFailCause { + NONE = 0, + IMSI_UNKNOWN_IN_HLR = 2, + ILLEGAL_MS = 3, + IMSI_UNKNOWN_IN_VLR = 4, + IMEI_NOT_ACCEPTED = 5, + ILLEGAL_ME = 6, + GPRS_SERVICES_NOT_ALLOWED = 7, + GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 8, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK = 9, + IMPLICITLY_DETACHED = 10, + PLMN_NOT_ALLOWED = 11, + LOCATION_AREA_NOT_ALLOWED = 12, + ROAMING_NOT_ALLOWED = 13, + GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14, + NO_SUITABLE_CELLS = 15, + MSC_TEMPORARILY_NOT_REACHABLE = 15, + NETWORK_FAILURE = 17, + MAC_FAILURE = 20, + SYNC_FAILURE = 21, + CONGESTION = 22, + GSM_AUTHENTICATION_UNACCEPTABLE = 23, + NOT_AUTHORIZED_FOR_THIS_CSG = 25, + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA, + SERVICE_OPTION_NOT_SUPPORTED = 32, + SERVICE_OPTION_NOT_SUBSCRIBED = 33, + SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34, + CALL_CANNOT_BE_IDENTIFIED = 38, + NO_PDP_CONTEXT_ACTIVATED = 40, + RETRY_UPON_ENTRY_INTO_NEW_CELL_1 = 48, + RETRY_UPON_ENTRY_INTO_NEW_CELL_2 = 49, + RETRY_UPON_ENTRY_INTO_NEW_CELL_3 = 50, + RETRY_UPON_ENTRY_INTO_NEW_CELL_4 = 51, + RETRY_UPON_ENTRY_INTO_NEW_CELL_5 = 52, + RETRY_UPON_ENTRY_INTO_NEW_CELL_6 = 53, + RETRY_UPON_ENTRY_INTO_NEW_CELL_7 = 54, + RETRY_UPON_ENTRY_INTO_NEW_CELL_8 = 55, + RETRY_UPON_ENTRY_INTO_NEW_CELL_9 = 56, + RETRY_UPON_ENTRY_INTO_NEW_CELL_10 = 57, + RETRY_UPON_ENTRY_INTO_NEW_CELL_11 = 58, + RETRY_UPON_ENTRY_INTO_NEW_CELL_12 = 59, + RETRY_UPON_ENTRY_INTO_NEW_CELL_13 = 60, + RETRY_UPON_ENTRY_INTO_NEW_CELL_14 = 61, + RETRY_UPON_ENTRY_INTO_NEW_CELL_15 = 62, + RETRY_UPON_ENTRY_INTO_NEW_CELL_16 = 63, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + PROTOCOL_ERROR_UNSPECIFIED = 111, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SignalStrength.aidl new file mode 100644 index 0000000000..1c50190947 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SignalStrength.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable SignalStrength { + android.hardware.radio.network.GsmSignalStrength gsm; + android.hardware.radio.network.CdmaSignalStrength cdma; + android.hardware.radio.network.EvdoSignalStrength evdo; + android.hardware.radio.network.LteSignalStrength lte; + android.hardware.radio.network.TdscdmaSignalStrength tdscdma; + android.hardware.radio.network.WcdmaSignalStrength wcdma; + android.hardware.radio.network.NrSignalStrength nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SignalThresholdInfo.aidl new file mode 100644 index 0000000000..744eed7ec5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable SignalThresholdInfo { + int signalMeasurement; + int hysteresisMs; + int hysteresisDb; + int[] thresholds; + boolean isEnabled; + android.hardware.radio.AccessNetwork ran; + const int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; + const int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; + const int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; + const int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4; + const int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5; + const int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; + const int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; + const int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; + const int SIGNAL_MEASUREMENT_TYPE_ECNO = 9; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SuppSvcNotification.aidl new file mode 100644 index 0000000000..b62c71bd37 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/SuppSvcNotification.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable SuppSvcNotification { + boolean isMT; + int code; + int index; + int type; + String number; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/TdscdmaSignalStrength.aidl new file mode 100644 index 0000000000..d74c950bde --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/TdscdmaSignalStrength.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable TdscdmaSignalStrength { + int signalStrength; + int bitErrorRate; + int rscp; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/UsageSetting.aidl new file mode 100644 index 0000000000..3ca16b5eaa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/UsageSetting.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum UsageSetting { + VOICE_CENTRIC = 1, + DATA_CENTRIC = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/UtranBands.aidl new file mode 100644 index 0000000000..8be3da28f3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/UtranBands.aidl @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum UtranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_25 = 25, + BAND_26 = 26, + BAND_A = 101, + BAND_B = 102, + BAND_C = 103, + BAND_D = 104, + BAND_E = 105, + BAND_F = 106, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/WcdmaSignalStrength.aidl new file mode 100644 index 0000000000..91125271d2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/2/android/hardware/radio/network/WcdmaSignalStrength.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable WcdmaSignalStrength { + int signalStrength; + int bitErrorRate; + int rscp; + int ecno; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl index 74c4e29d2b..927f9ac695 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl @@ -38,7 +38,7 @@ parcelable Cdma2000RegistrationInfo { int roamingIndicator; int systemIsInPrl; int defaultRoamingIndicator; - const int PRL_INDICATOR_NOT_REGISTERED = -1; + const int PRL_INDICATOR_NOT_REGISTERED = (-1); const int PRL_INDICATOR_NOT_IN_PRL = 0; const int PRL_INDICATOR_IN_PRL = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl index 24ec26b893..2a4db70cab 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaRoamingType { - HOME_NETWORK = 0, - AFFILIATED_ROAM = 1, - ANY_ROAM = 2, + HOME_NETWORK, + AFFILIATED_ROAM, + ANY_ROAM, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl index 8986d719c4..5ce3b3e613 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CellConnectionStatus { - NONE = 0, - PRIMARY_SERVING = 1, - SECONDARY_SERVING = 2, + NONE, + PRIMARY_SERVING, + SECONDARY_SERVING, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl index 209cf5e802..6b022b6955 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum Domain { - CS = 1, - PS = 2, + CS = (1 << 0), + PS = (1 << 1), } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl new file mode 100644 index 0000000000..071e6b5012 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EmergencyMode { + EMERGENCY_WWAN = 1, + EMERGENCY_WLAN = 2, + EMERGENCY_CALLBACK = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl new file mode 100644 index 0000000000..2797affc01 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable EmergencyNetworkScanTrigger { + android.hardware.radio.AccessNetwork[] accessNetwork; + android.hardware.radio.network.EmergencyScanType scanType; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl new file mode 100644 index 0000000000..7d99a53c7b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@JavaDerive(toString=true) @VintfStability +parcelable EmergencyRegResult { + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.network.RegState regState; + android.hardware.radio.network.Domain emcDomain; + boolean isVopsSupported; + boolean isEmcBearerSupported; + byte nwProvidedEmc; + byte nwProvidedEmf; + String mcc = ""; + String mnc = ""; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl new file mode 100644 index 0000000000..5e86c76a43 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.network; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EmergencyScanType { + NO_PREFERENCE = 0, + LIMITED_SERVICE = 1, + FULL_SERVICE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl index dfbf881353..90e342a9b7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -36,4 +36,13 @@ package android.hardware.radio.network; parcelable EutranRegistrationInfo { android.hardware.radio.network.LteVopsInfo lteVopsInfo; android.hardware.radio.network.NrIndicators nrIndicators; + android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType; + int extraInfo; + const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0); + const int EXTRA_SMS_ONLY = (1 << 1); + enum AttachResultType { + NONE, + EPS_ONLY, + COMBINED, + } } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl index 2b70e45084..382ddd846c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl @@ -41,6 +41,9 @@ interface IRadioNetwork { oneway void getCdmaRoamingPreference(in int serial); oneway void getCellInfoList(in int serial); oneway void getDataRegistrationState(in int serial); + /** + * @deprecated Deprecated starting from Android U. + */ oneway void getImsRegistrationState(in int serial); oneway void getNetworkSelectionMode(in int serial); oneway void getOperator(in int serial); @@ -70,4 +73,12 @@ interface IRadioNetwork { oneway void supplyNetworkDepersonalization(in int serial, in String netPin); oneway void setUsageSetting(in int serial, in android.hardware.radio.network.UsageSetting usageSetting); oneway void getUsageSetting(in int serial); + oneway void setEmergencyMode(int serial, in android.hardware.radio.network.EmergencyMode emcModeType); + oneway void triggerEmergencyNetworkScan(int serial, in android.hardware.radio.network.EmergencyNetworkScanTrigger request); + oneway void cancelEmergencyNetworkScan(int serial, boolean resetScan); + oneway void exitEmergencyMode(in int serial); + oneway void setNullCipherAndIntegrityEnabled(in int serial, in boolean enabled); + oneway void isNullCipherAndIntegrityEnabled(in int serial); + oneway void isN1ModeEnabled(in int serial); + oneway void setN1ModeEnabled(in int serial, boolean enable); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl index bd03c51ec7..0f017ea8ba 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -48,4 +48,5 @@ interface IRadioNetworkIndication { oneway void restrictedStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.PhoneRestrictedState state); oneway void suppSvcNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SuppSvcNotification suppSvc); oneway void voiceRadioTechChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioTechnology rat); + oneway void emergencyNetworkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.EmergencyRegResult result); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl index 5f6c7369f4..bfe8fa3f67 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -42,6 +42,9 @@ interface IRadioNetworkResponse { oneway void getCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CdmaRoamingType type); oneway void getCellInfoListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CellInfo[] cellInfo); oneway void getDataRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RegStateResult dataRegResponse); + /** + * @deprecated Deprecated starting from Android U. + */ oneway void getImsRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isRegistered, in android.hardware.radio.RadioTechnologyFamily ratFamily); oneway void getNetworkSelectionModeResponse(in android.hardware.radio.RadioResponseInfo info, in boolean manual); oneway void getOperatorResponse(in android.hardware.radio.RadioResponseInfo info, in String longName, in String shortName, in String numeric); @@ -69,4 +72,12 @@ interface IRadioNetworkResponse { oneway void supplyNetworkDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); oneway void setUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info); oneway void getUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.UsageSetting usageSetting); + oneway void setEmergencyModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.EmergencyRegResult regState); + oneway void triggerEmergencyNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void exitEmergencyModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void cancelEmergencyNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void isNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void isN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled); + oneway void setN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl index d9ed68ed6d..00ba3469c7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl @@ -35,12 +35,12 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum IndicationFilter { NONE = 0, - ALL = -1, - SIGNAL_STRENGTH = 1, - FULL_NETWORK_STATE = 2, - DATA_CALL_DORMANCY_CHANGED = 4, - LINK_CAPACITY_ESTIMATE = 8, - PHYSICAL_CHANNEL_CONFIG = 16, - REGISTRATION_FAILURE = 32, - BARRING_INFO = 64, + ALL = (~0), + SIGNAL_STRENGTH = (1 << 0), + FULL_NETWORK_STATE = (1 << 1), + DATA_CALL_DORMANCY_CHANGED = (1 << 2), + LINK_CAPACITY_ESTIMATE = (1 << 3), + PHYSICAL_CHANNEL_CONFIG = (1 << 4), + REGISTRATION_FAILURE = (1 << 5), + BARRING_INFO = (1 << 6), } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl index 98bbe6bd94..7d6ab8234a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl @@ -42,4 +42,5 @@ parcelable NrSignalStrength { int csiSinr; int csiCqiTableIndex; byte[] csiCqiReport; + int timingAdvance = 0x7FFFFFFF; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl index 41555f9e3d..4e3e39eab0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl @@ -34,9 +34,9 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PhoneRestrictedState { - NONE = 0, - CS_EMERGENCY = 1, - CS_NORMAL = 2, - CS_ALL = 4, - PS_ALL = 16, + NONE = 0x00, + CS_EMERGENCY = 0x01, + CS_NORMAL = 0x02, + CS_ALL = 0x04, + PS_ALL = 0x10, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl index e9a9f6034c..74696fbfbf 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl @@ -34,23 +34,23 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioBandMode { - BAND_MODE_UNSPECIFIED = 0, - BAND_MODE_EURO = 1, - BAND_MODE_USA = 2, - BAND_MODE_JPN = 3, - BAND_MODE_AUS = 4, - BAND_MODE_AUS_2 = 5, - BAND_MODE_CELL_800 = 6, - BAND_MODE_PCS = 7, - BAND_MODE_JTACS = 8, - BAND_MODE_KOREA_PCS = 9, - BAND_MODE_5_450M = 10, - BAND_MODE_IMT2000 = 11, - BAND_MODE_7_700M_2 = 12, - BAND_MODE_8_1800M = 13, - BAND_MODE_9_900M = 14, - BAND_MODE_10_800M_2 = 15, - BAND_MODE_EURO_PAMR_400M = 16, - BAND_MODE_AWS = 17, - BAND_MODE_USA_2500M = 18, + BAND_MODE_UNSPECIFIED, + BAND_MODE_EURO, + BAND_MODE_USA, + BAND_MODE_JPN, + BAND_MODE_AUS, + BAND_MODE_AUS_2, + BAND_MODE_CELL_800, + BAND_MODE_PCS, + BAND_MODE_JTACS, + BAND_MODE_KOREA_PCS, + BAND_MODE_5_450M, + BAND_MODE_IMT2000, + BAND_MODE_7_700M_2, + BAND_MODE_8_1800M, + BAND_MODE_9_900M, + BAND_MODE_10_800M_2, + BAND_MODE_EURO_PAMR_400M, + BAND_MODE_AWS, + BAND_MODE_USA_2500M, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl index e6e7999f6d..711c9ac3a6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl @@ -44,4 +44,5 @@ enum RegState { NOT_REG_MT_SEARCHING_OP_EM = 12, REG_DENIED_EM = 13, UNKNOWN_EM = 14, + REG_EM = 20, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl index e2cd44ce0c..8acf8ab22d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl @@ -56,7 +56,7 @@ enum RegistrationFailCause { CONGESTION = 22, GSM_AUTHENTICATION_UNACCEPTABLE = 23, NOT_AUTHORIZED_FOR_THIS_CSG = 25, - SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA = 26, + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA, SERVICE_OPTION_NOT_SUPPORTED = 32, SERVICE_OPTION_NOT_SUBSCRIBED = 33, SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl index 040932cf5b..744eed7ec5 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -48,4 +48,5 @@ parcelable SignalThresholdInfo { const int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; const int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; const int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; + const int SIGNAL_MEASUREMENT_TYPE_ECNO = 9; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.sap/1/.hash new file mode 100644 index 0000000000..876503fb1c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/.hash @@ -0,0 +1 @@ +dacee485b56bd1e1e5b5bcdedbd20e71ac24444b diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/ISap.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/ISap.aidl new file mode 100644 index 0000000000..37391e9804 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/ISap.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@VintfStability +interface ISap { + oneway void apduReq(in int serial, in android.hardware.radio.sap.SapApduType type, in byte[] command); + oneway void connectReq(in int serial, in int maxMsgSizeBytes); + oneway void disconnectReq(in int serial); + oneway void powerReq(in int serial, in boolean powerOn); + oneway void resetSimReq(in int serial); + oneway void setCallback(in android.hardware.radio.sap.ISapCallback sapCallback); + oneway void setTransferProtocolReq(in int serial, in android.hardware.radio.sap.SapTransferProtocol transferProtocol); + oneway void transferAtrReq(in int serial); + oneway void transferCardReaderStatusReq(in int serial); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/ISapCallback.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/ISapCallback.aidl new file mode 100644 index 0000000000..d507709a6d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/ISapCallback.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@VintfStability +interface ISapCallback { + oneway void apduResponse(in int serial, in android.hardware.radio.sap.SapResultCode resultCode, in byte[] apduRsp); + oneway void connectResponse(in int serial, in android.hardware.radio.sap.SapConnectRsp sapConnectRsp, in int maxMsgSizeBytes); + oneway void disconnectIndication(in int serial, in android.hardware.radio.sap.SapDisconnectType disconnectType); + oneway void disconnectResponse(in int serial); + oneway void errorResponse(in int serial); + oneway void powerResponse(in int serial, in android.hardware.radio.sap.SapResultCode resultCode); + oneway void resetSimResponse(in int serial, in android.hardware.radio.sap.SapResultCode resultCode); + oneway void statusIndication(in int serial, in android.hardware.radio.sap.SapStatus status); + oneway void transferAtrResponse(in int serial, in android.hardware.radio.sap.SapResultCode resultCode, in byte[] atr); + oneway void transferCardReaderStatusResponse(in int serial, in android.hardware.radio.sap.SapResultCode resultCode, in int cardReaderStatus); + oneway void transferProtocolResponse(in int serial, in android.hardware.radio.sap.SapResultCode resultCode); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapApduType.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapApduType.aidl new file mode 100644 index 0000000000..6cef92bdf1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapApduType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@Backing(type="int") @VintfStability +enum SapApduType { + APDU, + APDU7816, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapConnectRsp.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapConnectRsp.aidl new file mode 100644 index 0000000000..841dfe3e8c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapConnectRsp.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@Backing(type="int") @VintfStability +enum SapConnectRsp { + SUCCESS, + CONNECT_FAILURE, + MSG_SIZE_TOO_LARGE, + MSG_SIZE_TOO_SMALL, + CONNECT_OK_CALL_ONGOING, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapDisconnectType.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapDisconnectType.aidl new file mode 100644 index 0000000000..dace1e1ace --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapDisconnectType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@Backing(type="int") @VintfStability +enum SapDisconnectType { + GRACEFUL, + IMMEDIATE, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapResultCode.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapResultCode.aidl new file mode 100644 index 0000000000..a2a6df0a05 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapResultCode.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@Backing(type="int") @VintfStability +enum SapResultCode { + SUCCESS, + GENERIC_FAILURE, + CARD_NOT_ACCESSSIBLE, + CARD_ALREADY_POWERED_OFF, + CARD_REMOVED, + CARD_ALREADY_POWERED_ON, + DATA_NOT_AVAILABLE, + NOT_SUPPORTED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapStatus.aidl new file mode 100644 index 0000000000..6988c994c9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@Backing(type="int") @VintfStability +enum SapStatus { + UNKNOWN_ERROR, + CARD_RESET, + CARD_NOT_ACCESSIBLE, + CARD_REMOVED, + CARD_INSERTED, + RECOVERED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapTransferProtocol.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapTransferProtocol.aidl new file mode 100644 index 0000000000..3c6852eb22 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/1/android/hardware/radio/sap/SapTransferProtocol.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sap; +@Backing(type="int") @VintfStability +enum SapTransferProtocol { + T0, + T1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl index e0e2a03956..6cef92bdf1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapApduType.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.sap; @Backing(type="int") @VintfStability enum SapApduType { - APDU = 0, - APDU7816 = 1, + APDU, + APDU7816, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl index aceac3789c..841dfe3e8c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapConnectRsp.aidl @@ -34,9 +34,9 @@ package android.hardware.radio.sap; @Backing(type="int") @VintfStability enum SapConnectRsp { - SUCCESS = 0, - CONNECT_FAILURE = 1, - MSG_SIZE_TOO_LARGE = 2, - MSG_SIZE_TOO_SMALL = 3, - CONNECT_OK_CALL_ONGOING = 4, + SUCCESS, + CONNECT_FAILURE, + MSG_SIZE_TOO_LARGE, + MSG_SIZE_TOO_SMALL, + CONNECT_OK_CALL_ONGOING, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl index 0447f9b083..dace1e1ace 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapDisconnectType.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.sap; @Backing(type="int") @VintfStability enum SapDisconnectType { - GRACEFUL = 0, - IMMEDIATE = 1, + GRACEFUL, + IMMEDIATE, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl index 1db226b43c..a2a6df0a05 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapResultCode.aidl @@ -34,12 +34,12 @@ package android.hardware.radio.sap; @Backing(type="int") @VintfStability enum SapResultCode { - SUCCESS = 0, - GENERIC_FAILURE = 1, - CARD_NOT_ACCESSSIBLE = 2, - CARD_ALREADY_POWERED_OFF = 3, - CARD_REMOVED = 4, - CARD_ALREADY_POWERED_ON = 5, - DATA_NOT_AVAILABLE = 6, - NOT_SUPPORTED = 7, + SUCCESS, + GENERIC_FAILURE, + CARD_NOT_ACCESSSIBLE, + CARD_ALREADY_POWERED_OFF, + CARD_REMOVED, + CARD_ALREADY_POWERED_ON, + DATA_NOT_AVAILABLE, + NOT_SUPPORTED, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl index 32f71c218a..6988c994c9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapStatus.aidl @@ -34,10 +34,10 @@ package android.hardware.radio.sap; @Backing(type="int") @VintfStability enum SapStatus { - UNKNOWN_ERROR = 0, - CARD_RESET = 1, - CARD_NOT_ACCESSIBLE = 2, - CARD_REMOVED = 3, - CARD_INSERTED = 4, - RECOVERED = 5, + UNKNOWN_ERROR, + CARD_RESET, + CARD_NOT_ACCESSIBLE, + CARD_REMOVED, + CARD_INSERTED, + RECOVERED, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl index e3ffdb0702..3c6852eb22 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sap/current/android/hardware/radio/sap/SapTransferProtocol.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.sap; @Backing(type="int") @VintfStability enum SapTransferProtocol { - T0 = 0, - T1 = 1, + T0, + T1, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.sim/2/.hash new file mode 100644 index 0000000000..54ba274d43 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/.hash @@ -0,0 +1 @@ +4f348cc7aca716cc41c09ea95895c4b261231035 diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/AppStatus.aidl new file mode 100644 index 0000000000..8a41fb9d90 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/AppStatus.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable AppStatus { + int appType; + int appState; + android.hardware.radio.sim.PersoSubstate persoSubstate; + String aidPtr; + String appLabelPtr; + boolean pin1Replaced; + android.hardware.radio.sim.PinState pin1; + android.hardware.radio.sim.PinState pin2; + const int APP_STATE_UNKNOWN = 0; + const int APP_STATE_DETECTED = 1; + const int APP_STATE_PIN = 2; + const int APP_STATE_PUK = 3; + const int APP_STATE_SUBSCRIPTION_PERSO = 4; + const int APP_STATE_READY = 5; + const int APP_TYPE_UNKNOWN = 0; + const int APP_TYPE_SIM = 1; + const int APP_TYPE_USIM = 2; + const int APP_TYPE_RUIM = 3; + const int APP_TYPE_CSIM = 4; + const int APP_TYPE_ISIM = 5; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CardPowerState.aidl new file mode 100644 index 0000000000..6bc3919fb2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CardPowerState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum CardPowerState { + POWER_DOWN, + POWER_UP, + POWER_UP_PASS_THROUGH, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CardStatus.aidl new file mode 100644 index 0000000000..46cb7becb2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CardStatus.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable CardStatus { + int cardState; + android.hardware.radio.sim.PinState universalPinState; + int gsmUmtsSubscriptionAppIndex; + int cdmaSubscriptionAppIndex; + int imsSubscriptionAppIndex; + android.hardware.radio.sim.AppStatus[] applications; + String atr; + String iccid; + String eid; + android.hardware.radio.config.SlotPortMapping slotMap; + android.hardware.radio.config.MultipleEnabledProfilesMode supportedMepMode = android.hardware.radio.config.MultipleEnabledProfilesMode.NONE; + const int STATE_ABSENT = 0; + const int STATE_PRESENT = 1; + const int STATE_ERROR = 2; + const int STATE_RESTRICTED = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/Carrier.aidl new file mode 100644 index 0000000000..cc56888f31 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/Carrier.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable Carrier { + String mcc; + String mnc; + int matchType; + String matchData; + const int MATCH_TYPE_ALL = 0; + const int MATCH_TYPE_SPN = 1; + const int MATCH_TYPE_IMSI_PREFIX = 2; + const int MATCH_TYPE_GID1 = 3; + const int MATCH_TYPE_GID2 = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CarrierRestrictions.aidl new file mode 100644 index 0000000000..3700de3143 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable CarrierRestrictions { + android.hardware.radio.sim.Carrier[] allowedCarriers; + android.hardware.radio.sim.Carrier[] excludedCarriers; + boolean allowedCarriersPrioritized; + android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status; + @Backing(type="int") @VintfStability + enum CarrierRestrictionStatus { + UNKNOWN = 0, + NOT_RESTRICTED = 1, + RESTRICTED = 2, + } +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CdmaSubscriptionSource.aidl new file mode 100644 index 0000000000..080aa5ed27 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/CdmaSubscriptionSource.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum CdmaSubscriptionSource { + RUIM_SIM, + NV, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSim.aidl new file mode 100644 index 0000000000..901b2519f6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSim.aidl @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@VintfStability +interface IRadioSim { + oneway void areUiccApplicationsEnabled(in int serial); + oneway void changeIccPin2ForApp(in int serial, in String oldPin2, in String newPin2, in String aid); + oneway void changeIccPinForApp(in int serial, in String oldPin, in String newPin, in String aid); + oneway void enableUiccApplications(in int serial, in boolean enable); + oneway void getAllowedCarriers(in int serial); + oneway void getCdmaSubscription(in int serial); + oneway void getCdmaSubscriptionSource(in int serial); + oneway void getFacilityLockForApp(in int serial, in String facility, in String password, in int serviceClass, in String appId); + oneway void getIccCardStatus(in int serial); + oneway void getImsiForApp(in int serial, in String aid); + oneway void getSimPhonebookCapacity(in int serial); + oneway void getSimPhonebookRecords(in int serial); + /** + * @deprecated use iccCloseLogicalChannelWithSessionInfo instead. + */ + oneway void iccCloseLogicalChannel(in int serial, in int channelId); + oneway void iccIoForApp(in int serial, in android.hardware.radio.sim.IccIo iccIo); + oneway void iccOpenLogicalChannel(in int serial, in String aid, in int p2); + oneway void iccTransmitApduBasicChannel(in int serial, in android.hardware.radio.sim.SimApdu message); + oneway void iccTransmitApduLogicalChannel(in int serial, in android.hardware.radio.sim.SimApdu message); + oneway void reportStkServiceIsRunning(in int serial); + oneway void requestIccSimAuthentication(in int serial, in int authContext, in String authData, in String aid); + oneway void responseAcknowledgement(); + oneway void sendEnvelope(in int serial, in String contents); + oneway void sendEnvelopeWithStatus(in int serial, in String contents); + oneway void sendTerminalResponseToSim(in int serial, in String contents); + oneway void setAllowedCarriers(in int serial, in android.hardware.radio.sim.CarrierRestrictions carriers, in android.hardware.radio.sim.SimLockMultiSimPolicy multiSimPolicy); + oneway void setCarrierInfoForImsiEncryption(in int serial, in android.hardware.radio.sim.ImsiEncryptionInfo imsiEncryptionInfo); + oneway void setCdmaSubscriptionSource(in int serial, in android.hardware.radio.sim.CdmaSubscriptionSource cdmaSub); + oneway void setFacilityLockForApp(in int serial, in String facility, in boolean lockState, in String password, in int serviceClass, in String appId); + oneway void setResponseFunctions(in android.hardware.radio.sim.IRadioSimResponse radioSimResponse, in android.hardware.radio.sim.IRadioSimIndication radioSimIndication); + oneway void setSimCardPower(in int serial, in android.hardware.radio.sim.CardPowerState powerUp); + oneway void setUiccSubscription(in int serial, in android.hardware.radio.sim.SelectUiccSub uiccSub); + oneway void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); + oneway void supplyIccPinForApp(in int serial, in String pin, in String aid); + oneway void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid); + oneway void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); + oneway void supplySimDepersonalization(in int serial, in android.hardware.radio.sim.PersoSubstate persoType, in String controlKey); + oneway void updateSimPhonebookRecords(in int serial, in android.hardware.radio.sim.PhonebookRecordInfo recordInfo); + oneway void iccCloseLogicalChannelWithSessionInfo(in int serial, in android.hardware.radio.sim.SessionInfo sessionInfo); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSimIndication.aidl new file mode 100644 index 0000000000..d4371b8e69 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSimIndication.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@VintfStability +interface IRadioSimIndication { + oneway void carrierInfoForImsiEncryption(in android.hardware.radio.RadioIndicationType info); + oneway void cdmaSubscriptionSourceChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.sim.CdmaSubscriptionSource cdmaSource); + oneway void simPhonebookChanged(in android.hardware.radio.RadioIndicationType type); + oneway void simPhonebookRecordsReceived(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.sim.PbReceivedStatus status, in android.hardware.radio.sim.PhonebookRecordInfo[] records); + oneway void simRefresh(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.sim.SimRefreshResult refreshResult); + oneway void simStatusChanged(in android.hardware.radio.RadioIndicationType type); + oneway void stkEventNotify(in android.hardware.radio.RadioIndicationType type, in String cmd); + oneway void stkProactiveCommand(in android.hardware.radio.RadioIndicationType type, in String cmd); + oneway void stkSessionEnd(in android.hardware.radio.RadioIndicationType type); + oneway void subscriptionStatusChanged(in android.hardware.radio.RadioIndicationType type, in boolean activate); + oneway void uiccApplicationsEnablementChanged(in android.hardware.radio.RadioIndicationType type, in boolean enabled); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSimResponse.aidl new file mode 100644 index 0000000000..d7c2100fd6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IRadioSimResponse.aidl @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@VintfStability +interface IRadioSimResponse { + oneway void acknowledgeRequest(in int serial); + oneway void areUiccApplicationsEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enabled); + oneway void changeIccPin2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void changeIccPinForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void enableUiccApplicationsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.CarrierRestrictions carriers, in android.hardware.radio.sim.SimLockMultiSimPolicy multiSimPolicy); + oneway void getCdmaSubscriptionResponse(in android.hardware.radio.RadioResponseInfo info, in String mdn, in String hSid, in String hNid, in String min, in String prl); + oneway void getCdmaSubscriptionSourceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.CdmaSubscriptionSource source); + oneway void getFacilityLockForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int response); + oneway void getIccCardStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.CardStatus cardStatus); + oneway void getImsiForAppResponse(in android.hardware.radio.RadioResponseInfo info, in String imsi); + oneway void getSimPhonebookCapacityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.PhonebookCapacity capacity); + oneway void getSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info); + /** + * @deprecated use iccCloseLogicalChannelWithSessionInfoResponse instead. + */ + oneway void iccCloseLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void iccIoForAppResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult iccIo); + oneway void iccOpenLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in int channelId, in byte[] selectResponse); + oneway void iccTransmitApduBasicChannelResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult result); + oneway void iccTransmitApduLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult result); + oneway void reportStkServiceIsRunningResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void requestIccSimAuthenticationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult result); + oneway void sendEnvelopeResponse(in android.hardware.radio.RadioResponseInfo info, in String commandResponse); + oneway void sendEnvelopeWithStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult iccIo); + oneway void sendTerminalResponseToSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCarrierInfoForImsiEncryptionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaSubscriptionSourceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setFacilityLockForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int retry); + oneway void setSimCardPowerResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setUiccSubscriptionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void supplyIccPin2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPinForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPuk2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPukForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplySimDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.PersoSubstate persoType, in int remainingRetries); + oneway void updateSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info, in int updatedRecordIndex); + oneway void iccCloseLogicalChannelWithSessionInfoResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IccIo.aidl new file mode 100644 index 0000000000..5a312dc4fd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IccIo.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable IccIo { + int command; + int fileId; + String path; + int p1; + int p2; + int p3; + String data; + String pin2; + String aid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IccIoResult.aidl new file mode 100644 index 0000000000..6c6bde2012 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/IccIoResult.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable IccIoResult { + int sw1; + int sw2; + String simResponse; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/ImsiEncryptionInfo.aidl new file mode 100644 index 0000000000..05e71cd102 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/ImsiEncryptionInfo.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable ImsiEncryptionInfo { + String mcc; + String mnc; + byte[] carrierKey; + String keyIdentifier; + long expirationTime; + byte keyType; + const byte PUBLIC_KEY_TYPE_EPDG = 1; + const byte PUBLIC_KEY_TYPE_WLAN = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PbReceivedStatus.aidl new file mode 100644 index 0000000000..5e96fc6f22 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PbReceivedStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability +enum PbReceivedStatus { + PB_RECEIVED_OK = 1, + PB_RECEIVED_ERROR = 2, + PB_RECEIVED_ABORT = 3, + PB_RECEIVED_FINAL = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PersoSubstate.aidl new file mode 100644 index 0000000000..dc1d960631 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PersoSubstate.aidl @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum PersoSubstate { + UNKNOWN, + IN_PROGRESS, + READY, + SIM_NETWORK, + SIM_NETWORK_SUBSET, + SIM_CORPORATE, + SIM_SERVICE_PROVIDER, + SIM_SIM, + SIM_NETWORK_PUK, + SIM_NETWORK_SUBSET_PUK, + SIM_CORPORATE_PUK, + SIM_SERVICE_PROVIDER_PUK, + SIM_SIM_PUK, + RUIM_NETWORK1, + RUIM_NETWORK2, + RUIM_HRPD, + RUIM_CORPORATE, + RUIM_SERVICE_PROVIDER, + RUIM_RUIM, + RUIM_NETWORK1_PUK, + RUIM_NETWORK2_PUK, + RUIM_HRPD_PUK, + RUIM_CORPORATE_PUK, + RUIM_SERVICE_PROVIDER_PUK, + RUIM_RUIM_PUK, + SIM_SPN, + SIM_SPN_PUK, + SIM_SP_EHPLMN, + SIM_SP_EHPLMN_PUK, + SIM_ICCID, + SIM_ICCID_PUK, + SIM_IMPI, + SIM_IMPI_PUK, + SIM_NS_SP, + SIM_NS_SP_PUK, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PhonebookCapacity.aidl new file mode 100644 index 0000000000..7531c9638a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PhonebookCapacity.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable PhonebookCapacity { + int maxAdnRecords; + int usedAdnRecords; + int maxEmailRecords; + int usedEmailRecords; + int maxAdditionalNumberRecords; + int usedAdditionalNumberRecords; + int maxNameLen; + int maxNumberLen; + int maxEmailLen; + int maxAdditionalNumberLen; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PhonebookRecordInfo.aidl new file mode 100644 index 0000000000..2e96a4bf54 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PhonebookRecordInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable PhonebookRecordInfo { + int recordId; + String name; + String number; + String[] emails; + String[] additionalNumbers; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PinState.aidl new file mode 100644 index 0000000000..663ea734bf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/PinState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum PinState { + UNKNOWN, + ENABLED_NOT_VERIFIED, + ENABLED_VERIFIED, + DISABLED, + ENABLED_BLOCKED, + ENABLED_PERM_BLOCKED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SelectUiccSub.aidl new file mode 100644 index 0000000000..02121e632c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SelectUiccSub.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable SelectUiccSub { + int slot; + int appIndex; + int subType; + int actStatus; + const int SUBSCRIPTION_TYPE_1 = 0; + const int SUBSCRIPTION_TYPE_2 = 1; + const int SUBSCRIPTION_TYPE_3 = 2; + const int ACT_STATUS_DEACTIVATE = 0; + const int ACT_STATUS_ACTIVATE = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SessionInfo.aidl new file mode 100644 index 0000000000..1329141f22 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SessionInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable SessionInfo { + int sessionId; + boolean isEs10 = false; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimApdu.aidl new file mode 100644 index 0000000000..c391e5af34 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimApdu.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable SimApdu { + int sessionId; + int cla; + int instruction; + int p1; + int p2; + int p3; + String data; + boolean isEs10 = false; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl new file mode 100644 index 0000000000..d59fcab886 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum SimLockMultiSimPolicy { + NO_MULTISIM_POLICY, + ONE_VALID_SIM_MUST_BE_PRESENT, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimRefreshResult.aidl new file mode 100644 index 0000000000..69bf4767d3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/2/android/hardware/radio/sim/SimRefreshResult.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable SimRefreshResult { + int type; + int efId; + String aid; + const int TYPE_SIM_FILE_UPDATE = 0; + const int TYPE_SIM_INIT = 1; + const int TYPE_SIM_RESET = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl index 05bc13ac45..6bc3919fb2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.sim; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CardPowerState { - POWER_DOWN = 0, - POWER_UP = 1, - POWER_UP_PASS_THROUGH = 2, + POWER_DOWN, + POWER_UP, + POWER_UP_PASS_THROUGH, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl index 9000d43506..46cb7becb2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl @@ -44,6 +44,7 @@ parcelable CardStatus { String iccid; String eid; android.hardware.radio.config.SlotPortMapping slotMap; + android.hardware.radio.config.MultipleEnabledProfilesMode supportedMepMode = android.hardware.radio.config.MultipleEnabledProfilesMode.NONE; const int STATE_ABSENT = 0; const int STATE_PRESENT = 1; const int STATE_ERROR = 2; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl index 944f1ca981..3700de3143 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -37,4 +37,11 @@ parcelable CarrierRestrictions { android.hardware.radio.sim.Carrier[] allowedCarriers; android.hardware.radio.sim.Carrier[] excludedCarriers; boolean allowedCarriersPrioritized; + android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status; + @Backing(type="int") @VintfStability + enum CarrierRestrictionStatus { + UNKNOWN = 0, + NOT_RESTRICTED = 1, + RESTRICTED = 2, + } } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl index 13469f3d6a..080aa5ed27 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.sim; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaSubscriptionSource { - RUIM_SIM = 0, - NV = 1, + RUIM_SIM, + NV, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl index 85a0c710d8..901b2519f6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl @@ -46,6 +46,9 @@ interface IRadioSim { oneway void getImsiForApp(in int serial, in String aid); oneway void getSimPhonebookCapacity(in int serial); oneway void getSimPhonebookRecords(in int serial); + /** + * @deprecated use iccCloseLogicalChannelWithSessionInfo instead. + */ oneway void iccCloseLogicalChannel(in int serial, in int channelId); oneway void iccIoForApp(in int serial, in android.hardware.radio.sim.IccIo iccIo); oneway void iccOpenLogicalChannel(in int serial, in String aid, in int p2); @@ -70,4 +73,5 @@ interface IRadioSim { oneway void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); oneway void supplySimDepersonalization(in int serial, in android.hardware.radio.sim.PersoSubstate persoType, in String controlKey); oneway void updateSimPhonebookRecords(in int serial, in android.hardware.radio.sim.PhonebookRecordInfo recordInfo); + oneway void iccCloseLogicalChannelWithSessionInfo(in int serial, in android.hardware.radio.sim.SessionInfo sessionInfo); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl index 8e68e3042d..d7c2100fd6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl @@ -47,6 +47,9 @@ interface IRadioSimResponse { oneway void getImsiForAppResponse(in android.hardware.radio.RadioResponseInfo info, in String imsi); oneway void getSimPhonebookCapacityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.PhonebookCapacity capacity); oneway void getSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info); + /** + * @deprecated use iccCloseLogicalChannelWithSessionInfoResponse instead. + */ oneway void iccCloseLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info); oneway void iccIoForAppResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult iccIo); oneway void iccOpenLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in int channelId, in byte[] selectResponse); @@ -69,4 +72,5 @@ interface IRadioSimResponse { oneway void supplyIccPukForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); oneway void supplySimDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.PersoSubstate persoType, in int remainingRetries); oneway void updateSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info, in int updatedRecordIndex); + oneway void iccCloseLogicalChannelWithSessionInfoResponse(in android.hardware.radio.RadioResponseInfo info); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl index e33769e812..dc1d960631 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl @@ -34,39 +34,39 @@ package android.hardware.radio.sim; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PersoSubstate { - UNKNOWN = 0, - IN_PROGRESS = 1, - READY = 2, - SIM_NETWORK = 3, - SIM_NETWORK_SUBSET = 4, - SIM_CORPORATE = 5, - SIM_SERVICE_PROVIDER = 6, - SIM_SIM = 7, - SIM_NETWORK_PUK = 8, - SIM_NETWORK_SUBSET_PUK = 9, - SIM_CORPORATE_PUK = 10, - SIM_SERVICE_PROVIDER_PUK = 11, - SIM_SIM_PUK = 12, - RUIM_NETWORK1 = 13, - RUIM_NETWORK2 = 14, - RUIM_HRPD = 15, - RUIM_CORPORATE = 16, - RUIM_SERVICE_PROVIDER = 17, - RUIM_RUIM = 18, - RUIM_NETWORK1_PUK = 19, - RUIM_NETWORK2_PUK = 20, - RUIM_HRPD_PUK = 21, - RUIM_CORPORATE_PUK = 22, - RUIM_SERVICE_PROVIDER_PUK = 23, - RUIM_RUIM_PUK = 24, - SIM_SPN = 25, - SIM_SPN_PUK = 26, - SIM_SP_EHPLMN = 27, - SIM_SP_EHPLMN_PUK = 28, - SIM_ICCID = 29, - SIM_ICCID_PUK = 30, - SIM_IMPI = 31, - SIM_IMPI_PUK = 32, - SIM_NS_SP = 33, - SIM_NS_SP_PUK = 34, + UNKNOWN, + IN_PROGRESS, + READY, + SIM_NETWORK, + SIM_NETWORK_SUBSET, + SIM_CORPORATE, + SIM_SERVICE_PROVIDER, + SIM_SIM, + SIM_NETWORK_PUK, + SIM_NETWORK_SUBSET_PUK, + SIM_CORPORATE_PUK, + SIM_SERVICE_PROVIDER_PUK, + SIM_SIM_PUK, + RUIM_NETWORK1, + RUIM_NETWORK2, + RUIM_HRPD, + RUIM_CORPORATE, + RUIM_SERVICE_PROVIDER, + RUIM_RUIM, + RUIM_NETWORK1_PUK, + RUIM_NETWORK2_PUK, + RUIM_HRPD_PUK, + RUIM_CORPORATE_PUK, + RUIM_SERVICE_PROVIDER_PUK, + RUIM_RUIM_PUK, + SIM_SPN, + SIM_SPN_PUK, + SIM_SP_EHPLMN, + SIM_SP_EHPLMN_PUK, + SIM_ICCID, + SIM_ICCID_PUK, + SIM_IMPI, + SIM_IMPI_PUK, + SIM_NS_SP, + SIM_NS_SP_PUK, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl index 5cdc6d17d4..663ea734bf 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl @@ -34,10 +34,10 @@ package android.hardware.radio.sim; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PinState { - UNKNOWN = 0, - ENABLED_NOT_VERIFIED = 1, - ENABLED_VERIFIED = 2, - DISABLED = 3, - ENABLED_BLOCKED = 4, - ENABLED_PERM_BLOCKED = 5, + UNKNOWN, + ENABLED_NOT_VERIFIED, + ENABLED_VERIFIED, + DISABLED, + ENABLED_BLOCKED, + ENABLED_PERM_BLOCKED, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl new file mode 100644 index 0000000000..1329141f22 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +@JavaDerive(toString=true) @VintfStability +parcelable SessionInfo { + int sessionId; + boolean isEs10 = false; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl index 2201345695..c391e5af34 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl @@ -41,4 +41,5 @@ parcelable SimApdu { int p2; int p3; String data; + boolean isEs10 = false; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index 4ded3e96ec..d59fcab886 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -34,6 +34,6 @@ package android.hardware.radio.sim; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SimLockMultiSimPolicy { - NO_MULTISIM_POLICY = 0, - ONE_VALID_SIM_MUST_BE_PRESENT = 1, + NO_MULTISIM_POLICY, + ONE_VALID_SIM_MUST_BE_PRESENT, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/.hash b/radio/aidl/aidl_api/android.hardware.radio.voice/2/.hash new file mode 100644 index 0000000000..eef445d459 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/.hash @@ -0,0 +1 @@ +8c5e0d53dc67b5ed221b2da0570a17684d973a20 diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/AudioQuality.aidl new file mode 100644 index 0000000000..1ab29029b9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/AudioQuality.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum AudioQuality { + UNSPECIFIED, + AMR, + AMR_WB, + GSM_EFR, + GSM_FR, + GSM_HR, + EVRC, + EVRC_B, + EVRC_WB, + EVRC_NW, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/Call.aidl new file mode 100644 index 0000000000..10d2ee751b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/Call.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable Call { + int state; + int index; + int toa; + boolean isMpty; + boolean isMT; + byte als; + boolean isVoice; + boolean isVoicePrivacy; + String number; + int numberPresentation; + String name; + int namePresentation; + android.hardware.radio.voice.UusInfo[] uusInfo; + android.hardware.radio.voice.AudioQuality audioQuality; + String forwardedNumber; + const int PRESENTATION_ALLOWED = 0; + const int PRESENTATION_RESTRICTED = 1; + const int PRESENTATION_UNKNOWN = 2; + const int PRESENTATION_PAYPHONE = 3; + const int STATE_ACTIVE = 0; + const int STATE_HOLDING = 1; + const int STATE_DIALING = 2; + const int STATE_ALERTING = 3; + const int STATE_INCOMING = 4; + const int STATE_WAITING = 5; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CallForwardInfo.aidl new file mode 100644 index 0000000000..8e7aaab565 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CallForwardInfo.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CallForwardInfo { + int status; + int reason; + int serviceClass; + int toa; + String number; + int timeSeconds; + const int STATUS_DISABLE = 0; + const int STATUS_ENABLE = 1; + const int STATUS_INTERROGATE = 2; + const int STATUS_REGISTRATION = 3; + const int STATUS_ERASURE = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaCallWaiting.aidl new file mode 100644 index 0000000000..310f9a0fac --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaCallWaiting.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaCallWaiting { + String number; + int numberPresentation; + String name; + android.hardware.radio.voice.CdmaSignalInfoRecord signalInfoRecord; + int numberType; + int numberPlan; + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_ISDN = 1; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_NATIONAL = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PRESENTATION_ALLOWED = 0; + const int NUMBER_PRESENTATION_RESTRICTED = 1; + const int NUMBER_PRESENTATION_UNKNOWN = 2; + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL = 1; + const int NUMBER_TYPE_NATIONAL = 2; + const int NUMBER_TYPE_NETWORK_SPECIFIC = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl new file mode 100644 index 0000000000..b6b562c028 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaDisplayInfoRecord { + String alphaBuf; + const int CDMA_ALPHA_INFO_BUFFER_LENGTH = 64; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaInformationRecord.aidl new file mode 100644 index 0000000000..24ae775479 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaInformationRecord.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaInformationRecord { + int name; + android.hardware.radio.voice.CdmaDisplayInfoRecord[] display; + android.hardware.radio.voice.CdmaNumberInfoRecord[] number; + android.hardware.radio.voice.CdmaSignalInfoRecord[] signal; + android.hardware.radio.voice.CdmaRedirectingNumberInfoRecord[] redir; + android.hardware.radio.voice.CdmaLineControlInfoRecord[] lineCtrl; + android.hardware.radio.voice.CdmaT53ClirInfoRecord[] clir; + android.hardware.radio.voice.CdmaT53AudioControlInfoRecord[] audioCtrl; + const int CDMA_MAX_NUMBER_OF_INFO_RECS = 10; + const int NAME_DISPLAY = 0; + const int NAME_CALLED_PARTY_NUMBER = 1; + const int NAME_CALLING_PARTY_NUMBER = 2; + const int NAME_CONNECTED_NUMBER = 3; + const int NAME_SIGNAL = 4; + const int NAME_REDIRECTING_NUMBER = 5; + const int NAME_LINE_CONTROL = 6; + const int NAME_EXTENDED_DISPLAY = 7; + const int NAME_T53_CLIR = 8; + const int NAME_T53_RELEASE = 9; + const int NAME_T53_AUDIO_CONTROL = 10; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl new file mode 100644 index 0000000000..e34b3937b4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaLineControlInfoRecord { + byte lineCtrlPolarityIncluded; + byte lineCtrlToggle; + byte lineCtrlReverse; + byte lineCtrlPowerDenial; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl new file mode 100644 index 0000000000..aeb0347d67 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaNumberInfoRecord { + String number; + byte numberType; + byte numberPlan; + byte pi; + byte si; + const int CDMA_NUMBER_INFO_BUFFER_LENGTH = 81; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl new file mode 100644 index 0000000000..fad384172b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum CdmaOtaProvisionStatus { + SPL_UNLOCKED, + SPC_RETRIES_EXCEEDED, + A_KEY_EXCHANGED, + SSD_UPDATED, + NAM_DOWNLOADED, + MDN_DOWNLOADED, + IMSI_DOWNLOADED, + PRL_DOWNLOADED, + COMMITTED, + OTAPA_STARTED, + OTAPA_STOPPED, + OTAPA_ABORTED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl new file mode 100644 index 0000000000..b61b91b34f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaRedirectingNumberInfoRecord { + android.hardware.radio.voice.CdmaNumberInfoRecord redirectingNumber; + int redirectingReason; + const int REDIRECTING_REASON_UNKNOWN = 0; + const int REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1; + const int REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2; + const int REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9; + const int REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10; + const int REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15; + const int REDIRECTING_REASON_RESERVED = 16; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl new file mode 100644 index 0000000000..6c7b264476 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaSignalInfoRecord { + boolean isPresent; + byte signalType; + byte alertPitch; + byte signal; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl new file mode 100644 index 0000000000..438231cbad --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaT53AudioControlInfoRecord { + byte upLink; + byte downLink; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl new file mode 100644 index 0000000000..1b254f56a0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CdmaT53ClirInfoRecord { + byte cause; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CfData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CfData.aidl new file mode 100644 index 0000000000..7e799c7b03 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/CfData.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable CfData { + android.hardware.radio.voice.CallForwardInfo[] cfInfo; + const int NUM_SERVICE_CLASSES = 7; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/ClipStatus.aidl new file mode 100644 index 0000000000..a34149ad1b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/ClipStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum ClipStatus { + CLIP_PROVISIONED, + CLIP_UNPROVISIONED, + UNKNOWN, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/Dial.aidl new file mode 100644 index 0000000000..2b2e7590bc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/Dial.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable Dial { + String address; + int clir; + android.hardware.radio.voice.UusInfo[] uusInfo; + const int CLIR_DEFAULT = 0; + const int CLIR_INVOCATION = 1; + const int CLIR_SUPPRESSION = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyCallRouting.aidl new file mode 100644 index 0000000000..4e1dfc09fa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyCallRouting.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EmergencyCallRouting { + UNKNOWN, + EMERGENCY, + NORMAL, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyNumber.aidl new file mode 100644 index 0000000000..f2a7d8ca6d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyNumber.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable EmergencyNumber { + String number; + String mcc; + String mnc; + int categories; + String[] urns; + int sources; + const int SOURCE_NETWORK_SIGNALING = (1 << 0) /* 1 */; + const int SOURCE_SIM = (1 << 1) /* 2 */; + const int SOURCE_MODEM_CONFIG = (1 << 2) /* 4 */; + const int SOURCE_DEFAULT = (1 << 3) /* 8 */; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyServiceCategory.aidl new file mode 100644 index 0000000000..3a0cdae88b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/EmergencyServiceCategory.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum EmergencyServiceCategory { + UNSPECIFIED = 0, + POLICE = (1 << 0) /* 1 */, + AMBULANCE = (1 << 1) /* 2 */, + FIRE_BRIGADE = (1 << 2) /* 4 */, + MARINE_GUARD = (1 << 3) /* 8 */, + MOUNTAIN_RESCUE = (1 << 4) /* 16 */, + MIEC = (1 << 5) /* 32 */, + AIEC = (1 << 6) /* 64 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoice.aidl new file mode 100644 index 0000000000..603b1d67aa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoice.aidl @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@VintfStability +interface IRadioVoice { + oneway void acceptCall(in int serial); + oneway void cancelPendingUssd(in int serial); + oneway void conference(in int serial); + oneway void dial(in int serial, in android.hardware.radio.voice.Dial dialInfo); + oneway void emergencyDial(in int serial, in android.hardware.radio.voice.Dial dialInfo, in int categories, in String[] urns, in android.hardware.radio.voice.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting); + oneway void exitEmergencyCallbackMode(in int serial); + oneway void explicitCallTransfer(in int serial); + oneway void getCallForwardStatus(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo); + oneway void getCallWaiting(in int serial, in int serviceClass); + oneway void getClip(in int serial); + oneway void getClir(in int serial); + oneway void getCurrentCalls(in int serial); + oneway void getLastCallFailCause(in int serial); + oneway void getMute(in int serial); + oneway void getPreferredVoicePrivacy(in int serial); + oneway void getTtyMode(in int serial); + oneway void handleStkCallSetupRequestFromSim(in int serial, in boolean accept); + oneway void hangup(in int serial, in int gsmIndex); + oneway void hangupForegroundResumeBackground(in int serial); + oneway void hangupWaitingOrBackground(in int serial); + oneway void isVoNrEnabled(in int serial); + oneway void rejectCall(in int serial); + oneway void responseAcknowledgement(); + oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); + oneway void sendCdmaFeatureCode(in int serial, in String featureCode); + oneway void sendDtmf(in int serial, in String s); + oneway void sendUssd(in int serial, in String ussd); + oneway void separateConnection(in int serial, in int gsmIndex); + oneway void setCallForward(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo); + oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass); + oneway void setClir(in int serial, in int status); + oneway void setMute(in int serial, in boolean enable); + oneway void setPreferredVoicePrivacy(in int serial, in boolean enable); + oneway void setResponseFunctions(in android.hardware.radio.voice.IRadioVoiceResponse radioVoiceResponse, in android.hardware.radio.voice.IRadioVoiceIndication radioVoiceIndication); + oneway void setTtyMode(in int serial, in android.hardware.radio.voice.TtyMode mode); + oneway void setVoNrEnabled(in int serial, in boolean enable); + oneway void startDtmf(in int serial, in String s); + oneway void stopDtmf(in int serial); + oneway void switchWaitingOrHoldingAndActive(in int serial); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoiceIndication.aidl new file mode 100644 index 0000000000..189ed43cf9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoiceIndication.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@VintfStability +interface IRadioVoiceIndication { + oneway void callRing(in android.hardware.radio.RadioIndicationType type, in boolean isGsm, in android.hardware.radio.voice.CdmaSignalInfoRecord record); + oneway void callStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void cdmaCallWaiting(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.CdmaCallWaiting callWaitingRecord); + oneway void cdmaInfoRec(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.CdmaInformationRecord[] records); + oneway void cdmaOtaProvisionStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.CdmaOtaProvisionStatus status); + oneway void currentEmergencyNumberList(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.EmergencyNumber[] emergencyNumberList); + oneway void enterEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); + oneway void exitEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); + oneway void indicateRingbackTone(in android.hardware.radio.RadioIndicationType type, in boolean start); + oneway void onSupplementaryServiceIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.StkCcUnsolSsResult ss); + oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.UssdModeType modeType, in String msg); + oneway void resendIncallMute(in android.hardware.radio.RadioIndicationType type); + oneway void srvccStateNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.SrvccState state); + oneway void stkCallControlAlphaNotify(in android.hardware.radio.RadioIndicationType type, in String alpha); + oneway void stkCallSetup(in android.hardware.radio.RadioIndicationType type, in long timeout); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoiceResponse.aidl new file mode 100644 index 0000000000..7acc0446dd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/IRadioVoiceResponse.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@VintfStability +interface IRadioVoiceResponse { + oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeRequest(in int serial); + oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void conferenceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void dialResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void emergencyDialResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void exitEmergencyCallbackModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void explicitCallTransferResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getCallForwardStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.CallForwardInfo[] callForwardInfos); + oneway void getCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable, in int serviceClass); + oneway void getClipResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.ClipStatus status); + oneway void getClirResponse(in android.hardware.radio.RadioResponseInfo info, in int n, in int m); + oneway void getCurrentCallsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.Call[] calls); + oneway void getLastCallFailCauseResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.LastCallFailCauseInfo failCauseinfo); + oneway void getMuteResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void getPreferredVoicePrivacyResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void getTtyModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.TtyMode mode); + oneway void handleStkCallSetupRequestFromSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupConnectionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupForegroundResumeBackgroundResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupWaitingOrBackgroundResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void isVoNrEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void rejectCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendBurstDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendCdmaFeatureCodeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void separateConnectionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCallForwardResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setClirResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setMuteResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredVoicePrivacyResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setTtyModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setVoNrEnabledResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void switchWaitingOrHoldingAndActiveResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/LastCallFailCause.aidl new file mode 100644 index 0000000000..7d546233f1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/LastCallFailCause.aidl @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum LastCallFailCause { + UNOBTAINABLE_NUMBER = 1, + NO_ROUTE_TO_DESTINATION = 3, + CHANNEL_UNACCEPTABLE = 6, + OPERATOR_DETERMINED_BARRING = 8, + NORMAL = 16, + BUSY = 17, + NO_USER_RESPONDING = 18, + NO_ANSWER_FROM_USER = 19, + CALL_REJECTED = 21, + NUMBER_CHANGED = 22, + PREEMPTION = 25, + DESTINATION_OUT_OF_ORDER = 27, + INVALID_NUMBER_FORMAT = 28, + FACILITY_REJECTED = 29, + RESP_TO_STATUS_ENQUIRY = 30, + NORMAL_UNSPECIFIED = 31, + CONGESTION = 34, + NETWORK_OUT_OF_ORDER = 38, + TEMPORARY_FAILURE = 41, + SWITCHING_EQUIPMENT_CONGESTION = 42, + ACCESS_INFORMATION_DISCARDED = 43, + REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44, + RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47, + QOS_UNAVAILABLE = 49, + REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, + INCOMING_CALLS_BARRED_WITHIN_CUG = 55, + BEARER_CAPABILITY_NOT_AUTHORIZED = 57, + BEARER_CAPABILITY_UNAVAILABLE = 58, + SERVICE_OPTION_NOT_AVAILABLE = 63, + BEARER_SERVICE_NOT_IMPLEMENTED = 65, + ACM_LIMIT_EXCEEDED = 68, + REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, + ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70, + SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79, + INVALID_TRANSACTION_IDENTIFIER = 81, + USER_NOT_MEMBER_OF_CUG = 87, + INCOMPATIBLE_DESTINATION = 88, + INVALID_TRANSIT_NW_SELECTION = 91, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + RECOVERY_ON_TIMER_EXPIRED = 102, + PROTOCOL_ERROR_UNSPECIFIED = 111, + INTERWORKING_UNSPECIFIED = 127, + CALL_BARRED = 240, + FDN_BLOCKED = 241, + IMSI_UNKNOWN_IN_VLR = 242, + IMEI_NOT_ACCEPTED = 243, + DIAL_MODIFIED_TO_USSD = 244, + DIAL_MODIFIED_TO_SS = 245, + DIAL_MODIFIED_TO_DIAL = 246, + RADIO_OFF = 247, + OUT_OF_SERVICE = 248, + NO_VALID_SIM = 249, + RADIO_INTERNAL_ERROR = 250, + NETWORK_RESP_TIMEOUT = 251, + NETWORK_REJECT = 252, + RADIO_ACCESS_FAILURE = 253, + RADIO_LINK_FAILURE = 254, + RADIO_LINK_LOST = 255, + RADIO_UPLINK_FAILURE = 256, + RADIO_SETUP_FAILURE = 257, + RADIO_RELEASE_NORMAL = 258, + RADIO_RELEASE_ABNORMAL = 259, + ACCESS_CLASS_BLOCKED = 260, + NETWORK_DETACH = 261, + CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000, + CDMA_DROP = 1001, + CDMA_INTERCEPT = 1002, + CDMA_REORDER = 1003, + CDMA_SO_REJECT = 1004, + CDMA_RETRY_ORDER = 1005, + CDMA_ACCESS_FAILURE = 1006, + CDMA_PREEMPTED = 1007, + CDMA_NOT_EMERGENCY = 1008, + CDMA_ACCESS_BLOCKED = 1009, + OEM_CAUSE_1 = 0xf001, + OEM_CAUSE_2 = 0xf002, + OEM_CAUSE_3 = 0xf003, + OEM_CAUSE_4 = 0xf004, + OEM_CAUSE_5 = 0xf005, + OEM_CAUSE_6 = 0xf006, + OEM_CAUSE_7 = 0xf007, + OEM_CAUSE_8 = 0xf008, + OEM_CAUSE_9 = 0xf009, + OEM_CAUSE_10 = 0xf00a, + OEM_CAUSE_11 = 0xf00b, + OEM_CAUSE_12 = 0xf00c, + OEM_CAUSE_13 = 0xf00d, + OEM_CAUSE_14 = 0xf00e, + OEM_CAUSE_15 = 0xf00f, + ERROR_UNSPECIFIED = 0xffff, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/LastCallFailCauseInfo.aidl new file mode 100644 index 0000000000..221acf7306 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/LastCallFailCauseInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable LastCallFailCauseInfo { + android.hardware.radio.voice.LastCallFailCause causeCode; + String vendorCause; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/SrvccState.aidl new file mode 100644 index 0000000000..4b5c216081 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/SrvccState.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum SrvccState { + HANDOVER_STARTED, + HANDOVER_COMPLETED, + HANDOVER_FAILED, + HANDOVER_CANCELED, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/SsInfoData.aidl new file mode 100644 index 0000000000..f18b404605 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/SsInfoData.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable SsInfoData { + int[] ssInfo; + const int SS_INFO_MAX = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/StkCcUnsolSsResult.aidl new file mode 100644 index 0000000000..f04942b774 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable StkCcUnsolSsResult { + int serviceType; + int requestType; + int teleserviceType; + int serviceClass; + android.hardware.radio.RadioError result; + android.hardware.radio.voice.SsInfoData[] ssInfo; + android.hardware.radio.voice.CfData[] cfData; + const int REQUEST_TYPE_ACTIVATION = 0; + const int REQUEST_TYPE_DEACTIVATION = 1; + const int REQUEST_TYPE_INTERROGATION = 2; + const int REQUEST_TYPE_REGISTRATION = 3; + const int REQUEST_TYPE_ERASURE = 4; + const int SERVICE_TYPE_CFU = 0; + const int SERVICE_TYPE_CF_BUSY = 1; + const int SERVICE_TYPE_CF_NO_REPLY = 2; + const int SERVICE_TYPE_CF_NOT_REACHABLE = 3; + const int SERVICE_TYPE_CF_ALL = 4; + const int SERVICE_TYPE_CF_ALL_CONDITIONAL = 5; + const int SERVICE_TYPE_CLIP = 6; + const int SERVICE_TYPE_CLIR = 7; + const int SERVICE_TYPE_COLP = 8; + const int SERVICE_TYPE_COLR = 9; + const int SERVICE_TYPE_WAIT = 10; + const int SERVICE_TYPE_BAOC = 11; + const int SERVICE_TYPE_BAOIC = 12; + const int SERVICE_TYPE_BAOIC_EXC_HOME = 13; + const int SERVICE_TYPE_BAIC = 14; + const int SERVICE_TYPE_BAIC_ROAMING = 15; + const int SERVICE_TYPE_ALL_BARRING = 16; + const int SERVICE_TYPE_OUTGOING_BARRING = 17; + const int SERVICE_TYPE_INCOMING_BARRING = 18; + const int TELESERVICE_TYPE_ALL_TELE_AND_BEARER_SERVICES = 0; + const int TELESERVICE_TYPE_ALL_TELESEVICES = 1; + const int TELESERVICE_TYPE_TELEPHONY = 2; + const int TELESERVICE_TYPE_ALL_DATA_TELESERVICES = 3; + const int TELESERVICE_TYPE_SMS_SERVICES = 4; + const int TELESERVICE_TYPE_ALL_TELESERVICES_EXCEPT_SMS = 5; + const int SUPP_SERVICE_CLASS_NONE = 0; + const int SUPP_SERVICE_CLASS_VOICE = (1 << 0) /* 1 */; + const int SUPP_SERVICE_CLASS_DATA = (1 << 1) /* 2 */; + const int SUPP_SERVICE_CLASS_FAX = (1 << 2) /* 4 */; + const int SUPP_SERVICE_CLASS_SMS = (1 << 3) /* 8 */; + const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4) /* 16 */; + const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5) /* 32 */; + const int SUPP_SERVICE_CLASS_PACKET = (1 << 6) /* 64 */; + const int SUPP_SERVICE_CLASS_PAD = (1 << 7) /* 128 */; + const int SUPP_SERVICE_CLASS_MAX = (1 << 7) /* 128 */; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/TtyMode.aidl new file mode 100644 index 0000000000..e432e65093 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/TtyMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum TtyMode { + OFF, + FULL, + HCO, + VCO, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/UssdModeType.aidl new file mode 100644 index 0000000000..424e73fc35 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/UssdModeType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum UssdModeType { + NOTIFY, + REQUEST, + NW_RELEASE, + LOCAL_CLIENT, + NOT_SUPPORTED, + NW_TIMEOUT, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/UusInfo.aidl new file mode 100644 index 0000000000..931376014c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/2/android/hardware/radio/voice/UusInfo.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.voice; +@JavaDerive(toString=true) @VintfStability +parcelable UusInfo { + int uusType; + int uusDcs; + String uusData; + const int UUS_DCS_USP = 0; + const int UUS_DCS_OSIHLP = 1; + const int UUS_DCS_X244 = 2; + const int UUS_DCS_RMCF = 3; + const int UUS_DCS_IA5C = 4; + const int UUS_TYPE_TYPE1_IMPLICIT = 0; + const int UUS_TYPE_TYPE1_REQUIRED = 1; + const int UUS_TYPE_TYPE1_NOT_REQUIRED = 2; + const int UUS_TYPE_TYPE2_REQUIRED = 3; + const int UUS_TYPE_TYPE2_NOT_REQUIRED = 4; + const int UUS_TYPE_TYPE3_REQUIRED = 5; + const int UUS_TYPE_TYPE3_NOT_REQUIRED = 6; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl index 15669ac483..1ab29029b9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl @@ -34,14 +34,14 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AudioQuality { - UNSPECIFIED = 0, - AMR = 1, - AMR_WB = 2, - GSM_EFR = 3, - GSM_FR = 4, - GSM_HR = 5, - EVRC = 6, - EVRC_B = 7, - EVRC_WB = 8, - EVRC_NW = 9, + UNSPECIFIED, + AMR, + AMR_WB, + GSM_EFR, + GSM_FR, + GSM_HR, + EVRC, + EVRC_B, + EVRC_WB, + EVRC_NW, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl index 7877fda730..fad384172b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -34,16 +34,16 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaOtaProvisionStatus { - SPL_UNLOCKED = 0, - SPC_RETRIES_EXCEEDED = 1, - A_KEY_EXCHANGED = 2, - SSD_UPDATED = 3, - NAM_DOWNLOADED = 4, - MDN_DOWNLOADED = 5, - IMSI_DOWNLOADED = 6, - PRL_DOWNLOADED = 7, - COMMITTED = 8, - OTAPA_STARTED = 9, - OTAPA_STOPPED = 10, - OTAPA_ABORTED = 11, + SPL_UNLOCKED, + SPC_RETRIES_EXCEEDED, + A_KEY_EXCHANGED, + SSD_UPDATED, + NAM_DOWNLOADED, + MDN_DOWNLOADED, + IMSI_DOWNLOADED, + PRL_DOWNLOADED, + COMMITTED, + OTAPA_STARTED, + OTAPA_STOPPED, + OTAPA_ABORTED, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl index 3fbb0d8f7f..a34149ad1b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ClipStatus { - CLIP_PROVISIONED = 0, - CLIP_UNPROVISIONED = 1, - UNKNOWN = 2, + CLIP_PROVISIONED, + CLIP_UNPROVISIONED, + UNKNOWN, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl index 07f011d349..4e1dfc09fa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl @@ -34,7 +34,7 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyCallRouting { - UNKNOWN = 0, - EMERGENCY = 1, - NORMAL = 2, + UNKNOWN, + EMERGENCY, + NORMAL, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl index 98df8cd625..ac3867e72e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl @@ -40,8 +40,8 @@ parcelable EmergencyNumber { int categories; String[] urns; int sources; - const int SOURCE_NETWORK_SIGNALING = 1; - const int SOURCE_SIM = 2; - const int SOURCE_MODEM_CONFIG = 4; - const int SOURCE_DEFAULT = 8; + const int SOURCE_NETWORK_SIGNALING = (1 << 0); + const int SOURCE_SIM = (1 << 1); + const int SOURCE_MODEM_CONFIG = (1 << 2); + const int SOURCE_DEFAULT = (1 << 3); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl index 042dd6155e..0a70d2de95 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl @@ -35,11 +35,11 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyServiceCategory { UNSPECIFIED = 0, - POLICE = 1, - AMBULANCE = 2, - FIRE_BRIGADE = 4, - MARINE_GUARD = 8, - MOUNTAIN_RESCUE = 16, - MIEC = 32, - AIEC = 64, + POLICE = (1 << 0), + AMBULANCE = (1 << 1), + FIRE_BRIGADE = (1 << 2), + MARINE_GUARD = (1 << 3), + MOUNTAIN_RESCUE = (1 << 4), + MIEC = (1 << 5), + AIEC = (1 << 6), } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl index 1740134ef0..7d546233f1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl @@ -114,20 +114,20 @@ enum LastCallFailCause { CDMA_PREEMPTED = 1007, CDMA_NOT_EMERGENCY = 1008, CDMA_ACCESS_BLOCKED = 1009, - OEM_CAUSE_1 = 61441, - OEM_CAUSE_2 = 61442, - OEM_CAUSE_3 = 61443, - OEM_CAUSE_4 = 61444, - OEM_CAUSE_5 = 61445, - OEM_CAUSE_6 = 61446, - OEM_CAUSE_7 = 61447, - OEM_CAUSE_8 = 61448, - OEM_CAUSE_9 = 61449, - OEM_CAUSE_10 = 61450, - OEM_CAUSE_11 = 61451, - OEM_CAUSE_12 = 61452, - OEM_CAUSE_13 = 61453, - OEM_CAUSE_14 = 61454, - OEM_CAUSE_15 = 61455, - ERROR_UNSPECIFIED = 65535, + OEM_CAUSE_1 = 0xf001, + OEM_CAUSE_2 = 0xf002, + OEM_CAUSE_3 = 0xf003, + OEM_CAUSE_4 = 0xf004, + OEM_CAUSE_5 = 0xf005, + OEM_CAUSE_6 = 0xf006, + OEM_CAUSE_7 = 0xf007, + OEM_CAUSE_8 = 0xf008, + OEM_CAUSE_9 = 0xf009, + OEM_CAUSE_10 = 0xf00a, + OEM_CAUSE_11 = 0xf00b, + OEM_CAUSE_12 = 0xf00c, + OEM_CAUSE_13 = 0xf00d, + OEM_CAUSE_14 = 0xf00e, + OEM_CAUSE_15 = 0xf00f, + ERROR_UNSPECIFIED = 0xffff, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl index 864374b508..4b5c216081 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl @@ -34,8 +34,8 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SrvccState { - HANDOVER_STARTED = 0, - HANDOVER_COMPLETED = 1, - HANDOVER_FAILED = 2, - HANDOVER_CANCELED = 3, + HANDOVER_STARTED, + HANDOVER_COMPLETED, + HANDOVER_FAILED, + HANDOVER_CANCELED, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl index 50bb1fd35b..75f3de5495 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -72,13 +72,13 @@ parcelable StkCcUnsolSsResult { const int TELESERVICE_TYPE_SMS_SERVICES = 4; const int TELESERVICE_TYPE_ALL_TELESERVICES_EXCEPT_SMS = 5; const int SUPP_SERVICE_CLASS_NONE = 0; - const int SUPP_SERVICE_CLASS_VOICE = 1; - const int SUPP_SERVICE_CLASS_DATA = 2; - const int SUPP_SERVICE_CLASS_FAX = 4; - const int SUPP_SERVICE_CLASS_SMS = 8; - const int SUPP_SERVICE_CLASS_DATA_SYNC = 16; - const int SUPP_SERVICE_CLASS_DATA_ASYNC = 32; - const int SUPP_SERVICE_CLASS_PACKET = 64; - const int SUPP_SERVICE_CLASS_PAD = 128; - const int SUPP_SERVICE_CLASS_MAX = 128; + const int SUPP_SERVICE_CLASS_VOICE = (1 << 0); + const int SUPP_SERVICE_CLASS_DATA = (1 << 1); + const int SUPP_SERVICE_CLASS_FAX = (1 << 2); + const int SUPP_SERVICE_CLASS_SMS = (1 << 3); + const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4); + const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5); + const int SUPP_SERVICE_CLASS_PACKET = (1 << 6); + const int SUPP_SERVICE_CLASS_PAD = (1 << 7); + const int SUPP_SERVICE_CLASS_MAX = (1 << 7); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl index 77417e8718..e432e65093 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl @@ -34,8 +34,8 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum TtyMode { - OFF = 0, - FULL = 1, - HCO = 2, - VCO = 3, + OFF, + FULL, + HCO, + VCO, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl index ad243d2de7..424e73fc35 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl @@ -34,10 +34,10 @@ package android.hardware.radio.voice; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UssdModeType { - NOTIFY = 0, - REQUEST = 1, - NW_RELEASE = 2, - LOCAL_CLIENT = 3, - NOT_SUPPORTED = 4, - NW_TIMEOUT = 5, + NOTIFY, + REQUEST, + NW_RELEASE, + LOCAL_CLIENT, + NOT_SUPPORTED, + NW_TIMEOUT, } diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/.hash b/radio/aidl/aidl_api/android.hardware.radio/2/.hash new file mode 100644 index 0000000000..f7a1438c26 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/.hash @@ -0,0 +1 @@ +bb059adfc597be7a26032661374ee203320b3494 diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/AccessNetwork.aidl new file mode 100644 index 0000000000..964165149d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/AccessNetwork.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum AccessNetwork { + UNKNOWN, + GERAN, + UTRAN, + EUTRAN, + CDMA2000, + IWLAN, + NGRAN, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioAccessFamily.aidl new file mode 100644 index 0000000000..b7b074bda2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioAccessFamily.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioAccessFamily { + UNKNOWN = (1 << android.hardware.radio.RadioTechnology.UNKNOWN) /* 1 */, + GPRS = (1 << android.hardware.radio.RadioTechnology.GPRS) /* 2 */, + EDGE = (1 << android.hardware.radio.RadioTechnology.EDGE) /* 4 */, + UMTS = (1 << android.hardware.radio.RadioTechnology.UMTS) /* 8 */, + IS95A = (1 << android.hardware.radio.RadioTechnology.IS95A) /* 16 */, + IS95B = (1 << android.hardware.radio.RadioTechnology.IS95B) /* 32 */, + ONE_X_RTT = (1 << android.hardware.radio.RadioTechnology.ONE_X_RTT) /* 64 */, + EVDO_0 = (1 << android.hardware.radio.RadioTechnology.EVDO_0) /* 128 */, + EVDO_A = (1 << android.hardware.radio.RadioTechnology.EVDO_A) /* 256 */, + HSDPA = (1 << android.hardware.radio.RadioTechnology.HSDPA) /* 512 */, + HSUPA = (1 << android.hardware.radio.RadioTechnology.HSUPA) /* 1024 */, + HSPA = (1 << android.hardware.radio.RadioTechnology.HSPA) /* 2048 */, + EVDO_B = (1 << android.hardware.radio.RadioTechnology.EVDO_B) /* 4096 */, + EHRPD = (1 << android.hardware.radio.RadioTechnology.EHRPD) /* 8192 */, + LTE = (1 << android.hardware.radio.RadioTechnology.LTE) /* 16384 */, + HSPAP = (1 << android.hardware.radio.RadioTechnology.HSPAP) /* 32768 */, + GSM = (1 << android.hardware.radio.RadioTechnology.GSM) /* 65536 */, + TD_SCDMA = (1 << android.hardware.radio.RadioTechnology.TD_SCDMA) /* 131072 */, + IWLAN = (1 << android.hardware.radio.RadioTechnology.IWLAN) /* 262144 */, + /** + * @deprecated use LTE instead. + */ + LTE_CA = (1 << android.hardware.radio.RadioTechnology.LTE_CA) /* 524288 */, + NR = (1 << android.hardware.radio.RadioTechnology.NR) /* 1048576 */, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioConst.aidl new file mode 100644 index 0000000000..9785825e9d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioConst.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@JavaDerive(toString=true) @VintfStability +parcelable RadioConst { + const int MAX_RILDS = 3; + const int MAX_UUID_LENGTH = 64; + const int CARD_MAX_APPS = 8; + const int P2_CONSTANT_NO_P2 = (-1) /* -1 */; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioError.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioError.aidl new file mode 100644 index 0000000000..98606e588b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioError.aidl @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioError { + NONE = 0, + RADIO_NOT_AVAILABLE = 1, + GENERIC_FAILURE = 2, + PASSWORD_INCORRECT = 3, + SIM_PIN2 = 4, + SIM_PUK2 = 5, + REQUEST_NOT_SUPPORTED = 6, + CANCELLED = 7, + OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, + OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, + SMS_SEND_FAIL_RETRY = 10, + SIM_ABSENT = 11, + SUBSCRIPTION_NOT_AVAILABLE = 12, + MODE_NOT_SUPPORTED = 13, + FDN_CHECK_FAILURE = 14, + ILLEGAL_SIM_OR_ME = 15, + MISSING_RESOURCE = 16, + NO_SUCH_ELEMENT = 17, + DIAL_MODIFIED_TO_USSD = 18, + DIAL_MODIFIED_TO_SS = 19, + DIAL_MODIFIED_TO_DIAL = 20, + USSD_MODIFIED_TO_DIAL = 21, + USSD_MODIFIED_TO_SS = 22, + USSD_MODIFIED_TO_USSD = 23, + SS_MODIFIED_TO_DIAL = 24, + SS_MODIFIED_TO_USSD = 25, + SUBSCRIPTION_NOT_SUPPORTED = 26, + SS_MODIFIED_TO_SS = 27, + LCE_NOT_SUPPORTED = 36, + NO_MEMORY = 37, + INTERNAL_ERR = 38, + SYSTEM_ERR = 39, + MODEM_ERR = 40, + INVALID_STATE = 41, + NO_RESOURCES = 42, + SIM_ERR = 43, + INVALID_ARGUMENTS = 44, + INVALID_SIM_STATE = 45, + INVALID_MODEM_STATE = 46, + INVALID_CALL_ID = 47, + NO_SMS_TO_ACK = 48, + NETWORK_ERR = 49, + REQUEST_RATE_LIMITED = 50, + SIM_BUSY = 51, + SIM_FULL = 52, + NETWORK_REJECT = 53, + OPERATION_NOT_ALLOWED = 54, + EMPTY_RECORD = 55, + INVALID_SMS_FORMAT = 56, + ENCODING_ERR = 57, + INVALID_SMSC_ADDRESS = 58, + NO_SUCH_ENTRY = 59, + NETWORK_NOT_READY = 60, + NOT_PROVISIONED = 61, + NO_SUBSCRIPTION = 62, + NO_NETWORK_FOUND = 63, + DEVICE_IN_USE = 64, + ABORTED = 65, + INVALID_RESPONSE = 66, + OEM_ERROR_1 = 501, + OEM_ERROR_2 = 502, + OEM_ERROR_3 = 503, + OEM_ERROR_4 = 504, + OEM_ERROR_5 = 505, + OEM_ERROR_6 = 506, + OEM_ERROR_7 = 507, + OEM_ERROR_8 = 508, + OEM_ERROR_9 = 509, + OEM_ERROR_10 = 510, + OEM_ERROR_11 = 511, + OEM_ERROR_12 = 512, + OEM_ERROR_13 = 513, + OEM_ERROR_14 = 514, + OEM_ERROR_15 = 515, + OEM_ERROR_16 = 516, + OEM_ERROR_17 = 517, + OEM_ERROR_18 = 518, + OEM_ERROR_19 = 519, + OEM_ERROR_20 = 520, + OEM_ERROR_21 = 521, + OEM_ERROR_22 = 522, + OEM_ERROR_23 = 523, + OEM_ERROR_24 = 524, + OEM_ERROR_25 = 525, + SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67, + ACCESS_BARRED = 68, + BLOCKED_DUE_TO_CALL = 69, + RF_HARDWARE_ISSUE = 70, + NO_RF_CALIBRATION_INFO = 71, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioIndicationType.aidl new file mode 100644 index 0000000000..58b35a5723 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioIndicationType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioIndicationType { + UNSOLICITED, + UNSOLICITED_ACK_EXP, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseInfo.aidl new file mode 100644 index 0000000000..b2a7a062f9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@JavaDerive(toString=true) @VintfStability +parcelable RadioResponseInfo { + android.hardware.radio.RadioResponseType type; + int serial; + android.hardware.radio.RadioError error; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseInfoModem.aidl new file mode 100644 index 0000000000..37ed7bb230 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseInfoModem.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@JavaDerive(toString=true) @VintfStability +parcelable RadioResponseInfoModem { + android.hardware.radio.RadioResponseType type; + int serial; + android.hardware.radio.RadioError error; + boolean isEnabled; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseType.aidl new file mode 100644 index 0000000000..1ee62bd94c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioResponseType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioResponseType { + SOLICITED, + SOLICITED_ACK, + SOLICITED_ACK_EXP, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioTechnology.aidl new file mode 100644 index 0000000000..b6af5aabf2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioTechnology.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioTechnology { + UNKNOWN, + GPRS, + EDGE, + UMTS, + IS95A, + IS95B, + ONE_X_RTT, + EVDO_0, + EVDO_A, + HSDPA, + HSUPA, + HSPA, + EVDO_B, + EHRPD, + LTE, + HSPAP, + GSM, + TD_SCDMA, + IWLAN, + /** + * @deprecated use LTE instead and indicate carrier aggregation through multiple physical channel configurations in IRadioNetwork::currentPhysicalChannelConfigs. + */ + LTE_CA, + NR, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioTechnologyFamily.aidl new file mode 100644 index 0000000000..2af7e535da --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/2/android/hardware/radio/RadioTechnologyFamily.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioTechnologyFamily { + THREE_GPP, + THREE_GPP2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl index 8ce689f501..964165149d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl @@ -34,11 +34,11 @@ package android.hardware.radio; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AccessNetwork { - UNKNOWN = 0, - GERAN = 1, - UTRAN = 2, - EUTRAN = 3, - CDMA2000 = 4, - IWLAN = 5, - NGRAN = 6, + UNKNOWN, + GERAN, + UTRAN, + EUTRAN, + CDMA2000, + IWLAN, + NGRAN, } 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 ecc2a9be7c..b7b074bda2 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 @@ -34,25 +34,28 @@ package android.hardware.radio; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioAccessFamily { - UNKNOWN = 1, - GPRS = 2, - EDGE = 4, - UMTS = 8, - IS95A = 16, - IS95B = 32, - ONE_X_RTT = 64, - EVDO_0 = 128, - EVDO_A = 256, - HSDPA = 512, - HSUPA = 1024, - HSPA = 2048, - EVDO_B = 4096, - EHRPD = 8192, - LTE = 16384, - HSPAP = 32768, - GSM = 65536, - TD_SCDMA = 131072, - IWLAN = 262144, - LTE_CA = 524288, - NR = 1048576, + UNKNOWN = (1 << android.hardware.radio.RadioTechnology.UNKNOWN) /* 1 */, + GPRS = (1 << android.hardware.radio.RadioTechnology.GPRS) /* 2 */, + EDGE = (1 << android.hardware.radio.RadioTechnology.EDGE) /* 4 */, + UMTS = (1 << android.hardware.radio.RadioTechnology.UMTS) /* 8 */, + IS95A = (1 << android.hardware.radio.RadioTechnology.IS95A) /* 16 */, + IS95B = (1 << android.hardware.radio.RadioTechnology.IS95B) /* 32 */, + ONE_X_RTT = (1 << android.hardware.radio.RadioTechnology.ONE_X_RTT) /* 64 */, + EVDO_0 = (1 << android.hardware.radio.RadioTechnology.EVDO_0) /* 128 */, + EVDO_A = (1 << android.hardware.radio.RadioTechnology.EVDO_A) /* 256 */, + HSDPA = (1 << android.hardware.radio.RadioTechnology.HSDPA) /* 512 */, + HSUPA = (1 << android.hardware.radio.RadioTechnology.HSUPA) /* 1024 */, + HSPA = (1 << android.hardware.radio.RadioTechnology.HSPA) /* 2048 */, + EVDO_B = (1 << android.hardware.radio.RadioTechnology.EVDO_B) /* 4096 */, + EHRPD = (1 << android.hardware.radio.RadioTechnology.EHRPD) /* 8192 */, + LTE = (1 << android.hardware.radio.RadioTechnology.LTE) /* 16384 */, + HSPAP = (1 << android.hardware.radio.RadioTechnology.HSPAP) /* 32768 */, + GSM = (1 << android.hardware.radio.RadioTechnology.GSM) /* 65536 */, + TD_SCDMA = (1 << android.hardware.radio.RadioTechnology.TD_SCDMA) /* 131072 */, + IWLAN = (1 << android.hardware.radio.RadioTechnology.IWLAN) /* 262144 */, + /** + * @deprecated use LTE instead. + */ + LTE_CA = (1 << android.hardware.radio.RadioTechnology.LTE_CA) /* 524288 */, + NR = (1 << android.hardware.radio.RadioTechnology.NR) /* 1048576 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl index b91bf03511..9785825e9d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl @@ -37,5 +37,5 @@ parcelable RadioConst { const int MAX_RILDS = 3; const int MAX_UUID_LENGTH = 64; const int CARD_MAX_APPS = 8; - const int P2_CONSTANT_NO_P2 = -1; + const int P2_CONSTANT_NO_P2 = (-1) /* -1 */; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl index 54ea3a4b4f..58b35a5723 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl @@ -34,6 +34,6 @@ package android.hardware.radio; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioIndicationType { - UNSOLICITED = 0, - UNSOLICITED_ACK_EXP = 1, + UNSOLICITED, + UNSOLICITED_ACK_EXP, } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl index 5cd99c43b0..1ee62bd94c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl @@ -34,7 +34,7 @@ package android.hardware.radio; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioResponseType { - SOLICITED = 0, - SOLICITED_ACK = 1, - SOLICITED_ACK_EXP = 2, + SOLICITED, + SOLICITED_ACK, + SOLICITED_ACK_EXP, } 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 9dad0a4977..b6af5aabf2 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 @@ -34,25 +34,28 @@ package android.hardware.radio; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioTechnology { - UNKNOWN = 0, - GPRS = 1, - EDGE = 2, - UMTS = 3, - IS95A = 4, - IS95B = 5, - ONE_X_RTT = 6, - EVDO_0 = 7, - EVDO_A = 8, - HSDPA = 9, - HSUPA = 10, - HSPA = 11, - EVDO_B = 12, - EHRPD = 13, - LTE = 14, - HSPAP = 15, - GSM = 16, - TD_SCDMA = 17, - IWLAN = 18, - LTE_CA = 19, - NR = 20, + UNKNOWN, + GPRS, + EDGE, + UMTS, + IS95A, + IS95B, + ONE_X_RTT, + EVDO_0, + EVDO_A, + HSDPA, + HSUPA, + HSPA, + EVDO_B, + EHRPD, + LTE, + HSPAP, + GSM, + TD_SCDMA, + IWLAN, + /** + * @deprecated use LTE instead and indicate carrier aggregation through multiple physical channel configurations in IRadioNetwork::currentPhysicalChannelConfigs. + */ + LTE_CA, + NR, } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl index e6fdce269d..2af7e535da 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl @@ -34,6 +34,6 @@ package android.hardware.radio; @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioTechnologyFamily { - THREE_GPP = 0, - THREE_GPP2 = 1, + THREE_GPP, + THREE_GPP2, } diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl index 6cd0a9530a..edf33ba7cc 100644 --- a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl +++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl @@ -41,6 +41,7 @@ enum RadioAccessFamily { GSM = 1 << RadioTechnology.GSM, TD_SCDMA = 1 << RadioTechnology.TD_SCDMA, IWLAN = 1 << RadioTechnology.IWLAN, + /** @deprecated use LTE instead. */ LTE_CA = 1 << RadioTechnology.LTE_CA, /** * 5G NR. This is only use in 5G Standalone mode. diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl index ae58a0eb6a..20313993f5 100644 --- a/radio/aidl/android/hardware/radio/RadioError.aidl +++ b/radio/aidl/android/hardware/radio/RadioError.aidl @@ -41,6 +41,9 @@ enum RadioError { * Operation requires SIM PUK2 to be entered */ SIM_PUK2 = 5, + /** + * Optional API + */ REQUEST_NOT_SUPPORTED = 6, CANCELLED = 7, /** @@ -177,7 +180,8 @@ enum RadioError { */ NO_SMS_TO_ACK = 48, /** - * Received error from network + * Received error from network. This generic error code should be used only when the error + * cannot be mapped to other specific network error codes. */ NETWORK_ERR = 49, /** diff --git a/radio/aidl/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/android/hardware/radio/RadioTechnology.aidl index 917cb16057..4b51152ac4 100644 --- a/radio/aidl/android/hardware/radio/RadioTechnology.aidl +++ b/radio/aidl/android/hardware/radio/RadioTechnology.aidl @@ -45,6 +45,10 @@ enum RadioTechnology { GSM, TD_SCDMA, IWLAN, + /** + * @deprecated use LTE instead and indicate carrier aggregation through multiple + * physical channel configurations in IRadioNetwork::currentPhysicalChannelConfigs. + */ LTE_CA, /** * 5G NR. This is only used in 5G Standalone mode. diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl index 929f02df0f..0d36bbd016 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -54,7 +54,6 @@ oneway interface IRadioConfigResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED */ void getNumOfLiveModemsResponse( in android.hardware.radio.RadioResponseInfo info, in byte numOfLiveModems); @@ -93,7 +92,6 @@ oneway interface IRadioConfigResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_ARGUMENTS */ void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info); diff --git a/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl new file mode 100644 index 0000000000..b18ea0e710 --- /dev/null +++ b/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.config; + +/** + * Multiple Enabled Profiles(MEP) mode is the jointly supported MEP mode. As per section 3.4.1.1 of + * GSMA spec SGP.22 v3.0,there are 3 supported MEP modes: MEP-A1, MEP-A2 and MEP-B. + * If there is no jointly supported MEP mode, supported MEP mode is set to NONE. + */ +@VintfStability +@Backing(type="int") +@JavaDerive(toString=true) +enum MultipleEnabledProfilesMode { + /** + * If there is no jointly supported MEP mode, set supported MEP mode to NONE. + */ + NONE, + /** + * In case of MEP-A1, the ISD-R is selected on eSIM port 0 only and profiles are selected on + * eSIM ports 1 and higher, with the eSIM port being assigned by the LPA or platform. + */ + MEP_A1, + /** + * In case of MEP-A2, the ISD-R is selected on eSIM port 0 only and profiles are selected on + * eSIM ports 1 and higher, with the eSIM port being assigned by the eUICC. + */ + MEP_A2, + /** + * In case of MEP-B, profiles are selected on eSIM ports 0 and higher, with the ISD-R being + * selectable on any of these eSIM ports. + */ + MEP_B, +} diff --git a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl index 748660fecc..6a36d5e83b 100644 --- a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl +++ b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.config; +import android.hardware.radio.config.MultipleEnabledProfilesMode; import android.hardware.radio.config.SimPortInfo; @VintfStability @@ -52,4 +53,9 @@ parcelable SimSlotStatus { * active port in the slot mapping. */ SimPortInfo[] portInfo; + /** + * Jointly supported Multiple Enabled Profiles(MEP) mode as per SGP.22 V3.0. Should always + * report proper MEP mode irrespective of whether the slot is active or inactive. + */ + MultipleEnabledProfilesMode supportedMepMode = MultipleEnabledProfilesMode.NONE; } diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl index 29ece76711..071ce55c49 100644 --- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl @@ -911,9 +911,13 @@ enum DataCallFailCause { */ PDP_MODIFY_COLLISION = 0x875, /** - * Maximum size of the L2 message was exceeded. + * @deprecated use MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED instead. */ MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, + /** + * Maximum size of the L2 message was exceeded. + */ + MAXIMUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, /** * Non-access stratum (NAS) request was rejected by the network. */ diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl index 88b6c1b720..06c83c1e92 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl @@ -44,7 +44,6 @@ oneway interface IRadioDataResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR * RadioError:NO_RESOURCES- Indicates that no pdu session ids are available - * RadioError:REQUEST_NOT_SUPPORTED */ void allocatePduSessionIdResponse(in RadioResponseInfo info, in int id); @@ -57,7 +56,6 @@ oneway interface IRadioDataResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR * RadioError:NO_RESOURCES - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_CALL_ID */ void cancelHandoverResponse(in RadioResponseInfo info); @@ -66,7 +64,6 @@ oneway interface IRadioDataResponse { * @param info Response info struct containing response type, serial no. and error * * Valid errors returned: - * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. * RadioError:NONE indicates success. Any other error will remove the network from the list. * RadioError:RADIO_NOT_AVAILABLE * RadioError:INVALID_CALL_ID @@ -112,7 +109,6 @@ oneway interface IRadioDataResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR * RadioError:NO_RESOURCES - * RadioError:REQUEST_NOT_SUPPORTED */ void releasePduSessionIdResponse(in RadioResponseInfo info); @@ -131,7 +127,6 @@ oneway interface IRadioDataResponse { * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void setDataAllowedResponse(in RadioResponseInfo info); @@ -146,7 +141,6 @@ oneway interface IRadioDataResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void setDataProfileResponse(in RadioResponseInfo info); @@ -159,7 +153,6 @@ oneway interface IRadioDataResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:MODEM_ERR * RadioError:INVALID_ARGUMENTS - * RadioError:REQUEST_NOT_SUPPORTED */ void setDataThrottlingResponse(in RadioResponseInfo info); @@ -176,7 +169,6 @@ oneway interface IRadioDataResponse { * RadioError:MODEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:NOT_PROVISIONED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -208,7 +200,6 @@ oneway interface IRadioDataResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR * RadioError:NO_RESOURCES - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_CALL_ID */ void startHandoverResponse(in RadioResponseInfo info); diff --git a/radio/aidl/android/hardware/radio/data/NrQos.aidl b/radio/aidl/android/hardware/radio/data/NrQos.aidl index af8ab833ff..4078fdccc6 100644 --- a/radio/aidl/android/hardware/radio/data/NrQos.aidl +++ b/radio/aidl/android/hardware/radio/data/NrQos.aidl @@ -27,6 +27,8 @@ parcelable NrQos { const byte FLOW_ID_RANGE_MIN = 1; const byte FLOW_ID_RANGE_MAX = 63; + const int AVERAGING_WINDOW_UNKNOWN = -1; + /** * 5G QOS Identifier (5QI), see 3GPP TS 24.501 and 23.501. The allowed values are standard * values (1-9, 65-68, 69-70, 75, 79-80, 82-85) defined in the spec and operator specific values @@ -37,8 +39,15 @@ parcelable NrQos { QosBandwidth uplink; /** * QOS flow identifier of the QOS flow description in the range - * (FLOW_ID_RANGE_MIN, FLOW_ID_RANGE_MAX) + * (FLOW_ID_RANGE_MIN, FLOW_ID_RANGE_MAX). */ byte qfi; + /** + * @deprecated use averagingWindowMillis; + */ char averagingWindowMs; + /** + * The duration over which flow rates are calculated. + */ + int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN; } diff --git a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl new file mode 100644 index 0000000000..70faa1e2e9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +parcelable ConnectionFailureInfo { + + @VintfStability + @Backing(type="int") + enum ConnectionFailureReason { + /** Access class check failed */ + REASON_ACCESS_DENIED = 1, + /** 3GPP Non-access stratum failure */ + REASON_NAS_FAILURE = 2, + /** Random access failure */ + REASON_RACH_FAILURE = 3, + /** Radio link failure */ + REASON_RLC_FAILURE = 4, + /** Radio connection establishment rejected by network */ + REASON_RRC_REJECT = 5, + /** Radio connection establishment timed out */ + REASON_RRC_TIMEOUT = 6, + /** Device currently not in service */ + REASON_NO_SERVICE = 7, + /** The PDN is no more active */ + REASON_PDN_NOT_AVAILABLE = 8, + /** Radio resource is busy with another subscription */ + REASON_RF_BUSY = 9, + REASON_UNSPECIFIED = 0xFFFF, + } + + /** + * Values are REASON_* constants + */ + ConnectionFailureReason failureReason; + + /** + * Failure cause code from network or modem specific to the failure + */ + int causeCode; + + /** + * Retry wait time provided by network in milliseconds + */ + int waitTimeMillis; +} diff --git a/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl new file mode 100644 index 0000000000..670638b029 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +@Backing(type="int") +enum EpsFallbackReason { + /** + * If VoNR is not supported and EPS fallback is not triggered by network then UE initiated EPS + * fallback would be triggered by IMS stack with this reason. The modem shall locally release + * the 5G NR SA RRC connection and acquire the LTE network and perform a tracking area update + * procedure. After the EPS fallback procedure is completed, the call setup for voice will + * be established. + */ + NO_NETWORK_TRIGGER = 1, + + /** + * If the UE doesn't receive any response for SIP INVITE within a certain time in 5G NR SA, + * UE initiated EPS fallback will be triggered with this reason. The modem shall reset its data + * buffer of IMS PDUs to prevent the ghost call. After the EPS fallback procedure is completed, + * the VoLTE call will be established. + */ + NO_NETWORK_RESPONSE = 2, +} diff --git a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl new file mode 100644 index 0000000000..bd661a7224 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +import android.hardware.radio.AccessNetwork; +import android.hardware.radio.ims.EpsFallbackReason; +import android.hardware.radio.ims.IRadioImsIndication; +import android.hardware.radio.ims.IRadioImsResponse; +import android.hardware.radio.ims.ImsCall; +import android.hardware.radio.ims.ImsRegistration; +import android.hardware.radio.ims.ImsStreamDirection; +import android.hardware.radio.ims.ImsStreamType; +import android.hardware.radio.ims.ImsTrafficType; +import android.hardware.radio.ims.SrvccCall; + +/** + * This interface is used by IMS telephony layer to talk to cellular radio. + * All the functions have minimum one parameter: + * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the + * duration of a method call. If clients provide colliding serials (including passing the same + * serial to different methods), multiple responses (one for each method call) must still be served. + * setResponseFunctions must work with IRadioImsResponse and IRadioImsIndication. + */ +@VintfStability +oneway interface IRadioIms { + /** + * Provides a list of SRVCC call information to radio. + * + * @param serial Serial number of request + * @param srvccCalls the list of calls + * + * Response function is IRadioImsResponse.setSrvccCallInfoResponse() + */ + void setSrvccCallInfo(int serial, in SrvccCall[] srvccCalls); + + /** + * Update the IMS registration information to the radio. + * + * This information shall be used by radio to implement following carrier requirements: + * 1) Graceful IMS PDN disconnection on cellular when NAS is about to perform detach + * eg. SIM removal or SIM refresh + * 2) Block PLMN or RAT based on the IMS registration failure reason + * + * @param serial Serial number of request + * @param imsRegistration IMS registration information + * + * Response function is IRadioImsResponse.updateImsRegistrationInfoResponse() + */ + void updateImsRegistrationInfo(int serial, in ImsRegistration imsRegistration); + + /** + * IMS stack notifies the NAS and RRC layers of the radio that the upcoming IMS traffic is + * for the service mentioned in the ImsTrafficType. If this API is not + * explicitly invoked and IMS module sends traffic on IMS PDN then the radio + * shall treat type as background data traffic type. + * This API shall be used by modem + * 1. To set the appropriate establishment cause in RRC connection request. + * 2. To prioritize RF resources in case of DSDS. The service priority is + * EMERGENCY > EMERGENCY SMS > VOICE > VIDEO > SMS > REGISTRATION > Ut/XCAP. The RF + * shall be prioritized to the subscription which handles higher priority service. + * When both subscriptions are handling the same type of service then RF shall be + * prioritized to the voice preferred sub. + * 3. To evaluate the overall access barring in the case of ACB, ACB-Skp/SCM and UAC. + * The response {@link IRadioImsResponse#startImsTrafficResponse()} with success shall + * be sent by modem upon access class is allowed and RF resource is allotted. Otherwise + * the same API shall be invoked with appropriate {@link ConnectionFailureInfo}. Further + * if RRC connection setup fails then {@link IRadioImsIndication#onConnectionSetupFailure()} + * shall be invoked by modem with appropriate {@link ConnectionFailureInfo}. + * + * @param serial Serial number of request + * @param token A nonce to identify the request + * @param imsTrafficType IMS traffic type like registration, voice, and video + * @param accessNetworkType The type of the radio access network used + * @param trafficDirection Indicates whether traffic is originated by mobile originated or + * mobile terminated use case eg. MO/MT call/SMS etc + * + * Response function is IRadioImsResponse.startImsTrafficResponse() + */ + void startImsTraffic(int serial, int token, + ImsTrafficType imsTrafficType, AccessNetwork accessNetworkType, + ImsCall.Direction trafficDirection); + + /** + * Indicates IMS traffic has been stopped. + * For all IMS traffic, notified with startImsTraffic, IMS service shall notify + * stopImsTraffic when it completes the traffic specified by the token. + * + * @param serial Serial number of request + * @param token The token assigned by startImsTraffic() + * + * Response function is IRadioImsResponse.stopImsTrafficResponse() + */ + void stopImsTraffic(int serial, int token); + + /** + * Triggers the UE initiated EPS fallback when a MO voice call failed to establish on 5G NR + * network and network didn't initiate a fallback. + * + * @param serial Serial number of request + * @param reason Specifies the reason that causes EPS fallback + * + * Response function is IRadioImsResponse.triggerEpsFallbackResponse() + */ + void triggerEpsFallback(int serial, in EpsFallbackReason reason); + + /** + * Set response functions for IMS radio requests and indications. + * + * @param radioImsResponse Object containing response functions + * @param radioImsIndication Object containing radio indications + */ + void setResponseFunctions(in IRadioImsResponse radioImsResponse, + in IRadioImsIndication radioImsIndication); + + /** + * Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114. + * This API triggers radio to send ANBRQ message + * to the access network to query the desired bitrate. + * + * @param serial Serial number of request + * @param mediaType Media type is used to identify media stream such as audio or video + * @param direction Direction of this packet stream (e.g. uplink or downlink) + * @param bitsPerSecond The bit rate requested by the opponent UE + * + * Response function is IRadioImsResponse.sendAnbrQueryResponse() + */ + void sendAnbrQuery(int serial, ImsStreamType mediaType, ImsStreamDirection direction, int bitsPerSecond); + + /** + * Provides a list of IMS call information to radio. + * + * @param serial Serial number of request + * @param imsCalls The list of IMS calls + * + * Response function is IRadioImsResponse.updateImsCallStatusResponse() + */ + void updateImsCallStatus(int serial, in ImsCall[] imsCalls); +} diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl new file mode 100644 index 0000000000..d123d07b90 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +import android.hardware.radio.RadioIndicationType; +import android.hardware.radio.ims.ConnectionFailureInfo; +import android.hardware.radio.ims.ImsDeregistrationReason; +import android.hardware.radio.ims.ImsStreamDirection; +import android.hardware.radio.ims.ImsStreamType; + +/** + * Interface declaring unsolicited radio indications for ims APIs. + */ +@VintfStability +oneway interface IRadioImsIndication { + /** + * Fired by radio when any IMS traffic is not sent to network due to any failure + * on cellular networks. IMS service shall call stopImsTraffic when receiving + * this indication. + * + * @param type Type of radio indication + * @param token The token of startImsTraffic() associated with this indication + * @param info Connection failure information + */ + void onConnectionSetupFailure( + in RadioIndicationType type, int token, in ConnectionFailureInfo info); + + /** + * Access Network Bitrate Recommendation (ANBR), see 3GPP TS 26.114. + * Notifies the bit rate received from the network via ANBR message + * + * @param type Type of radio indication + * @param mediaType Media type is used to identify media stream such as audio or video + * @param direction Direction of this packet stream (e.g. uplink or downlink) + * @param bitsPerSecond The recommended bit rate for the UE + * for a specific logical channel and a specific direction by NW + */ + void notifyAnbr(in RadioIndicationType type, in ImsStreamType mediaType, + in ImsStreamDirection direction, int bitsPerSecond); + + /** + * Requests IMS stack to perform graceful IMS deregistration before radio performing + * network detach in the events of SIM remove, refresh or and so on. The radio waits for + * the IMS deregistration, which will be notified by telephony via + * {@link IRadioIms#updateImsRegistrationInfo()}, or a certain timeout interval to start + * the network detach procedure. + * + * @param type Type of radio indication + * @param reason the reason why the deregistration is triggered + */ + void triggerImsDeregistration(in RadioIndicationType type, in ImsDeregistrationReason reason); +} diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl new file mode 100644 index 0000000000..ff516cc8f1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +import android.hardware.radio.RadioResponseInfo; +import android.hardware.radio.ims.ConnectionFailureInfo; + +/** + * Interface declaring response functions to solicited radio requests for ims APIs. + */ +@VintfStability +oneway interface IRadioImsResponse { + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void setSrvccCallInfoResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void updateImsRegistrationInfoResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error. + * @param failureInfo Information about failure in detail. If there is no error, + * it should be {@code null}. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void startImsTrafficResponse(in RadioResponseInfo info, + in @nullable ConnectionFailureInfo failureInfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void stopImsTrafficResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void triggerEpsFallbackResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void sendAnbrQueryResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + */ + void updateImsCallStatusResponse(in RadioResponseInfo info); +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl new file mode 100644 index 0000000000..b71682fae3 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +import android.hardware.radio.AccessNetwork; + +@VintfStability +@JavaDerive(toString=true) +parcelable ImsCall { + + @Backing(type="int") + enum CallType { + NORMAL, + EMERGENCY, + } + + @Backing(type="int") + enum CallState { + ACTIVE, + HOLDING, + DIALING, /* Outgoing only */ + ALERTING, /* Outgoing only */ + INCOMING, /* Incoming only */ + WAITING, /* Incoming only */ + DISCONNECTING, + DISCONNECTED, + } + + @Backing(type="int") + enum Direction { + INCOMING, + OUTGOING, + } + + /** Call index */ + int index; + + /** The type of the call */ + CallType callType; + + /** The access network where the call is in progress */ + AccessNetwork accessNetwork; + + /** The state of the call */ + CallState callState; + + /** The direction of the call */ + Direction direction; + + /** True if the call is put on HOLD by the other party */ + boolean isHeldByRemote; +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl new file mode 100644 index 0000000000..eac8db4437 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +@Backing(type="int") +enum ImsDeregistrationReason { + /** + * Radio shall send this reason to IMS stack to perform graceful de-registration + * due to SIM card is removed. + */ + REASON_SIM_REMOVED = 1, + /** + * Radio shall send this reason to IMS stack to perform graceful de-registration + * due to SIM refresh that needs a NAS detach and re-attach. + */ + REASON_SIM_REFRESH = 2, + /** + * Radio shall send this reason to IMS stack to perform graceful de-registration + * due to allowed network types bitmask changed that results in NAS detach. + */ + REASON_ALLOWED_NETWORK_TYPES_CHANGED = 3, +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl new file mode 100644 index 0000000000..662f9e9a56 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +import android.hardware.radio.AccessNetwork; +import android.hardware.radio.ims.ImsRegistrationState; +import android.hardware.radio.ims.SuggestedAction; + +@VintfStability +@JavaDerive(toString=true) +parcelable ImsRegistration { + /** Default value */ + const int IMS_MMTEL_CAPABILITY_NONE = 0; + /** IMS voice */ + const int IMS_MMTEL_CAPABILITY_VOICE = 1 << 0; + /** IMS video */ + const int IMS_MMTEL_CAPABILITY_VIDEO = 1 << 1; + /** IMS SMS */ + const int IMS_MMTEL_CAPABILITY_SMS = 1 << 2; + /** IMS RCS */ + const int IMS_RCS_CAPABILITIES = 1 << 3; + + /** Indicates the current IMS registration state. */ + ImsRegistrationState regState; + + /** + * Indicates the type of the radio access network where IMS is registered. + */ + AccessNetwork accessNetworkType; + + /** Indicates the expected action for the radio to do. */ + SuggestedAction suggestedAction; + + /** + * Values are bitwise ORs of IMS_MMTEL_CAPABILITY_* constants and IMS_RCS_CAPABILITIES. + * IMS capability such as VOICE, VIDEO, SMS and RCS. + */ + int capabilities; +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl new file mode 100644 index 0000000000..fd5c0fa930 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +@Backing(type="int") +enum ImsRegistrationState { + /** IMS is not registered */ + NOT_REGISTERED, + + /** IMS is successfully registered */ + REGISTERED, +} \ No newline at end of file diff --git a/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl new file mode 100644 index 0000000000..c0cea32230 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +@Backing(type="int") +enum ImsStreamDirection { + /** DIRECTION_UPLINK - From UE to Network **/ + UPLINK = 1, + /** DIRECTION_DOWNLINK - From Network to UE **/ + DOWNLINK = 2, +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl new file mode 100644 index 0000000000..c12a0c120f --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@Backing(type="int") +enum ImsStreamType { + /** Media Stream Type - Audio **/ + AUDIO = 1, + /** Media Stream Type - Video **/ + VIDEO = 2, +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl new file mode 100644 index 0000000000..5a824c0d54 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +@Backing(type="int") +enum ImsTrafficType { + /** Emergency call */ + EMERGENCY, + + /** Emergency SMS */ + EMERGENCY_SMS, + + /** Voice call */ + VOICE, + + /** Video call */ + VIDEO, + + /** SMS over IMS */ + SMS, + + /** IMS registration and subscription for reg event package (signaling) */ + REGISTRATION, + + /** Ut/XCAP (XML Configuration Access Protocol) */ + UT_XCAP +} \ No newline at end of file diff --git a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl new file mode 100644 index 0000000000..38e6cdbd54 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +parcelable SrvccCall { + + @VintfStability + @Backing(type="int") + enum CallType { + NORMAL, + EMERGENCY, + } + + @VintfStability + @Backing(type="int") + enum CallSubState { + NONE, + /** Pre-alerting state. Applicable for MT calls only */ + PREALERTING, + } + + @VintfStability + @Backing(type="int") + enum ToneType { + NONE, + LOCAL, + NETWORK, + } + + /** Connection index */ + int index; + + /** The type of the call */ + CallType callType; + + /** Values are android.hardware.radio.voice.Call.STATE_* constants */ + int callState; + + /** The substate of the call */ + CallSubState callSubstate; + + /** The type of the ringback tone */ + ToneType ringbackToneType; + + /** true if is mpty call */ + boolean isMpty; + + /** true if call is mobile terminated */ + boolean isMT; + + /** Remote party nummber */ + String number; + + /** Values are android.hardware.radio.voice.Call.PRESENTATION_* constants */ + int numPresentation; + + /** Remote party name */ + String name; + + /** Values are android.hardware.radio.voice.Call.PRESENTATION_* constants */ + int namePresentation; +} diff --git a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl new file mode 100644 index 0000000000..2d12ed628c --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims; + +@VintfStability +@JavaDerive(toString=true) +@Backing(type="int") +enum SuggestedAction { + /** Default value */ + NONE, + /** + * Indicates that the IMS registration is failed with fatal error such as 403 or 404 + * on all P-CSCF addresses. The radio shall block the current PLMN or disable + * the RAT as per the carrier requirements. + */ + TRIGGER_PLMN_BLOCK, + /** + * Indicates that the IMS registration on current PLMN failed multiple times. + * The radio shall block the current PLMN or disable the RAT during EPS or 5GS mobility + * management timer value as per the carrier requirements. + */ + TRIGGER_PLMN_BLOCK_WITH_TIMEOUT, +} diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl new file mode 100644 index 0000000000..66d8ef096b --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +/** AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071 */ +@VintfStability +@Backing(type="int") +enum AmrMode { + /** 4.75 kbps for AMR / 6.6 kbps for AMR-WB */ + AMR_MODE_0 = 1 << 0, + /** 5.15 kbps for AMR / 8.855 kbps for AMR-WB */ + AMR_MODE_1 = 1 << 1, + /** 5.9 kbps for AMR / 12.65 kbps for AMR-WB */ + AMR_MODE_2 = 1 << 2, + /** 6.7 kbps for AMR / 14.25 kbps for AMR-WB */ + AMR_MODE_3 = 1 << 3, + /** 7.4 kbps for AMR / 15.85 kbps for AMR-WB */ + AMR_MODE_4 = 1 << 4, + /** 7.95 kbps for AMR / 18.25 kbps for AMR-WB */ + AMR_MODE_5 = 1 << 5, + /** 10.2 kbps for AMR / 19.85 kbps for AMR-WB */ + AMR_MODE_6 = 1 << 6, + /** 12.2 kbps for AMR / 23.05 kbps for AMR-WB */ + AMR_MODE_7 = 1 << 7, + /** Silence frame for AMR / 23.85 kbps for AMR-WB */ + AMR_MODE_8 = 1 << 8, +} diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl new file mode 100644 index 0000000000..4ed3a24d66 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.AmrMode; + +@VintfStability +parcelable AmrParams { + /** mode-set: AMR codec mode to represent the bit rate */ + AmrMode amrMode; + /** + * octet-align: If it's set to true then all fields in the AMR/AMR-WB header + * shall be aligned to octet boundaries by adding padding bits. + */ + boolean octetAligned; + /** + * max-red: It’s the maximum duration in milliseconds that elapses between the + * primary (first) transmission of a frame and any redundant transmission that + * the sender will use. This parameter allows a receiver to have a bounded delay + * when redundancy is used. Allowed values are between 0 (no redundancy will be + * used) and 65535. If the parameter is omitted, no limitation on the use of + * redundancy is present. See RFC 4867 + */ + int maxRedundancyMillis; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl new file mode 100644 index 0000000000..f758cd47cc --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.CodecMode; + +@VintfStability +@JavaDerive(toString=true) +parcelable AnbrMode { + /** + * Codec mode converted from bitrate received for uplink + * from network or peer UE for ANBR + */ + CodecMode anbrUplinkMode; + /** + * Codec mode converted from bitrate received for downlink + * from network or peer UE for ANBR + */ + CodecMode anbrDownlinkMode; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl new file mode 100644 index 0000000000..a8f7b16181 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +parcelable CallQuality { + /** + * downlink CallQualityLevel for a given ongoing call + * this value corresponds to the CALL_QUALITY_* constants in {@link CallQuality} + */ + int downlinkCallQualityLevel; + /** + * uplink CallQualityLevel for a given ongoing call + * this value corresponds to the CALL_QUALITY_* constants in {@link CallQuality} + */ + int uplinkCallQualityLevel; + /** the call duration in milliseconds */ + int callDuration; + /** RTP packets sent to network */ + int numRtpPacketsTransmitted; + /** RTP packets received from network */ + int numRtpPacketsReceived; + /** RTP packets which were lost in network and never transmitted */ + int numRtpPacketsTransmittedLost; + /** RTP packets which were lost in network and never received */ + int numRtpPacketsNotReceived; + /** average relative jitter in milliseconds */ + int averageRelativeJitter; + /** maximum relative jitter in milliseconds */ + int maxRelativeJitter; + /** average round trip delay in milliseconds */ + int averageRoundTripTime; + /** + * the codec type. This value corresponds to the AUDIO_QUALITY_* constants in + * {@link ImsStreamMediaProfile} + */ + int codecType; + /** True if no incoming RTP is received for a continuous duration of 4 seconds */ + boolean rtpInactivityDetected; + /** + * True if only silence RTP packets are received for 20 seconds + * immediately after call is connected + */ + boolean rxSilenceDetected; + /** + * True if only silence RTP packets are sent for 20 seconds + * immediately after call is connected + */ + boolean txSilenceDetected; + /** the number of Voice frames sent by jitter buffer to audio */ + int numVoiceFrames; + /** the number of no-data frames sent by jitter buffer to audio */ + int numNoDataFrames; + /** the number of RTP voice packets dropped by jitter buffer */ + int numDroppedRtpPackets; + /** the minimum playout delay in the reporting interval in milliseconds */ + long minPlayoutDelayMillis; + /** the maximum playout delay in the reporting interval in milliseconds */ + long maxPlayoutDelayMillis; + /** + * the total number of RTP SID (Silence Insertion Descriptor) packets + * received by this device for an ongoing call + */ + int numRtpSidPacketsReceived; + /** + * the total number of RTP duplicate packets received by this device + * for an ongoing call + */ + int numRtpDuplicatePackets; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl new file mode 100644 index 0000000000..aa1b3a4cf1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.AmrMode; +import android.hardware.radio.ims.media.EvsMode; + +@VintfStability +@JavaDerive(toString=true) +union CodecMode { + /** Default value */ + boolean noinit; + /** AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071 */ + AmrMode amr; + /** EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1 */ + EvsMode evs; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl new file mode 100644 index 0000000000..0aa5505816 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.CodecSpecificParams; +import android.hardware.radio.ims.media.CodecType; + +@VintfStability +parcelable CodecParams { + /** Negotiated codec type */ + CodecType codecType; + /** + * Static or dynamic payload type number negotiated through the SDP for + * the incoming RTP packets. This value shall be matched with the PT value + * of the incoming RTP header. Values 0 to 127, see RFC 3551 section 6 + */ + byte rxPayloadTypeNumber; + /** + * Static or dynamic payload type number negotiated through the SDP for + * the outgoing RTP packets. This value shall be set to the PT value + * of the outgoing RTP header. Values 0 to 127, see RFC 3551 section 6 + */ + byte txPayloadTypeNumber; + /** Sampling rate in kHz*/ + byte samplingRateKHz; + /** dtx: Whether discontinuous transmission is enabled or not */ + boolean dtxEnabled; + /** Codec specific parameters */ + CodecSpecificParams codecSpecificParams; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl similarity index 75% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl rename to radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl index 1759a90e51..4410c81bb7 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl @@ -14,14 +14,13 @@ * limitations under the License. */ -package android.hardware.automotive.vehicle; +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.AmrParams; +import android.hardware.radio.ims.media.EvsParams; @VintfStability -@Backing(type="int") -enum VehicleDisplay { - /** - * The primary Android display (for example, center console) - */ - MAIN = 0, - INSTRUMENT_CLUSTER = 1, +union CodecSpecificParams { + AmrParams amr; + EvsParams evs; } diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl new file mode 100644 index 0000000000..31218e328e --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +@Backing(type="int") +enum CodecType { + /** Adaptive Multi-Rate */ + AMR = 1 << 0, + /** Adaptive Multi-Rate Wide Band */ + AMR_WB = 1 << 1, + /** Enhanced Voice Services */ + EVS = 1 << 2, + /** G.711 A-law i.e. Pulse Code Modulation using A-law */ + PCMA = 1 << 3, + /** G.711 μ-law i.e. Pulse Code Modulation using μ-law */ + PCMU = 1 << 4, +} diff --git a/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl new file mode 100644 index 0000000000..a7dcb0dc94 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +parcelable DtmfParams { + /** + * Dynamic payload type number to be used for DTMF RTP packets received. + * The values is in the range from 96 to 127 chosen during the session + * establishment. The PT value of the RTP header of all DTMF packets shall be + * set with this value. + */ + byte rxPayloadTypeNumber; + + /** + * Dynamic payload type number to be used for DTMF RTP packets sent. + * The values is in the range from 96 to 127 chosen during the session + * establishment. The PT value of the RTP header of all DTMF packets shall be set + * with this value. + */ + byte txPayloadTypeNumber; + + /** Sampling rate in kHz */ + byte samplingRateKHz; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl similarity index 73% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl rename to radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl index fd420626d6..8278514bf3 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl @@ -14,17 +14,14 @@ * limitations under the License. */ -package android.hardware.automotive.vehicle; - -/** - * Used by the trailer present property to enumerate the current state - * of the trailer. - */ +package android.hardware.radio.ims.media; +/** EVS Speech codec bandwidths, See 3gpp spec 26.441 Table 1 */ @VintfStability @Backing(type="int") -enum TrailerState { - UNKNOWN = 0, - NOT_PRESENT = 1, - PRESENT = 2, - ERROR = 3, +enum EvsBandwidth { + NONE = 0, + NARROW_BAND = 1 << 0, + WIDE_BAND = 1 << 1, + SUPER_WIDE_BAND = 1 << 2, + FULL_BAND = 1 << 3, } diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl new file mode 100644 index 0000000000..95bd6c7117 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +/** EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1 */ +@VintfStability +@Backing(type="int") +enum EvsMode { + /** 6.6 kbps for EVS AMR-WB IO */ + EVS_MODE_0 = 1 << 0, + /** 8.855 kbps for AMR-WB IO */ + EVS_MODE_1 = 1 << 1, + /** 12.65 kbps for AMR-WB IO */ + EVS_MODE_2 = 1 << 2, + /** 14.25 kbps for AMR-WB IO */ + EVS_MODE_3 = 1 << 3, + /** 15.85 kbps for AMR-WB IO */ + EVS_MODE_4 = 1 << 4, + /** 18.25 kbps for AMR-WB IO */ + EVS_MODE_5 = 1 << 5, + /** 19.85 kbps for AMR-WB IO */ + EVS_MODE_6 = 1 << 6, + /** 23.05 kbps for AMR-WB IO */ + EVS_MODE_7 = 1 << 7, + /** 23.85 kbps for AMR-WB IO */ + EVS_MODE_8 = 1 << 8, + /** 5.9 kbps for EVS primary */ + EVS_MODE_9 = 1 << 9, + /** 7.2 kbps for EVS primary */ + EVS_MODE_10 = 1 << 10, + /** 8.0 kbps for EVS primary */ + EVS_MODE_11 = 1 << 11, + /** 9.6 kbps for EVS primary */ + EVS_MODE_12 = 1 << 12, + /** 13.2 kbps for EVS primary */ + EVS_MODE_13 = 1 << 13, + /** 16.4 kbps for EVS primary */ + EVS_MODE_14 = 1 << 14, + /** 24.4 kbps for EVS primary */ + EVS_MODE_15 = 1 << 15, + /** 32.0 kbps for EVS primary */ + EVS_MODE_16 = 1 << 16, + /** 48.0 kbps for EVS primary */ + EVS_MODE_17 = 1 << 17, + /** 64.0 kbps for EVS primary */ + EVS_MODE_18 = 1 << 18, + /** 96.0 kbps for EVS primary */ + EVS_MODE_19 = 1 << 19, + /** 128.0 kbps for EVS primary */ + EVS_MODE_20 = 1 << 20, +} diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl new file mode 100644 index 0000000000..d138c8387a --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.EvsBandwidth; +import android.hardware.radio.ims.media.EvsMode; + +@VintfStability +parcelable EvsParams { + /** EVS codec bandwidth */ + EvsBandwidth bandwidth; + + /** mode-set: EVS codec mode to represent the bit rate */ + EvsMode evsMode; + /** + * ch-aw-recv: Channel aware mode for the receive direction. Permissible values + * are -1, 0, 2, 3, 5, and 7. If -1, channel-aware mode is disabled in the + * session for the receive direction. If 0 or not present, partial redundancy + * (channel-aware mode) is not used at the start of the session for the receive + * direction. If positive (2, 3, 5, or 7), partial redundancy (channel-aware + * mode) is used at the start of the session for the receive direction using the + * value as the offset, See 3GPP TS 26.445 section 4.4.5 + */ + byte channelAwareMode; + /** + * hf-only: Header full only is used for the outgoing and incoming packets. + * If it's true then the session shall support header full format only else the + * session could support both header full format and compact format. + */ + boolean useHeaderFullOnly; + /** + * evs-mode-switch: Used for switching between EVS Primary mode and EVS AMR-WB IO mode, + * If this value is true, the codec operates in AMR-WB IO mode + */ + boolean useEvsModeSwitch; + /** + * cmr: Codec mode request is used to request the speech codec encoder of the + * other party to set the frame type index of speech mode via RTP header, See + * 3GPP TS 26.445 section A.3. Allowed values are -1, 0 and 1. + */ + byte codecModeRequest; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl new file mode 100644 index 0000000000..ecf137030a --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.IImsMediaListener; +import android.hardware.radio.ims.media.LocalEndPoint; +import android.hardware.radio.ims.media.RtpConfig; +import android.hardware.radio.ims.media.RtpError; + +/** + * This interface is used by IMS media framework to talk to RTP stack located in another processor. + */ +@VintfStability +oneway interface IImsMedia { + + /** + * Set the listener functions for receiving notifications from the RTP stack. + * + * @param mediaListener Object containing listener methods + */ + void setListener(in IImsMediaListener mediaListener); + + /** + * Opens a RTP session for the local end point with the associated initial remote configuration + * if there is a valid RtpConfig passed. It starts the media flow if the media direction in the + * RtpConfig is set to any value other than NO_MEDIA_FLOW. If the open session is successful + * then the implementation shall return a new IImsMediaSession binder connection for this + * session using IImsMediaListener#onOpenSessionSuccess() API. If the open session is failed + * then the implementation shall return the error using IImsMediaListener#onOpenSessionFailure() + * + * @param sessionId unique identifier of the session + * @param localEndPoint provides IP address, port and logical modem id for local RTP endpoint + * @param config provides remote end point info and codec details. This could be null initially + * and the application may update this later using modifySession() API. + */ + void openSession(int sessionId, in LocalEndPoint localEndPoint, in RtpConfig config); + + /** + * Close the RTP session including cleanup of all the resources associated with the session. + * This shall also close the session specific binder connection opened as part of openSession(). + * + * @param sessionId identifier for the rtp session that needs to be closed + */ + void closeSession(int sessionId); +} diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl new file mode 100644 index 0000000000..228acb77d9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.IImsMediaSession; +import android.hardware.radio.ims.media.RtpError; + +/** + * Interface declaring listener functions for unsolicited IMS media notifications. + */ +@VintfStability +oneway interface IImsMediaListener { + /** + * Fired when a IImsMedia#openSession() API is successful. + * + * @param sessionId identifier of the session + * @param session new IImsMediaSession binder connection to be used for the session + * specific operations + */ + void onOpenSessionSuccess(int sessionId, IImsMediaSession session); + + /** + * Fired when IImsMedia#openSession() API failed to create a new session. + * + * @param sessionId identifier of the session + * @param error one of the following RTP error code + * RtpError :INVALID_PARAM + * RtpError :INTERNAL_ERR + * RtpError :NO_MEMORY + * RtpError :NO_RESOURCES + * RtpError :PORT_UNAVAILABLE + */ + void onOpenSessionFailure(int sessionId, RtpError error); + + /** + * Fired when IImsMedia#closeSession() API handled. + * + * @param sessionId identifier of the session + */ + void onSessionClosed(int sessionId); +} diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl new file mode 100644 index 0000000000..ec2fa2b3cd --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.IImsMediaSessionListener; +import android.hardware.radio.ims.media.MediaQualityThreshold; +import android.hardware.radio.ims.media.RtpConfig; +import android.hardware.radio.ims.media.RtpError; +import android.hardware.radio.ims.media.RtpHeaderExtension; + +/** + * Session specific interface used by IMS media framework to talk to the vendor RTP stack. + */ +@VintfStability +oneway interface IImsMediaSession { + /** + * Set the listener functions to receive IMS media session specific notifications. + * + * @param sessionListener Object containing notification methods + */ + void setListener(in IImsMediaSessionListener sessionListener); + + /** + * Modifies the configuration of the RTP session. It can be used to pause/resume + * the media stream by changing the value of the MediaDirection. + * + * @param config provides remote end point info and codec details + */ + void modifySession(in RtpConfig config); + + /** + * Send DTMF digit until the duration expires. + * + * @param dtmfDigit single char having one of 12 values: 0-9, *, # + * @param duration of the key press in milliseconds. + */ + void sendDtmf(char dtmfDigit, int duration); + + /** + * Start sending DTMF digit until the stopDtmf() API is received. + * If the implementation is currently sending a DTMF tone for which + * stopDtmf() is not received yet, then that digit must be stopped first + * + * @param dtmfDigit single char having one of 12 values: 0-9, *, # + */ + void startDtmf(char dtmfDigit); + + /** + * Stop sending the last DTMF digit started by startDtmf(). + * stopDtmf() without preceding startDtmf() must be ignored. + */ + void stopDtmf(); + + /** + * Send RTP header extension to the other party in the next RTP packet. + * + * @param extensions data to be transmitted via RTP header extension + */ + void sendHeaderExtension(in List extensions); + + /** + * Sets the media quality threshold parameters of the session to get + * media quality notifications. + * + * @param threshold media quality thresholds for various quality parameters + */ + void setMediaQualityThreshold(in MediaQualityThreshold threshold); +} diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl new file mode 100644 index 0000000000..8341da2bb1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.CallQuality; +import android.hardware.radio.ims.media.MediaQualityStatus; +import android.hardware.radio.ims.media.RtpConfig; +import android.hardware.radio.ims.media.RtpError; +import android.hardware.radio.ims.media.RtpHeaderExtension; + +/** + * Interface declaring listener functions for unsolicited IMS media notifications per session. + */ +@VintfStability +oneway interface IImsMediaSessionListener { + /** + * Notifies the result of IImsMediaSession#modifySession() API. + * + * @param config The RTP config passed in IImsMediaSession#modifySession() API + * @param error RtpError.NONE in case of success else one of the following + * RtpError :INVALID_PARAM + * RtpError :INTERNAL_ERR + * RtpError :NO_MEMORY + * RtpError :NO_RESOURCES + */ + void onModifySessionResponse(in RtpConfig config, RtpError error); + + /** + * Indicates when the first Rtp media packet is received by the UE during ring + * back, call hold or early media scenarios. This is sent only if the packet is + * received on the active remote configuration. + * + * In case of early media scenarios, the implementation shall play the RTP + * packets from the most recently added config. + * + * @param config The remote config where the media is received + */ + void onFirstMediaPacketReceived(in RtpConfig config); + + /** + * RTP header extension received from the other party + * + * @param extensions content of the received RTP header extension + */ + void onHeaderExtensionReceived(in List extensions); + + /** + * Notifies when the measured media quality crosses at least one of + * {@link MediaQualityThreshold} set by {@link IImsMediaSession#setMediaQualityThreshold()}. + * + * @param quality The object of MediaQualityStatus with the rtp and the rtcp statistics. + */ + void notifyMediaQualityStatus(in MediaQualityStatus quality); + + /** + * The modem RTP stack fires this API to query whether the desired bitrate mentioned + * in the RtpConfig is currently available on the NW or not using ANBRQ message. + * See 3GPP TS 26.114. + * + * @param config containing desired bitrate and direction + */ + void triggerAnbrQuery(in RtpConfig config); + + /** + * Notifies the received DTMF digit from the other party + * + * @param dtmfDigit single char having one of 12 values: 0-9, *, # + * @param durationMs The duration to play the tone in milliseconds unit + */ + void onDtmfReceived(char dtmfDigit, int durationMs); + + /** + * Notifies when a change to call quality has occurred + * + * @param CallQuality The call quality statistics of ongoing call since last report + */ + void onCallQualityChanged(in CallQuality callQuality); +} diff --git a/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl new file mode 100644 index 0000000000..2bd48c6fd7 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable LocalEndPoint { + /** Socket file descriptor for RTP traffic */ + ParcelFileDescriptor rtpFd; + /** Socket file descriptor for RTCP traffic */ + ParcelFileDescriptor rtcpFd; + /** The logical modem ID, returned by IRadioConfig.getPhoneCapability() */ + int modemId; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl new file mode 100644 index 0000000000..e5c34c7c1b --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +/** + * Directions can be combined to meet various media direction + * requirements depending on the scenario. + * + * Examples: + * No Flow : NO_FLOW - eg. SRVCC. + * RTCP-only : RTCP_TX | RTCP_RX - eg. Local Hold or Dual Hold. + * Receive-Only : RTP_RX | RTCP_TX | RTCP_RX - eg. Remote Hold. + * Send-Receive : RTP_TX | RTP_RX | RTCP_TX | RTCP_RX - eg. Active call. + * Send-Only : RTP_TX | RTCP_TX | RTCP_RX - eg. Simplex call, voice mail, etc + */ +@VintfStability +@Backing(type="int") +enum MediaDirection { + /** + * No RTP/RTCP flow in either direction. The implementation + * may release the audio resource. Eg. SRVCC. + */ + NO_FLOW = 0, + + /** Send RTP packets */ + RTP_TX = 1 << 0, + + /** Receive and processes RTP packets */ + RTP_RX = 1 << 1, + + /** Send RTCP packets */ + RTCP_TX = 1 << 2, + + /** Receive RTCP packets */ + RTCP_RX = 1 << 3, +} diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl new file mode 100644 index 0000000000..b99e501522 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +parcelable MediaQualityStatus { + /** + * Rtp inactivity observed as per threshold set by + * {@link IImsMediaSession#setMediaQualityThreshold()} + */ + int rtpInactivityTimeMillis; + /** + * Rtcp inactivity observed as per threshold set by + * {@link IImsMediaSession#setMediaQualityThreshold()} + */ + int rtcpInactivityTimeMillis; + /** + * Rtp packet loss rate observed as per threshold set by + * {@link IImsMediaSession#setMediaQualityThreshold()} + */ + int rtpPacketLossRate; + /** + * Rtp jitter observed as per threshold set by + * {@link IImsMediaSession#setMediaQualityThreshold()} + */ + int rtpJitterMillis; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl new file mode 100644 index 0000000000..bf98928ef0 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +parcelable MediaQualityThreshold { + /** Array including threshold values in milliseconds for monitoring RTP inactivity */ + int[] rtpInactivityTimerMillis; + /** Timer in milliseconds for monitoring RTCP inactivity */ + int rtcpInactivityTimerMillis; + /** + * This value determines the size of the time window (in milliseconds) + * required to calculate the packet loss rate per second for the manner of + * smoothly monitoring changes in the packet loss rate value. + */ + int rtpPacketLossDurationMillis; + /** + * The threshold hysteresis time for packet loss and jitter. This has a goal to prevent + * frequent ping-pong notification. So whenever a notifier needs to report the cross of + * threshold in opposite direction, this hysteresis timer should be respected. + */ + int rtpHysteresisTimeInMillis; + /** + * Array including threshold values of Packet loss rate in percentage of + * (total number of packets lost) / (total number of packets expected) calculated + * every one sec with the packet received in rtpPacketLossDurationMillis. + */ + int[] rtpPacketLossRate; + + /** Array including threshold values in milliseconds for RTP jitter */ + int[] rtpJitterMillis; + + /** + * A flag indicating whether the client needs to be notified the current media quality status + * right after the threshold is being set. True means the media stack should notify the client + * of the current status. + */ + boolean notifyCurrentStatus; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl new file mode 100644 index 0000000000..98bbfc6aeb --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +parcelable RtcpConfig { + /** Canonical name that will be sent to all session participants */ + String canonicalName; + /** Port for sending outgoing RTCP packets */ + int transmitPort; + /** Transmit interval in seconds. Value 0 indicates that RTCP reports should not be reported */ + int transmitIntervalSec; + /** Bitmask of RTCP-XR blocks to enable as in RtcpXrReportBlockType */ + int rtcpXrBlocks; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl new file mode 100644 index 0000000000..7f6839a6bc --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +/** RTP Control Protocol Extended Reports (RTCP XR) Blocks, See RFC 3611 section 4 */ + +@VintfStability +@Backing(type="int") +enum RtcpXrReportBlockType { + /** Disable RTCP XR */ + RTCPXR_NONE = 0, + /** Loss RLE Report Block */ + RTCPXR_LOSS_RLE_REPORT_BLOCK = 1 << 0, + /** Duplicate RLE Report Block */ + RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = 1 << 1, + /** Packet Receipt Times Report Block */ + RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = 1 << 2, + /** Receiver Reference Time Report Block */ + RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = 1 << 3, + /** DLRR Report Block */ + RTCPXR_DLRR_REPORT_BLOCK = 1 << 4, + /** Statistics Summary Report Block */ + RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = 1 << 5, + /** VoIP Metrics Report Block */ + RTCPXR_VOIP_METRICS_REPORT_BLOCK = 1 << 6, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl similarity index 75% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl rename to radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl index bf3c858c55..2db73a3fbd 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl @@ -14,17 +14,12 @@ * limitations under the License. */ -package android.hardware.automotive.vehicle; +package android.hardware.radio.ims.media; @VintfStability -@Backing(type="int") -enum VehicleOilLevel { - /** - * Oil level values - */ - CRITICALLY_LOW = 0, - LOW = 1, - NORMAL = 2, - HIGH = 3, - ERROR = 4, +parcelable RtpAddress { + /** Point to point IP address */ + String ipAddress; + /** UDP port number used for the RTP traffic */ + int portNumber; } diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl new file mode 100644 index 0000000000..f93b1125aa --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.AccessNetwork; +import android.hardware.radio.ims.media.AnbrMode; +import android.hardware.radio.ims.media.RtcpConfig; +import android.hardware.radio.ims.media.RtpAddress; +import android.hardware.radio.ims.media.RtpSessionParams; + +@VintfStability +parcelable RtpConfig { + /** Media flow direction. The bitfield of MediaDirection(s) */ + int direction; + /** Radio Access Network */ + AccessNetwork accessNetwork; + /** IP address and port number of the other party for RTP media */ + RtpAddress remoteAddress; + /** Negotiated session parameters */ + RtpSessionParams sessionParams; + /** RTCP configuration */ + RtcpConfig rtcpConfig; + /** + * ANBR Mode parameters. This is set to valid only when its triggered, + * otherwise it shall be set to NULL. + * + * This would be used in the following two cases + * - IImsMediaSession#modifySession(RtpConfig) - When RAN wants to change the bit + * rate via ANBR MAC layer signaling, ImsStack converts the received bitrate + * to the codec mode appropriately and passes the codec mode and direction + * using modifySession(). The underlying RTP stack shall adapt to + * the changed bitrate. + * + * - IImsMediaSessionListener#triggerAnbrQuery(RtpConfig) - When the vendor RTP + * stack receives a request for bitrate increase from the peer terminal via CMR, + * RTCP-APP or TMMBR, it triggers ANBRQ by setting the desired bitrate and the + * direction of the stream. + */ + AnbrMode anbrModeParams; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl new file mode 100644 index 0000000000..11a3468da2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +@VintfStability +@Backing(type="int") +enum RtpError { + /** Success */ + NONE = 0, + /** Invalid parameters passed in the request */ + INVALID_PARAM = 1, + /** The RTP stack is not ready to handle the request */ + NOT_READY = 2, + /** Unable to handle the request due to memory allocation failure */ + NO_MEMORY = 3, + /** Unable to handle the request due to no sufficient resources such as audio, codec */ + NO_RESOURCES = 4, + /** The requested port number is not available */ + PORT_UNAVAILABLE = 5, + /** The request is not supported by the implementation */ + NOT_SUPPORTED = 6, +} diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl new file mode 100644 index 0000000000..76b13dc629 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +/** RTP Header Extensions, see RFC 8285 */ +@VintfStability +parcelable RtpHeaderExtension { + /** Local identifier */ + int localId; + /** Extension data bytes */ + byte[] data; +} diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl new file mode 100644 index 0000000000..f93c52c088 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.ims.media; + +import android.hardware.radio.ims.media.CodecParams; +import android.hardware.radio.ims.media.DtmfParams; + +@VintfStability +parcelable RtpSessionParams { + /** + * ptime: Recommended length of time in milliseconds represented by the media + * in each packet, see RFC 4566 + */ + byte pTimeMillis; + /** + * maxptime: Maximum amount of media that can be encapsulated in each packet + * represented in milliseconds, see RFC 4566 + */ + int maxPtimeMillis; + /** dscp: Differentiated Services Field Code Point value, see RFC 2474 */ + byte dscp; + /** DTMF payload and clock rate */ + DtmfParams dtmfParams; + /** Negotiated codec parameters */ + CodecParams codecParams; +} diff --git a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl index ee62d957f4..b256c9a8bc 100644 --- a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl @@ -27,6 +27,7 @@ parcelable GsmSmsMessage { /** * SMS in PDU format as an ASCII hex string less the SMSC address. * TP-Layer-Length is be "strlen(pdu)/2 + * TP - MessageRef field of pdu must not be modified by modem */ String pdu; } diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl index 492755f6a1..8cbc869d33 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl @@ -36,7 +36,6 @@ oneway interface IRadioMessagingResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void acknowledgeIncomingGsmSmsWithPduResponse(in RadioResponseInfo info); @@ -56,7 +55,6 @@ oneway interface IRadioMessagingResponse { * RadioError:NETWORK_NOT_READY * RadioError:INVALID_MODEM_STATE * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -73,7 +71,6 @@ oneway interface IRadioMessagingResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void acknowledgeLastIncomingGsmSmsResponse(in RadioResponseInfo info); @@ -98,7 +95,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NO_SUCH_ENTRY * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -122,7 +118,6 @@ oneway interface IRadioMessagingResponse { * RadioError:NO_SUCH_ENTRY * RadioError:INTERNAL_ERR * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE @@ -145,7 +140,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NO_RESOURCES * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE @@ -168,7 +162,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NO_RESOURCES * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE @@ -191,7 +184,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:INVALID_MODEM_STATE * RadioError:NOT_PROVISIONED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -212,7 +204,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:INVALID_STATE * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT @@ -240,7 +231,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED @@ -275,7 +265,6 @@ oneway interface IRadioMessagingResponse { * RadioError:INVALID_SMSC_ADDRESS * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:ENCODING_ERR * RadioError:NO_RESOURCES @@ -308,7 +297,6 @@ oneway interface IRadioMessagingResponse { * RadioError:ENCODING_ERR * RadioError:OPERATION_NOT_ALLOWED * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NETWORK_NOT_READY * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -336,7 +324,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED @@ -368,7 +355,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED @@ -393,7 +379,6 @@ oneway interface IRadioMessagingResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -414,7 +399,6 @@ oneway interface IRadioMessagingResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE @@ -434,7 +418,6 @@ oneway interface IRadioMessagingResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -455,7 +438,6 @@ oneway interface IRadioMessagingResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE @@ -476,7 +458,6 @@ oneway interface IRadioMessagingResponse { * RadioError:MODEM_ERR * RadioError:NO_RESOURCES * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -502,7 +483,6 @@ oneway interface IRadioMessagingResponse { * RadioError:INVALID_MODEM_STATE * RadioError:INVALID_SMSC_ADDRESS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -531,7 +511,6 @@ oneway interface IRadioMessagingResponse { * RadioError:INVALID_SMSC_ADDRESS * RadioError:RADIO_NOT_AVAILABLE * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE * RadioError:SIM_ABSENT diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl index ba0ddb94b1..2011c53e13 100644 --- a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl +++ b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl @@ -67,6 +67,7 @@ oneway interface IRadioModem { * @param serial Serial number of request. * * Response function is IRadioModemResponse.getDeviceIdentityResponse() + * @deprecated use getImei(int serial) */ void getDeviceIdentity(in int serial); @@ -117,6 +118,8 @@ oneway interface IRadioModem { * @param itemId NvItem * * Response function is IRadioModemResponse.nvReadItemResponse() + * + * @deprecated NV APIs are deprecated starting from Android U. */ void nvReadItem(in int serial, in NvItem itemId); @@ -128,6 +131,8 @@ oneway interface IRadioModem { * @param resetType ResetNvType * * Response function is IRadioModemResponse.nvResetConfigResponse() + * + * Note: This will be deprecated in favor of a rebootModem API in Android U. */ void nvResetConfig(in int serial, in ResetNvType resetType); @@ -139,6 +144,8 @@ oneway interface IRadioModem { * @param prl PRL as a byte array * * Response function is IRadioModemResponse.nvWriteCdmaPrlResponse() + * + * @deprecated NV APIs are deprecated starting from Android U. */ void nvWriteCdmaPrl(in int serial, in byte[] prl); @@ -150,6 +157,8 @@ oneway interface IRadioModem { * @param item NvWriteItem * * Response function is IRadioModemResponse.nvWriteItemResponse() + * + * @deprecated NV APIs are deprecated starting from Android U. */ void nvWriteItem(in int serial, in NvWriteItem item); @@ -227,4 +236,13 @@ oneway interface IRadioModem { */ void setResponseFunctions(in IRadioModemResponse radioModemResponse, in IRadioModemIndication radioModemIndication); + + /** + * Request the IMEI associated with the radio. + * + * @param serial : Serial number of request. + * + * Response function is IRadioModemResponse.getImeiResponse() + */ + void getImei(in int serial); } diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl index b17cac41c7..fd4bffb659 100644 --- a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl +++ b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioResponseInfo; import android.hardware.radio.modem.ActivityStatsInfo; import android.hardware.radio.modem.HardwareConfig; import android.hardware.radio.modem.RadioCapability; +import android.hardware.radio.modem.ImeiInfo; /** * Interface declaring response functions to solicited radio requests for modem APIs. @@ -61,7 +62,6 @@ oneway interface IRadioModemResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:NOT_PROVISIONED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -89,6 +89,7 @@ oneway interface IRadioModemResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED + * @deprecated use getImeiResponse(RadioResponseInfo responseInfo, ImeiInfo imeiInfo) */ void getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid); @@ -100,7 +101,6 @@ oneway interface IRadioModemResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED */ void getHardwareConfigResponse(in RadioResponseInfo info, in HardwareConfig[] config); @@ -118,7 +118,6 @@ oneway interface IRadioModemResponse { * RadioError:NOT_PROVISIONED * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void getModemActivityInfoResponse(in RadioResponseInfo info, in ActivityStatsInfo activityInfo); @@ -141,7 +140,6 @@ oneway interface IRadioModemResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:OPERATION_NOT_ALLOWED * RadioError:INVALID_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY * RadioError:NO_RESOURCES @@ -156,7 +154,8 @@ oneway interface IRadioModemResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED + * + * @deprecated NV APIs are deprecated starting from Android U. */ void nvReadItemResponse(in RadioResponseInfo info, in String result); @@ -166,7 +165,8 @@ oneway interface IRadioModemResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED + * + * Note: This will be deprecated in favor of a rebootModemResponse API in Android U. */ void nvResetConfigResponse(in RadioResponseInfo info); @@ -176,7 +176,8 @@ oneway interface IRadioModemResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED + * + * @deprecated NV APIs are deprecated starting from Android U. */ void nvWriteCdmaPrlResponse(in RadioResponseInfo info); @@ -186,7 +187,8 @@ oneway interface IRadioModemResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED + * + * @deprecated NV APIs are deprecated starting from Android U. */ void nvWriteItemResponse(in RadioResponseInfo info); @@ -200,7 +202,6 @@ oneway interface IRadioModemResponse { * RadioError:NO_MEMORY * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -216,7 +217,6 @@ oneway interface IRadioModemResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -237,7 +237,6 @@ oneway interface IRadioModemResponse { * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR * RadioError:INVALID_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -254,4 +253,20 @@ oneway interface IRadioModemResponse { * RadioError:NO_RF_CALIBRATION_INFO */ void setRadioPowerResponse(in RadioResponseInfo info); + + /** + * ImeiInfo to encapsulate the IMEI information from modem. When the return error code + * is {@code RadioError:NONE}, {@code imeiInfo} must be non-null, and a valid IMEITYPE, + * IMEI and SVN must be filled in {@code imeiInfo}. When the error code is not + * {@code RadioError:NONE}, {@code imeiInfo} must be {@code null}. + * + * @param responseInfo Response info struct containing response type, serial no. and error + * @param imeiInfo IMEI information + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + */ + void getImeiResponse(in RadioResponseInfo responseInfo, in @nullable ImeiInfo imeiInfo); } diff --git a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl new file mode 100644 index 0000000000..2d25bb71c1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.modem; + +/** + * ImeiInfo to encapsulate the IMEI information from modem + */ + +@VintfStability +@JavaDerive(toString=true) +parcelable ImeiInfo { + + @VintfStability + @Backing(type="int") + /** + * ImeiType enum is used identify the IMEI as primary or secondary as mentioned in GSMA TS.37 + */ + enum ImeiType { + /** + * This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM + * device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8. + * A single SIM with one IMEI must by default set that IMEI with this type. + */ + PRIMARY = 1, + /** This is not the primary IMEI of the device */ + SECONDARY = 2, + } + + /** Primary or secondary IMEI as mentioned in GSMA spec TS.37 */ + ImeiType type; + /** + * IMEI value, see 3gpp spec 23.003 section 6. Note: This primary IMEI mapping must be + * permanent throughout the lifetime of the device irrespective of the factory data reset, + * SIM activations or swaps. + */ + String imei; + /** + * IMEI software version, see 3gpp spec 23.003 section 6. + */ + String svn; +} \ No newline at end of file diff --git a/radio/aidl/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/android/hardware/radio/modem/NvItem.aidl index 649b0d2db6..310b1ad601 100644 --- a/radio/aidl/android/hardware/radio/modem/NvItem.aidl +++ b/radio/aidl/android/hardware/radio/modem/NvItem.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.modem; +/** @deprecated NV APIs are deprecated starting from Android U. */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl index 47fb4904ef..6472f23d78 100644 --- a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl +++ b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; import android.hardware.radio.modem.NvItem; +/** @deprecated NV APIs are deprecated starting from Android U. */ @VintfStability @JavaDerive(toString=true) parcelable NvWriteItem { diff --git a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl index 16487f8391..6476fe8704 100644 --- a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl +++ b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.modem; +/** Note: This will be deprecated along with nvResetConfig in Android U. */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl new file mode 100644 index 0000000000..25031a9790 --- /dev/null +++ b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.network; + +@VintfStability +@Backing(type="int") +@JavaDerive(toString=true) +enum EmergencyMode { + /** + * Mode Type Emergency WWAN, indicates that the current domain selected for the Emergency call + * is cellular. + */ + EMERGENCY_WWAN = 1, + + /** + * Mode Type Emergency WLAN, indicates that the current domain selected for the Emergency call + * is WLAN/WIFI. + */ + EMERGENCY_WLAN = 2, + + /** + * Mode Type Emergency Callback, indicates that the current mode set request is for Emergency + * callback. + */ + EMERGENCY_CALLBACK = 3, +} diff --git a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl new file mode 100644 index 0000000000..0a22e4c93a --- /dev/null +++ b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.network; +import android.hardware.radio.AccessNetwork; +import android.hardware.radio.network.EmergencyScanType; + +@VintfStability +@JavaDerive(toString=true) +parcelable EmergencyNetworkScanTrigger{ + /** + * Access network to be prioritized during emergency scan. The 1st entry has the highest + * priority. + */ + AccessNetwork[] accessNetwork; + + /** + * Scan type indicates the type of scans to be performed i.e. limited scan, full service scan or + * any scan. + */ + EmergencyScanType scanType; +} diff --git a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl new file mode 100644 index 0000000000..2215149995 --- /dev/null +++ b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.network; +import android.hardware.radio.AccessNetwork; +import android.hardware.radio.network.Domain; +import android.hardware.radio.network.RegState; + +@VintfStability +@JavaDerive(toString=true) +parcelable EmergencyRegResult { + /** + * Indicates the cellular access network of the current emergency capable system. + */ + AccessNetwork accessNetwork; + + /** + * Registration state of the current emergency capable system. + */ + RegState regState; + + /** + * EMC domain indicates the current domain of the acquired system. + */ + Domain emcDomain; + + /** + * This indicates whether the network supports voice over PS network. + */ + boolean isVopsSupported; + + /** + * This indicates if camped network support VoLTE emergency bearers. + * This should only be set if the UE is in LTE mode. + */ + boolean isEmcBearerSupported; + + /** + * The value of the network provided EMC 5G Registration ACCEPT. + * This should be set only if the UE is in 5G mode. + */ + byte nwProvidedEmc; + + /** + * The value of the network provided EMF ( EPS Fallback) in 5G Registration ACCEPT. + * This should not be set if UE is not in 5G mode. + */ + byte nwProvidedEmf; + + /** 3-digit Mobile Country Code, 000..999, empty string if unknown. */ + String mcc = ""; + + /** 2 or 3-digit Mobile Network Code, 00..999, empty string if unknown. */ + String mnc = ""; +} diff --git a/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl new file mode 100644 index 0000000000..72c54903c1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.network; + +@VintfStability +@Backing(type="int") +@JavaDerive(toString=true) +enum EmergencyScanType { + /** + * Scan Type No Preference, indicates that the modem can scan for emergency + * service as per modem’s implementation. + */ + NO_PREFERENCE = 0, + + /** + * Scan Type limited, indicates that the modem will scan for + * emergency service in limited service mode. + */ + LIMITED_SERVICE = 1, + + /** + * Scan Type Full Service, indicates that the modem will scan for + * emergency service in Full service mode. + */ + FULL_SERVICE = 2, +} diff --git a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl index c9563ace60..b986944214 100644 --- a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -22,6 +22,21 @@ import android.hardware.radio.network.NrIndicators; @VintfStability @JavaDerive(toString=true) parcelable EutranRegistrationInfo { + enum AttachResultType { + /** Default value. */ + NONE, + /** LTE is attached with eps only. */ + EPS_ONLY, + /** LTE combined EPS and IMSI attach. */ + COMBINED, + } + + /** LTE combined attach with CSFB not preferred */ + const int EXTRA_CSFB_NOT_PREFERRED = 1 << 0; + + /** LTE combined attach for SMS only */ + const int EXTRA_SMS_ONLY = 1 << 1; + /** * Network capabilities for voice over PS services. This info is valid only on LTE network and * must be present when device is camped on LTE. VopsInfo must be empty when device is camped @@ -33,4 +48,13 @@ parcelable EutranRegistrationInfo { * be empty. */ NrIndicators nrIndicators; + + /** + * The type of network attachment. This info is valid only on LTE network and must be present + * when device has attached to the network. + */ + AttachResultType lteAttachResultType; + + /** Values are bitwise ORs of EXTRA_* constants */ + int extraInfo; } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index cce52ffe52..f22cdb0f12 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -18,6 +18,8 @@ package android.hardware.radio.network; import android.hardware.radio.AccessNetwork; import android.hardware.radio.network.CdmaRoamingType; +import android.hardware.radio.network.EmergencyMode; +import android.hardware.radio.network.EmergencyNetworkScanTrigger; import android.hardware.radio.network.IRadioNetworkIndication; import android.hardware.radio.network.IRadioNetworkResponse; import android.hardware.radio.network.IndicationFilter; @@ -110,6 +112,8 @@ oneway interface IRadioNetwork { * @param serial Serial number of request. * * Response function is IRadioNetworkResponse.getImsRegistrationStateResponse() + * + * @deprecated Deprecated starting from Android U. */ void getImsRegistrationState(in int serial); @@ -437,4 +441,118 @@ oneway interface IRadioNetwork { * @param serial Serial number of request. */ oneway void getUsageSetting(in int serial); + + /** + * Set the Emergency Mode + * + * @param serial Serial number of the request. + * @param emcModeType Defines the radio emergency mode type/radio network required/ + * type of service to be scanned. + * + * Response function is IRadioEmergencyResponse.setEmergencyModeResponse() + */ + void setEmergencyMode(int serial, in EmergencyMode emcModeType); + + /** + * Triggers an Emergency network scan. + * + * @param serial Serial number of the request. + * @param request Contains the preferred networks and type of service to be scanned. + * See {@link EmergencyNetworkScanTrigger}. + * + * Response function is IRadioEmergencyResponse.triggerEmergencyNetworkScanResponse() + */ + void triggerEmergencyNetworkScan(int serial, in EmergencyNetworkScanTrigger request); + + /** + * Cancels ongoing Emergency network scan + * + * @param serial Serial number of the request. + * @param resetScan Indicates how the next {@link #triggerEmergencyNetworkScan} should work. + * If {@code true}, then the modem shall start the new scan from the beginning, + * otherwise the modem shall resume from the last search. + * + * Response function is IRadioEmergencyResponse.cancelEmergencyNetworkScan() + */ + void cancelEmergencyNetworkScan(int serial, boolean resetScan); + + /** + * Exits ongoing Emergency Mode + * + * @param serial Serial number of the request. + * + * Response function is IRadioEmergencyResponse.exitEmergencyModeResponse() + */ + void exitEmergencyMode(in int serial); + + /** + * Set if null encryption and integrity modes are enabled. If the value of enabled is false + * the modem must not allow any network communications with null ciphering (for both signalling + * and user data) or null integrity (for signalling) modes for 3G and above, even if the + * network only uses null algorithms. This setting must be respected even if + * "cipheringDisabled" (as defined in TS 38.331) is in use by the network. + * + * For 2G, which does not use integrity protection, the modem must only disallow any network + * communications with null ciphering. + * + * In the case when enabled is false, integrity protection for user data is optional, but + * ciphering for user data is required. + * + * In case of an emergency call, the modem must bypass this setting. + * + * Null ciphering and integrity modes include (but are not limited to): + * 2G: A5/0 and GEA0 + * 3G: UEA0 and UIA0 + * 4G: EEA0 and EIA0 + * 5G: NEA0 and NIA0 + * + * + * @param serial Serial number of the request. + * @param enabled To allow null encryption/integrity, set to true. + * Otherwise, false. + * + * Response callback is IRadioResponse.setNullCipherAndIntegrityEnabledResponse() + */ + void setNullCipherAndIntegrityEnabled(in int serial, in boolean enabled); + + /** + * Get whether null encryption and integrity modes are enabled. + * + * Null ciphering and integrity modes include, (but are not limited to): + * 2G: A5/0, GAE0 (no integrity algorithm supported) + * 3G: UEA0 and UIA0 + * 4G: EEA0 and EIA + * 5G: NEA0 and NIA0 + * + * @param serial Serial number of the request. + * + * Response callback is IRadioNetworkResponse.isNullCipherAndIntegrityEnabledResponse() + */ + void isNullCipherAndIntegrityEnabled(in int serial); + + /** + * Checks whether N1 mode (access to 5G core network) is enabled or not. + * + * @param serial Serial number of request. + * + * Response function is IRadioNetworkResponse.isN1ModeEnabledResponse() + */ + void isN1ModeEnabled(in int serial); + + /** + * Enables or disables N1 mode (access to 5G core network) in accordance with + * 3GPP TS 24.501 4.9. + * + * Note: The default value of N1 mode shall be based on the modem's internal configuration + * as per device or carrier. This API may be invoked on demand first to disable N1 mode and + * later to re-enable for certain use case. This setting shall not be persisted by modem. + * This setting shall not interfere with the allowed network type bitmap set using + * {@link IRadioNetwork#setAllowedNetworkTypesBitmap()} API. + * + * @param serial Serial number of request. + * @param enable {@code true} to enable N1 mode, {@code false} to disable N1 mode. + * + * Response function is IRadioNetworkResponse.setN1ModeEnabledResponse() + */ + void setN1ModeEnabled(in int serial, boolean enable); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl index f471433780..47d932d909 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -27,6 +27,7 @@ import android.hardware.radio.network.PhoneRestrictedState; import android.hardware.radio.network.PhysicalChannelConfig; import android.hardware.radio.network.SignalStrength; import android.hardware.radio.network.SuppSvcNotification; +import android.hardware.radio.network.EmergencyRegResult; /** * Interface declaring unsolicited radio indications for network APIs. @@ -190,4 +191,12 @@ oneway interface IRadioNetworkIndication { * @param rat Current new voice rat */ void voiceRadioTechChanged(in RadioIndicationType type, in RadioTechnology rat); + + /** + * Emergency Scan Results. + * + * @param type Type of radio indication + * @param result the result of the Emergency Network Scan + */ + void emergencyNetworkScanResult(in RadioIndicationType type, in EmergencyRegResult result); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index dcf0004d6c..457b5b9149 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.network.BarringInfo; import android.hardware.radio.network.CdmaRoamingType; import android.hardware.radio.network.CellIdentity; import android.hardware.radio.network.CellInfo; +import android.hardware.radio.network.EmergencyRegResult; import android.hardware.radio.network.OperatorInfo; import android.hardware.radio.network.RadioAccessSpecifier; import android.hardware.radio.network.RadioBandMode; @@ -56,7 +57,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ void getAllowedNetworkTypesBitmapResponse(in RadioResponseInfo info, in int networkTypeBitmap); @@ -73,7 +73,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -92,7 +91,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED * RadioError:NO_RESOURCES * RadioError:INTERNAL_ERR @@ -125,7 +123,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT @@ -169,7 +166,8 @@ oneway interface IRadioNetworkResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE - * RadioError:REQUEST_NOT_SUPPORTED + * + * @deprecated Deprecated starting from Android U. */ void getImsRegistrationStateResponse( in RadioResponseInfo info, in boolean isRegistered, in RadioTechnologyFamily ratFamily); @@ -186,7 +184,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -204,7 +201,6 @@ oneway interface IRadioNetworkResponse { * RadioError:NO_MEMORY * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -246,7 +242,6 @@ oneway interface IRadioNetworkResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void getVoiceRadioTechnologyResponse(in RadioResponseInfo info, in RadioTechnology rat); @@ -271,7 +266,6 @@ oneway interface IRadioNetworkResponse { * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED */ void isNrDualConnectivityEnabledResponse(in RadioResponseInfo info, in boolean isEnabled); @@ -286,7 +280,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ void setAllowedNetworkTypesBitmapResponse(in RadioResponseInfo info); @@ -303,7 +296,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -324,7 +316,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -341,7 +332,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -361,7 +351,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INVALID_ARGUMENTS * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void setCellInfoListRateResponse(in RadioResponseInfo info); @@ -399,7 +388,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT @@ -419,7 +407,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * @@ -442,7 +429,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * @@ -458,7 +444,6 @@ oneway interface IRadioNetworkResponse { * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_STATE */ void setNrDualConnectivityStateResponse(in RadioResponseInfo info); @@ -485,7 +470,6 @@ oneway interface IRadioNetworkResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT @@ -542,7 +526,6 @@ oneway interface IRadioNetworkResponse { * RadioError:INVALID_ARGUMENTS * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void supplyNetworkDepersonalizationResponse(in RadioResponseInfo info, in int remainingRetries); @@ -572,4 +555,116 @@ oneway interface IRadioNetworkResponse { * RadioError:SIM_ABSENT */ oneway void getUsageSettingResponse(in RadioResponseInfo info, in UsageSetting usageSetting); + + /** + * Response of setEmergencyMode. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * @param regState the current registration state of the modem. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + */ + void setEmergencyModeResponse(in RadioResponseInfo info, in EmergencyRegResult regState); + + /** + * Response of triggerEmergencyNetworkScan. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + */ + void triggerEmergencyNetworkScanResponse(in RadioResponseInfo info); + + /** + * Response of exitEmergencyMode. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + */ + void exitEmergencyModeResponse(in RadioResponseInfo info); + + /** + * Response of cancelEmergencyNetworkScan. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + */ + void cancelEmergencyNetworkScanResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + */ + void setNullCipherAndIntegrityEnabledResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param enabled the last known state of null ciphering and integrity algorithms + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + */ + void isNullCipherAndIntegrityEnabledResponse(in RadioResponseInfo info, in boolean isEnabled); + + /** + * Response of isN1ModeEnabled. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * @param isEnabled Indicates whether N1 mode is enabled or not. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + */ + void isN1ModeEnabledResponse(in RadioResponseInfo info, boolean isEnabled); + + /** + * Response of setN1ModeEnabled. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_STATE + */ + void setN1ModeEnabledResponse(in RadioResponseInfo info); } diff --git a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl index 1bb569a91b..30ae067ec0 100644 --- a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl @@ -71,4 +71,11 @@ parcelable NrSignalStrength { * Range [0, 15], 0xFF means invalid/unreported. */ byte[] csiCqiReport; + /** + * Timing advance in micro seconds for a one way trip from cell to device. Approximate distance + * is calculated using 300m/us * timingAdvance. Range: 0 to 1282 inclusive. + * INT_MAX: 0x7FFFFFFF denotes invalid/unreported value. + * Reference: 3GPP 36.213 section 4.2.3 + */ + int timingAdvance = 0x7FFFFFFF; } diff --git a/radio/aidl/android/hardware/radio/network/RegState.aidl b/radio/aidl/android/hardware/radio/network/RegState.aidl index 3f1378321e..bdba4c4a78 100644 --- a/radio/aidl/android/hardware/radio/network/RegState.aidl +++ b/radio/aidl/android/hardware/radio/network/RegState.aidl @@ -65,4 +65,10 @@ enum RegState { * Same as UNKNOWN but indicates that emergency calls are enabled */ UNKNOWN_EM = 14, + /** + * Emergency attached in EPS or in 5GS. + * Reference: 3GPP TS 24.301 9.9.3.11 EPS attach type. + * Reference: 3GPP TS 24.501 9.11.3.6 5GS registration result. + */ + REG_EM = 20, } diff --git a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl index 3d96b8cbf2..f1d2972fc9 100644 --- a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl +++ b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl @@ -33,9 +33,9 @@ parcelable RegStateResult { */ RegState regState; /** - * Indicates the radio technology (except LTE_CA, which is no longer a valid value), which - * must not be UNKNOWN if regState is REG_HOME, REG_ROAMING, NOT_REG_MT_NOT_SEARCHING_OP_EM, - * NOT_REG_MT_SEARCHING_OP_EM, REG_DENIED_EM, or UNKNOWN_EM. + * Indicates the radio technology, which must not be UNKNOWN if regState is REG_HOME, + * REG_ROAMING, NOT_REG_MT_NOT_SEARCHING_OP_EM, NOT_REG_MT_SEARCHING_OP_EM, REG_DENIED_EM, + * or UNKNOWN_EM. * When the device is on carrier aggregation, vendor RIL service must properly report multiple * PhysicalChannelConfig elements through IRadioNetwork::currentPhysicalChannelConfigs. */ diff --git a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl index 2f901807e8..0a8e9ceee7 100644 --- a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -82,7 +82,13 @@ parcelable SignalThresholdInfo { * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. */ const int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; - + /** + * EcNo value + * Range: -24 dBm to 1 dBm. + * Used RAN: UTRAN + * Reference: 3GPP TS 25.215 5.1.5 + */ + const int SIGNAL_MEASUREMENT_TYPE_ECNO = 9; /** * Signal Measurement Type * Values are SIGNAL_MEASUREMENT_TYPE_ diff --git a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl index a14cf7d4cc..1419c51de6 100644 --- a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl +++ b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +import android.hardware.radio.config.MultipleEnabledProfilesMode; import android.hardware.radio.config.SlotPortMapping; import android.hardware.radio.sim.AppStatus; import android.hardware.radio.sim.PinState; @@ -93,4 +94,8 @@ parcelable CardStatus { * PortId is the id (enumerated value) for the associated port available on the SIM. */ SlotPortMapping slotMap; + /** + * Jointly supported Multiple Enabled Profiles(MEP) mode as per SGP.22 V3.0 + */ + MultipleEnabledProfilesMode supportedMepMode = MultipleEnabledProfilesMode.NONE; } diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl index 3dce9076ea..edbec2c4f8 100644 --- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -21,6 +21,22 @@ import android.hardware.radio.sim.Carrier; @VintfStability @JavaDerive(toString=true) parcelable CarrierRestrictions { + @VintfStability + @Backing(type="int") + /** This enum defines the carrier restriction status values */ + enum CarrierRestrictionStatus { + /** + * Carrier restriction status value is unknown, used in cases where modem is dependent on + * external module to know about the lock status and the module hasn’t yet provided the lock + * status. For example, when the lock status is maintained on a cloud server and device has + * just booted after out of box and not yet connected to the internet. + */ + UNKNOWN = 0, + /** There is no carrier restriction on the device */ + NOT_RESTRICTED = 1, + /** The device is restricted to a carrier */ + RESTRICTED = 2, + } /** * Allowed carriers */ @@ -40,4 +56,6 @@ parcelable CarrierRestrictions { * and not in the allowed list. */ boolean allowedCarriersPrioritized; + /** Current restriction status as defined in CarrierRestrictionStatus enum */ + CarrierRestrictionStatus status; } diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl index 7923b142f6..3823a718b5 100644 --- a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl +++ b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl @@ -26,6 +26,7 @@ import android.hardware.radio.sim.ImsiEncryptionInfo; import android.hardware.radio.sim.PersoSubstate; import android.hardware.radio.sim.PhonebookRecordInfo; import android.hardware.radio.sim.SelectUiccSub; +import android.hardware.radio.sim.SessionInfo; import android.hardware.radio.sim.SimApdu; import android.hardware.radio.sim.SimLockMultiSimPolicy; @@ -184,6 +185,8 @@ oneway interface IRadioSim { * @param channelId session id of the logical channel (+CCHC). * * Response function is IRadioSimResponse.iccCloseLogicalChannelResponse() + * + * @deprecated use iccCloseLogicalChannelWithSessionInfo instead. */ void iccCloseLogicalChannel(in int serial, in int channelId); @@ -494,4 +497,19 @@ oneway interface IRadioSim { * Response function is IRadioSimResponse.updateSimPhonebookRecordsResponse() */ void updateSimPhonebookRecords(in int serial, in PhonebookRecordInfo recordInfo); + + /** + * Close a previously opened logical channel. This command reflects TS 27.007 + * "close logical channel" operation (+CCHC). + * + * Per spec SGP.22 V3.0, ES10 commands needs to be sent over command port of MEP-A. In order + * to close proper logical channel, should pass information about whether the logical channel + * was opened for sending ES10 commands or not. + * + * @param serial Serial number of request. + * @param sessionInfo Details of the opened logical channel info like sessionId and isEs10. + * + * Response function is IRadioSimResponse.iccCloseLogicalChannelWithSessionInfoResponse() + */ + void iccCloseLogicalChannelWithSessionInfo(in int serial, in SessionInfo sessionInfo); } diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl index 750a29ad83..90f172f802 100644 --- a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl +++ b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl @@ -65,7 +65,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_PUK2 */ void changeIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); @@ -84,7 +83,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE - * RadioError:REQUEST_NOT_SUPPORTED */ void changeIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); @@ -108,7 +106,6 @@ oneway interface IRadioSimResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED */ void getAllowedCarriersResponse(in RadioResponseInfo info, in CarrierRestrictions carriers, in SimLockMultiSimPolicy multiSimPolicy); @@ -133,7 +130,6 @@ oneway interface IRadioSimResponse { * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR * RadioError:NOT_PROVISIONED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT @@ -153,7 +149,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void getCdmaSubscriptionSourceResponse( @@ -176,7 +171,6 @@ oneway interface IRadioSimResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -191,7 +185,6 @@ oneway interface IRadioSimResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR * RadioError:NO_RESOURCES - * RadioError:REQUEST_NOT_SUPPORTED */ void getIccCardStatusResponse(in RadioResponseInfo info, in CardStatus cardStatus); @@ -208,7 +201,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_SIM_STATE * RadioError:SIM_ERR - * RadioError:REQUEST_NOT_SUPPORTED */ void getImsiForAppResponse(in RadioResponseInfo info, in String imsi); @@ -219,13 +211,10 @@ oneway interface IRadioSimResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, - * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. */ void getSimPhonebookCapacityResponse(in RadioResponseInfo info, in PhonebookCapacity capacity); @@ -235,13 +224,10 @@ oneway interface IRadioSimResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR - * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, - * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. */ void getSimPhonebookRecordsResponse(in RadioResponseInfo info); @@ -255,7 +241,8 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED + * + * @deprecated use iccCloseLogicalChannelWithSessionInfoResponse instead. */ void iccCloseLogicalChannelResponse(in RadioResponseInfo info); @@ -274,7 +261,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_SIM_STATE * RadioError:SIM_ERR - * RadioError:REQUEST_NOT_SUPPORTED */ void iccIoForAppResponse(in RadioResponseInfo info, in IccIoResult iccIo); @@ -296,7 +282,6 @@ oneway interface IRadioSimResponse { * RadioError:SIM_ERR * RadioError:INVALID_SIM_STATE * RadioError:MISSING_RESOURCE - * RadioError:REQUEST_NOT_SUPPORTED */ void iccOpenLogicalChannelResponse( in RadioResponseInfo info, in int channelId, in byte[] selectResponse); @@ -312,7 +297,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void iccTransmitApduBasicChannelResponse(in RadioResponseInfo info, in IccIoResult result); @@ -327,7 +311,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void iccTransmitApduLogicalChannelResponse(in RadioResponseInfo info, in IccIoResult result); @@ -341,7 +324,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void reportStkServiceIsRunningResponse(in RadioResponseInfo info); @@ -359,7 +341,6 @@ oneway interface IRadioSimResponse { * RadioError:INVALID_MODEM_STATE * RadioError:SIM_ERR * RadioError:INVALID_ARGUMENTS - * RadioError:REQUEST_NOT_SUPPORTED */ void requestIccSimAuthenticationResponse(in RadioResponseInfo info, in IccIoResult result); @@ -379,7 +360,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void sendEnvelopeResponse(in RadioResponseInfo info, in String commandResponse); @@ -397,7 +377,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void sendEnvelopeWithStatusResponse(in RadioResponseInfo info, in IccIoResult iccIo); @@ -415,7 +394,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void sendTerminalResponseToSimResponse(in RadioResponseInfo info); @@ -427,7 +405,6 @@ oneway interface IRadioSimResponse { * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:INVALID_ARGUMENTS - * RadioError:REQUEST_NOT_SUPPORTED */ void setAllowedCarriersResponse(in RadioResponseInfo info); @@ -435,12 +412,11 @@ oneway interface IRadioSimResponse { * @param info Response info struct containing response type, serial no. and error * * Valid errors returned: - * RadioError:RIL_E_SUCCESS - * RadioError:RIL_E_RADIO_NOT_AVAILABLE + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE * RadioError:SIM_ABSENT - * RadioError:RIL_E_REQUEST_NOT_SUPPORTED * RadioError:INVALID_ARGUMENTS - * RadioError:MODEM_INTERNAL_FAILURE + * RadioError:INTERNAL_FAILURE */ void setCarrierInfoForImsiEncryptionResponse(in RadioResponseInfo info); @@ -456,7 +432,6 @@ oneway interface IRadioSimResponse { * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void setCdmaSubscriptionSourceResponse(in RadioResponseInfo info); @@ -477,7 +452,6 @@ oneway interface IRadioSimResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_STATE * RadioError:FDN_CHECK_FAILURE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -507,7 +481,6 @@ oneway interface IRadioSimResponse { * RadioError:SYSTEM_ERR * RadioError:MODEM_ERR * RadioError:INVALID_ARGUMENTS - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -527,7 +500,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_PUK2 */ void supplyIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); @@ -546,7 +518,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE - * RadioError:REQUEST_NOT_SUPPORTED */ void supplyIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); @@ -564,7 +535,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE - * RadioError:REQUEST_NOT_SUPPORTED */ void supplyIccPuk2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); @@ -582,7 +552,6 @@ oneway interface IRadioSimResponse { * RadioError:CANCELLED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE - * RadioError:REQUEST_NOT_SUPPORTED */ void supplyIccPukForAppResponse(in RadioResponseInfo info, in int remainingRetries); @@ -603,7 +572,6 @@ oneway interface IRadioSimResponse { * RadioError:MODEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:NO_RESOURCES - * RadioError:REQUEST_NOT_SUPPORTED */ void supplySimDepersonalizationResponse( in RadioResponseInfo info, in PersoSubstate persoType, in int remainingRetries); @@ -616,7 +584,6 @@ oneway interface IRadioSimResponse { * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_ARGUMENTS * RadioError:INVALID_SIM_STATE * RadioError:MODEM_ERR @@ -624,8 +591,19 @@ oneway interface IRadioSimResponse { * RadioError:SIM_ERR * RadioError:NO_SUCH_ENTRY * RadioError:NO_RESOURCES - * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, - * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. */ void updateSimPhonebookRecordsResponse(in RadioResponseInfo info, in int updatedRecordIndex); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + void iccCloseLogicalChannelWithSessionInfoResponse(in RadioResponseInfo info); } diff --git a/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl new file mode 100644 index 0000000000..9e3e8ed04d --- /dev/null +++ b/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.sim; + +@VintfStability +@JavaDerive(toString=true) +parcelable SessionInfo { + /** + * Session id of the logical channel from TS 27.007 (+CCHC). + */ + int sessionId; + /** + * Whether the logical channel was opened for sending ES10 commands. + */ + boolean isEs10 = false; +} diff --git a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl index 43adbbcd5e..9799f2bc7a 100644 --- a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl @@ -49,4 +49,9 @@ parcelable SimApdu { * In hex string format ([a-fA-F0-9]*) */ String data; + /** + * isEs10 indicates that the current streaming APDU contains an ES10 command or it is a regular + * APDU. (As per spec SGP.22 V3.0, ES10 commands needs to be sent over command port of MEP-A1) + */ + boolean isEs10 = false; } diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl index cf1b953fc6..39e3aced92 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl @@ -42,7 +42,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_CALL_ID * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -71,7 +70,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -92,7 +90,6 @@ oneway interface IRadioVoiceResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -122,7 +119,6 @@ oneway interface IRadioVoiceResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:ABORTED * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:CANCELLED */ @@ -163,7 +159,6 @@ oneway interface IRadioVoiceResponse { * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT @@ -185,7 +180,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_CALL_ID * RadioError:OPERATION_NOT_ALLOWED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -212,7 +206,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR * RadioError:FDN_CHECK_FAILURE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SYSTEM_ERR * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -241,7 +234,6 @@ oneway interface IRadioVoiceResponse { * RadioError:FDN_CHECK_FAILURE * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -260,7 +252,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR * RadioError:FDN_CHECK_FAILURE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -282,7 +273,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_ARGUMENTS * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -298,7 +288,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:INVALID_ARGUMENTS - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -344,7 +333,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_ARGUMENTS * RadioError:INTERNAL_ERR * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_MEMORY * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -367,7 +355,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_ARGUMENTS * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -386,7 +373,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -404,7 +390,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -423,7 +408,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_ARGUMENTS * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ void handleStkCallSetupRequestFromSimResponse(in RadioResponseInfo info); @@ -442,7 +426,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_CALL_ID * RadioError:NO_RESOURCES * RadioError:CANCELLED - * RadioError:REQUEST_NOT_SUPPORTED */ void hangupConnectionResponse(in RadioResponseInfo info); @@ -461,7 +444,6 @@ oneway interface IRadioVoiceResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -482,7 +464,6 @@ oneway interface IRadioVoiceResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED */ void hangupWaitingOrBackgroundResponse(in RadioResponseInfo info); @@ -497,7 +478,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY - * RadioError:REQUEST_NOT_SUPPORTED */ void isVoNrEnabledResponse(in RadioResponseInfo info, in boolean enable); @@ -516,7 +496,6 @@ oneway interface IRadioVoiceResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -536,7 +515,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INVALID_CALL_ID * RadioError:INVALID_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE @@ -557,7 +535,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INVALID_CALL_ID * RadioError:INVALID_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -578,7 +555,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_CALL_ID * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ @@ -603,7 +579,6 @@ oneway interface IRadioVoiceResponse { * RadioError:ABORTED * RadioError:SYSTEM_ERR * RadioError:INVALID_STATE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -625,7 +600,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_CALL_ID * RadioError:OPERATION_NOT_ALLOWED - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:CANCELLED */ @@ -647,7 +621,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_STATE * RadioError:FDN_CHECK_FAILURE - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -670,7 +643,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INVALID_STATE * RadioError:FDN_CHECK_FAILURE * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -690,7 +662,6 @@ oneway interface IRadioVoiceResponse { * RadioError:NO_MEMORY * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -707,7 +678,6 @@ oneway interface IRadioVoiceResponse { * RadioError:REQUEST_RATE_LIMITED * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -724,7 +694,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_CALL_ID * RadioError:NO_RESOURCES * RadioError:CANCELLED @@ -742,7 +711,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES * RadioError:CANCELLED */ @@ -758,7 +726,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR * RadioError:NO_MEMORY - * RadioError:REQUEST_NOT_SUPPORTED */ void setVoNrEnabledResponse(in RadioResponseInfo info); @@ -776,7 +743,6 @@ oneway interface IRadioVoiceResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_CALL_ID * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ @@ -796,7 +762,6 @@ oneway interface IRadioVoiceResponse { * RadioError:MODEM_ERR * RadioError:INTERNAL_ERR * RadioError:INVALID_CALL_ID - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ @@ -817,7 +782,6 @@ oneway interface IRadioVoiceResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:INVALID_ARGUMENTS * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NO_RESOURCES * RadioError:CANCELLED diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index aa20fc3fd5..5cf1378821 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -31,18 +31,20 @@ cc_library { "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], shared_libs: [ - "android.hardware.radio.config-V1-ndk", + "android.hardware.radio.config-V2-ndk", "android.hardware.radio.config@1.0", "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", - "android.hardware.radio.data-V1-ndk", - "android.hardware.radio.messaging-V1-ndk", - "android.hardware.radio.modem-V1-ndk", - "android.hardware.radio.network-V1-ndk", + "android.hardware.radio.data-V2-ndk", + "android.hardware.radio.ims-V1-ndk", + "android.hardware.radio.ims.media-V1-ndk", + "android.hardware.radio.messaging-V2-ndk", + "android.hardware.radio.modem-V2-ndk", + "android.hardware.radio.network-V2-ndk", "android.hardware.radio.sap-V1-ndk", - "android.hardware.radio.sim-V1-ndk", - "android.hardware.radio.voice-V1-ndk", + "android.hardware.radio.sim-V2-ndk", + "android.hardware.radio.voice-V2-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", @@ -70,6 +72,11 @@ cc_library { "data/RadioResponse-data.cpp", "data/RadioData.cpp", "data/structs.cpp", + "ims/RadioIndication-ims.cpp", + "ims/RadioResponse-ims.cpp", + "ims/RadioIms.cpp", + "ims/media/RadioImsMediaSession.cpp", + "ims/media/RadioImsMedia.cpp", "messaging/RadioIndication-messaging.cpp", "messaging/RadioMessaging.cpp", "messaging/RadioResponse-messaging.cpp", diff --git a/radio/aidl/compat/libradiocompat/data/structs.cpp b/radio/aidl/compat/libradiocompat/data/structs.cpp index cc6dcbcdf5..47f1f86320 100644 --- a/radio/aidl/compat/libradiocompat/data/structs.cpp +++ b/radio/aidl/compat/libradiocompat/data/structs.cpp @@ -137,7 +137,7 @@ static aidl::NrQos toAidl(const V1_6::NrQos& qos) { .downlink = toAidl(qos.downlink), .uplink = toAidl(qos.uplink), .qfi = static_cast(qos.qfi), - .averagingWindowMs = qos.averagingWindowMs, + .averagingWindowMillis = qos.averagingWindowMs, }; } diff --git a/radio/aidl/compat/libradiocompat/ims/RadioIms.cpp b/radio/aidl/compat/libradiocompat/ims/RadioIms.cpp new file mode 100644 index 0000000000..d2bdfff954 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/ims/RadioIms.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "commonStructs.h" +#include "debug.h" + +#include "collections.h" + +#define RADIO_MODULE "Ims" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::ims; +constexpr auto ok = &ScopedAStatus::ok; + +std::shared_ptr RadioIms::respond() { + return mCallbackManager->response().imsCb(); +} + +ScopedAStatus RadioIms::setSrvccCallInfo( + int32_t serial, const std::vector& /*srvccCalls*/) { + LOG_CALL << serial; + LOG(ERROR) << " setSrvccCallInfo is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioIms::updateImsRegistrationInfo( + int32_t serial, const aidl::ImsRegistration& /*imsRegistration*/) { + LOG_CALL << serial; + LOG(ERROR) << " updateImsRegistrationInfo is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioIms::startImsTraffic( + int32_t serial, int32_t /*token*/, aidl::ImsTrafficType /*imsTrafficType*/, + ::aidl::android::hardware::radio::AccessNetwork /*accessNetworkType*/, + ::aidl::android::hardware::radio::ims::ImsCall::Direction /*trafficDirection*/) { + LOG_CALL << serial; + LOG(ERROR) << " startImsTraffic is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioIms::stopImsTraffic(int32_t serial, int32_t /*token*/) { + LOG_CALL << serial; + LOG(ERROR) << " stopImsTraffic is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioIms::triggerEpsFallback(int32_t serial, aidl::EpsFallbackReason /*reason*/) { + LOG_CALL << serial; + LOG(ERROR) << " triggerEpsFallback is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioIms::sendAnbrQuery( + int32_t serial, aidl::ImsStreamType /*mediaType*/, aidl::ImsStreamDirection /*direction*/, + int32_t /*bitsPerSecond*/) { + LOG_CALL << serial; + LOG(ERROR) << " sendAnbrQuery is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioIms::updateImsCallStatus( + int32_t serial, const std::vector& /*imsCalls*/) { + LOG_CALL << serial; + LOG(ERROR) << " updateImsCallStatus is unsupported by HIDL HALs"; + return ok(); +} + +ScopedAStatus RadioIms::setResponseFunctions( + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/ims/RadioIndication-ims.cpp b/radio/aidl/compat/libradiocompat/ims/RadioIndication-ims.cpp new file mode 100644 index 0000000000..10109b8f9b --- /dev/null +++ b/radio/aidl/compat/libradiocompat/ims/RadioIndication-ims.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "commonStructs.h" +#include "debug.h" + +#include "collections.h" + +#define RADIO_MODULE "ImsIndication" + +namespace android::hardware::radio::compat { + +using ::aidl::android::hardware::radio::RadioTechnology; +namespace aidl = ::aidl::android::hardware::radio::ims; + +void RadioIndication::setResponseFunction(std::shared_ptr imsCb) { + mImsCb = imsCb; +} + +std::shared_ptr RadioIndication::imsCb() { + return mImsCb.get(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/ims/RadioResponse-ims.cpp b/radio/aidl/compat/libradiocompat/ims/RadioResponse-ims.cpp new file mode 100644 index 0000000000..831a0ae9c8 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/ims/RadioResponse-ims.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "commonStructs.h" +#include "debug.h" + +#include "collections.h" + +#define RADIO_MODULE "ImsResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::ims; + +void RadioResponse::setResponseFunction(std::shared_ptr imsCb) { + mImsCb = imsCb; +} + +std::shared_ptr RadioResponse::imsCb() { + return mImsCb.get(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMedia.cpp b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMedia.cpp new file mode 100644 index 0000000000..464a410535 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMedia.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "commonStructs.h" +#include "debug.h" + +#include "collections.h" + +#define RADIO_MODULE "ImsMedia" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioImsMedia::setListener( + const std::shared_ptr<::aidl::android::hardware::radio::ims::media:: + IImsMediaListener>& /*in_mediaListener*/) { + LOG(ERROR) << " setListener is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMedia::openSession( + int32_t /*in_sessionId*/, + const ::aidl::android::hardware::radio::ims::media::LocalEndPoint& /*in_localEndPoint*/, + const ::aidl::android::hardware::radio::ims::media::RtpConfig& /*in_config*/) { + LOG(ERROR) << " openSession is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMedia::closeSession(int32_t /*in_sessionId*/) { + LOG(ERROR) << " closeSession is unsupported by HIDL HALs"; + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp new file mode 100644 index 0000000000..ae86914e27 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "commonStructs.h" +#include "debug.h" + +#include "collections.h" + +#define RADIO_MODULE "ImsMediaSession" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::ims::media; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioImsMediaSession::setListener( + const std::shared_ptr& /*in_sessionListener*/) { + LOG(ERROR) << " setListener is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMediaSession::modifySession(const aidl::RtpConfig& /*in_config*/) { + LOG(ERROR) << " modifySession is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMediaSession::sendDtmf(char16_t /*in_dtmfDigit*/, int32_t /*in_duration*/) { + LOG(ERROR) << " sendDtmf is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMediaSession::startDtmf(char16_t /*in_dtmfDigit*/) { + LOG(ERROR) << " startDtmf is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMediaSession::stopDtmf() { + LOG(ERROR) << " stopDtmf is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMediaSession::sendHeaderExtension( + const std::vector& /*in_extensions*/) { + LOG(ERROR) << " sendHeaderExtension is unsupported by HIDL HALs"; + return ok(); +} +ScopedAStatus RadioImsMediaSession::setMediaQualityThreshold( + const aidl::MediaQualityThreshold& /*in_threshold*/) { + LOG(ERROR) << " setMediaQualityThreshold is unsupported by HIDL HALs"; + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIms.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIms.h new file mode 100644 index 0000000000..0dbc565c0e --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIms.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioIms : public RadioCompatBase, public aidl::android::hardware::radio::ims::BnRadioIms { + ::ndk::ScopedAStatus setSrvccCallInfo( + int32_t serial, + const std::vector<::aidl::android::hardware::radio::ims::SrvccCall>& srvccCalls) + override; + ::ndk::ScopedAStatus updateImsRegistrationInfo( + int32_t serial, + const ::aidl::android::hardware::radio::ims::ImsRegistration& imsRegistration) override; + ::ndk::ScopedAStatus startImsTraffic( + int32_t serial, int32_t token, + ::aidl::android::hardware::radio::ims::ImsTrafficType imsTrafficType, + ::aidl::android::hardware::radio::AccessNetwork accessNetworkType, + ::aidl::android::hardware::radio::ims::ImsCall::Direction trafficDirection) override; + ::ndk::ScopedAStatus stopImsTraffic(int32_t serial, int32_t token) override; + ::ndk::ScopedAStatus triggerEpsFallback( + int32_t serial, + ::aidl::android::hardware::radio::ims::EpsFallbackReason reason) override; + ::ndk::ScopedAStatus sendAnbrQuery( + int32_t serial, ::aidl::android::hardware::radio::ims::ImsStreamType mediaType, + ::aidl::android::hardware::radio::ims::ImsStreamDirection direction, + int32_t bitsPerSecond) override; + ::ndk::ScopedAStatus updateImsCallStatus( + int32_t serial, + const std::vector<::aidl::android::hardware::radio::ims::ImsCall>& imsCalls) override; + + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse>& + radioImsResponse, + const std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication>& + radioImsIndication) override; + + protected: + std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> respond(); + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMedia.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMedia.h new file mode 100644 index 0000000000..2ee6bf1a75 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMedia.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioImsMedia : public RadioCompatBase, + public aidl::android::hardware::radio::ims::media::BnImsMedia { + ::ndk::ScopedAStatus setListener( + const std::shared_ptr<::aidl::android::hardware::radio::ims::media::IImsMediaListener>& + in_mediaListener) override; + ::ndk::ScopedAStatus openSession( + int32_t in_sessionId, + const ::aidl::android::hardware::radio::ims::media::LocalEndPoint& in_localEndPoint, + const ::aidl::android::hardware::radio::ims::media::RtpConfig& in_config) override; + ::ndk::ScopedAStatus closeSession(int32_t in_sessionId) override; + + protected: + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h new file mode 100644 index 0000000000..00f21fc077 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioImsMediaSession : public RadioCompatBase, + public aidl::android::hardware::radio::ims::media::BnImsMediaSession { + ::ndk::ScopedAStatus setListener( + const std::shared_ptr< + ::aidl::android::hardware::radio::ims::media::IImsMediaSessionListener>& + in_sessionListener) override; + ::ndk::ScopedAStatus modifySession( + const ::aidl::android::hardware::radio::ims::media::RtpConfig& in_config) override; + ::ndk::ScopedAStatus sendDtmf(char16_t in_dtmfDigit, int32_t in_duration) override; + ::ndk::ScopedAStatus startDtmf(char16_t in_dtmfDigit) override; + ::ndk::ScopedAStatus stopDtmf() override; + ::ndk::ScopedAStatus sendHeaderExtension( + const std::vector<::aidl::android::hardware::radio::ims::media::RtpHeaderExtension>& + in_extensions) override; + ::ndk::ScopedAStatus setMediaQualityThreshold( + const ::aidl::android::hardware::radio::ims::media::MediaQualityThreshold& in_threshold) + override; + + protected: + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 6cfd59c6a3..f042456409 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -19,6 +19,7 @@ #include "GuaranteedCallback.h" #include +#include #include #include #include @@ -55,6 +56,10 @@ class RadioIndication : public V1_6::IRadioIndication { ::aidl::android::hardware::radio::voice::IRadioVoiceIndication, ::aidl::android::hardware::radio::voice::IRadioVoiceIndicationDefault, true> mVoiceCb; + GuaranteedCallback< // + ::aidl::android::hardware::radio::ims::IRadioImsIndication, + ::aidl::android::hardware::radio::ims::IRadioImsIndicationDefault, true> + mImsCb; // IRadioIndication @ 1.0 Return radioStateChanged(V1_0::RadioIndicationType type, @@ -220,6 +225,8 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication> imsCb); std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb(); std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> @@ -228,6 +235,7 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> networkCb(); std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb(); std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voiceCb(); + std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication> imsCb(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h index beb1fb0b49..54bedd8141 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h @@ -26,6 +26,7 @@ class RadioModem : public RadioCompatBase, ::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override; ::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override; ::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override; + ::ndk::ScopedAStatus getImei(int32_t serial) override; ::ndk::ScopedAStatus getHardwareConfig(int32_t serial) override; ::ndk::ScopedAStatus getModemActivityInfo(int32_t serial) override; ::ndk::ScopedAStatus getModemStackStatus(int32_t serial) override; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index 9784665ef7..d57c83de19 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -18,6 +18,9 @@ #include "RadioCompatBase.h" #include +#include + +// using namespace aidl::android::hardware::radio::network; namespace android::hardware::radio::compat { @@ -90,6 +93,21 @@ class RadioNetwork : public RadioCompatBase, ::aidl::android::hardware::radio::network::UsageSetting usageSetting) override; ::ndk::ScopedAStatus getUsageSetting(int32_t serial) override; + ::ndk::ScopedAStatus setEmergencyMode( + int32_t serial, + const ::aidl::android::hardware::radio::network::EmergencyMode emergencyMode) override; + ::ndk::ScopedAStatus triggerEmergencyNetworkScan( + int32_t serial, + const ::aidl::android::hardware::radio::network::EmergencyNetworkScanTrigger& + scanTrigger) override; + ::ndk::ScopedAStatus cancelEmergencyNetworkScan(int32_t serial, bool resetScan) override; + ::ndk::ScopedAStatus exitEmergencyMode(int32_t serial) override; + ::ndk::ScopedAStatus isN1ModeEnabled(int32_t serial) override; + ::ndk::ScopedAStatus setN1ModeEnabled(int32_t serial, bool enable) override; + + ::ndk::ScopedAStatus setNullCipherAndIntegrityEnabled(int32_t serial, bool enabled) override; + ::ndk::ScopedAStatus isNullCipherAndIntegrityEnabled(int32_t serial) override; + protected: std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond(); diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index 1f82dd19ca..e20eed985f 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -19,6 +19,8 @@ #include "GuaranteedCallback.h" #include +#include +#include #include #include #include @@ -49,6 +51,9 @@ class RadioResponse : public V1_6::IRadioResponse { GuaranteedCallback<::aidl::android::hardware::radio::voice::IRadioVoiceResponse, ::aidl::android::hardware::radio::voice::IRadioVoiceResponseDefault> mVoiceCb; + GuaranteedCallback<::aidl::android::hardware::radio::ims::IRadioImsResponse, + ::aidl::android::hardware::radio::ims::IRadioImsResponseDefault> + mImsCb; // IRadioResponse @ 1.0 Return getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, @@ -440,6 +445,8 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> imsCb); std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb(); std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> @@ -448,6 +455,7 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> networkCb(); std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb(); std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb(); + std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> imsCb(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h index ff91aef5fa..99e4b25a52 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h @@ -40,7 +40,8 @@ class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio:: ::ndk::ScopedAStatus getImsiForApp(int32_t serial, const std::string& aid) override; ::ndk::ScopedAStatus getSimPhonebookCapacity(int32_t serial) override; ::ndk::ScopedAStatus getSimPhonebookRecords(int32_t serial) override; - ::ndk::ScopedAStatus iccCloseLogicalChannel(int32_t serial, int32_t channelId) override; + ::ndk::ScopedAStatus iccCloseLogicalChannelWithSessionInfo(int32_t serial, + const ::aidl::android::hardware::radio::sim::SessionInfo& recordInfo) override; ::ndk::ScopedAStatus iccIoForApp( int32_t serial, const ::aidl::android::hardware::radio::sim::IccIo& iccIo) override; ::ndk::ScopedAStatus iccOpenLogicalChannel(int32_t serial, const std::string& aid, @@ -102,6 +103,7 @@ class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio:: protected: std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond(); + ::ndk::ScopedAStatus iccCloseLogicalChannel(int32_t serial, int32_t channelId) override; public: using RadioCompatBase::RadioCompatBase; diff --git a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp index d28b94041b..f088b10b19 100644 --- a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp +++ b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp @@ -15,7 +15,7 @@ */ #include - +#include "commonStructs.h" #include "debug.h" #include "structs.h" @@ -49,6 +49,13 @@ ScopedAStatus RadioModem::getDeviceIdentity(int32_t serial) { return ok(); } +ScopedAStatus RadioModem::getImei(int32_t serial) { + LOG_CALL << serial; + LOG(ERROR) << " getImei is unsupported by HIDL HALs"; + respond()->getImeiResponse(notSupported(serial), {}); + return ok(); +} + ScopedAStatus RadioModem::getHardwareConfig(int32_t serial) { LOG_CALL << serial; mHal1_5->getHardwareConfig(serial); diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index d5e2a8df99..a379eec10b 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -261,6 +261,11 @@ ScopedAStatus RadioNetwork::setSignalStrengthReportingCriteria( if (infos.size() > 1) { LOG(WARNING) << "Multi-element reporting criteria are not supported with HIDL HAL"; } + if (infos[0].signalMeasurement == aidl::SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_ECNO) { + LOG(WARNING) << "SIGNAL_MEASUREMENT_TYPE_ECNO are not supported with HIDL HAL"; + respond()->setSignalStrengthReportingCriteriaResponse(notSupported(serial)); + return ok(); + } mHal1_5->setSignalStrengthReportingCriteria_1_5(serial, toHidl(infos[0]), V1_5::AccessNetwork(infos[0].ran)); return ok(); @@ -311,4 +316,60 @@ ScopedAStatus RadioNetwork::getUsageSetting(int32_t serial) { return ok(); } +ScopedAStatus RadioNetwork::setEmergencyMode(int32_t serial, aidl::EmergencyMode) { + LOG_CALL << serial; + LOG(ERROR) << " setEmergencyMode is unsupported by HIDL HALs"; + respond()->setEmergencyModeResponse(notSupported(serial), {}); + return ok(); +} + +ScopedAStatus RadioNetwork::triggerEmergencyNetworkScan(int32_t serial, + const aidl::EmergencyNetworkScanTrigger&) { + LOG_CALL << serial; + LOG(ERROR) << " triggerEmergencyNetworkScan is unsupported by HIDL HALs"; + respond()->triggerEmergencyNetworkScanResponse(notSupported(serial)); + return ok(); +} + +ScopedAStatus RadioNetwork::cancelEmergencyNetworkScan(int32_t serial, bool) { + LOG_CALL << serial; + LOG(ERROR) << " cancelEmergencyNetworkScan is unsupported by HIDL HALs"; + respond()->cancelEmergencyNetworkScanResponse(notSupported(serial)); + return ok(); +} + +ScopedAStatus RadioNetwork::exitEmergencyMode(int32_t serial) { + LOG_CALL << serial; + LOG(ERROR) << " exitEmergencyMode is unsupported by HIDL HALs"; + respond()->exitEmergencyModeResponse(notSupported(serial)); + return ok(); +} + +ScopedAStatus RadioNetwork::setNullCipherAndIntegrityEnabled(int32_t serial, bool) { + LOG_CALL << serial; + LOG(ERROR) << " setNullCipherAndIntegrityEnabled is unsupported by HIDL HALs"; + respond()->setNullCipherAndIntegrityEnabledResponse(notSupported(serial)); + return ok(); +} + +ScopedAStatus RadioNetwork::isNullCipherAndIntegrityEnabled(int32_t serial) { + LOG_CALL << serial; + LOG(ERROR) << " isNullCipherAndIntegrityEnabled is unsupported by HIDL HALs"; + respond()->isNullCipherAndIntegrityEnabledResponse(notSupported(serial), true); + return ok(); +} + +ScopedAStatus RadioNetwork::isN1ModeEnabled(int32_t serial) { + LOG_CALL << serial; + LOG(ERROR) << " isN1ModeEnabled is unsupported by HIDL HALs"; + respond()->isN1ModeEnabledResponse(notSupported(serial), false); + return ok(); +} + +ScopedAStatus RadioNetwork::setN1ModeEnabled(int32_t serial, bool /*enable*/) { + LOG_CALL << serial; + LOG(ERROR) << " setN1ModeEnabled is unsupported by HIDL HALs"; + respond()->setN1ModeEnabledResponse(notSupported(serial)); + return ok(); +} } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp index b43f64f784..490b07b9f9 100644 --- a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp +++ b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp @@ -124,6 +124,14 @@ ScopedAStatus RadioSim::iccCloseLogicalChannel(int32_t serial, int32_t channelId return ok(); } +ScopedAStatus RadioSim::iccCloseLogicalChannelWithSessionInfo(int32_t serial, + const aidl::SessionInfo& /*SessionInfo*/) { + LOG_CALL << serial; + LOG(ERROR) << " iccCloseLogicalChannelWithSessionInfo is unsupported by HIDL HALs"; + respond()->iccCloseLogicalChannelWithSessionInfoResponse(notSupported(serial)); + return ok(); +} + ScopedAStatus RadioSim::iccIoForApp(int32_t serial, const aidl::IccIo& iccIo) { LOG_CALL << serial; mHal1_5->iccIOForApp(serial, toHidl(iccIo)); @@ -289,5 +297,4 @@ ScopedAStatus RadioSim::updateSimPhonebookRecords(int32_t serial, } return ok(); } - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 933e3e18d2..dff018285a 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -34,18 +34,20 @@ cc_binary { ], shared_libs: [ "android.hardware.radio-library.compat", - "android.hardware.radio.config-V1-ndk", + "android.hardware.radio.config-V2-ndk", "android.hardware.radio.config@1.0", "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", - "android.hardware.radio.data-V1-ndk", - "android.hardware.radio.messaging-V1-ndk", - "android.hardware.radio.modem-V1-ndk", - "android.hardware.radio.network-V1-ndk", + "android.hardware.radio.data-V2-ndk", + "android.hardware.radio.ims-V1-ndk", + "android.hardware.radio.ims.media-V1-ndk", + "android.hardware.radio.messaging-V2-ndk", + "android.hardware.radio.modem-V2-ndk", + "android.hardware.radio.network-V2-ndk", "android.hardware.radio.sap-V1-ndk", - "android.hardware.radio.sim-V1-ndk", - "android.hardware.radio.voice-V1-ndk", + "android.hardware.radio.sim-V2-ndk", + "android.hardware.radio.voice-V2-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp index 97964b4fd7..e79d3c0277 100644 --- a/radio/aidl/vts/Android.bp +++ b/radio/aidl/vts/Android.bp @@ -41,6 +41,12 @@ cc_test { "radio_data_indication.cpp", "radio_data_response.cpp", "radio_data_test.cpp", + "radio_ims_indication.cpp", + "radio_ims_response.cpp", + "radio_ims_test.cpp", + "radio_imsmedia_listener.cpp", + "radio_imsmedia_session_listener.cpp", + "radio_imsmedia_test.cpp", "radio_messaging_indication.cpp", "radio_messaging_response.cpp", "radio_messaging_test.cpp", @@ -65,15 +71,17 @@ cc_test { "libvintf", ], static_libs: [ - "android.hardware.radio-V1-ndk", - "android.hardware.radio.config-V1-ndk", - "android.hardware.radio.data-V1-ndk", - "android.hardware.radio.messaging-V1-ndk", - "android.hardware.radio.modem-V1-ndk", - "android.hardware.radio.network-V1-ndk", + "android.hardware.radio-V2-ndk", + "android.hardware.radio.config-V2-ndk", + "android.hardware.radio.data-V2-ndk", + "android.hardware.radio.ims-V1-ndk", + "android.hardware.radio.ims.media-V1-ndk", + "android.hardware.radio.messaging-V2-ndk", + "android.hardware.radio.modem-V2-ndk", + "android.hardware.radio.network-V2-ndk", "android.hardware.radio.sap-V1-ndk", - "android.hardware.radio.sim-V1-ndk", - "android.hardware.radio.voice-V1-ndk", + "android.hardware.radio.sim-V2-ndk", + "android.hardware.radio.voice-V2-ndk", ], test_suites: [ "general-tests", diff --git a/radio/aidl/vts/VtsHalRadioTargetTest.cpp b/radio/aidl/vts/VtsHalRadioTargetTest.cpp index ccd44276c9..c04173b762 100644 --- a/radio/aidl/vts/VtsHalRadioTargetTest.cpp +++ b/radio/aidl/vts/VtsHalRadioTargetTest.cpp @@ -18,6 +18,8 @@ #include "radio_config_utils.h" #include "radio_data_utils.h" +#include "radio_ims_utils.h" +#include "radio_imsmedia_utils.h" #include "radio_messaging_utils.h" #include "radio_modem_utils.h" #include "radio_network_utils.h" @@ -71,6 +73,17 @@ INSTANTIATE_TEST_SUITE_P( testing::ValuesIn(android::getAidlHalInstanceNames(IRadioVoice::descriptor)), android::PrintInstanceNameToString); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioImsTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioImsTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioIms::descriptor)), + android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioImsMediaTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, RadioImsMediaTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IImsMedia::descriptor)), + android::PrintInstanceNameToString); + int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); ABinderProcess_setThreadPoolMaxThreadCount(1); diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index 5781b4212e..15152014a1 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -16,7 +16,6 @@ #define LOG_TAG "RadioTest" #include "radio_aidl_hal_utils.h" -#include #include "VtsCoreUtil.h" #include "radio_config_utils.h" #include "radio_sim_utils.h" @@ -144,11 +143,25 @@ bool isServiceValidForDeviceConfiguration(std::string& serviceName) { return true; } +void RadioServiceTest::SetUp() { + ALOGD("BEGIN %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); + count_ = 0; + serial = -1; +} + +void RadioServiceTest::TearDown() { + count_ = 0; + serial = -1; + ALOGD("END %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); +} + /* * Notify that the response message is received. */ void RadioServiceTest::notify(int receivedSerial) { - std::unique_lock lock(mtx_); + std::lock_guard lock(mtx_); if (serial == receivedSerial) { count_++; cv_.notify_one(); diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index e68c5c185a..d8aa02431e 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -25,7 +25,6 @@ #include #include #include -#include using namespace aidl::android::hardware::radio; using aidl::android::hardware::radio::config::SimSlotStatus; @@ -67,6 +66,8 @@ static constexpr const char* FEATURE_TELEPHONY_GSM = "android.hardware.telephony static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; +static constexpr const char* FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims"; + #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 #define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2 @@ -136,14 +137,15 @@ bool isLteConnected(); /** * RadioServiceTest base class */ -class RadioServiceTest { +class RadioServiceTest : public ::testing::TestWithParam { protected: - std::mutex mtx_; - std::condition_variable cv_; std::shared_ptr radio_config; std::shared_ptr radio_sim; public: + void SetUp() override; + void TearDown() override; + /* Used as a mechanism to inform the test about data/event callback */ void notify(int receivedSerial); @@ -158,4 +160,8 @@ class RadioServiceTest { /* Update SIM slot status */ void updateSimSlotStatus(int physicalSlotId); + + private: + std::mutex mtx_; + std::condition_variable cv_; }; diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index c979d28781..aed3b05b4f 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include "radio_config_utils.h" @@ -22,6 +21,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioConfigTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); radio_config = IRadioConfig::fromBinder( @@ -31,8 +31,6 @@ void RadioConfigTest::SetUp() { radioRsp_config = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_config.get()); - count_ = 0; - radioInd_config = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_config.get()); diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h index 3db430db5f..f79aedbf9e 100644 --- a/radio/aidl/vts/radio_config_utils.h +++ b/radio/aidl/vts/radio_config_utils.h @@ -74,9 +74,10 @@ class RadioConfigIndication : public BnRadioConfigIndication { }; // The main test class for Radio AIDL Config. -class RadioConfigTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioConfigTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; + ndk::ScopedAStatus updateSimCardStatus(); /* Override updateSimSlotStatus in RadioServiceTest to not call setResponseFunctions */ void updateSimSlotStatus(); diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp index 3eedc146ff..0fb2fb404f 100644 --- a/radio/aidl/vts/radio_data_test.cpp +++ b/radio/aidl/vts/radio_data_test.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "radio_data_utils.h" @@ -25,6 +24,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioDataTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -39,8 +39,6 @@ void RadioDataTest::SetUp() { radioRsp_data = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_data.get()); - count_ = 0; - radioInd_data = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_data.get()); @@ -555,7 +553,6 @@ TEST_P(RadioDataTest, stopKeepalive) { * Test IRadioData.getDataCallList() for the response returned. */ TEST_P(RadioDataTest, getDataCallList) { - LOG(DEBUG) << "getDataCallList"; serial = GetRandomSerialNumber(); radio_data->getDataCallList(serial); @@ -569,14 +566,12 @@ TEST_P(RadioDataTest, getDataCallList) { radioRsp_data->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "getDataCallList finished"; } /* * Test IRadioData.setDataAllowed() for the response returned. */ TEST_P(RadioDataTest, setDataAllowed) { - LOG(DEBUG) << "setDataAllowed"; serial = GetRandomSerialNumber(); bool allow = true; @@ -589,5 +584,4 @@ TEST_P(RadioDataTest, setDataAllowed) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_data->rspInfo.error); } - LOG(DEBUG) << "setDataAllowed finished"; } diff --git a/radio/aidl/vts/radio_data_utils.h b/radio/aidl/vts/radio_data_utils.h index fb91ef61d5..0959207cf6 100644 --- a/radio/aidl/vts/radio_data_utils.h +++ b/radio/aidl/vts/radio_data_utils.h @@ -100,13 +100,13 @@ class RadioDataIndication : public BnRadioDataIndication { }; // The main test class for Radio AIDL Data. -class RadioDataTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioDataTest : public RadioServiceTest { protected: /* Get current data call list */ ndk::ScopedAStatus getDataCallList(); public: - virtual void SetUp() override; + void SetUp() override; /* radio data service handle */ std::shared_ptr radio_data; diff --git a/radio/aidl/vts/radio_ims_indication.cpp b/radio/aidl/vts/radio_ims_indication.cpp new file mode 100644 index 0000000000..988038bb92 --- /dev/null +++ b/radio/aidl/vts/radio_ims_indication.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "radio_ims_utils.h" + +RadioImsIndication::RadioImsIndication(RadioServiceTest& parent) : parent_ims(parent) {} + +ndk::ScopedAStatus RadioImsIndication::onConnectionSetupFailure(RadioIndicationType /*type*/, + int32_t /*token*/, const ConnectionFailureInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsIndication::notifyAnbr(RadioIndicationType /*type*/, + ImsStreamType /*mediaType*/, ImsStreamDirection /*direction*/, int /*bitsPerSecond*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsIndication::triggerImsDeregistration(RadioIndicationType /*type*/, + ImsDeregistrationReason /*reason*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_ims_response.cpp b/radio/aidl/vts/radio_ims_response.cpp new file mode 100644 index 0000000000..c6d62dce69 --- /dev/null +++ b/radio/aidl/vts/radio_ims_response.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "radio_ims_utils.h" + +RadioImsResponse::RadioImsResponse(RadioServiceTest& parent) : parent_ims(parent) {} + +ndk::ScopedAStatus RadioImsResponse::setSrvccCallInfoResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsResponse::updateImsRegistrationInfoResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsResponse::startImsTrafficResponse(const RadioResponseInfo& info, + const std::optional& response) { + rspInfo = info; + startImsTrafficResp = response; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsResponse::stopImsTrafficResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsResponse::triggerEpsFallbackResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsResponse::sendAnbrQueryResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioImsResponse::updateImsCallStatusResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_ims.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_ims_test.cpp b/radio/aidl/vts/radio_ims_test.cpp new file mode 100644 index 0000000000..1938e0a8b6 --- /dev/null +++ b/radio/aidl/vts/radio_ims_test.cpp @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "radio_ims_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioImsTest::SetUp() { + RadioServiceTest::SetUp(); + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_ims = IRadioIms::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_ims.get()); + + radioRsp_ims = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_ims.get()); + + radioInd_ims = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_ims.get()); + + radio_ims->setResponseFunctions(radioRsp_ims, radioInd_ims); + + // Assert IRadioConfig exists before testing + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); +} + +/* + * Test IRadioIms.setSrvccCallInfo() for the response returned. + */ +TEST_P(RadioImsTest, setSrvccCallInfo) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping setSrvccCallInfo because ims is not supported in device"); + return; + } else { + ALOGI("Running setSrvccCallInfo because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + SrvccCall srvccCall; + + ndk::ScopedAStatus res = + radio_ims->setSrvccCallInfo(serial, { srvccCall }); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("setSrvccCallInfo, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +/* + * Test IRadioIms.updateImsRegistrationInfo() for the response returned. + */ +TEST_P(RadioImsTest, updateImsRegistrationInfo) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping updateImsRegistrationInfo because ims is not supported in device"); + return; + } else { + ALOGI("Running updateImsRegistrationInfo because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + ImsRegistration regInfo; + regInfo.regState = ImsRegistrationState::NOT_REGISTERED; + regInfo.accessNetworkType = AccessNetwork::EUTRAN; + regInfo.suggestedAction = SuggestedAction::NONE; + regInfo.capabilities = ImsRegistration::IMS_MMTEL_CAPABILITY_NONE; + + ndk::ScopedAStatus res = + radio_ims->updateImsRegistrationInfo(serial, regInfo); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("updateImsRegistrationInfo, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +/* + * Test IRadioIms.startImsTraffic() for the response returned. + */ +TEST_P(RadioImsTest, startImsTraffic) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping startImsTraffic because ims is not supported in device"); + return; + } else { + ALOGI("Running startImsTraffic because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = + radio_ims->startImsTraffic(serial, 1, + ImsTrafficType::REGISTRATION, AccessNetwork::EUTRAN, ImsCall::Direction::OUTGOING); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("startImsTraffic, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +/* + * Test IRadioIms.stopImsTraffic() for the response returned. + */ +TEST_P(RadioImsTest, stopImsTraffic) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping stopImsTraffic because ims is not supported in device"); + return; + } else { + ALOGI("Running stopImsTraffic because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_ims->stopImsTraffic(serial, 2); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("stopImsTraffic, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +/* + * Test IRadioIms.triggerEpsFallback() for the response returned. + */ +TEST_P(RadioImsTest, triggerEpsFallback) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping triggerEpsFallback because ims is not supported in device"); + return; + } else { + ALOGI("Running triggerEpsFallback because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = + radio_ims->triggerEpsFallback(serial, EpsFallbackReason::NO_NETWORK_TRIGGER); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("triggerEpsFallback, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +/* + * Test IRadioIms.sendAnbrQuery() for the response returned. + */ +TEST_P(RadioImsTest, sendAnbrQuery) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping sendAnbrQuery because ims is not supported in device"); + return; + } else { + ALOGI("Running sendAnbrQuery because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = + radio_ims->sendAnbrQuery(serial, ImsStreamType::AUDIO, ImsStreamDirection::UPLINK, 13200); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("sendAnbrQuery, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +/* + * Test IRadioIms.updateImsCallStatus() for the response returned. + */ +TEST_P(RadioImsTest, updateImsCallStatus) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping updateImsCallStatus because ims is not supported in device"); + return; + } else { + ALOGI("Running updateImsCallStatus because ims is supported in device"); + } + + serial = GetRandomSerialNumber(); + + ImsCall imsCall; + + ndk::ScopedAStatus res = + radio_ims->updateImsCallStatus(serial, { imsCall }); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_ims->rspInfo.type); + EXPECT_EQ(serial, radioRsp_ims->rspInfo.serial); + + ALOGI("updateImsCallStatus, rspInfo.error = %s\n", + toString(radioRsp_ims->rspInfo.error).c_str()); + + verifyError(radioRsp_ims->rspInfo.error); +} + +void RadioImsTest::verifyError(RadioError resp) { + switch (resp) { + case RadioError::NONE: + case RadioError::RADIO_NOT_AVAILABLE: + case RadioError::INVALID_STATE: + case RadioError::NO_MEMORY: + case RadioError::SYSTEM_ERR: + case RadioError::MODEM_ERR: + case RadioError::INTERNAL_ERR: + case RadioError::INVALID_ARGUMENTS: + case RadioError::NO_RESOURCES: + SUCCEED(); + break; + default: + FAIL(); + break; + } +} diff --git a/radio/aidl/vts/radio_ims_utils.h b/radio/aidl/vts/radio_ims_utils.h new file mode 100644 index 0000000000..208c94b05c --- /dev/null +++ b/radio/aidl/vts/radio_ims_utils.h @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::ims; + +class RadioImsTest; + +/* Callback class for radio ims response */ +class RadioImsResponse : public BnRadioImsResponse { + protected: + RadioServiceTest& parent_ims; + + public: + RadioImsResponse(RadioServiceTest& parent_ims); + virtual ~RadioImsResponse() = default; + + RadioResponseInfo rspInfo; + std::optional startImsTrafficResp; + + virtual ndk::ScopedAStatus setSrvccCallInfoResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus updateImsRegistrationInfoResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus startImsTrafficResponse( + const RadioResponseInfo& info, + const std::optional& response) override; + + virtual ndk::ScopedAStatus stopImsTrafficResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus triggerEpsFallbackResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus sendAnbrQueryResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus updateImsCallStatusResponse(const RadioResponseInfo& info) override; +}; + +/* Callback class for radio ims indication */ +class RadioImsIndication : public BnRadioImsIndication { + protected: + RadioServiceTest& parent_ims; + + public: + RadioImsIndication(RadioServiceTest& parent_ims); + virtual ~RadioImsIndication() = default; + + virtual ndk::ScopedAStatus onConnectionSetupFailure(RadioIndicationType type, + int32_t token, const ConnectionFailureInfo& info) override; + + virtual ndk::ScopedAStatus notifyAnbr(RadioIndicationType type, ImsStreamType mediaType, + ImsStreamDirection direction, int bitsPerSecond) override; + + virtual ndk::ScopedAStatus triggerImsDeregistration(RadioIndicationType type, + ImsDeregistrationReason reason) override; +}; + +// The main test class for Radio AIDL Ims. +class RadioImsTest : public RadioServiceTest { + protected: + virtual void verifyError(RadioError resp); + + public: + void SetUp() override; + + /* radio ims service handle */ + std::shared_ptr radio_ims; + /* radio ims response handle */ + std::shared_ptr radioRsp_ims; + /* radio ims indication handle */ + std::shared_ptr radioInd_ims; +}; diff --git a/radio/aidl/vts/radio_imsmedia_listener.cpp b/radio/aidl/vts/radio_imsmedia_listener.cpp new file mode 100644 index 0000000000..78f66a9f4c --- /dev/null +++ b/radio/aidl/vts/radio_imsmedia_listener.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "radio_imsmedia_utils.h" + +ImsMediaListener::ImsMediaListener(RadioServiceTest& parent) : parent_imsmedia(parent) {} + +ndk::ScopedAStatus ImsMediaListener::onOpenSessionSuccess( + int32_t in_sessionId, const std::shared_ptr& in_session) { + mSessionId = in_sessionId; + mSession = in_session; + parent_imsmedia.notify(SERIAL_OPEN_SESSION); + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaListener::onOpenSessionFailure(int32_t in_sessionId, RtpError in_error) { + mSessionId = in_sessionId; + mError = in_error; + parent_imsmedia.notify(SERIAL_OPEN_SESSION); + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaListener::onSessionClosed(int32_t in_sessionId) { + mSessionId = in_sessionId; + parent_imsmedia.notify(SERIAL_CLOSE_SESSION); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_imsmedia_session_listener.cpp b/radio/aidl/vts/radio_imsmedia_session_listener.cpp new file mode 100644 index 0000000000..986cab24c9 --- /dev/null +++ b/radio/aidl/vts/radio_imsmedia_session_listener.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "radio_imsmedia_utils.h" + +ImsMediaSessionListener::ImsMediaSessionListener(RadioServiceTest& parent) + : parent_imsmedia(parent) {} + +ndk::ScopedAStatus ImsMediaSessionListener::onModifySessionResponse(const RtpConfig& in_config, + RtpError in_error) { + mConfig = in_config; + mError = in_error; + parent_imsmedia.notify(SERIAL_MODIFY_SESSION); + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaSessionListener::onFirstMediaPacketReceived( + const RtpConfig& /*in_config*/) { + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaSessionListener::onHeaderExtensionReceived( + const std::vector& /*in_extensions*/) { + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaSessionListener::notifyMediaQualityStatus( + const MediaQualityStatus& /*in_quality*/) { + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaSessionListener::triggerAnbrQuery(const RtpConfig& /*in_config*/) { + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaSessionListener::onDtmfReceived(char16_t /*in_dtmfDigit*/, + int32_t /*in_durationMs*/) { + return ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus ImsMediaSessionListener::onCallQualityChanged( + const CallQuality& /*in_callQuality*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_imsmedia_test.cpp b/radio/aidl/vts/radio_imsmedia_test.cpp new file mode 100644 index 0000000000..425f6b4d6a --- /dev/null +++ b/radio/aidl/vts/radio_imsmedia_test.cpp @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "radio_imsmedia_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioImsMediaTest::SetUp() { + RadioServiceTest::SetUp(); + std::string serviceName = GetParam(); + + radio_imsmedia = IImsMedia::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_imsmedia.get()); + + radio_imsmedialistener = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radio_imsmedialistener.get()); + + radio_imsmediasessionlistener = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radio_imsmediasessionlistener.get()); +} + +TEST_P(RadioImsMediaTest, MOCallSuccess) { + int32_t sessionId = 1; + RtpConfig modifyRtpConfig; + + modifyRtpConfig.direction = static_cast(MediaDirection::RTP_TX) | + static_cast(MediaDirection::RTP_RX) | + static_cast(MediaDirection::RTCP_TX) | + static_cast(MediaDirection::RTCP_RX); + modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33"; + modifyRtpConfig.remoteAddress.portNumber = 1234; + + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping setListener because ims is not supported in device"); + return; + } else { + ALOGI("Running setListener because ims is supported in device"); + } + + ndk::ScopedAStatus res = radio_imsmedia->setListener(radio_imsmedialistener); + ASSERT_OK(res); + + serial = SERIAL_OPEN_SESSION; + res = triggerOpenSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId); + ASSERT_NE(nullptr, radio_imsmedialistener->mSession); + + radio_imsmediasession = radio_imsmedialistener->mSession; + radio_imsmediasession->setListener(radio_imsmediasessionlistener); + ASSERT_OK(res); + + serial = SERIAL_MODIFY_SESSION; + res = radio_imsmediasession->modifySession(modifyRtpConfig); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(modifyRtpConfig, radio_imsmediasessionlistener->mConfig); + verifyError(radio_imsmediasessionlistener->mError); + + serial = SERIAL_CLOSE_SESSION; + res = radio_imsmedia->closeSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId); +} + +TEST_P(RadioImsMediaTest, testDtmfOperation) { + int32_t sessionId = 1; + char16_t dtmfDight = 'a'; + int32_t duration = 200; + RtpConfig modifyRtpConfig; + + modifyRtpConfig.direction = static_cast(MediaDirection::RTP_TX) | + static_cast(MediaDirection::RTP_RX) | + static_cast(MediaDirection::RTCP_TX) | + static_cast(MediaDirection::RTCP_RX); + modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33"; + modifyRtpConfig.remoteAddress.portNumber = 1234; + + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping setListener because ims is not supported in device"); + return; + } else { + ALOGI("Running setListener because ims is supported in device"); + } + + ndk::ScopedAStatus res = radio_imsmedia->setListener(radio_imsmedialistener); + ASSERT_OK(res); + + serial = SERIAL_OPEN_SESSION; + res = triggerOpenSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId); + ASSERT_NE(nullptr, radio_imsmedialistener->mSession); + + radio_imsmediasession = radio_imsmedialistener->mSession; + radio_imsmediasession->setListener(radio_imsmediasessionlistener); + ASSERT_OK(res); + + serial = SERIAL_MODIFY_SESSION; + res = radio_imsmediasession->modifySession(modifyRtpConfig); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(modifyRtpConfig, radio_imsmediasessionlistener->mConfig); + verifyError(radio_imsmediasessionlistener->mError); + + res = radio_imsmediasession->sendDtmf(dtmfDight, duration); + ASSERT_OK(res); + + res = radio_imsmediasession->startDtmf(dtmfDight); + ASSERT_OK(res); + + res = radio_imsmediasession->stopDtmf(); + ASSERT_OK(res); + + serial = SERIAL_CLOSE_SESSION; + res = radio_imsmedia->closeSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); +} + +TEST_P(RadioImsMediaTest, sendHeaderExtension) { + int32_t sessionId = 1; + std::vector extensions; + RtpConfig modifyRtpConfig; + + modifyRtpConfig.direction = static_cast(MediaDirection::RTP_TX) | + static_cast(MediaDirection::RTP_RX) | + static_cast(MediaDirection::RTCP_TX) | + static_cast(MediaDirection::RTCP_RX); + modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33"; + modifyRtpConfig.remoteAddress.portNumber = 1234; + + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping setListener because ims is not supported in device"); + return; + } else { + ALOGI("Running setListener because ims is supported in device"); + } + + ndk::ScopedAStatus res = radio_imsmedia->setListener(radio_imsmedialistener); + ASSERT_OK(res); + + serial = SERIAL_OPEN_SESSION; + res = triggerOpenSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId); + ASSERT_NE(nullptr, radio_imsmedialistener->mSession); + + radio_imsmediasession = radio_imsmedialistener->mSession; + radio_imsmediasession->setListener(radio_imsmediasessionlistener); + ASSERT_OK(res); + + serial = SERIAL_MODIFY_SESSION; + res = radio_imsmediasession->modifySession(modifyRtpConfig); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(modifyRtpConfig, radio_imsmediasessionlistener->mConfig); + verifyError(radio_imsmediasessionlistener->mError); + + res = radio_imsmediasession->sendHeaderExtension(extensions); + ASSERT_OK(res); + + serial = SERIAL_CLOSE_SESSION; + res = radio_imsmedia->closeSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); +} + +TEST_P(RadioImsMediaTest, setMediaQualityThreshold) { + int32_t sessionId = 1; + MediaQualityThreshold threshold; + RtpConfig modifyRtpConfig; + + modifyRtpConfig.direction = static_cast(MediaDirection::RTP_TX) | + static_cast(MediaDirection::RTP_RX) | + static_cast(MediaDirection::RTCP_TX) | + static_cast(MediaDirection::RTCP_RX); + modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33"; + modifyRtpConfig.remoteAddress.portNumber = 1234; + + if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) { + ALOGI("Skipping setListener because ims is not supported in device"); + return; + } else { + ALOGI("Running setListener because ims is supported in device"); + } + + ndk::ScopedAStatus res = radio_imsmedia->setListener(radio_imsmedialistener); + ASSERT_OK(res); + + serial = SERIAL_OPEN_SESSION; + res = triggerOpenSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId); + ASSERT_NE(nullptr, radio_imsmedialistener->mSession); + + radio_imsmediasession = radio_imsmedialistener->mSession; + radio_imsmediasession->setListener(radio_imsmediasessionlistener); + ASSERT_OK(res); + + serial = SERIAL_MODIFY_SESSION; + res = radio_imsmediasession->modifySession(modifyRtpConfig); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(modifyRtpConfig, radio_imsmediasessionlistener->mConfig); + verifyError(radio_imsmediasessionlistener->mError); + + res = radio_imsmediasession->setMediaQualityThreshold(threshold); + ASSERT_OK(res); + + serial = SERIAL_CLOSE_SESSION; + res = radio_imsmedia->closeSession(sessionId); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); +} + +ndk::ScopedAStatus RadioImsMediaTest::triggerOpenSession(int32_t sessionId) { + LocalEndPoint localEndPoint; + RtpConfig rtpConfig; + ndk::ScopedAStatus result; + + int mSocketFd = ::socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); + int mRtcpSocketFd = ::socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); + localEndPoint.rtpFd = ndk::ScopedFileDescriptor(mSocketFd); + localEndPoint.rtcpFd = ndk::ScopedFileDescriptor(mRtcpSocketFd); + localEndPoint.modemId = 1; + + rtpConfig.direction = static_cast(MediaDirection::RTP_TX) | + static_cast(MediaDirection::RTP_RX) | + static_cast(MediaDirection::RTCP_TX) | + static_cast(MediaDirection::RTCP_RX); + rtpConfig.remoteAddress.ipAddress = "122.22.22.22"; + rtpConfig.remoteAddress.portNumber = 2222; + + result = radio_imsmedia->openSession(sessionId, localEndPoint, rtpConfig); + return result; +} + +void RadioImsMediaTest::verifyError(RtpError error) { + switch (error) { + case RtpError::NONE: + case RtpError::INVALID_PARAM: + case RtpError::NOT_READY: + case RtpError::NO_MEMORY: + case RtpError::NO_RESOURCES: + case RtpError::PORT_UNAVAILABLE: + case RtpError::NOT_SUPPORTED: + SUCCEED(); + break; + default: + FAIL(); + break; + } +} diff --git a/radio/aidl/vts/radio_imsmedia_utils.h b/radio/aidl/vts/radio_imsmedia_utils.h new file mode 100644 index 0000000000..87f1b00a63 --- /dev/null +++ b/radio/aidl/vts/radio_imsmedia_utils.h @@ -0,0 +1,98 @@ + +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include "radio_aidl_hal_utils.h" + +#define SERIAL_SET_LISTENER 1 +#define SERIAL_OPEN_SESSION 2 +#define SERIAL_CLOSE_SESSION 3 +#define SERIAL_MODIFY_SESSION 4 + +using namespace aidl::android::hardware::radio::ims::media; + +class RadioImsMediaTest; + +/* Listener class for ImsMedia. */ +class ImsMediaListener : public BnImsMediaListener { + protected: + RadioServiceTest& parent_imsmedia; + + public: + ImsMediaListener(RadioServiceTest& parent_imsmedialistener); + virtual ~ImsMediaListener() = default; + + int32_t mSessionId; + std::shared_ptr<::aidl::android::hardware::radio::ims::media::IImsMediaSession> mSession; + RtpError mError; + + virtual ndk::ScopedAStatus onOpenSessionSuccess( + int32_t in_sessionId, const std::shared_ptr& in_session) override; + virtual ndk::ScopedAStatus onOpenSessionFailure(int32_t in_sessionId, + RtpError in_error) override; + virtual ndk::ScopedAStatus onSessionClosed(int32_t in_sessionId) override; +}; + +/* Listener class for ImsMediaSession. */ +class ImsMediaSessionListener : public BnImsMediaSessionListener { + protected: + RadioServiceTest& parent_imsmedia; + + public: + ImsMediaSessionListener(RadioServiceTest& parent_imsmediasessionlistener); + virtual ~ImsMediaSessionListener() = default; + + RtpConfig mConfig; + RtpError mError; + + virtual ndk::ScopedAStatus onModifySessionResponse(const RtpConfig& in_config, + RtpError in_error) override; + virtual ndk::ScopedAStatus onFirstMediaPacketReceived(const RtpConfig& in_config) override; + virtual ndk::ScopedAStatus onHeaderExtensionReceived( + const std::vector& in_extensions) override; + virtual ndk::ScopedAStatus notifyMediaQualityStatus( + const MediaQualityStatus& in_quality) override; + virtual ndk::ScopedAStatus triggerAnbrQuery(const RtpConfig& in_config) override; + virtual ndk::ScopedAStatus onDtmfReceived(char16_t in_dtmfDigit, + int32_t in_durationMs) override; + virtual ndk::ScopedAStatus onCallQualityChanged(const CallQuality& in_callQuality) override; +}; + +/* The main test class for Radio AIDL ImsMedia. */ +class RadioImsMediaTest : public RadioServiceTest { + protected: + virtual void verifyError(RtpError inError); + virtual ndk::ScopedAStatus triggerOpenSession(int32_t sessionId); + + public: + void SetUp() override; + + /* radio imsmedia service handle */ + std::shared_ptr radio_imsmedia; + /* radio imsmediasession service handle */ + std::shared_ptr radio_imsmediasession; + /* radio imsmedia listener handle */ + std::shared_ptr radio_imsmedialistener; + /* radio imsmediasession listener handle */ + std::shared_ptr radio_imsmediasessionlistener; +}; diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp index 9f1718b1a0..4ab88d2d8a 100644 --- a/radio/aidl/vts/radio_messaging_test.cpp +++ b/radio/aidl/vts/radio_messaging_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include "radio_messaging_utils.h" @@ -23,6 +22,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioMessagingTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -37,8 +37,6 @@ void RadioMessagingTest::SetUp() { radioRsp_messaging = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_messaging.get()); - count_ = 0; - radioInd_messaging = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_messaging.get()); @@ -61,7 +59,6 @@ void RadioMessagingTest::SetUp() { * Test IRadioMessaging.sendSms() for the response returned. */ TEST_P(RadioMessagingTest, sendSms) { - LOG(DEBUG) << "sendSms"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; @@ -80,14 +77,12 @@ TEST_P(RadioMessagingTest, sendSms) { CHECK_GENERAL_ERROR)); EXPECT_EQ(0, radioRsp_messaging->sendSmsResult.errorCode); } - LOG(DEBUG) << "sendSms finished"; } /* * Test IRadioMessaging.sendSmsExpectMore() for the response returned. */ TEST_P(RadioMessagingTest, sendSmsExpectMore) { - LOG(DEBUG) << "sendSmsExpectMore"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; @@ -105,14 +100,12 @@ TEST_P(RadioMessagingTest, sendSmsExpectMore) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendSmsExpectMore finished"; } /* * Test IRadioMessaging.sendCdmaSms() for the response returned. */ TEST_P(RadioMessagingTest, sendCdmaSms) { - LOG(DEBUG) << "sendCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -151,7 +144,6 @@ TEST_P(RadioMessagingTest, sendCdmaSms) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendCdmaSms finished"; } /* @@ -202,7 +194,6 @@ TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) { * Test IRadioMessaging.setGsmBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, setGsmBroadcastConfig) { - LOG(DEBUG) << "setGsmBroadcastConfig"; serial = GetRandomSerialNumber(); // Create GsmBroadcastSmsConfigInfo #1 @@ -260,14 +251,12 @@ TEST_P(RadioMessagingTest, setGsmBroadcastConfig) { RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setGsmBroadcastConfig finished"; } /* * Test IRadioMessaging.getGsmBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, getGsmBroadcastConfig) { - LOG(DEBUG) << "getGsmBroadcastConfig"; serial = GetRandomSerialNumber(); radio_messaging->getGsmBroadcastConfig(serial); @@ -282,14 +271,12 @@ TEST_P(RadioMessagingTest, getGsmBroadcastConfig) { {RadioError::NONE, RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getGsmBroadcastConfig finished"; } /* * Test IRadioMessaging.setCdmaBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) { - LOG(DEBUG) << "setCdmaBroadcastConfig"; serial = GetRandomSerialNumber(); CdmaBroadcastSmsConfigInfo cbSmsConfig; @@ -310,14 +297,12 @@ TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) { {RadioError::NONE, RadioError::INVALID_MODEM_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCdmaBroadcastConfig finished"; } /* * Test IRadioMessaging.getCdmaBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) { - LOG(DEBUG) << "getCdmaBroadcastConfig"; serial = GetRandomSerialNumber(); radio_messaging->getCdmaBroadcastConfig(serial); @@ -330,14 +315,12 @@ TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCdmaBroadcastConfig finished"; } /* * Test IRadioMessaging.setCdmaBroadcastActivation() for the response returned. */ TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) { - LOG(DEBUG) << "setCdmaBroadcastActivation"; serial = GetRandomSerialNumber(); bool activate = false; @@ -352,14 +335,12 @@ TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCdmaBroadcastActivation finished"; } /* * Test IRadioMessaging.setGsmBroadcastActivation() for the response returned. */ TEST_P(RadioMessagingTest, setGsmBroadcastActivation) { - LOG(DEBUG) << "setGsmBroadcastActivation"; serial = GetRandomSerialNumber(); bool activate = false; @@ -376,14 +357,12 @@ TEST_P(RadioMessagingTest, setGsmBroadcastActivation) { RadioError::INVALID_STATE, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setGsmBroadcastActivation finished"; } /* * Test IRadioMessaging.acknowledgeLastIncomingGsmSms() for the response returned. */ TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) { - LOG(DEBUG) << "acknowledgeLastIncomingGsmSms"; serial = GetRandomSerialNumber(); bool success = true; @@ -399,14 +378,12 @@ TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acknowledgeLastIncomingGsmSms finished"; } /* * Test IRadioMessaging.acknowledgeIncomingGsmSmsWithPdu() for the response returned. */ TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) { - LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu"; serial = GetRandomSerialNumber(); bool success = true; std::string ackPdu = ""; @@ -422,14 +399,12 @@ TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) { {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu finished"; } /* * Test IRadioMessaging.acknowledgeLastIncomingCdmaSms() for the response returned. */ TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) { - LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAck @@ -448,14 +423,12 @@ TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) { {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms finished"; } /* * Test IRadioMessaging.sendImsSms() for the response returned. */ TEST_P(RadioMessagingTest, sendImsSms) { - LOG(DEBUG) << "sendImsSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -482,7 +455,7 @@ TEST_P(RadioMessagingTest, sendImsSms) { cdmaSmsMessage.bearerData = (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; - // Creata an ImsSmsMessage + // Create an ImsSmsMessage ImsSmsMessage msg; msg.tech = RadioTechnologyFamily::THREE_GPP2; msg.retry = false; @@ -500,14 +473,12 @@ TEST_P(RadioMessagingTest, sendImsSms) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, {RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendImsSms finished"; } /* * Test IRadioMessaging.getSmscAddress() for the response returned. */ TEST_P(RadioMessagingTest, getSmscAddress) { - LOG(DEBUG) << "getSmscAddress"; serial = GetRandomSerialNumber(); radio_messaging->getSmscAddress(serial); @@ -522,14 +493,12 @@ TEST_P(RadioMessagingTest, getSmscAddress) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getSmscAddress finished"; } /* * Test IRadioMessaging.setSmscAddress() for the response returned. */ TEST_P(RadioMessagingTest, setSmscAddress) { - LOG(DEBUG) << "setSmscAddress"; serial = GetRandomSerialNumber(); std::string address = std::string("smscAddress"); @@ -545,14 +514,12 @@ TEST_P(RadioMessagingTest, setSmscAddress) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setSmscAddress finished"; } /* * Test IRadioMessaging.writeSmsToSim() for the response returned. */ TEST_P(RadioMessagingTest, writeSmsToSim) { - LOG(DEBUG) << "writeSmsToSim"; serial = GetRandomSerialNumber(); SmsWriteArgs smsWriteArgs; smsWriteArgs.status = SmsWriteArgs::STATUS_REC_UNREAD; @@ -573,14 +540,12 @@ TEST_P(RadioMessagingTest, writeSmsToSim) { RadioError::NETWORK_NOT_READY, RadioError::NO_RESOURCES, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "writeSmsToSim finished"; } /* * Test IRadioMessaging.deleteSmsOnSim() for the response returned. */ TEST_P(RadioMessagingTest, deleteSmsOnSim) { - LOG(DEBUG) << "deleteSmsOnSim"; serial = GetRandomSerialNumber(); int index = 1; @@ -598,14 +563,12 @@ TEST_P(RadioMessagingTest, deleteSmsOnSim) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "deleteSmsOnSim finished"; } /* * Test IRadioMessaging.writeSmsToRuim() for the response returned. */ TEST_P(RadioMessagingTest, writeSmsToRuim) { - LOG(DEBUG) << "writeSmsToRuim"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -651,14 +614,12 @@ TEST_P(RadioMessagingTest, writeSmsToRuim) { RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "writeSmsToRuim finished"; } /* * Test IRadioMessaging.deleteSmsOnRuim() for the response returned. */ TEST_P(RadioMessagingTest, deleteSmsOnRuim) { - LOG(DEBUG) << "deleteSmsOnRuim"; serial = GetRandomSerialNumber(); int index = 1; @@ -704,14 +665,12 @@ TEST_P(RadioMessagingTest, deleteSmsOnRuim) { RadioError::MODEM_ERR, RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "deleteSmsOnRuim finished"; } /* * Test IRadioMessaging.reportSmsMemoryStatus() for the response returned. */ TEST_P(RadioMessagingTest, reportSmsMemoryStatus) { - LOG(DEBUG) << "reportSmsMemoryStatus"; serial = GetRandomSerialNumber(); bool available = true; @@ -727,5 +686,4 @@ TEST_P(RadioMessagingTest, reportSmsMemoryStatus) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "reportSmsMemoryStatus finished"; } diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h index 7b66192679..3bd8346575 100644 --- a/radio/aidl/vts/radio_messaging_utils.h +++ b/radio/aidl/vts/radio_messaging_utils.h @@ -132,9 +132,9 @@ class RadioMessagingIndication : public BnRadioMessagingIndication { }; // The main test class for Radio AIDL Messaging. -class RadioMessagingTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioMessagingTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* radio messaging service handle */ std::shared_ptr radio_messaging; diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp index 20b44c5831..050b2c838f 100644 --- a/radio/aidl/vts/radio_modem_response.cpp +++ b/radio/aidl/vts/radio_modem_response.cpp @@ -46,6 +46,13 @@ ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResp return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus RadioModemResponse::getImeiResponse(const RadioResponseInfo& info, + const std::optional& /*imeiInfo*/) { + rspInfo = info; + parent_modem.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse( const RadioResponseInfo& info, const std::vector& /*config*/) { rspInfo = info; diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp index e86737888f..c48a46104a 100644 --- a/radio/aidl/vts/radio_modem_test.cpp +++ b/radio/aidl/vts/radio_modem_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include "radio_modem_utils.h" @@ -23,6 +22,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioModemTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -37,8 +37,6 @@ void RadioModemTest::SetUp() { radioRsp_modem = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_modem.get()); - count_ = 0; - radioInd_modem = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_modem.get()); @@ -154,7 +152,6 @@ TEST_P(RadioModemTest, getModemStackStatus) { * Test IRadioModem.getBasebandVersion() for the response returned. */ TEST_P(RadioModemTest, getBasebandVersion) { - LOG(DEBUG) << "getBasebandVersion"; serial = GetRandomSerialNumber(); radio_modem->getBasebandVersion(serial); @@ -165,14 +162,12 @@ TEST_P(RadioModemTest, getBasebandVersion) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); } - LOG(DEBUG) << "getBasebandVersion finished"; } /* * Test IRadioModem.getDeviceIdentity() for the response returned. */ TEST_P(RadioModemTest, getDeviceIdentity) { - LOG(DEBUG) << "getDeviceIdentity"; serial = GetRandomSerialNumber(); radio_modem->getDeviceIdentity(serial); @@ -184,14 +179,36 @@ TEST_P(RadioModemTest, getDeviceIdentity) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::EMPTY_RECORD})); } - LOG(DEBUG) << "getDeviceIdentity finished"; +} + +/* + * Test IRadioModem.getImei() for the response returned. + */ +TEST_P(RadioModemTest, getImei) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since getImei is not supported on version < 2"); + GTEST_SKIP(); + } + serial = GetRandomSerialNumber(); + + radio_modem->getImei(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::EMPTY_RECORD})); + } } /* * Test IRadioModem.nvReadItem() for the response returned. */ TEST_P(RadioModemTest, nvReadItem) { - LOG(DEBUG) << "nvReadItem"; serial = GetRandomSerialNumber(); radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25); @@ -203,14 +220,12 @@ TEST_P(RadioModemTest, nvReadItem) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "nvReadItem finished"; } /* * Test IRadioModem.nvWriteItem() for the response returned. */ TEST_P(RadioModemTest, nvWriteItem) { - LOG(DEBUG) << "nvWriteItem"; serial = GetRandomSerialNumber(); NvWriteItem item; memset(&item, 0, sizeof(item)); @@ -225,14 +240,12 @@ TEST_P(RadioModemTest, nvWriteItem) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "nvWriteItem finished"; } /* * Test IRadioModem.nvWriteCdmaPrl() for the response returned. */ TEST_P(RadioModemTest, nvWriteCdmaPrl) { - LOG(DEBUG) << "nvWriteCdmaPrl"; serial = GetRandomSerialNumber(); std::vector prl = {1, 2, 3, 4, 5}; @@ -245,14 +258,12 @@ TEST_P(RadioModemTest, nvWriteCdmaPrl) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "nvWriteCdmaPrl finished"; } /* * Test IRadioModem.nvResetConfig() for the response returned. */ TEST_P(RadioModemTest, nvResetConfig) { - LOG(DEBUG) << "nvResetConfig"; serial = GetRandomSerialNumber(); radio_modem->nvResetConfig(serial, ResetNvType::FACTORY_RESET); @@ -266,14 +277,12 @@ TEST_P(RadioModemTest, nvResetConfig) { } // wait until modem reset finishes sleep(10); - LOG(DEBUG) << "nvResetConfig finished"; } /* * Test IRadioModem.getHardwareConfig() for the response returned. */ TEST_P(RadioModemTest, getHardwareConfig) { - LOG(DEBUG) << "getHardwareConfig"; serial = GetRandomSerialNumber(); radio_modem->getHardwareConfig(serial); @@ -285,7 +294,6 @@ TEST_P(RadioModemTest, getHardwareConfig) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getHardwareConfig finished"; } /* @@ -311,7 +319,6 @@ TEST_P(RadioModemTest, DISABLED_requestShutdown) { * Test IRadioModem.getRadioCapability() for the response returned. */ TEST_P(RadioModemTest, getRadioCapability) { - LOG(DEBUG) << "getRadioCapability"; serial = GetRandomSerialNumber(); radio_modem->getRadioCapability(serial); @@ -322,14 +329,12 @@ TEST_P(RadioModemTest, getRadioCapability) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); } - LOG(DEBUG) << "getRadioCapability finished"; } /* * Test IRadioModem.setRadioCapability() for the response returned. */ TEST_P(RadioModemTest, setRadioCapability) { - LOG(DEBUG) << "setRadioCapability"; serial = GetRandomSerialNumber(); RadioCapability rc; memset(&rc, 0, sizeof(rc)); @@ -345,14 +350,12 @@ TEST_P(RadioModemTest, setRadioCapability) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setRadioCapability finished"; } /* * Test IRadioModem.getModemActivityInfo() for the response returned. */ TEST_P(RadioModemTest, getModemActivityInfo) { - LOG(DEBUG) << "getModemActivityInfo"; serial = GetRandomSerialNumber(); radio_modem->getModemActivityInfo(serial); @@ -364,14 +367,12 @@ TEST_P(RadioModemTest, getModemActivityInfo) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "getModemActivityInfo finished"; } /* * Test IRadioModem.sendDeviceState() for the response returned. */ TEST_P(RadioModemTest, sendDeviceState) { - LOG(DEBUG) << "sendDeviceState"; serial = GetRandomSerialNumber(); radio_modem->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true); @@ -385,5 +386,4 @@ TEST_P(RadioModemTest, sendDeviceState) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "sendDeviceState finished"; } diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h index 49e1891212..d47bdeb921 100644 --- a/radio/aidl/vts/radio_modem_utils.h +++ b/radio/aidl/vts/radio_modem_utils.h @@ -19,6 +19,7 @@ #include #include #include +#include #include "radio_aidl_hal_utils.h" @@ -52,6 +53,9 @@ class RadioModemResponse : public BnRadioModemResponse { const std::string& esn, const std::string& meid) override; + virtual ndk::ScopedAStatus getImeiResponse(const RadioResponseInfo& info, + const std::optional& config) override; + virtual ndk::ScopedAStatus getHardwareConfigResponse( const RadioResponseInfo& info, const std::vector& config) override; @@ -108,9 +112,9 @@ class RadioModemIndication : public BnRadioModemIndication { }; // The main test class for Radio AIDL Modem. -class RadioModemTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioModemTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* radio modem service handle */ std::shared_ptr radio_modem; diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp index 7acbff4b2e..ae3bd4b01a 100644 --- a/radio/aidl/vts/radio_network_indication.cpp +++ b/radio/aidl/vts/radio_network_indication.cpp @@ -92,3 +92,8 @@ ndk::ScopedAStatus RadioNetworkIndication::voiceRadioTechChanged(RadioIndication RadioTechnology /*rat*/) { return ndk::ScopedAStatus::ok(); } + +ndk::ScopedAStatus RadioNetworkIndication::emergencyNetworkScanResult( + RadioIndicationType /*type*/, const EmergencyRegResult& /*result*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index 2292c549ca..25d45a5577 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -266,3 +266,57 @@ ndk::ScopedAStatus RadioNetworkResponse::supplyNetworkDepersonalizationResponse( parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } + +ndk::ScopedAStatus RadioNetworkResponse::setEmergencyModeResponse( + const RadioResponseInfo& info, const EmergencyRegResult& /*regState*/) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::triggerEmergencyNetworkScanResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::exitEmergencyModeResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::cancelEmergencyNetworkScanResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setNullCipherAndIntegrityEnabledResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::isNullCipherAndIntegrityEnabledResponse( + const RadioResponseInfo& info, bool /*isEnabled*/) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::isN1ModeEnabledResponse( + const RadioResponseInfo& info, bool /*isEnabled*/) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setN1ModeEnabledResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 6423329022..2beb249674 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "radio_network_utils.h" @@ -25,6 +24,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioNetworkTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -39,8 +39,6 @@ void RadioNetworkTest::SetUp() { radioRsp_network = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_network.get()); - count_ = 0; - radioInd_network = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_network.get()); @@ -359,7 +357,7 @@ TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Geran) { /* * Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN */ -TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran) { +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran_Rscp) { serial = GetRandomSerialNumber(); SignalThresholdInfo signalThresholdInfo; @@ -382,6 +380,33 @@ TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); } +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran_Ecno) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_ECNO; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-22, -18, 0}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::UTRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ALOGI("setSignalStrengthReportingCriteria_Utran, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + /* * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN */ @@ -1516,11 +1541,12 @@ TEST_P(RadioNetworkTest, getDataRegistrationState) { // Check for access technology specific info AccessTechnologySpecificInfo info = radioRsp_network->dataRegResp.accessTechnologySpecificInfo; RadioTechnology rat = radioRsp_network->dataRegResp.rat; + // TODO: add logic for cdmaInfo - if (rat == RadioTechnology::LTE || rat == RadioTechnology::LTE_CA) { + if (rat == RadioTechnology::LTE) { ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::eutranInfo); } else if (rat == RadioTechnology::NR) { - ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::ngranNrVopsInfo); + ASSERT_TRUE(info.getTag() == AccessTechnologySpecificInfo::ngranNrVopsInfo); } } @@ -1637,7 +1663,6 @@ TEST_P(RadioNetworkTest, getImsRegistrationState) { * Test IRadioNetwork.getOperator() for the response returned. */ TEST_P(RadioNetworkTest, getOperator) { - LOG(DEBUG) << "getOperator"; serial = GetRandomSerialNumber(); radio_network->getOperator(serial); @@ -1648,14 +1673,12 @@ TEST_P(RadioNetworkTest, getOperator) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } - LOG(DEBUG) << "getOperator finished"; } /* * Test IRadioNetwork.getNetworkSelectionMode() for the response returned. */ TEST_P(RadioNetworkTest, getNetworkSelectionMode) { - LOG(DEBUG) << "getNetworkSelectionMode"; serial = GetRandomSerialNumber(); radio_network->getNetworkSelectionMode(serial); @@ -1666,14 +1689,12 @@ TEST_P(RadioNetworkTest, getNetworkSelectionMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } - LOG(DEBUG) << "getNetworkSelectionMode finished"; } /* * Test IRadioNetwork.setNetworkSelectionModeAutomatic() for the response returned. */ TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) { - LOG(DEBUG) << "setNetworkSelectionModeAutomatic"; serial = GetRandomSerialNumber(); radio_network->setNetworkSelectionModeAutomatic(serial); @@ -1687,14 +1708,12 @@ TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) { RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setNetworkSelectionModeAutomatic finished"; } /* * Test IRadioNetwork.getAvailableNetworks() for the response returned. */ TEST_P(RadioNetworkTest, getAvailableNetworks) { - LOG(DEBUG) << "getAvailableNetworks"; serial = GetRandomSerialNumber(); radio_network->getAvailableNetworks(serial); @@ -1710,14 +1729,12 @@ TEST_P(RadioNetworkTest, getAvailableNetworks) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getAvailableNetworks finished"; } /* * Test IRadioNetwork.setBandMode() for the response returned. */ TEST_P(RadioNetworkTest, setBandMode) { - LOG(DEBUG) << "setBandMode"; serial = GetRandomSerialNumber(); radio_network->setBandMode(serial, RadioBandMode::BAND_MODE_USA); @@ -1729,14 +1746,12 @@ TEST_P(RadioNetworkTest, setBandMode) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setBandMode finished"; } /* * Test IRadioNetwork.setLocationUpdates() for the response returned. */ TEST_P(RadioNetworkTest, setLocationUpdates) { - LOG(DEBUG) << "setLocationUpdates"; serial = GetRandomSerialNumber(); radio_network->setLocationUpdates(serial, true); @@ -1748,14 +1763,12 @@ TEST_P(RadioNetworkTest, setLocationUpdates) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "setLocationUpdates finished"; } /* * Test IRadioNetwork.setCdmaRoamingPreference() for the response returned. */ TEST_P(RadioNetworkTest, setCdmaRoamingPreference) { - LOG(DEBUG) << "setCdmaRoamingPreference"; serial = GetRandomSerialNumber(); radio_network->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK); @@ -1768,14 +1781,12 @@ TEST_P(RadioNetworkTest, setCdmaRoamingPreference) { radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "setCdmaRoamingPreference finished"; } /* * Test IRadioNetwork.getCdmaRoamingPreference() for the response returned. */ TEST_P(RadioNetworkTest, getCdmaRoamingPreference) { - LOG(DEBUG) << "getCdmaRoamingPreference"; serial = GetRandomSerialNumber(); radio_network->getCdmaRoamingPreference(serial); @@ -1789,14 +1800,12 @@ TEST_P(RadioNetworkTest, getCdmaRoamingPreference) { {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCdmaRoamingPreference finished"; } /* * Test IRadioNetwork.getVoiceRadioTechnology() for the response returned. */ TEST_P(RadioNetworkTest, getVoiceRadioTechnology) { - LOG(DEBUG) << "getVoiceRadioTechnology"; serial = GetRandomSerialNumber(); radio_network->getVoiceRadioTechnology(serial); @@ -1807,14 +1816,12 @@ TEST_P(RadioNetworkTest, getVoiceRadioTechnology) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } - LOG(DEBUG) << "getVoiceRadioTechnology finished"; } /* * Test IRadioNetwork.setCellInfoListRate() for the response returned. */ TEST_P(RadioNetworkTest, setCellInfoListRate) { - LOG(DEBUG) << "setCellInfoListRate"; serial = GetRandomSerialNumber(); radio_network->setCellInfoListRate(serial, 10); @@ -1826,14 +1833,12 @@ TEST_P(RadioNetworkTest, setCellInfoListRate) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "setCellInfoListRate finished"; } /* * Test IRadioNetwork.supplyNetworkDepersonalization() for the response returned. */ TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) { - LOG(DEBUG) << "supplyNetworkDepersonalization"; serial = GetRandomSerialNumber(); radio_network->supplyNetworkDepersonalization(serial, std::string("test")); @@ -1848,5 +1853,226 @@ TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) { RadioError::INVALID_SIM_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, RadioError::PASSWORD_INCORRECT, RadioError::SIM_ABSENT, RadioError::SYSTEM_ERR})); } - LOG(DEBUG) << "supplyNetworkDepersonalization finished"; +} + +/* + * Test IRadioNetwork.setEmergencyMode() for the response returned. + */ +TEST_P(RadioNetworkTest, setEmergencyMode) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since setEmergencyMode is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + radio_network->setEmergencyMode(serial, EmergencyMode::EMERGENCY_WWAN); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS})); + + // exit emergency mode for other tests + serial = GetRandomSerialNumber(); + radio_network->exitEmergencyMode(serial); +} + +/* + * Test IRadioNetwork.triggerEmergencyNetworkScan() for the response returned. + */ +TEST_P(RadioNetworkTest, triggerEmergencyNetworkScan) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since" + " triggerEmergencyNetworkScan is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + EmergencyNetworkScanTrigger scanRequest; + scanRequest.accessNetwork = {AccessNetwork::EUTRAN}; + scanRequest.scanType = EmergencyScanType::NO_PREFERENCE; + + radio_network->triggerEmergencyNetworkScan(serial, scanRequest); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS})); +} + +/* + * Test IRadioNetwork.cancelEmergencyNetworkScan() for the response returned. + */ +TEST_P(RadioNetworkTest, cancelEmergencyNetworkScan) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since cancelEmergencyNetworkScan is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + radio_network->cancelEmergencyNetworkScan(serial, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); +} + +/* + * Test IRadioNetwork.exitEmergencyMode() for the response returned. + */ +TEST_P(RadioNetworkTest, exitEmergencyMode) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since exitEmergencyMode is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + radio_network->exitEmergencyMode(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); +} + +/* + * Test IRadioNetwork.setN1ModeEnabled() for the response returned. + */ +TEST_P(RadioNetworkTest, setN1ModeEnabled) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since setN1ModeEnabled is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = + radio_network->setN1ModeEnabled(serial, false); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, + RadioError::INVALID_STATE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } +} + +/* + * Test IRadioNetwork.isN1ModeEnabled() for the response returned. + */ +TEST_P(RadioNetworkTest, isN1ModeEnabled) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since isN1ModeEnabled is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->isN1ModeEnabled(serial); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } +} + +/* + * Test IRadioNetwork.setNullCipherAndIntegrityEnabled() for the response returned. + */ +TEST_P(RadioNetworkTest, setNullCipherAndIntegrityEnabled) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since" + " setNullCipherAndIntegrityEnabled is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + radio_network->setNullCipherAndIntegrityEnabled(serial, false); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); +} + +/** + * Test IRadioNetwork.isNullCipherAndIntegrityEnabled() for the response returned. + */ +TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since" + " isNullCipherAndIntegrityEnabled is not supported on version < 2."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->isNullCipherAndIntegrityEnabled(serial); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED})); } diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 29f20e8dbd..8f8f6b070f 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -147,6 +147,28 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { virtual ndk::ScopedAStatus supplyNetworkDepersonalizationResponse( const RadioResponseInfo& info, int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus setEmergencyModeResponse( + const RadioResponseInfo& info, const EmergencyRegResult& regState) override; + + virtual ndk::ScopedAStatus triggerEmergencyNetworkScanResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus exitEmergencyModeResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus cancelEmergencyNetworkScanResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setNullCipherAndIntegrityEnabledResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus isNullCipherAndIntegrityEnabledResponse( + const RadioResponseInfo& info, const bool isEnabled) override; + + virtual ndk::ScopedAStatus isN1ModeEnabledResponse( + const RadioResponseInfo& info, bool isEnabled) override; + + virtual ndk::ScopedAStatus setN1ModeEnabledResponse(const RadioResponseInfo& info) override; }; /* Callback class for radio network indication */ @@ -201,12 +223,15 @@ class RadioNetworkIndication : public BnRadioNetworkIndication { virtual ndk::ScopedAStatus voiceRadioTechChanged(RadioIndicationType type, RadioTechnology rat) override; + + virtual ndk::ScopedAStatus emergencyNetworkScanResult( + RadioIndicationType type, const EmergencyRegResult& result) override; }; // The main test class for Radio AIDL Network. -class RadioNetworkTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioNetworkTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* radio network service handle */ std::shared_ptr radio_network; diff --git a/radio/aidl/vts/radio_sap_test.cpp b/radio/aidl/vts/radio_sap_test.cpp index c94379c934..9a1c145576 100644 --- a/radio/aidl/vts/radio_sap_test.cpp +++ b/radio/aidl/vts/radio_sap_test.cpp @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include + #include #include "radio_sap_utils.h" @@ -22,9 +22,13 @@ #define TIMEOUT_PERIOD 40 void SapTest::SetUp() { + ALOGD("BEGIN %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); + count = 0; + serial = -1; std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { - LOG(DEBUG) << "Skipped the test due to device configuration."; + ALOGI("Skipped the test due to device configuration."); GTEST_SKIP(); } sap = ISap::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService(serviceName.c_str()))); @@ -33,13 +37,16 @@ void SapTest::SetUp() { sapCb = ndk::SharedRefBase::make(*this); ASSERT_NE(sapCb.get(), nullptr); - count = 0; - ndk::ScopedAStatus res = sap->setCallback(sapCb); ASSERT_OK(res) << res; } -void SapTest::TearDown() {} +void SapTest::TearDown() { + count_ = 0; + serial = -1; + ALOGD("END %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); +} ::testing::AssertionResult SapTest::CheckAnyOfErrors(SapResultCode err, std::vector errors) { @@ -52,9 +59,9 @@ void SapTest::TearDown() {} } void SapTest::notify(int receivedSerial) { - std::unique_lock lock(mtx); - count++; + std::lock_guard lock(mtx); if (serial == receivedSerial) { + count++; cv.notify_one(); } } @@ -78,7 +85,6 @@ std::cv_status SapTest::wait() { * Test ISap.connectReq() for the response returned. */ TEST_P(SapTest, connectReq) { - LOG(DEBUG) << "connectReq"; serial = GetRandomSerialNumber(); int32_t maxMsgSize = 100; @@ -97,7 +103,6 @@ TEST_P(SapTest, connectReq) { * Test ISap.disconnectReq() for the response returned */ TEST_P(SapTest, disconnectReq) { - LOG(DEBUG) << "disconnectReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->disconnectReq(serial); @@ -105,14 +110,12 @@ TEST_P(SapTest, disconnectReq) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(sapCb->sapResponseSerial, serial); - LOG(DEBUG) << "disconnectReq finished"; } /* * Test ISap.apduReq() for the response returned. */ TEST_P(SapTest, apduReq) { - LOG(DEBUG) << "apduReq"; serial = GetRandomSerialNumber(); SapApduType sapApduType = SapApduType::APDU; std::vector command = {}; @@ -128,14 +131,12 @@ TEST_P(SapTest, apduReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_REMOVED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "apduReq finished"; } /* * Test ISap.transferAtrReq() for the response returned. */ TEST_P(SapTest, transferAtrReq) { - LOG(DEBUG) << "transferAtrReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->transferAtrReq(serial); @@ -148,14 +149,12 @@ TEST_P(SapTest, transferAtrReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::DATA_NOT_AVAILABLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "transferAtrReq finished"; } /* * Test ISap.powerReq() for the response returned. */ TEST_P(SapTest, powerReq) { - LOG(DEBUG) << "powerReq"; serial = GetRandomSerialNumber(); bool state = true; @@ -170,14 +169,12 @@ TEST_P(SapTest, powerReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::CARD_ALREADY_POWERED_ON, SapResultCode::SUCCESS})); - LOG(DEBUG) << "powerReq finished"; } /* * Test ISap.resetSimReq() for the response returned. */ TEST_P(SapTest, resetSimReq) { - LOG(DEBUG) << "resetSimReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->resetSimReq(serial); @@ -191,14 +188,12 @@ TEST_P(SapTest, resetSimReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "resetSimReq finished"; } /* * Test ISap.transferCardReaderStatusReq() for the response returned. */ TEST_P(SapTest, transferCardReaderStatusReq) { - LOG(DEBUG) << "transferCardReaderStatusReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->transferCardReaderStatusReq(serial); @@ -210,14 +205,12 @@ TEST_P(SapTest, transferCardReaderStatusReq) { ASSERT_TRUE(CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::DATA_NOT_AVAILABLE, SapResultCode::SUCCESS})); - LOG(DEBUG) << "transferCardReaderStatusReq finished"; } /* * Test ISap.setTransferProtocolReq() for the response returned. */ TEST_P(SapTest, setTransferProtocolReq) { - LOG(DEBUG) << "setTransferProtocolReq"; serial = GetRandomSerialNumber(); SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0; @@ -229,5 +222,4 @@ TEST_P(SapTest, setTransferProtocolReq) { ASSERT_TRUE(CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::NOT_SUPPORTED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "setTransferProtocolReq finished"; } diff --git a/radio/aidl/vts/radio_sim_response.cpp b/radio/aidl/vts/radio_sim_response.cpp index 391c9cb12d..296c65cab8 100644 --- a/radio/aidl/vts/radio_sim_response.cpp +++ b/radio/aidl/vts/radio_sim_response.cpp @@ -118,6 +118,13 @@ ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse(const RadioR return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelWithSessionInfoResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& info, const IccIoResult& /*iccIo*/) { rspInfo = info; diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index e69247d135..d90658893b 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include "radio_sim_utils.h" @@ -24,6 +23,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioSimTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -38,8 +38,6 @@ void RadioSimTest::SetUp() { radioRsp_sim = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_sim.get()); - count_ = 0; - radioInd_sim = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_sim.get()); @@ -481,19 +479,16 @@ TEST_P(RadioSimTest, setAllowedCarriers) { * Test IRadioSim.getIccCardStatus() for the response returned. */ TEST_P(RadioSimTest, getIccCardStatus) { - LOG(DEBUG) << "getIccCardStatus"; EXPECT_LE(cardStatus.applications.size(), RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.imsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); - LOG(DEBUG) << "getIccCardStatus finished"; } /* * Test IRadioSim.supplyIccPinForApp() for the response returned */ TEST_P(RadioSimTest, supplyIccPinForApp) { - LOG(DEBUG) << "supplyIccPinForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -513,14 +508,12 @@ TEST_P(RadioSimTest, supplyIccPinForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); } } - LOG(DEBUG) << "supplyIccPinForApp finished"; } /* * Test IRadioSim.supplyIccPukForApp() for the response returned. */ TEST_P(RadioSimTest, supplyIccPukForApp) { - LOG(DEBUG) << "supplyIccPukForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -540,14 +533,12 @@ TEST_P(RadioSimTest, supplyIccPukForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE})); } } - LOG(DEBUG) << "supplyIccPukForApp finished"; } /* * Test IRadioSim.supplyIccPin2ForApp() for the response returned. */ TEST_P(RadioSimTest, supplyIccPin2ForApp) { - LOG(DEBUG) << "supplyIccPin2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -568,14 +559,12 @@ TEST_P(RadioSimTest, supplyIccPin2ForApp) { RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2})); } } - LOG(DEBUG) << "supplyIccPin2ForApp finished"; } /* * Test IRadioSim.supplyIccPuk2ForApp() for the response returned. */ TEST_P(RadioSimTest, supplyIccPuk2ForApp) { - LOG(DEBUG) << "supplyIccPuk2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -595,14 +584,12 @@ TEST_P(RadioSimTest, supplyIccPuk2ForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE})); } } - LOG(DEBUG) << "supplyIccPuk2ForApp finished"; } /* * Test IRadioSim.changeIccPinForApp() for the response returned. */ TEST_P(RadioSimTest, changeIccPinForApp) { - LOG(DEBUG) << "changeIccPinForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -622,14 +609,12 @@ TEST_P(RadioSimTest, changeIccPinForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); } } - LOG(DEBUG) << "changeIccPinForApp finished"; } /* * Test IRadioSim.changeIccPin2ForApp() for the response returned. */ TEST_P(RadioSimTest, changeIccPin2ForApp) { - LOG(DEBUG) << "changeIccPin2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -650,14 +635,12 @@ TEST_P(RadioSimTest, changeIccPin2ForApp) { RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2})); } } - LOG(DEBUG) << "changeIccPin2ForApp finished"; } /* * Test IRadioSim.getImsiForApp() for the response returned. */ TEST_P(RadioSimTest, getImsiForApp) { - LOG(DEBUG) << "getImsiForApp"; serial = GetRandomSerialNumber(); // Check success returned while getting imsi for 3GPP and 3GPP2 apps only @@ -681,14 +664,12 @@ TEST_P(RadioSimTest, getImsiForApp) { } } } - LOG(DEBUG) << "getImsiForApp finished"; } /* * Test IRadioSim.iccIoForApp() for the response returned. */ TEST_P(RadioSimTest, iccIoForApp) { - LOG(DEBUG) << "iccIoForApp"; serial = GetRandomSerialNumber(); for (int i = 0; i < (int)cardStatus.applications.size(); i++) { @@ -708,14 +689,12 @@ TEST_P(RadioSimTest, iccIoForApp) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); } - LOG(DEBUG) << "iccIoForApp finished"; } /* * Test IRadioSim.iccTransmitApduBasicChannel() for the response returned. */ TEST_P(RadioSimTest, iccTransmitApduBasicChannel) { - LOG(DEBUG) << "iccTransmitApduBasicChannel"; serial = GetRandomSerialNumber(); SimApdu msg; memset(&msg, 0, sizeof(msg)); @@ -725,14 +704,12 @@ TEST_P(RadioSimTest, iccTransmitApduBasicChannel) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); - LOG(DEBUG) << "iccTransmitApduBasicChannel finished"; } /* * Test IRadioSim.iccOpenLogicalChannel() for the response returned. */ TEST_P(RadioSimTest, iccOpenLogicalChannel) { - LOG(DEBUG) << "iccOpenLogicalChannel"; serial = GetRandomSerialNumber(); int p2 = 0x04; // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested. @@ -742,14 +719,12 @@ TEST_P(RadioSimTest, iccOpenLogicalChannel) { EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); } - LOG(DEBUG) << "iccOpenLogicalChannel finished"; } /* * Test IRadioSim.iccCloseLogicalChannel() for the response returned. */ TEST_P(RadioSimTest, iccCloseLogicalChannel) { - LOG(DEBUG) << "iccCloseLogicalChannel"; serial = GetRandomSerialNumber(); // Try closing invalid channel and check INVALID_ARGUMENTS returned as error radio_sim->iccCloseLogicalChannel(serial, 0); @@ -758,14 +733,39 @@ TEST_P(RadioSimTest, iccCloseLogicalChannel) { EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error); - LOG(DEBUG) << "iccCloseLogicalChannel finished"; +} + +/* + * Test IRadioSim.iccCloseLogicalChannelWithSessionInfo() for the response returned. + */ +TEST_P(RadioSimTest, iccCloseLogicalChannelWithSessionInfo) { + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 2) { + ALOGI("Skipped the test since" + " iccCloseLogicalChannelWithSessionInfo is not supported on version < 2"); + GTEST_SKIP(); + } + serial = GetRandomSerialNumber(); + SessionInfo info; + memset(&info, 0, sizeof(info)); + info.sessionId = 0; + info.isEs10 = false; + + // Try closing invalid channel and check INVALID_ARGUMENTS returned as error + radio_sim->iccCloseLogicalChannelWithSessionInfo(serial, info); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error); } /* * Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned. */ TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) { - LOG(DEBUG) << "iccTransmitApduLogicalChannel"; serial = GetRandomSerialNumber(); SimApdu msg; memset(&msg, 0, sizeof(msg)); @@ -775,14 +775,12 @@ TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); - LOG(DEBUG) << "iccTransmitApduLogicalChannel finished"; } /* * Test IRadioSim.requestIccSimAuthentication() for the response returned. */ TEST_P(RadioSimTest, requestIccSimAuthentication) { - LOG(DEBUG) << "requestIccSimAuthentication"; serial = GetRandomSerialNumber(); // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS @@ -797,7 +795,6 @@ TEST_P(RadioSimTest, requestIccSimAuthentication) { radioRsp_sim->rspInfo.error, {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "requestIccSimAuthentication finished"; } /* @@ -851,7 +848,6 @@ TEST_P(RadioSimTest, setFacilityLockForApp) { * Test IRadioSim.getCdmaSubscription() for the response returned. */ TEST_P(RadioSimTest, getCdmaSubscription) { - LOG(DEBUG) << "getCdmaSubscription"; serial = GetRandomSerialNumber(); radio_sim->getCdmaSubscription(serial); @@ -864,14 +860,12 @@ TEST_P(RadioSimTest, getCdmaSubscription) { radioRsp_sim->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "getCdmaSubscription finished"; } /* * Test IRadioSim.getCdmaSubscriptionSource() for the response returned. */ TEST_P(RadioSimTest, getCdmaSubscriptionSource) { - LOG(DEBUG) << "getCdmaSubscriptionSource"; serial = GetRandomSerialNumber(); radio_sim->getCdmaSubscriptionSource(serial); @@ -884,14 +878,12 @@ TEST_P(RadioSimTest, getCdmaSubscriptionSource) { radioRsp_sim->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "getCdmaSubscriptionSource finished"; } /* * Test IRadioSim.setCdmaSubscriptionSource() for the response returned. */ TEST_P(RadioSimTest, setCdmaSubscriptionSource) { - LOG(DEBUG) << "setCdmaSubscriptionSource"; serial = GetRandomSerialNumber(); radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM); @@ -905,14 +897,12 @@ TEST_P(RadioSimTest, setCdmaSubscriptionSource) { {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::SUBSCRIPTION_NOT_AVAILABLE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCdmaSubscriptionSource finished"; } /* * Test IRadioSim.setUiccSubscription() for the response returned. */ TEST_P(RadioSimTest, setUiccSubscription) { - LOG(DEBUG) << "setUiccSubscription"; serial = GetRandomSerialNumber(); SelectUiccSub item; memset(&item, 0, sizeof(item)); @@ -929,14 +919,12 @@ TEST_P(RadioSimTest, setUiccSubscription) { RadioError::MODEM_ERR, RadioError::SUBSCRIPTION_NOT_SUPPORTED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setUiccSubscription finished"; } /* * Test IRadioSim.sendEnvelope() for the response returned. */ TEST_P(RadioSimTest, sendEnvelope) { - LOG(DEBUG) << "sendEnvelope"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -954,14 +942,12 @@ TEST_P(RadioSimTest, sendEnvelope) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendEnvelope finished"; } /* * Test IRadioSim.sendTerminalResponseToSim() for the response returned. */ TEST_P(RadioSimTest, sendTerminalResponseToSim) { - LOG(DEBUG) << "sendTerminalResponseToSim"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -979,14 +965,12 @@ TEST_P(RadioSimTest, sendTerminalResponseToSim) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendTerminalResponseToSim finished"; } /* * Test IRadioSim.reportStkServiceIsRunning() for the response returned. */ TEST_P(RadioSimTest, reportStkServiceIsRunning) { - LOG(DEBUG) << "reportStkServiceIsRunning"; serial = GetRandomSerialNumber(); radio_sim->reportStkServiceIsRunning(serial); @@ -999,7 +983,6 @@ TEST_P(RadioSimTest, reportStkServiceIsRunning) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "reportStkServiceIsRunning finished"; } /* @@ -1007,7 +990,6 @@ TEST_P(RadioSimTest, reportStkServiceIsRunning) { * string. */ TEST_P(RadioSimTest, sendEnvelopeWithStatus) { - LOG(DEBUG) << "sendEnvelopeWithStatus"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -1025,5 +1007,4 @@ TEST_P(RadioSimTest, sendEnvelopeWithStatus) { {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendEnvelopeWithStatus finished"; } diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h index 83f1cbc1ae..7cbcc58fd1 100644 --- a/radio/aidl/vts/radio_sim_utils.h +++ b/radio/aidl/vts/radio_sim_utils.h @@ -87,6 +87,9 @@ class RadioSimResponse : public BnRadioSimResponse { virtual ndk::ScopedAStatus iccCloseLogicalChannelResponse( const RadioResponseInfo& info) override; + virtual ndk::ScopedAStatus iccCloseLogicalChannelWithSessionInfoResponse( + const RadioResponseInfo& info) override; + virtual ndk::ScopedAStatus iccIoForAppResponse(const RadioResponseInfo& info, const IccIoResult& iccIo) override; @@ -191,9 +194,9 @@ class RadioSimIndication : public BnRadioSimIndication { }; // The main test class for Radio AIDL SIM. -class RadioSimTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioSimTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* Override updateSimCardStatus in RadioServiceTest to not call setResponseFunctions */ void updateSimCardStatus(); diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp index 249ee63dee..397c417efa 100644 --- a/radio/aidl/vts/radio_voice_test.cpp +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include "radio_voice_utils.h" @@ -24,6 +23,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioVoiceTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -38,8 +38,6 @@ void RadioVoiceTest::SetUp() { radioRsp_voice = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_voice.get()); - count_ = 0; - radioInd_voice = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_voice.get()); @@ -324,7 +322,6 @@ TEST_P(RadioVoiceTest, getClip) { * Test IRadioVoice.getTtyMode() for the response returned. */ TEST_P(RadioVoiceTest, getTtyMode) { - LOG(DEBUG) << "getTtyMode"; serial = GetRandomSerialNumber(); radio_voice->getTtyMode(serial); @@ -335,14 +332,12 @@ TEST_P(RadioVoiceTest, getTtyMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "getTtyMode finished"; } /* * Test IRadioVoice.setTtyMode() for the response returned. */ TEST_P(RadioVoiceTest, setTtyMode) { - LOG(DEBUG) << "setTtyMode"; serial = GetRandomSerialNumber(); radio_voice->setTtyMode(serial, TtyMode::OFF); @@ -353,14 +348,12 @@ TEST_P(RadioVoiceTest, setTtyMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "setTtyMode finished"; } /* * Test IRadioVoice.setPreferredVoicePrivacy() for the response returned. */ TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) { - LOG(DEBUG) << "setPreferredVoicePrivacy"; serial = GetRandomSerialNumber(); radio_voice->setPreferredVoicePrivacy(serial, true); @@ -372,14 +365,12 @@ TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "setPreferredVoicePrivacy finished"; } /* * Test IRadioVoice.getPreferredVoicePrivacy() for the response returned. */ TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) { - LOG(DEBUG) << "getPreferredVoicePrivacy"; serial = GetRandomSerialNumber(); radio_voice->getPreferredVoicePrivacy(serial); @@ -391,14 +382,12 @@ TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "getPreferredVoicePrivacy finished"; } /* * Test IRadioVoice.exitEmergencyCallbackMode() for the response returned. */ TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) { - LOG(DEBUG) << "exitEmergencyCallbackMode"; serial = GetRandomSerialNumber(); radio_voice->exitEmergencyCallbackMode(serial); @@ -411,14 +400,12 @@ TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) { radioRsp_voice->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "exitEmergencyCallbackMode finished"; } /* * Test IRadioVoice.handleStkCallSetupRequestFromSim() for the response returned. */ TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) { - LOG(DEBUG) << "handleStkCallSetupRequestFromSim"; serial = GetRandomSerialNumber(); bool accept = false; @@ -434,14 +421,12 @@ TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "handleStkCallSetupRequestFromSim finished"; } /* * Test IRadioVoice.dial() for the response returned. */ TEST_P(RadioVoiceTest, dial) { - LOG(DEBUG) << "dial"; serial = GetRandomSerialNumber(); Dial dialInfo; @@ -463,14 +448,12 @@ TEST_P(RadioVoiceTest, dial) { RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "dial finished"; } /* * Test IRadioVoice.hangup() for the response returned. */ TEST_P(RadioVoiceTest, hangup) { - LOG(DEBUG) << "hangup"; serial = GetRandomSerialNumber(); radio_voice->hangup(serial, 1); @@ -484,14 +467,12 @@ TEST_P(RadioVoiceTest, hangup) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "hangup finished"; } /* * Test IRadioVoice.hangupWaitingOrBackground() for the response returned. */ TEST_P(RadioVoiceTest, hangupWaitingOrBackground) { - LOG(DEBUG) << "hangupWaitingOrBackground"; serial = GetRandomSerialNumber(); radio_voice->hangupWaitingOrBackground(serial); @@ -504,14 +485,12 @@ TEST_P(RadioVoiceTest, hangupWaitingOrBackground) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "hangupWaitingOrBackground finished"; } /* * Test IRadioVoice.hangupForegroundResumeBackground() for the response returned. */ TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) { - LOG(DEBUG) << "hangupForegroundResumeBackground"; serial = GetRandomSerialNumber(); radio_voice->hangupForegroundResumeBackground(serial); @@ -524,14 +503,12 @@ TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "hangupForegroundResumeBackground finished"; } /* * Test IRadioVoice.switchWaitingOrHoldingAndActive() for the response returned. */ TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) { - LOG(DEBUG) << "switchWaitingOrHoldingAndActive"; serial = GetRandomSerialNumber(); radio_voice->switchWaitingOrHoldingAndActive(serial); @@ -544,14 +521,12 @@ TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "switchWaitingOrHoldingAndActive finished"; } /* * Test IRadioVoice.conference() for the response returned. */ TEST_P(RadioVoiceTest, conference) { - LOG(DEBUG) << "conference"; serial = GetRandomSerialNumber(); radio_voice->conference(serial); @@ -564,14 +539,12 @@ TEST_P(RadioVoiceTest, conference) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "conference finished"; } /* * Test IRadioVoice.rejectCall() for the response returned. */ TEST_P(RadioVoiceTest, rejectCall) { - LOG(DEBUG) << "rejectCall"; serial = GetRandomSerialNumber(); radio_voice->rejectCall(serial); @@ -584,14 +557,12 @@ TEST_P(RadioVoiceTest, rejectCall) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "rejectCall finished"; } /* * Test IRadioVoice.getLastCallFailCause() for the response returned. */ TEST_P(RadioVoiceTest, getLastCallFailCause) { - LOG(DEBUG) << "getLastCallFailCause"; serial = GetRandomSerialNumber(); radio_voice->getLastCallFailCause(serial); @@ -603,14 +574,12 @@ TEST_P(RadioVoiceTest, getLastCallFailCause) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getLastCallFailCause finished"; } /* * Test IRadioVoice.getCallForwardStatus() for the response returned. */ TEST_P(RadioVoiceTest, getCallForwardStatus) { - LOG(DEBUG) << "getCallForwardStatus"; serial = GetRandomSerialNumber(); CallForwardInfo callInfo; memset(&callInfo, 0, sizeof(callInfo)); @@ -627,14 +596,12 @@ TEST_P(RadioVoiceTest, getCallForwardStatus) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCallForwardStatus finished"; } /* * Test IRadioVoice.setCallForward() for the response returned. */ TEST_P(RadioVoiceTest, setCallForward) { - LOG(DEBUG) << "setCallForward"; serial = GetRandomSerialNumber(); CallForwardInfo callInfo; memset(&callInfo, 0, sizeof(callInfo)); @@ -651,14 +618,12 @@ TEST_P(RadioVoiceTest, setCallForward) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCallForward finished"; } /* * Test IRadioVoice.getCallWaiting() for the response returned. */ TEST_P(RadioVoiceTest, getCallWaiting) { - LOG(DEBUG) << "getCallWaiting"; serial = GetRandomSerialNumber(); radio_voice->getCallWaiting(serial, 1); @@ -672,14 +637,12 @@ TEST_P(RadioVoiceTest, getCallWaiting) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCallWaiting finished"; } /* * Test IRadioVoice.setCallWaiting() for the response returned. */ TEST_P(RadioVoiceTest, setCallWaiting) { - LOG(DEBUG) << "setCallWaiting"; serial = GetRandomSerialNumber(); radio_voice->setCallWaiting(serial, true, 1); @@ -693,14 +656,12 @@ TEST_P(RadioVoiceTest, setCallWaiting) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCallWaiting finished"; } /* * Test IRadioVoice.acceptCall() for the response returned. */ TEST_P(RadioVoiceTest, acceptCall) { - LOG(DEBUG) << "acceptCall"; serial = GetRandomSerialNumber(); radio_voice->acceptCall(serial); @@ -713,14 +674,12 @@ TEST_P(RadioVoiceTest, acceptCall) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acceptCall finished"; } /* * Test IRadioVoice.separateConnection() for the response returned. */ TEST_P(RadioVoiceTest, separateConnection) { - LOG(DEBUG) << "separateConnection"; serial = GetRandomSerialNumber(); radio_voice->separateConnection(serial, 1); @@ -734,14 +693,12 @@ TEST_P(RadioVoiceTest, separateConnection) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "separateConnection finished"; } /* * Test IRadioVoice.explicitCallTransfer() for the response returned. */ TEST_P(RadioVoiceTest, explicitCallTransfer) { - LOG(DEBUG) << "explicitCallTransfer"; serial = GetRandomSerialNumber(); radio_voice->explicitCallTransfer(serial); @@ -754,14 +711,12 @@ TEST_P(RadioVoiceTest, explicitCallTransfer) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "explicitCallTransfer finished"; } /* * Test IRadioVoice.sendCdmaFeatureCode() for the response returned. */ TEST_P(RadioVoiceTest, sendCdmaFeatureCode) { - LOG(DEBUG) << "sendCdmaFeatureCode"; serial = GetRandomSerialNumber(); radio_voice->sendCdmaFeatureCode(serial, std::string()); @@ -776,14 +731,12 @@ TEST_P(RadioVoiceTest, sendCdmaFeatureCode) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendCdmaFeatureCode finished"; } /* * Test IRadioVoice.sendDtmf() for the response returned. */ TEST_P(RadioVoiceTest, sendDtmf) { - LOG(DEBUG) << "sendDtmf"; serial = GetRandomSerialNumber(); radio_voice->sendDtmf(serial, "1"); @@ -798,14 +751,12 @@ TEST_P(RadioVoiceTest, sendDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendDtmf finished"; } /* * Test IRadioVoice.startDtmf() for the response returned. */ TEST_P(RadioVoiceTest, startDtmf) { - LOG(DEBUG) << "startDtmf"; serial = GetRandomSerialNumber(); radio_voice->startDtmf(serial, "1"); @@ -820,14 +771,12 @@ TEST_P(RadioVoiceTest, startDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "startDtmf finished"; } /* * Test IRadioVoice.stopDtmf() for the response returned. */ TEST_P(RadioVoiceTest, stopDtmf) { - LOG(DEBUG) << "stopDtmf"; serial = GetRandomSerialNumber(); radio_voice->stopDtmf(serial); @@ -841,14 +790,12 @@ TEST_P(RadioVoiceTest, stopDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "stopDtmf finished"; } /* * Test IRadioVoice.setMute() for the response returned. */ TEST_P(RadioVoiceTest, setMute) { - LOG(DEBUG) << "setMute"; serial = GetRandomSerialNumber(); radio_voice->setMute(serial, true); @@ -861,14 +808,12 @@ TEST_P(RadioVoiceTest, setMute) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setMute finished"; } /* * Test IRadioVoice.getMute() for the response returned. */ TEST_P(RadioVoiceTest, getMute) { - LOG(DEBUG) << "getMute"; serial = GetRandomSerialNumber(); radio_voice->getMute(serial); @@ -879,14 +824,12 @@ TEST_P(RadioVoiceTest, getMute) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "getMute finished"; } /* * Test IRadioVoice.sendBurstDtmf() for the response returned. */ TEST_P(RadioVoiceTest, sendBurstDtmf) { - LOG(DEBUG) << "sendBurstDtmf"; serial = GetRandomSerialNumber(); radio_voice->sendBurstDtmf(serial, "1", 0, 0); @@ -900,14 +843,12 @@ TEST_P(RadioVoiceTest, sendBurstDtmf) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendBurstDtmf finished"; } /* * Test IRadioVoice.sendUssd() for the response returned. */ TEST_P(RadioVoiceTest, sendUssd) { - LOG(DEBUG) << "sendUssd"; serial = GetRandomSerialNumber(); radio_voice->sendUssd(serial, std::string("test")); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -920,14 +861,12 @@ TEST_P(RadioVoiceTest, sendUssd) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendUssd finished"; } /* * Test IRadioVoice.cancelPendingUssd() for the response returned. */ TEST_P(RadioVoiceTest, cancelPendingUssd) { - LOG(DEBUG) << "cancelPendingUssd"; serial = GetRandomSerialNumber(); radio_voice->cancelPendingUssd(serial); @@ -941,14 +880,12 @@ TEST_P(RadioVoiceTest, cancelPendingUssd) { {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "cancelPendingUssd finished"; } /* * Test IRadioVoice.isVoNrEnabled() for the response returned. */ TEST_P(RadioVoiceTest, isVoNrEnabled) { - LOG(DEBUG) << "isVoNrEnabled"; serial = GetRandomSerialNumber(); radio_voice->isVoNrEnabled(serial); @@ -958,14 +895,12 @@ TEST_P(RadioVoiceTest, isVoNrEnabled) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); - LOG(DEBUG) << "isVoNrEnabled finished"; } /* * Test IRadioVoice.setVoNrEnabled() for the response returned. */ TEST_P(RadioVoiceTest, setVoNrEnabled) { - LOG(DEBUG) << "setVoNrEnabled"; serial = GetRandomSerialNumber(); radio_voice->setVoNrEnabled(serial, true); @@ -975,5 +910,4 @@ TEST_P(RadioVoiceTest, setVoNrEnabled) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); - LOG(DEBUG) << "setVoNrEnabled finished"; } diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h index 0c3df7fbbf..dda6c6572a 100644 --- a/radio/aidl/vts/radio_voice_utils.h +++ b/radio/aidl/vts/radio_voice_utils.h @@ -183,7 +183,7 @@ class RadioVoiceIndication : public BnRadioVoiceIndication { }; // The main test class for Radio AIDL Voice. -class RadioVoiceTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioVoiceTest : public RadioServiceTest { protected: /* Clear Potential Established Calls */ virtual ndk::ScopedAStatus clearPotentialEstablishedCalls(); @@ -192,7 +192,7 @@ class RadioVoiceTest : public ::testing::TestWithParam, public Radi std::shared_ptr radioInd_network; public: - virtual void SetUp() override; + void SetUp() override; /* radio voice service handle */ std::shared_ptr radio_voice; diff --git a/secure_element/aidl/Android.bp b/secure_element/aidl/Android.bp index 6450eb4a99..655487de34 100644 --- a/secure_element/aidl/Android.bp +++ b/secure_element/aidl/Android.bp @@ -21,6 +21,14 @@ aidl_interface { sdk_version: "system_current", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } cc_test { diff --git a/secure_element/aidl/aidl_api/android.hardware.secure_element/1/.hash b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/.hash new file mode 100644 index 0000000000..d7ad83f1c9 --- /dev/null +++ b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/.hash @@ -0,0 +1 @@ +3430a4053a6e5f73f2d0c250cab7a8ba654efdae diff --git a/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/ISecureElement.aidl b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/ISecureElement.aidl new file mode 100644 index 0000000000..fba29ab8fa --- /dev/null +++ b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/ISecureElement.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.secure_element; +@VintfStability +interface ISecureElement { + void closeChannel(in byte channelNumber); + byte[] getAtr(); + void init(in android.hardware.secure_element.ISecureElementCallback clientCallback); + boolean isCardPresent(); + byte[] openBasicChannel(in byte[] aid, in byte p2); + android.hardware.secure_element.LogicalChannelResponse openLogicalChannel(in byte[] aid, in byte p2); + void reset(); + byte[] transmit(in byte[] data); + const int FAILED = 1; + const int CHANNEL_NOT_AVAILABLE = 2; + const int NO_SUCH_ELEMENT_ERROR = 3; + const int UNSUPPORTED_OPERATION = 4; + const int IOERROR = 5; +} diff --git a/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/ISecureElementCallback.aidl b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/ISecureElementCallback.aidl new file mode 100644 index 0000000000..6c2be2a73a --- /dev/null +++ b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/ISecureElementCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.secure_element; +@VintfStability +interface ISecureElementCallback { + void onStateChange(in boolean connected, in String debugReason); +} diff --git a/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/LogicalChannelResponse.aidl b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/LogicalChannelResponse.aidl new file mode 100644 index 0000000000..f2e7f0423a --- /dev/null +++ b/secure_element/aidl/aidl_api/android.hardware.secure_element/1/android/hardware/secure_element/LogicalChannelResponse.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.secure_element; +@VintfStability +parcelable LogicalChannelResponse { + byte channelNumber; + byte[] selectResponse; +} diff --git a/security/keymint/aidl/Android.bp b/security/keymint/aidl/Android.bp index 4753afbd0e..e346610f91 100644 --- a/security/keymint/aidl/Android.bp +++ b/security/keymint/aidl/Android.bp @@ -17,7 +17,7 @@ aidl_interface { "android.hardware.security.secureclock-V1", ], stability: "vintf", - frozen: false, + frozen: true, backend: { java: { platform_apis: true, @@ -42,6 +42,10 @@ aidl_interface { version: "2", imports: ["android.hardware.security.secureclock-V1"], }, + { + version: "3", + imports: ["android.hardware.security.secureclock-V1"], + }, ], diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/.hash b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/.hash new file mode 100644 index 0000000000..d8a0378fb9 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/.hash @@ -0,0 +1 @@ +74a538630d5d90f732f361a2313cbb69b09eb047 diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Algorithm.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Algorithm.aidl new file mode 100644 index 0000000000..6da124f601 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Algorithm.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum Algorithm { + RSA = 1, + EC = 3, + AES = 32, + TRIPLE_DES = 33, + HMAC = 128, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/AttestationKey.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/AttestationKey.aidl new file mode 100644 index 0000000000..90f2e6ee54 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/AttestationKey.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable AttestationKey { + byte[] keyBlob; + android.hardware.security.keymint.KeyParameter[] attestKeyParams; + byte[] issuerSubjectName; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/BeginResult.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/BeginResult.aidl new file mode 100644 index 0000000000..c952a3152a --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/BeginResult.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable BeginResult { + long challenge; + android.hardware.security.keymint.KeyParameter[] params; + android.hardware.security.keymint.IKeyMintOperation operation; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/BlockMode.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/BlockMode.aidl new file mode 100644 index 0000000000..004988326b --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/BlockMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum BlockMode { + ECB = 1, + CBC = 2, + CTR = 3, + GCM = 32, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Certificate.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Certificate.aidl new file mode 100644 index 0000000000..645f0a72ee --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Certificate.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable Certificate { + byte[] encodedCertificate; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Digest.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Digest.aidl new file mode 100644 index 0000000000..0df709609f --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Digest.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum Digest { + NONE = 0, + MD5 = 1, + SHA1 = 2, + SHA_2_224 = 3, + SHA_2_256 = 4, + SHA_2_384 = 5, + SHA_2_512 = 6, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/EcCurve.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/EcCurve.aidl new file mode 100644 index 0000000000..ffc7efe0e7 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/EcCurve.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum EcCurve { + P_224 = 0, + P_256 = 1, + P_384 = 2, + P_521 = 3, + CURVE_25519 = 4, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/ErrorCode.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/ErrorCode.aidl new file mode 100644 index 0000000000..6d49c44621 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/ErrorCode.aidl @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum ErrorCode { + OK = 0, + ROOT_OF_TRUST_ALREADY_SET = (-1) /* -1 */, + UNSUPPORTED_PURPOSE = (-2) /* -2 */, + INCOMPATIBLE_PURPOSE = (-3) /* -3 */, + UNSUPPORTED_ALGORITHM = (-4) /* -4 */, + INCOMPATIBLE_ALGORITHM = (-5) /* -5 */, + UNSUPPORTED_KEY_SIZE = (-6) /* -6 */, + UNSUPPORTED_BLOCK_MODE = (-7) /* -7 */, + INCOMPATIBLE_BLOCK_MODE = (-8) /* -8 */, + UNSUPPORTED_MAC_LENGTH = (-9) /* -9 */, + UNSUPPORTED_PADDING_MODE = (-10) /* -10 */, + INCOMPATIBLE_PADDING_MODE = (-11) /* -11 */, + UNSUPPORTED_DIGEST = (-12) /* -12 */, + INCOMPATIBLE_DIGEST = (-13) /* -13 */, + INVALID_EXPIRATION_TIME = (-14) /* -14 */, + INVALID_USER_ID = (-15) /* -15 */, + INVALID_AUTHORIZATION_TIMEOUT = (-16) /* -16 */, + UNSUPPORTED_KEY_FORMAT = (-17) /* -17 */, + INCOMPATIBLE_KEY_FORMAT = (-18) /* -18 */, + UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM = (-19) /* -19 */, + UNSUPPORTED_KEY_VERIFICATION_ALGORITHM = (-20) /* -20 */, + INVALID_INPUT_LENGTH = (-21) /* -21 */, + KEY_EXPORT_OPTIONS_INVALID = (-22) /* -22 */, + DELEGATION_NOT_ALLOWED = (-23) /* -23 */, + KEY_NOT_YET_VALID = (-24) /* -24 */, + KEY_EXPIRED = (-25) /* -25 */, + KEY_USER_NOT_AUTHENTICATED = (-26) /* -26 */, + OUTPUT_PARAMETER_NULL = (-27) /* -27 */, + INVALID_OPERATION_HANDLE = (-28) /* -28 */, + INSUFFICIENT_BUFFER_SPACE = (-29) /* -29 */, + VERIFICATION_FAILED = (-30) /* -30 */, + TOO_MANY_OPERATIONS = (-31) /* -31 */, + UNEXPECTED_NULL_POINTER = (-32) /* -32 */, + INVALID_KEY_BLOB = (-33) /* -33 */, + IMPORTED_KEY_NOT_ENCRYPTED = (-34) /* -34 */, + IMPORTED_KEY_DECRYPTION_FAILED = (-35) /* -35 */, + IMPORTED_KEY_NOT_SIGNED = (-36) /* -36 */, + IMPORTED_KEY_VERIFICATION_FAILED = (-37) /* -37 */, + INVALID_ARGUMENT = (-38) /* -38 */, + UNSUPPORTED_TAG = (-39) /* -39 */, + INVALID_TAG = (-40) /* -40 */, + MEMORY_ALLOCATION_FAILED = (-41) /* -41 */, + IMPORT_PARAMETER_MISMATCH = (-44) /* -44 */, + SECURE_HW_ACCESS_DENIED = (-45) /* -45 */, + OPERATION_CANCELLED = (-46) /* -46 */, + CONCURRENT_ACCESS_CONFLICT = (-47) /* -47 */, + SECURE_HW_BUSY = (-48) /* -48 */, + SECURE_HW_COMMUNICATION_FAILED = (-49) /* -49 */, + UNSUPPORTED_EC_FIELD = (-50) /* -50 */, + MISSING_NONCE = (-51) /* -51 */, + INVALID_NONCE = (-52) /* -52 */, + MISSING_MAC_LENGTH = (-53) /* -53 */, + KEY_RATE_LIMIT_EXCEEDED = (-54) /* -54 */, + CALLER_NONCE_PROHIBITED = (-55) /* -55 */, + KEY_MAX_OPS_EXCEEDED = (-56) /* -56 */, + INVALID_MAC_LENGTH = (-57) /* -57 */, + MISSING_MIN_MAC_LENGTH = (-58) /* -58 */, + UNSUPPORTED_MIN_MAC_LENGTH = (-59) /* -59 */, + UNSUPPORTED_KDF = (-60) /* -60 */, + UNSUPPORTED_EC_CURVE = (-61) /* -61 */, + KEY_REQUIRES_UPGRADE = (-62) /* -62 */, + ATTESTATION_CHALLENGE_MISSING = (-63) /* -63 */, + KEYMINT_NOT_CONFIGURED = (-64) /* -64 */, + ATTESTATION_APPLICATION_ID_MISSING = (-65) /* -65 */, + CANNOT_ATTEST_IDS = (-66) /* -66 */, + ROLLBACK_RESISTANCE_UNAVAILABLE = (-67) /* -67 */, + HARDWARE_TYPE_UNAVAILABLE = (-68) /* -68 */, + PROOF_OF_PRESENCE_REQUIRED = (-69) /* -69 */, + CONCURRENT_PROOF_OF_PRESENCE_REQUESTED = (-70) /* -70 */, + NO_USER_CONFIRMATION = (-71) /* -71 */, + DEVICE_LOCKED = (-72) /* -72 */, + EARLY_BOOT_ENDED = (-73) /* -73 */, + ATTESTATION_KEYS_NOT_PROVISIONED = (-74) /* -74 */, + ATTESTATION_IDS_NOT_PROVISIONED = (-75) /* -75 */, + INVALID_OPERATION = (-76) /* -76 */, + STORAGE_KEY_UNSUPPORTED = (-77) /* -77 */, + INCOMPATIBLE_MGF_DIGEST = (-78) /* -78 */, + UNSUPPORTED_MGF_DIGEST = (-79) /* -79 */, + MISSING_NOT_BEFORE = (-80) /* -80 */, + MISSING_NOT_AFTER = (-81) /* -81 */, + MISSING_ISSUER_SUBJECT = (-82) /* -82 */, + INVALID_ISSUER_SUBJECT = (-83) /* -83 */, + BOOT_LEVEL_EXCEEDED = (-84) /* -84 */, + HARDWARE_NOT_YET_AVAILABLE = (-85) /* -85 */, + UNIMPLEMENTED = (-100) /* -100 */, + VERSION_MISMATCH = (-101) /* -101 */, + UNKNOWN_ERROR = (-1000) /* -1000 */, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/HardwareAuthToken.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/HardwareAuthToken.aidl new file mode 100644 index 0000000000..2e07924382 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/HardwareAuthToken.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable HardwareAuthToken { + long challenge; + long userId; + long authenticatorId; + android.hardware.security.keymint.HardwareAuthenticatorType authenticatorType = android.hardware.security.keymint.HardwareAuthenticatorType.NONE; + android.hardware.security.secureclock.Timestamp timestamp; + byte[] mac; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/HardwareAuthenticatorType.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/HardwareAuthenticatorType.aidl new file mode 100644 index 0000000000..eb4f6215b7 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/HardwareAuthenticatorType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum HardwareAuthenticatorType { + NONE = 0, + PASSWORD = (1 << 0) /* 1 */, + FINGERPRINT = (1 << 1) /* 2 */, + ANY = 0xFFFFFFFF, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/IKeyMintDevice.aidl new file mode 100644 index 0000000000..dcc22c4ba7 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/IKeyMintDevice.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@SensitiveData @VintfStability +interface IKeyMintDevice { + android.hardware.security.keymint.KeyMintHardwareInfo getHardwareInfo(); + void addRngEntropy(in byte[] data); + android.hardware.security.keymint.KeyCreationResult generateKey(in android.hardware.security.keymint.KeyParameter[] keyParams, in @nullable android.hardware.security.keymint.AttestationKey attestationKey); + android.hardware.security.keymint.KeyCreationResult importKey(in android.hardware.security.keymint.KeyParameter[] keyParams, in android.hardware.security.keymint.KeyFormat keyFormat, in byte[] keyData, in @nullable android.hardware.security.keymint.AttestationKey attestationKey); + android.hardware.security.keymint.KeyCreationResult importWrappedKey(in byte[] wrappedKeyData, in byte[] wrappingKeyBlob, in byte[] maskingKey, in android.hardware.security.keymint.KeyParameter[] unwrappingParams, in long passwordSid, in long biometricSid); + byte[] upgradeKey(in byte[] keyBlobToUpgrade, in android.hardware.security.keymint.KeyParameter[] upgradeParams); + void deleteKey(in byte[] keyBlob); + void deleteAllKeys(); + void destroyAttestationIds(); + android.hardware.security.keymint.BeginResult begin(in android.hardware.security.keymint.KeyPurpose purpose, in byte[] keyBlob, in android.hardware.security.keymint.KeyParameter[] params, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken); + void deviceLocked(in boolean passwordOnly, in @nullable android.hardware.security.secureclock.TimeStampToken timestampToken); + void earlyBootEnded(); + byte[] convertStorageKeyToEphemeral(in byte[] storageKeyBlob); + android.hardware.security.keymint.KeyCharacteristics[] getKeyCharacteristics(in byte[] keyBlob, in byte[] appId, in byte[] appData); + byte[16] getRootOfTrustChallenge(); + byte[] getRootOfTrust(in byte[16] challenge); + void sendRootOfTrust(in byte[] rootOfTrust); + const int AUTH_TOKEN_MAC_LENGTH = 32; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/IKeyMintOperation.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/IKeyMintOperation.aidl new file mode 100644 index 0000000000..4ab4ffed11 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/IKeyMintOperation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@SensitiveData @VintfStability +interface IKeyMintOperation { + void updateAad(in byte[] input, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken, in @nullable android.hardware.security.secureclock.TimeStampToken timeStampToken); + byte[] update(in byte[] input, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken, in @nullable android.hardware.security.secureclock.TimeStampToken timeStampToken); + byte[] finish(in @nullable byte[] input, in @nullable byte[] signature, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken, in @nullable android.hardware.security.secureclock.TimeStampToken timestampToken, in @nullable byte[] confirmationToken); + void abort(); +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyCharacteristics.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyCharacteristics.aidl new file mode 100644 index 0000000000..008381f282 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyCharacteristics.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable KeyCharacteristics { + android.hardware.security.keymint.SecurityLevel securityLevel = android.hardware.security.keymint.SecurityLevel.SOFTWARE; + android.hardware.security.keymint.KeyParameter[] authorizations; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyCreationResult.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyCreationResult.aidl new file mode 100644 index 0000000000..9f77d3e3d5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyCreationResult.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable KeyCreationResult { + byte[] keyBlob; + android.hardware.security.keymint.KeyCharacteristics[] keyCharacteristics; + android.hardware.security.keymint.Certificate[] certificateChain; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyFormat.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyFormat.aidl new file mode 100644 index 0000000000..9560d8d2b5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyFormat.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum KeyFormat { + X509 = 0, + PKCS8 = 1, + RAW = 3, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyMintHardwareInfo.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyMintHardwareInfo.aidl new file mode 100644 index 0000000000..2113e42a8e --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyMintHardwareInfo.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable KeyMintHardwareInfo { + int versionNumber; + android.hardware.security.keymint.SecurityLevel securityLevel = android.hardware.security.keymint.SecurityLevel.SOFTWARE; + @utf8InCpp String keyMintName; + @utf8InCpp String keyMintAuthorName; + boolean timestampTokenRequired; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyOrigin.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyOrigin.aidl new file mode 100644 index 0000000000..4b3c659ffe --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyOrigin.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum KeyOrigin { + GENERATED = 0, + DERIVED = 1, + IMPORTED = 2, + RESERVED = 3, + SECURELY_IMPORTED = 4, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyParameter.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyParameter.aidl new file mode 100644 index 0000000000..c5a1e011d2 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyParameter.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable KeyParameter { + android.hardware.security.keymint.Tag tag = android.hardware.security.keymint.Tag.INVALID; + android.hardware.security.keymint.KeyParameterValue value; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyParameterValue.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyParameterValue.aidl new file mode 100644 index 0000000000..7a0b074fe5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyParameterValue.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +union KeyParameterValue { + int invalid; + android.hardware.security.keymint.Algorithm algorithm; + android.hardware.security.keymint.BlockMode blockMode; + android.hardware.security.keymint.PaddingMode paddingMode; + android.hardware.security.keymint.Digest digest; + android.hardware.security.keymint.EcCurve ecCurve; + android.hardware.security.keymint.KeyOrigin origin; + android.hardware.security.keymint.KeyPurpose keyPurpose; + android.hardware.security.keymint.HardwareAuthenticatorType hardwareAuthenticatorType; + android.hardware.security.keymint.SecurityLevel securityLevel; + boolean boolValue; + int integer; + long longInteger; + long dateTime; + byte[] blob; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyPurpose.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyPurpose.aidl new file mode 100644 index 0000000000..b84bec1fc0 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/KeyPurpose.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum KeyPurpose { + ENCRYPT = 0, + DECRYPT = 1, + SIGN = 2, + VERIFY = 3, + WRAP_KEY = 5, + AGREE_KEY = 6, + ATTEST_KEY = 7, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/PaddingMode.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/PaddingMode.aidl new file mode 100644 index 0000000000..dba4a8a06e --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/PaddingMode.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum PaddingMode { + NONE = 1, + RSA_OAEP = 2, + RSA_PSS = 3, + RSA_PKCS1_1_5_ENCRYPT = 4, + RSA_PKCS1_1_5_SIGN = 5, + PKCS7 = 64, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/SecurityLevel.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/SecurityLevel.aidl new file mode 100644 index 0000000000..0d278e0af9 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/SecurityLevel.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum SecurityLevel { + SOFTWARE = 0, + TRUSTED_ENVIRONMENT = 1, + STRONGBOX = 2, + KEYSTORE = 100, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Tag.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Tag.aidl new file mode 100644 index 0000000000..0d30c0aad1 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/Tag.aidl @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum Tag { + INVALID = 0, + PURPOSE = (android.hardware.security.keymint.TagType.ENUM_REP | 1) /* 536870913 */, + ALGORITHM = (android.hardware.security.keymint.TagType.ENUM | 2) /* 268435458 */, + KEY_SIZE = (android.hardware.security.keymint.TagType.UINT | 3) /* 805306371 */, + BLOCK_MODE = (android.hardware.security.keymint.TagType.ENUM_REP | 4) /* 536870916 */, + DIGEST = (android.hardware.security.keymint.TagType.ENUM_REP | 5) /* 536870917 */, + PADDING = (android.hardware.security.keymint.TagType.ENUM_REP | 6) /* 536870918 */, + CALLER_NONCE = (android.hardware.security.keymint.TagType.BOOL | 7) /* 1879048199 */, + MIN_MAC_LENGTH = (android.hardware.security.keymint.TagType.UINT | 8) /* 805306376 */, + EC_CURVE = (android.hardware.security.keymint.TagType.ENUM | 10) /* 268435466 */, + RSA_PUBLIC_EXPONENT = (android.hardware.security.keymint.TagType.ULONG | 200) /* 1342177480 */, + INCLUDE_UNIQUE_ID = (android.hardware.security.keymint.TagType.BOOL | 202) /* 1879048394 */, + RSA_OAEP_MGF_DIGEST = (android.hardware.security.keymint.TagType.ENUM_REP | 203) /* 536871115 */, + BOOTLOADER_ONLY = (android.hardware.security.keymint.TagType.BOOL | 302) /* 1879048494 */, + ROLLBACK_RESISTANCE = (android.hardware.security.keymint.TagType.BOOL | 303) /* 1879048495 */, + HARDWARE_TYPE = (android.hardware.security.keymint.TagType.ENUM | 304) /* 268435760 */, + EARLY_BOOT_ONLY = (android.hardware.security.keymint.TagType.BOOL | 305) /* 1879048497 */, + ACTIVE_DATETIME = (android.hardware.security.keymint.TagType.DATE | 400) /* 1610613136 */, + ORIGINATION_EXPIRE_DATETIME = (android.hardware.security.keymint.TagType.DATE | 401) /* 1610613137 */, + USAGE_EXPIRE_DATETIME = (android.hardware.security.keymint.TagType.DATE | 402) /* 1610613138 */, + MIN_SECONDS_BETWEEN_OPS = (android.hardware.security.keymint.TagType.UINT | 403) /* 805306771 */, + MAX_USES_PER_BOOT = (android.hardware.security.keymint.TagType.UINT | 404) /* 805306772 */, + USAGE_COUNT_LIMIT = (android.hardware.security.keymint.TagType.UINT | 405) /* 805306773 */, + USER_ID = (android.hardware.security.keymint.TagType.UINT | 501) /* 805306869 */, + USER_SECURE_ID = (android.hardware.security.keymint.TagType.ULONG_REP | 502) /* -1610612234 */, + NO_AUTH_REQUIRED = (android.hardware.security.keymint.TagType.BOOL | 503) /* 1879048695 */, + USER_AUTH_TYPE = (android.hardware.security.keymint.TagType.ENUM | 504) /* 268435960 */, + AUTH_TIMEOUT = (android.hardware.security.keymint.TagType.UINT | 505) /* 805306873 */, + ALLOW_WHILE_ON_BODY = (android.hardware.security.keymint.TagType.BOOL | 506) /* 1879048698 */, + TRUSTED_USER_PRESENCE_REQUIRED = (android.hardware.security.keymint.TagType.BOOL | 507) /* 1879048699 */, + TRUSTED_CONFIRMATION_REQUIRED = (android.hardware.security.keymint.TagType.BOOL | 508) /* 1879048700 */, + UNLOCKED_DEVICE_REQUIRED = (android.hardware.security.keymint.TagType.BOOL | 509) /* 1879048701 */, + APPLICATION_ID = (android.hardware.security.keymint.TagType.BYTES | 601) /* -1879047591 */, + APPLICATION_DATA = (android.hardware.security.keymint.TagType.BYTES | 700) /* -1879047492 */, + CREATION_DATETIME = (android.hardware.security.keymint.TagType.DATE | 701) /* 1610613437 */, + ORIGIN = (android.hardware.security.keymint.TagType.ENUM | 702) /* 268436158 */, + ROOT_OF_TRUST = (android.hardware.security.keymint.TagType.BYTES | 704) /* -1879047488 */, + OS_VERSION = (android.hardware.security.keymint.TagType.UINT | 705) /* 805307073 */, + OS_PATCHLEVEL = (android.hardware.security.keymint.TagType.UINT | 706) /* 805307074 */, + UNIQUE_ID = (android.hardware.security.keymint.TagType.BYTES | 707) /* -1879047485 */, + ATTESTATION_CHALLENGE = (android.hardware.security.keymint.TagType.BYTES | 708) /* -1879047484 */, + ATTESTATION_APPLICATION_ID = (android.hardware.security.keymint.TagType.BYTES | 709) /* -1879047483 */, + ATTESTATION_ID_BRAND = (android.hardware.security.keymint.TagType.BYTES | 710) /* -1879047482 */, + ATTESTATION_ID_DEVICE = (android.hardware.security.keymint.TagType.BYTES | 711) /* -1879047481 */, + ATTESTATION_ID_PRODUCT = (android.hardware.security.keymint.TagType.BYTES | 712) /* -1879047480 */, + ATTESTATION_ID_SERIAL = (android.hardware.security.keymint.TagType.BYTES | 713) /* -1879047479 */, + ATTESTATION_ID_IMEI = (android.hardware.security.keymint.TagType.BYTES | 714) /* -1879047478 */, + ATTESTATION_ID_MEID = (android.hardware.security.keymint.TagType.BYTES | 715) /* -1879047477 */, + ATTESTATION_ID_MANUFACTURER = (android.hardware.security.keymint.TagType.BYTES | 716) /* -1879047476 */, + ATTESTATION_ID_MODEL = (android.hardware.security.keymint.TagType.BYTES | 717) /* -1879047475 */, + VENDOR_PATCHLEVEL = (android.hardware.security.keymint.TagType.UINT | 718) /* 805307086 */, + BOOT_PATCHLEVEL = (android.hardware.security.keymint.TagType.UINT | 719) /* 805307087 */, + DEVICE_UNIQUE_ATTESTATION = (android.hardware.security.keymint.TagType.BOOL | 720) /* 1879048912 */, + IDENTITY_CREDENTIAL_KEY = (android.hardware.security.keymint.TagType.BOOL | 721) /* 1879048913 */, + STORAGE_KEY = (android.hardware.security.keymint.TagType.BOOL | 722) /* 1879048914 */, + ATTESTATION_ID_SECOND_IMEI = (android.hardware.security.keymint.TagType.BYTES | 723) /* -1879047469 */, + ASSOCIATED_DATA = (android.hardware.security.keymint.TagType.BYTES | 1000) /* -1879047192 */, + NONCE = (android.hardware.security.keymint.TagType.BYTES | 1001) /* -1879047191 */, + MAC_LENGTH = (android.hardware.security.keymint.TagType.UINT | 1003) /* 805307371 */, + RESET_SINCE_ID_ROTATION = (android.hardware.security.keymint.TagType.BOOL | 1004) /* 1879049196 */, + CONFIRMATION_TOKEN = (android.hardware.security.keymint.TagType.BYTES | 1005) /* -1879047187 */, + CERTIFICATE_SERIAL = (android.hardware.security.keymint.TagType.BIGNUM | 1006) /* -2147482642 */, + CERTIFICATE_SUBJECT = (android.hardware.security.keymint.TagType.BYTES | 1007) /* -1879047185 */, + CERTIFICATE_NOT_BEFORE = (android.hardware.security.keymint.TagType.DATE | 1008) /* 1610613744 */, + CERTIFICATE_NOT_AFTER = (android.hardware.security.keymint.TagType.DATE | 1009) /* 1610613745 */, + MAX_BOOT_LEVEL = (android.hardware.security.keymint.TagType.UINT | 1010) /* 805307378 */, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/TagType.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/TagType.aidl new file mode 100644 index 0000000000..ca19e7ee27 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/3/android/hardware/security/keymint/TagType.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum TagType { + INVALID = (0 << 28) /* 0 */, + ENUM = (1 << 28) /* 268435456 */, + ENUM_REP = (2 << 28) /* 536870912 */, + UINT = (3 << 28) /* 805306368 */, + UINT_REP = (4 << 28) /* 1073741824 */, + ULONG = (5 << 28) /* 1342177280 */, + DATE = (6 << 28) /* 1610612736 */, + BOOL = (7 << 28) /* 1879048192 */, + BIGNUM = (8 << 28) /* -2147483648 */, + BYTES = (9 << 28) /* -1879048192 */, + ULONG_REP = (10 << 28) /* -1610612736 */, +} diff --git a/security/rkp/aidl/Android.bp b/security/rkp/aidl/Android.bp index 5285477519..e2ce649efb 100644 --- a/security/rkp/aidl/Android.bp +++ b/security/rkp/aidl/Android.bp @@ -37,5 +37,11 @@ aidl_interface { { version: "2", }, + { + version: "3", + imports: [], + }, + ], + frozen: true, } diff --git a/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/.hash b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/.hash new file mode 100644 index 0000000000..85cefd9900 --- /dev/null +++ b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/.hash @@ -0,0 +1 @@ +7d14edbfab5c490efa407ba55fa80614bb48ae8e diff --git a/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/DeviceInfo.aidl b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/DeviceInfo.aidl new file mode 100644 index 0000000000..d04d49cea8 --- /dev/null +++ b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/DeviceInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable DeviceInfo { + byte[] deviceInfo; +} diff --git a/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl new file mode 100644 index 0000000000..626ece8de2 --- /dev/null +++ b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +interface IRemotelyProvisionedComponent { + android.hardware.security.keymint.RpcHardwareInfo getHardwareInfo(); + byte[] generateEcdsaP256KeyPair(in boolean testMode, out android.hardware.security.keymint.MacedPublicKey macedPublicKey); + byte[] generateCertificateRequest(in boolean testMode, in android.hardware.security.keymint.MacedPublicKey[] keysToSign, in byte[] endpointEncryptionCertChain, in byte[] challenge, out android.hardware.security.keymint.DeviceInfo deviceInfo, out android.hardware.security.keymint.ProtectedData protectedData); + byte[] generateCertificateRequestV2(in android.hardware.security.keymint.MacedPublicKey[] keysToSign, in byte[] challenge); + const int STATUS_FAILED = 1; + const int STATUS_INVALID_MAC = 2; + const int STATUS_PRODUCTION_KEY_IN_TEST_REQUEST = 3; + const int STATUS_TEST_KEY_IN_PRODUCTION_REQUEST = 4; + const int STATUS_INVALID_EEK = 5; + const int STATUS_REMOVED = 6; +} diff --git a/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/MacedPublicKey.aidl b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/MacedPublicKey.aidl new file mode 100644 index 0000000000..8095e8ce04 --- /dev/null +++ b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/MacedPublicKey.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable MacedPublicKey { + byte[] macedKey; +} diff --git a/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/ProtectedData.aidl b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/ProtectedData.aidl new file mode 100644 index 0000000000..d1610b4d6f --- /dev/null +++ b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/ProtectedData.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable ProtectedData { + byte[] protectedData; +} diff --git a/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/RpcHardwareInfo.aidl b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/RpcHardwareInfo.aidl new file mode 100644 index 0000000000..147331c1a9 --- /dev/null +++ b/security/rkp/aidl/aidl_api/android.hardware.security.rkp/3/android/hardware/security/keymint/RpcHardwareInfo.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable RpcHardwareInfo { + int versionNumber; + @utf8InCpp String rpcAuthorName; + int supportedEekCurve = CURVE_NONE /* 0 */; + @nullable @utf8InCpp String uniqueId; + int supportedNumKeysInCsr = 4; + const int CURVE_NONE = 0; + const int CURVE_P256 = 1; + const int CURVE_25519 = 2; + const int MIN_SUPPORTED_NUM_KEYS_IN_CSR = 20; +} diff --git a/security/rkp/aidl/lint-baseline.xml b/security/rkp/aidl/lint-baseline.xml new file mode 100644 index 0000000000..d25d383dfd --- /dev/null +++ b/security/rkp/aidl/lint-baseline.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sensors/2.1/multihal/android.hardware.sensors@2.1-service-multihal.rc b/sensors/2.1/multihal/android.hardware.sensors@2.1-service-multihal.rc index e149058f0f..deea16e4d3 100644 --- a/sensors/2.1/multihal/android.hardware.sensors@2.1-service-multihal.rc +++ b/sensors/2.1/multihal/android.hardware.sensors@2.1-service-multihal.rc @@ -1,7 +1,7 @@ service vendor.sensors-hal-2-1-multihal /vendor/bin/hw/android.hardware.sensors@2.1-service.multihal class hal user system - group system wakelock context_hub input uhid + group system wakelock context_hub input task_profiles ServiceCapacityLow capabilities BLOCK_SUSPEND rlimit rtprio 10 10 diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp index 9673190731..3914ec1f7b 100644 --- a/sensors/aidl/Android.bp +++ b/sensors/aidl/Android.bp @@ -33,6 +33,15 @@ aidl_interface { "android.hardware.common.fmq-V1", ], }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + }, + ], + frozen: true, } diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/.hash b/sensors/aidl/aidl_api/android.hardware.sensors/2/.hash new file mode 100644 index 0000000000..f04da9f6d9 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/.hash @@ -0,0 +1 @@ +8cdc9f2ea08fd57e6c60a600fea28a51a2ff12f9 diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/AdditionalInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/AdditionalInfo.aidl new file mode 100644 index 0000000000..a35b54ca38 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/AdditionalInfo.aidl @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@FixedSize @VintfStability +parcelable AdditionalInfo { + android.hardware.sensors.AdditionalInfo.AdditionalInfoType type; + int serial; + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload payload; + @FixedSize @VintfStability + union AdditionalInfoPayload { + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.Int32Values dataInt32; + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.FloatValues dataFloat; + @FixedSize @VintfStability + parcelable Int32Values { + int[14] values; + } + @FixedSize @VintfStability + parcelable FloatValues { + float[14] values; + } + } + @Backing(type="int") @VintfStability + enum AdditionalInfoType { + AINFO_BEGIN = 0, + AINFO_END = 1, + 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/2/android/hardware/sensors/DynamicSensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/DynamicSensorInfo.aidl new file mode 100644 index 0000000000..0c9a493a91 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/DynamicSensorInfo.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@FixedSize @VintfStability +parcelable DynamicSensorInfo { + boolean connected; + int sensorHandle; + android.hardware.sensors.DynamicSensorInfo.Uuid uuid; + @FixedSize @VintfStability + parcelable Uuid { + byte[16] values; + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/Event.aidl new file mode 100644 index 0000000000..4f49002fce --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/Event.aidl @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@FixedSize @VintfStability +parcelable Event { + long timestamp; + int sensorHandle; + android.hardware.sensors.SensorType sensorType; + android.hardware.sensors.Event.EventPayload payload; + @FixedSize @VintfStability + union EventPayload { + android.hardware.sensors.Event.EventPayload.Vec3 vec3; + android.hardware.sensors.Event.EventPayload.Vec4 vec4; + android.hardware.sensors.Event.EventPayload.Uncal uncal; + android.hardware.sensors.Event.EventPayload.MetaData meta; + float scalar; + long stepCount; + android.hardware.sensors.Event.EventPayload.HeartRate heartRate; + android.hardware.sensors.Event.EventPayload.Pose6Dof pose6DOF; + android.hardware.sensors.DynamicSensorInfo dynamic; + android.hardware.sensors.AdditionalInfo additional; + android.hardware.sensors.Event.EventPayload.Data data; + android.hardware.sensors.Event.EventPayload.HeadTracker headTracker; + android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu; + android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal; + android.hardware.sensors.Event.EventPayload.Heading heading; + @FixedSize @VintfStability + parcelable Vec4 { + float x; + float y; + float z; + float w; + } + @FixedSize @VintfStability + parcelable Vec3 { + float x; + float y; + float z; + android.hardware.sensors.SensorStatus status; + } + @FixedSize @VintfStability + parcelable Uncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + } + @FixedSize @VintfStability + parcelable HeadTracker { + float rx; + float ry; + float rz; + float vx; + float vy; + float vz; + int discontinuityCount; + } + @FixedSize @VintfStability + parcelable LimitedAxesImu { + float x; + float y; + float z; + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability + parcelable LimitedAxesImuUncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability + parcelable HeartRate { + float bpm; + android.hardware.sensors.SensorStatus status; + } + @FixedSize @VintfStability + parcelable Heading { + float heading; + float accuracy; + } + @FixedSize @VintfStability + parcelable MetaData { + android.hardware.sensors.Event.EventPayload.MetaData.MetaDataEventType what; + @Backing(type="int") @VintfStability + enum MetaDataEventType { + META_DATA_FLUSH_COMPLETE = 1, + } + } + @FixedSize @VintfStability + parcelable Pose6Dof { + float[15] values; + } + @FixedSize @VintfStability + parcelable Data { + float[16] values; + } + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/ISensors.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/ISensors.aidl new file mode 100644 index 0000000000..0566a64c3c --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/ISensors.aidl @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@VintfStability +interface ISensors { + void activate(in int sensorHandle, in boolean enabled); + void batch(in int sensorHandle, in long samplingPeriodNs, in long maxReportLatencyNs); + int configDirectReport(in int sensorHandle, in int channelHandle, in android.hardware.sensors.ISensors.RateLevel rate); + void flush(in int sensorHandle); + android.hardware.sensors.SensorInfo[] getSensorsList(); + void initialize(in android.hardware.common.fmq.MQDescriptor eventQueueDescriptor, in android.hardware.common.fmq.MQDescriptor wakeLockDescriptor, in android.hardware.sensors.ISensorsCallback sensorsCallback); + void injectSensorData(in android.hardware.sensors.Event event); + 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) /* -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 << 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 = 0x5F000000; + const int RUNTIME_SENSORS_HANDLE_END = 0x5FFFFFFF; + @Backing(type="int") @VintfStability + enum RateLevel { + STOP, + NORMAL, + FAST, + VERY_FAST, + } + @Backing(type="int") @VintfStability + enum OperationMode { + NORMAL = 0, + DATA_INJECTION = 1, + } + @VintfStability + parcelable SharedMemInfo { + android.hardware.sensors.ISensors.SharedMemInfo.SharedMemType type; + android.hardware.sensors.ISensors.SharedMemInfo.SharedMemFormat format; + int size; + android.hardware.common.NativeHandle memoryHandle; + @Backing(type="int") @VintfStability + enum SharedMemFormat { + SENSORS_EVENT = 1, + } + @Backing(type="int") @VintfStability + enum SharedMemType { + ASHMEM = 1, + GRALLOC, + } + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/ISensorsCallback.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/ISensorsCallback.aidl new file mode 100644 index 0000000000..78ab56711b --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/ISensorsCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@VintfStability +interface ISensorsCallback { + void onDynamicSensorsConnected(in android.hardware.sensors.SensorInfo[] sensorInfos); + void onDynamicSensorsDisconnected(in int[] sensorHandles); +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorInfo.aidl new file mode 100644 index 0000000000..677e6c4e39 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorInfo.aidl @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@VintfStability +parcelable SensorInfo { + int sensorHandle; + String name; + String vendor; + int version; + android.hardware.sensors.SensorType type; + String typeAsString; + float maxRange; + float resolution; + float power; + int minDelayUs; + int fifoReservedEventCount; + int fifoMaxEventCount; + String requiredPermission; + int maxDelayUs; + int flags; + const int SENSOR_FLAG_BITS_WAKE_UP = 1; + const int SENSOR_FLAG_BITS_CONTINUOUS_MODE = 0; + 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 = 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; + const int SENSOR_FLAG_SHIFT_ADDITIONAL_INFO = 6; + const int SENSOR_FLAG_SHIFT_DIRECT_REPORT = 7; + const int SENSOR_FLAG_SHIFT_DIRECT_CHANNEL = 10; +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorStatus.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorStatus.aidl new file mode 100644 index 0000000000..f401dac04c --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@Backing(type="byte") @VintfStability +enum SensorStatus { + NO_CONTACT = (-1) /* -1 */, + UNRELIABLE = 0, + ACCURACY_LOW = 1, + ACCURACY_MEDIUM = 2, + ACCURACY_HIGH = 3, +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorType.aidl new file mode 100644 index 0000000000..0639f131c5 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/2/android/hardware/sensors/SensorType.aidl @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.sensors; +@Backing(type="int") @VintfStability +enum SensorType { + META_DATA = 0, + ACCELEROMETER = 1, + MAGNETIC_FIELD = 2, + ORIENTATION = 3, + GYROSCOPE = 4, + LIGHT = 5, + PRESSURE = 6, + PROXIMITY = 8, + GRAVITY = 9, + LINEAR_ACCELERATION = 10, + ROTATION_VECTOR = 11, + RELATIVE_HUMIDITY = 12, + AMBIENT_TEMPERATURE = 13, + MAGNETIC_FIELD_UNCALIBRATED = 14, + GAME_ROTATION_VECTOR = 15, + GYROSCOPE_UNCALIBRATED = 16, + SIGNIFICANT_MOTION = 17, + STEP_DETECTOR = 18, + STEP_COUNTER = 19, + GEOMAGNETIC_ROTATION_VECTOR = 20, + HEART_RATE = 21, + TILT_DETECTOR = 22, + WAKE_GESTURE = 23, + GLANCE_GESTURE = 24, + PICK_UP_GESTURE = 25, + WRIST_TILT_GESTURE = 26, + DEVICE_ORIENTATION = 27, + POSE_6DOF = 28, + STATIONARY_DETECT = 29, + MOTION_DETECT = 30, + HEART_BEAT = 31, + DYNAMIC_SENSOR_META = 32, + ADDITIONAL_INFO = 33, + LOW_LATENCY_OFFBODY_DETECT = 34, + ACCELEROMETER_UNCALIBRATED = 35, + HINGE_ANGLE = 36, + HEAD_TRACKER = 37, + ACCELEROMETER_LIMITED_AXES = 38, + GYROSCOPE_LIMITED_AXES = 39, + ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40, + GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, + HEADING = 42, + DEVICE_PRIVATE_BASE = 0x10000, +} 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 f60f5bb247..b26040b56d 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 @@ -58,6 +58,8 @@ interface ISensors { const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 24; const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 88; const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104; + const int RUNTIME_SENSORS_HANDLE_BASE = 1593835520; + const int RUNTIME_SENSORS_HANDLE_END = 1610612735; @Backing(type="int") @VintfStability enum RateLevel { STOP = 0, diff --git a/sensors/aidl/android/hardware/sensors/ISensors.aidl b/sensors/aidl/android/hardware/sensors/ISensors.aidl index 2c684897cf..5e276dd90a 100644 --- a/sensors/aidl/android/hardware/sensors/ISensors.aidl +++ b/sensors/aidl/android/hardware/sensors/ISensors.aidl @@ -371,4 +371,13 @@ interface ISensors { 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; + + /** + * Constants related to reserved sensor handle ranges. + * + * The following range (inclusive) is reserved for usage by the system for + * runtime sensors. + */ + const int RUNTIME_SENSORS_HANDLE_BASE = 0x5F000000; + const int RUNTIME_SENSORS_HANDLE_END = 0x5FFFFFFF; } diff --git a/sensors/aidl/convert/Android.bp b/sensors/aidl/convert/Android.bp index 0b31597478..53060b958a 100644 --- a/sensors/aidl/convert/Android.bp +++ b/sensors/aidl/convert/Android.bp @@ -35,7 +35,7 @@ cc_library_static { "libhardware", "libbase", "libutils", - "android.hardware.sensors-V1-ndk", + "android.hardware.sensors-V2-ndk", ], whole_static_libs: [ "sensors_common_convert", diff --git a/sensors/aidl/default/Android.bp b/sensors/aidl/default/Android.bp index 3c66744324..16b4d3558a 100644 --- a/sensors/aidl/default/Android.bp +++ b/sensors/aidl/default/Android.bp @@ -41,7 +41,7 @@ cc_library_static { "libfmq", "libpower", "libbinder_ndk", - "android.hardware.sensors-V1-ndk", + "android.hardware.sensors-V2-ndk", ], export_include_dirs: ["include"], srcs: [ @@ -68,7 +68,7 @@ cc_binary { "libcutils", "liblog", "libutils", - "android.hardware.sensors-V1-ndk", + "android.hardware.sensors-V2-ndk", ], static_libs: [ "libsensorsexampleimpl", diff --git a/sensors/aidl/default/multihal/Android.bp b/sensors/aidl/default/multihal/Android.bp index eee10625bb..a20d6d7434 100644 --- a/sensors/aidl/default/multihal/Android.bp +++ b/sensors/aidl/default/multihal/Android.bp @@ -38,7 +38,7 @@ cc_library_static { "android.hardware.sensors@1.0", "android.hardware.sensors@2.0", "android.hardware.sensors@2.1", - "android.hardware.sensors-V1-ndk", + "android.hardware.sensors-V2-ndk", ], export_include_dirs: ["include"], srcs: [ diff --git a/sensors/aidl/default/multihal/HalProxyAidl.cpp b/sensors/aidl/default/multihal/HalProxyAidl.cpp index e6bcdada52..dbef0305f9 100644 --- a/sensors/aidl/default/multihal/HalProxyAidl.cpp +++ b/sensors/aidl/default/multihal/HalProxyAidl.cpp @@ -17,6 +17,7 @@ #include "HalProxyAidl.h" #include #include +#include #include #include "ConvertUtils.h" #include "EventMessageQueueWrapperAidl.h" @@ -28,6 +29,8 @@ using ::aidl::android::hardware::common::fmq::MQDescriptor; using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; using ::aidl::android::hardware::sensors::ISensors; using ::aidl::android::hardware::sensors::ISensorsCallback; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; using ::android::hardware::sensors::V2_1::implementation::convertToOldEvent; using ::ndk::ScopedAStatus; @@ -225,13 +228,18 @@ ScopedAStatus HalProxyAidl::unregisterDirectChannel(int32_t in_channelHandle) { return resultToAStatus(HalProxy::unregisterDirectChannel(in_channelHandle)); } -binder_status_t HalProxyAidl::dump(int fd, const char ** /* args */, - uint32_t /* numArgs */) { +binder_status_t HalProxyAidl::dump(int fd, const char ** args, + uint32_t numArgs) { native_handle_t *nativeHandle = native_handle_create(1 /* numFds */, 0 /* numInts */); nativeHandle->data[0] = fd; - HalProxy::debug(nativeHandle, {} /* args */); + hidl_vec hidl_args; + hidl_args.resize(numArgs); + for (size_t i = 0; i < numArgs; ++i) { + hidl_args[i] = args[i]; + } + HalProxy::debug(nativeHandle, hidl_args); native_handle_delete(nativeHandle); return STATUS_OK; @@ -241,4 +249,4 @@ binder_status_t HalProxyAidl::dump(int fd, const char ** /* args */, } // namespace sensors } // namespace hardware } // namespace android -} // namespace aidl \ No newline at end of file +} // namespace aidl diff --git a/sensors/aidl/default/sensors-default.xml b/sensors/aidl/default/sensors-default.xml index 7898a6bab0..36b28ed0a6 100644 --- a/sensors/aidl/default/sensors-default.xml +++ b/sensors/aidl/default/sensors-default.xml @@ -1,7 +1,7 @@ android.hardware.sensors - 1 + 2 ISensors/default diff --git a/sensors/aidl/multihal/Android.bp b/sensors/aidl/multihal/Android.bp index 6d35dafd6d..522d305d86 100644 --- a/sensors/aidl/multihal/Android.bp +++ b/sensors/aidl/multihal/Android.bp @@ -40,7 +40,7 @@ cc_binary { "android.hardware.sensors@2.0-ScopedWakelock", "android.hardware.sensors@2.0", "android.hardware.sensors@2.1", - "android.hardware.sensors-V1-ndk", + "android.hardware.sensors-V2-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 d78edffaf9..5da4fbd9a1 100644 --- a/sensors/aidl/multihal/android.hardware.sensors-multihal.xml +++ b/sensors/aidl/multihal/android.hardware.sensors-multihal.xml @@ -17,7 +17,7 @@ android.hardware.sensors - 1 + 2 ISensors/default diff --git a/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc b/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc index 3f91a0a04a..5aecc54539 100644 --- a/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc +++ b/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc @@ -1,7 +1,7 @@ service vendor.sensors-hal-multihal /vendor/bin/hw/android.hardware.sensors-service.multihal class hal user system - group system wakelock context_hub + group system wakelock context_hub input uhid task_profiles ServiceCapacityLow capabilities BLOCK_SUSPEND - rlimit rtprio 10 10 \ No newline at end of file + rlimit rtprio 10 10 diff --git a/sensors/aidl/vts/Android.bp b/sensors/aidl/vts/Android.bp index f3972ec2a3..c17a5585fd 100644 --- a/sensors/aidl/vts/Android.bp +++ b/sensors/aidl/vts/Android.bp @@ -41,7 +41,7 @@ cc_test { "android.hardware.common.fmq-V1-ndk", ], static_libs: [ - "android.hardware.sensors-V1-ndk", + "android.hardware.sensors-V2-ndk", "VtsHalSensorsTargetTestUtils", "libaidlcommonsupport", ], diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 35220a2d31..618acbb1d4 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -561,10 +561,15 @@ TEST_P(SensorsAidlTest, SensorListValid) { EXPECT_NO_FATAL_FAILURE(assertTypeMatchStringType(info.type, info.typeAsString)); } - // Test if all sensor has name and vendor + // Test if all sensors have name and vendor EXPECT_FALSE(info.name.empty()); EXPECT_FALSE(info.vendor.empty()); + // Make sure that the sensor handle is not within the reserved range for runtime + // sensors. + EXPECT_FALSE(ISensors::RUNTIME_SENSORS_HANDLE_BASE <= info.sensorHandle && + info.sensorHandle <= ISensors::RUNTIME_SENSORS_HANDLE_END); + // Make sure that sensors of the same type have a unique name. std::vector& v = sensorTypeNameMap[static_cast(info.type)]; bool isUniqueName = std::find(v.begin(), v.end(), info.name) == v.end(); diff --git a/sensors/common/default/2.X/multihal/HalProxy.cpp b/sensors/common/default/2.X/multihal/HalProxy.cpp index 31a17db167..305383e93a 100644 --- a/sensors/common/default/2.X/multihal/HalProxy.cpp +++ b/sensors/common/default/2.X/multihal/HalProxy.cpp @@ -351,7 +351,7 @@ Return HalProxy::configDirectReport(int32_t sensorHandle, int32_t channelH return Return(); } -Return HalProxy::debug(const hidl_handle& fd, const hidl_vec& /*args*/) { +Return HalProxy::debug(const hidl_handle& fd, const hidl_vec& args) { if (fd.getNativeHandle() == nullptr || fd->numFds < 1) { ALOGE("%s: missing fd for writing", __FUNCTION__); return Void(); @@ -385,7 +385,7 @@ Return HalProxy::debug(const hidl_handle& fd, const hidl_vec& stream << " Name: " << subHal->getName() << std::endl; stream << " Debug dump: " << std::endl; android::base::WriteStringToFd(stream.str(), writeFd); - subHal->debug(fd, {}); + subHal->debug(fd, args); stream.str(""); stream << std::endl; } diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlTestBase.h b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlTestBase.h index f2c92ae1a4..ec7c906759 100644 --- a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlTestBase.h +++ b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlTestBase.h @@ -225,7 +225,9 @@ class SensorsHidlTestBase : public testing::TestWithParam { ASSERT_EQ(batch(handle, samplingPeriodInNs, batchingPeriodInNs), Result::OK); ASSERT_EQ(activate(handle, 1), Result::OK); - events = getEnvironment()->collectEvents(minTimeUs, minNEvent, true /*clearBeforeStart*/); + events = getEnvironment()->collectEvents( + minTimeUs, minNEvent, true /* clearBeforeStart */, true /* changeCollection */, + [&type](const EventType& event) { return event.sensorType == type; }); ASSERT_EQ(activate(handle, 0), Result::OK); ALOGI("Collected %zu samples", events.size()); @@ -233,24 +235,14 @@ class SensorsHidlTestBase : public testing::TestWithParam { ASSERT_GT(events.size(), 0u); bool handleMismatchReported = false; - bool metaSensorTypeErrorReported = false; for (auto& e : events) { - if (e.sensorType == type) { - // avoid generating hundreds of error - if (!handleMismatchReported) { - EXPECT_EQ(e.sensorHandle, handle) - << (handleMismatchReported = true, - "Event of the same type must come from the sensor registered"); - } - sensorEvents.push_back(e); - } else { - // avoid generating hundreds of error - if (!metaSensorTypeErrorReported) { - EXPECT_TRUE(isMetaSensorType(e.sensorType)) - << (metaSensorTypeErrorReported = true, - "Only meta types are allowed besides the type registered"); - } + // avoid generating hundreds of error + if (!handleMismatchReported) { + EXPECT_EQ(e.sensorHandle, handle) + << (handleMismatchReported = true, + "Event of the same type must come from the sensor registered"); } + sensorEvents.push_back(e); } std::string s; diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h index e851d401d1..c061a75b8f 100644 --- a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h +++ b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsVtsEnvironmentBase.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -61,9 +62,16 @@ class SensorsVtsEnvironmentBase { } // set sensor event collection status - void setCollection(bool enable) { + void setCollection(bool enable, const std::optional>& filter = + std::nullopt) { std::lock_guard lock(mEventsMutex); mCollectionEnabled = enable; + + if (enable && filter.has_value()) { + mEventFilter = *filter; + } else { + mEventFilter.reset(); + } } void registerCallback(IEventCallback* callback) { @@ -76,8 +84,10 @@ class SensorsVtsEnvironmentBase { mCallback = nullptr; } - std::vector collectEvents(useconds_t timeLimitUs, size_t nEventLimit, - bool clearBeforeStart = true, bool changeCollection = true) { + std::vector collectEvents( + useconds_t timeLimitUs, size_t nEventLimit, bool clearBeforeStart = true, + bool changeCollection = true, + const std::optional>& filter = std::nullopt) { std::vector events; constexpr useconds_t SLEEP_GRANULARITY = 100 * 1000; // granularity 100 ms @@ -85,7 +95,7 @@ class SensorsVtsEnvironmentBase { clearBeforeStart); if (changeCollection) { - setCollection(true); + setCollection(true, filter); } if (clearBeforeStart) { catEvents(nullptr); @@ -121,7 +131,7 @@ class SensorsVtsEnvironmentBase { void addEvent(const Event& ev) { std::lock_guard lock(mEventsMutex); - if (mCollectionEnabled) { + if (mCollectionEnabled && (!mEventFilter.has_value() || (*mEventFilter)(ev))) { mEvents.push_back(ev); } @@ -138,6 +148,7 @@ class SensorsVtsEnvironmentBase { std::atomic_bool mStopThread; std::thread mPollThread; std::vector mEvents; + std::optional> mEventFilter; std::mutex mEventsMutex; IEventCallback* mCallback; diff --git a/staging/threadnetwork/OWNERS b/staging/threadnetwork/OWNERS deleted file mode 100644 index 037215d70f..0000000000 --- a/staging/threadnetwork/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Bug component: 1203089 - -wgtdkp@google.com -xyk@google.com -zhanglongxia@google.com diff --git a/staging/threadnetwork/README.md b/staging/threadnetwork/README.md deleted file mode 100644 index 12104e5f4d..0000000000 --- a/staging/threadnetwork/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Staging threadnetwork HAL interface - -The directory includes the unstable/unreleased version of `hardware/interfaces/threadnetwork` -code which should **NOT** be used in production. But vendors may start verifying their hardware -with the HAL interface. - -This directory will be cleaned up when the stable Thread HAL interface is added in -`hardware/interfaces/threadnetwork` by version `V` or later. - -More information about _Thread_: -- https://www.threadgroup.org -- https://openthread.io diff --git a/tetheroffload/aidl/Android.bp b/tetheroffload/aidl/Android.bp index 1d8058685c..6de27c3462 100644 --- a/tetheroffload/aidl/Android.bp +++ b/tetheroffload/aidl/Android.bp @@ -23,5 +23,12 @@ aidl_interface { apps_enabled: false, }, }, - frozen: false, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/.hash b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/.hash new file mode 100644 index 0000000000..e7b452e355 --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/.hash @@ -0,0 +1 @@ +ba3f0342e13af942628a6c00e920d55ce8ad1ea3 diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/ForwardedStats.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/ForwardedStats.aidl new file mode 100644 index 0000000000..493a69868f --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/ForwardedStats.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@VintfStability +parcelable ForwardedStats { + long rxBytes; + long txBytes; +} diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/IOffload.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/IOffload.aidl new file mode 100644 index 0000000000..9a58b1fbba --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/IOffload.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@VintfStability +interface IOffload { + void initOffload(in ParcelFileDescriptor fd1, in ParcelFileDescriptor fd2, in android.hardware.tetheroffload.ITetheringOffloadCallback cb); + void stopOffload(); + void setLocalPrefixes(in String[] prefixes); + android.hardware.tetheroffload.ForwardedStats getForwardedStats(in String upstream); + void setDataWarningAndLimit(in String upstream, in long warningBytes, in long limitBytes); + void setUpstreamParameters(in String iface, in String v4Addr, in String v4Gw, in String[] v6Gws); + void addDownstream(in String iface, in String prefix); + void removeDownstream(in String iface, in String prefix); + const int ERROR_CODE_UNUSED = 0; +} diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/IPv4AddrPortPair.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/IPv4AddrPortPair.aidl new file mode 100644 index 0000000000..2b42f0c056 --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/IPv4AddrPortPair.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@VintfStability +parcelable IPv4AddrPortPair { + String addr; + int port; +} diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl new file mode 100644 index 0000000000..4eb7d04d00 --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/ITetheringOffloadCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@VintfStability +interface ITetheringOffloadCallback { + oneway void onEvent(in android.hardware.tetheroffload.OffloadCallbackEvent event); + oneway void updateTimeout(in android.hardware.tetheroffload.NatTimeoutUpdate params); +} diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/NatTimeoutUpdate.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/NatTimeoutUpdate.aidl new file mode 100644 index 0000000000..9eddaa205f --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/NatTimeoutUpdate.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@VintfStability +parcelable NatTimeoutUpdate { + android.hardware.tetheroffload.IPv4AddrPortPair src; + android.hardware.tetheroffload.IPv4AddrPortPair dst; + android.hardware.tetheroffload.NetworkProtocol proto; +} diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/NetworkProtocol.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/NetworkProtocol.aidl new file mode 100644 index 0000000000..52bd2a6c50 --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/NetworkProtocol.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@Backing(type="int") @VintfStability +enum NetworkProtocol { + TCP = 6, + UDP = 17, +} diff --git a/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/OffloadCallbackEvent.aidl b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/OffloadCallbackEvent.aidl new file mode 100644 index 0000000000..026e18ed1d --- /dev/null +++ b/tetheroffload/aidl/aidl_api/android.hardware.tetheroffload/1/android/hardware/tetheroffload/OffloadCallbackEvent.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tetheroffload; +@Backing(type="int") @VintfStability +enum OffloadCallbackEvent { + OFFLOAD_STARTED = 1, + OFFLOAD_STOPPED_ERROR = 2, + OFFLOAD_STOPPED_UNSUPPORTED = 3, + OFFLOAD_SUPPORT_AVAILABLE = 4, + OFFLOAD_STOPPED_LIMIT_REACHED = 5, + OFFLOAD_WARNING_REACHED = 6, +} diff --git a/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp b/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp index f46c9aba75..1049ea2cb9 100644 --- a/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp +++ b/tetheroffload/aidl/vts/functional/VtsHalTetheroffloadTargetTest.cpp @@ -690,6 +690,7 @@ INSTANTIATE_TEST_SUITE_P( ::android::PrintInstanceNameToString); } // namespace +} // namespace aidl::android::hardware::tetheroffload int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); @@ -697,5 +698,3 @@ int main(int argc, char** argv) { ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); } - -} // namespace aidl::android::hardware::tetheroffload diff --git a/thermal/aidl/Android.bp b/thermal/aidl/Android.bp index b132746d81..efc763c388 100644 --- a/thermal/aidl/Android.bp +++ b/thermal/aidl/Android.bp @@ -36,4 +36,12 @@ aidl_interface { platform_apis: true, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/.hash b/thermal/aidl/aidl_api/android.hardware.thermal/1/.hash new file mode 100644 index 0000000000..1a9e33bc2b --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/.hash @@ -0,0 +1 @@ +76e77ca374a7860f09aeac48e98b2ec61f576767 diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/CoolingDevice.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/CoolingDevice.aidl new file mode 100644 index 0000000000..dff3c4cc49 --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/CoolingDevice.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * +1 * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@JavaDerive(toString=true) @VintfStability +parcelable CoolingDevice { + android.hardware.thermal.CoolingType type; + String name; + long value; +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/CoolingType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/CoolingType.aidl new file mode 100644 index 0000000000..1f87cf29ae --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/CoolingType.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@Backing(type="int") @VintfStability +enum CoolingType { + FAN, + BATTERY, + CPU, + GPU, + MODEM, + NPU, + COMPONENT, + TPU, + POWER_AMPLIFIER, + DISPLAY, + SPEAKER, +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/IThermal.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/IThermal.aidl new file mode 100644 index 0000000000..c9b6cab364 --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/IThermal.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@VintfStability +interface IThermal { + android.hardware.thermal.CoolingDevice[] getCoolingDevices(); + android.hardware.thermal.CoolingDevice[] getCoolingDevicesWithType(in android.hardware.thermal.CoolingType type); + android.hardware.thermal.Temperature[] getTemperatures(); + android.hardware.thermal.Temperature[] getTemperaturesWithType(in android.hardware.thermal.TemperatureType type); + android.hardware.thermal.TemperatureThreshold[] getTemperatureThresholds(); + android.hardware.thermal.TemperatureThreshold[] getTemperatureThresholdsWithType(in android.hardware.thermal.TemperatureType type); + void registerThermalChangedCallback(in android.hardware.thermal.IThermalChangedCallback callback); + void registerThermalChangedCallbackWithType(in android.hardware.thermal.IThermalChangedCallback callback, in android.hardware.thermal.TemperatureType type); + void unregisterThermalChangedCallback(in android.hardware.thermal.IThermalChangedCallback callback); +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/IThermalChangedCallback.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/IThermalChangedCallback.aidl new file mode 100644 index 0000000000..5e1d753d18 --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/IThermalChangedCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@VintfStability +interface IThermalChangedCallback { + oneway void notifyThrottling(in android.hardware.thermal.Temperature temperature); +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/Temperature.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/Temperature.aidl new file mode 100644 index 0000000000..ce70ab844f --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/Temperature.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@JavaDerive(toString=true) @VintfStability +parcelable Temperature { + android.hardware.thermal.TemperatureType type; + String name; + float value; + android.hardware.thermal.ThrottlingSeverity throttlingStatus; +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/TemperatureThreshold.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/TemperatureThreshold.aidl new file mode 100644 index 0000000000..a384d19600 --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/TemperatureThreshold.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@JavaDerive(toString=true) @VintfStability +parcelable TemperatureThreshold { + android.hardware.thermal.TemperatureType type; + String name; + float[] hotThrottlingThresholds; + float[] coldThrottlingThresholds; +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/TemperatureType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/TemperatureType.aidl new file mode 100644 index 0000000000..fb0b0b3e7b --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/TemperatureType.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@Backing(type="int") @VintfStability +enum TemperatureType { + UNKNOWN = (-1) /* -1 */, + CPU = 0, + GPU = 1, + BATTERY = 2, + SKIN = 3, + USB_PORT = 4, + POWER_AMPLIFIER = 5, + BCL_VOLTAGE = 6, + BCL_CURRENT = 7, + BCL_PERCENTAGE = 8, + NPU = 9, + TPU = 10, + DISPLAY = 11, + MODEM = 12, + SOC = 13, +} diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/ThrottlingSeverity.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/ThrottlingSeverity.aidl new file mode 100644 index 0000000000..183344d45b --- /dev/null +++ b/thermal/aidl/aidl_api/android.hardware.thermal/1/android/hardware/thermal/ThrottlingSeverity.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.thermal; +/* @hide */ +@Backing(type="int") @VintfStability +enum ThrottlingSeverity { + NONE = 0, + LIGHT, + MODERATE, + SEVERE, + CRITICAL, + EMERGENCY, + SHUTDOWN, +} diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp index 73c5dd2c8d..835fbfa85a 100644 --- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp +++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp @@ -95,20 +95,15 @@ class ThermalAidlTest : public testing::TestWithParam { mThermalCallback = ndk::SharedRefBase::make(); ASSERT_NE(mThermalCallback, nullptr); - auto status = mThermal->registerThermalChangedCallback(mThermalCallback); - ASSERT_TRUE(status.isOk()); - // Expect to fail if register again - status = mThermal->registerThermalChangedCallback(mThermalCallback); - ASSERT_FALSE(status.isOk()); - ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + ::ndk::ScopedAStatus status = mThermal->registerThermalChangedCallback(mThermalCallback); + ASSERT_TRUE(status.isOk()) << status.getMessage(); } void TearDown() override { - auto status = mThermal->unregisterThermalChangedCallback(mThermalCallback); - ASSERT_TRUE(status.isOk()); + ::ndk::ScopedAStatus status = mThermal->unregisterThermalChangedCallback(mThermalCallback); + ASSERT_TRUE(status.isOk()) << status.getMessage(); // Expect to fail if unregister again status = mThermal->unregisterThermalChangedCallback(mThermalCallback); - ASSERT_FALSE(status.isOk()); ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); } @@ -121,11 +116,142 @@ class ThermalAidlTest : public testing::TestWithParam { // This just calls into and back from our local ThermalChangedCallback impl. TEST_P(ThermalAidlTest, NotifyThrottlingTest) { std::shared_ptr thermalCallback = ndk::SharedRefBase::make(); - auto ret = thermalCallback->notifyThrottling(kThrottleTemp); - ASSERT_TRUE(ret.isOk()); + ::ndk::ScopedAStatus status = thermalCallback->notifyThrottling(kThrottleTemp); + ASSERT_TRUE(status.isOk()) << status.getMessage(); ASSERT_TRUE(thermalCallback->waitForCallback(200ms)); } +// Test Thermal->registerThermalChangedCallback. +TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackTest) { + // Expect to fail with same callback + ::ndk::ScopedAStatus status = mThermal->registerThermalChangedCallback(mThermalCallback); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + // Expect to fail with null callback + status = mThermal->registerThermalChangedCallback(nullptr); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + std::shared_ptr localThermalCallback = + ndk::SharedRefBase::make(); + // Expect to succeed with different callback + status = mThermal->registerThermalChangedCallback(localThermalCallback); + ASSERT_TRUE(status.isOk()) << status.getMessage(); + // Remove the local callback + status = mThermal->unregisterThermalChangedCallback(localThermalCallback); + ASSERT_TRUE(status.isOk()) << status.getMessage(); + // Expect to fail with null callback + status = mThermal->unregisterThermalChangedCallback(nullptr); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); +} + +// Test Thermal->registerThermalChangedCallbackWithType. +TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackWithTypeTest) { + // Expect to fail with same callback + ::ndk::ScopedAStatus status = mThermal->registerThermalChangedCallbackWithType( + mThermalCallback, TemperatureType::SKIN); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + // Expect to fail with null callback + status = mThermal->registerThermalChangedCallbackWithType(nullptr, TemperatureType::SKIN); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + std::shared_ptr localThermalCallback = + ndk::SharedRefBase::make(); + // Expect to succeed with different callback + status = mThermal->registerThermalChangedCallbackWithType(localThermalCallback, + TemperatureType::SKIN); + ASSERT_TRUE(status.isOk()) << status.getMessage(); + // Remove the local callback + status = mThermal->unregisterThermalChangedCallback(localThermalCallback); + ASSERT_TRUE(status.isOk()) << status.getMessage(); + // Expect to fail with null callback + status = mThermal->unregisterThermalChangedCallback(nullptr); + ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); +} + +// Test Thermal->getCurrentTemperatures(). +TEST_P(ThermalAidlTest, TemperatureTest) { + std::vector ret; + ::ndk::ScopedAStatus status = mThermal->getTemperatures(&ret); + if (status.isOk()) { + for (auto& i : ret) { + EXPECT_LT(0u, i.name.size()); + LOG(INFO) << i.name + " " + toString(i.type) << "\n"; + } + } else { + ASSERT_EQ(EX_ILLEGAL_STATE, status.getExceptionCode()); + } + + auto types = ::ndk::enum_range(); + for (const auto& type : types) { + status = mThermal->getTemperaturesWithType(type, &ret); + + if (status.isOk()) { + for (auto& i : ret) { + EXPECT_EQ(type, i.type) << "Expect type " + toString(type) + " but got " + + toString(i.type) + " for " + i.name; + EXPECT_LT(0u, i.name.size()); + } + } else { + ASSERT_EQ(EX_ILLEGAL_STATE, status.getExceptionCode()); + } + } +} + +// Test Thermal->getTemperatureThresholds(). +TEST_P(ThermalAidlTest, TemperatureThresholdTest) { + std::vector ret; + ::ndk::ScopedAStatus status = mThermal->getTemperatureThresholds(&ret); + if (status.isOk()) { + for (auto& i : ret) { + EXPECT_LT(0u, i.name.size()); + LOG(INFO) << i.name + " " + toString(i.type) << "\n"; + } + } else { + ASSERT_EQ(EX_ILLEGAL_STATE, status.getExceptionCode()); + } + + auto types = ::ndk::enum_range(); + for (const auto& type : types) { + status = mThermal->getTemperatureThresholdsWithType(type, &ret); + + if (status.isOk()) { + for (auto& i : ret) { + EXPECT_EQ(type, i.type) << "Expect type " + toString(type) + " but got " + + toString(i.type) + " for " + i.name; + EXPECT_LT(0u, i.name.size()); + } + } else { + ASSERT_EQ(EX_ILLEGAL_STATE, status.getExceptionCode()); + } + } +} + +// Test Thermal->getCoolingDevices(). +TEST_P(ThermalAidlTest, CoolingDeviceTest) { + std::vector ret; + ::ndk::ScopedAStatus status = mThermal->getCoolingDevices(&ret); + if (status.isOk()) { + for (auto& i : ret) { + EXPECT_LT(0u, i.name.size()); + LOG(INFO) << i.name + " " + toString(i.type) << "\n"; + } + } else { + ASSERT_EQ(EX_ILLEGAL_STATE, status.getExceptionCode()); + } + + auto types = ::ndk::enum_range(); + for (const auto& type : types) { + status = mThermal->getCoolingDevicesWithType(type, &ret); + if (status.isOk()) { + ASSERT_TRUE(status.isOk()); + for (auto& i : ret) { + EXPECT_EQ(type, i.type) << "Expect type " + toString(type) + " but got " + + toString(i.type) + " for " + i.name; + EXPECT_LT(0u, i.name.size()); + } + } else { + ASSERT_EQ(EX_ILLEGAL_STATE, status.getExceptionCode()); + } + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThermalAidlTest); INSTANTIATE_TEST_SUITE_P( Thermal, ThermalAidlTest, @@ -133,6 +259,7 @@ INSTANTIATE_TEST_SUITE_P( ::android::PrintInstanceNameToString); } // namespace +} // namespace aidl::android::hardware::thermal int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); @@ -140,5 +267,3 @@ int main(int argc, char** argv) { ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); } - -} // namespace aidl::android::hardware::thermal diff --git a/automotive/vehicle/aidl/impl/default_config/Android.bp b/thermal/utils/Android.bp similarity index 62% rename from automotive/vehicle/aidl/impl/default_config/Android.bp rename to thermal/utils/Android.bp index 0feaf23a73..72e1e34f9d 100644 --- a/automotive/vehicle/aidl/impl/default_config/Android.bp +++ b/thermal/utils/Android.bp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,14 +18,21 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -cc_library_headers { - name: "VehicleHalDefaultConfig", - vendor: true, - local_include_dirs: ["include"], +cc_library_static { + name: "libthermalutils", + vendor_available: true, export_include_dirs: ["include"], - defaults: ["VehicleHalDefaults"], - static_libs: ["VehicleHalUtils"], - header_libs: ["VehicleHalTestUtilHeaders"], - export_static_lib_headers: ["VehicleHalUtils"], - export_header_lib_headers: ["VehicleHalTestUtilHeaders"], + srcs: [ + "ThermalHidlWrapper.cpp", + ], + + cflags: [ + "-Wall", + "-Werror", + ], + + shared_libs: [ + "android.hardware.thermal@2.0", + "android.hardware.thermal-V1-ndk", + ], } diff --git a/thermal/utils/ThermalHidlWrapper.cpp b/thermal/utils/ThermalHidlWrapper.cpp new file mode 100644 index 0000000000..05a992a792 --- /dev/null +++ b/thermal/utils/ThermalHidlWrapper.cpp @@ -0,0 +1,305 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "include/thermalutils/ThermalHidlWrapper.h" + +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace thermal { + +using ::android::hardware::Void; + +namespace { + +template +Return setFailureAndCallback(T _hidl_cb, hidl_vec data, std::string_view debug_msg) { + ThermalStatus status; + status.code = ThermalStatusCode::FAILURE; + status.debugMessage = debug_msg.data(); + _hidl_cb(status, data); + return Void(); +} + +template +Return setFailureAndCallback(T _hidl_cb, std::string_view debug_msg) { + ThermalStatus status; + status.code = ThermalStatusCode::FAILURE; + status.debugMessage = debug_msg.data(); + _hidl_cb(status); + return Void(); +} + +template +Return setInitFailureAndCallback(T _hidl_cb, hidl_vec data) { + return setFailureAndCallback( + _hidl_cb, data, "Thermal AIDL HAL client used by HIDL wrapper was not initialized"); +} + +template +Return setInitFailureAndCallback(T _hidl_cb) { + return setFailureAndCallback( + _hidl_cb, "Thermal AIDL HAL client used by HIDL wrapper was not initialized"); +} + +template +Return setUnsupportedFailureAndCallback(T _hidl_cb, hidl_vec data) { + return setFailureAndCallback(_hidl_cb, data, "Operation unsupported by Thermal HIDL wrapper"); +} + +TemperatureType_2_0 convertAidlTemperatureType(const TemperatureType& type) { + if (type < TemperatureType::CPU || type > TemperatureType::NPU) { + return TemperatureType_2_0::UNKNOWN; + } + return static_cast(type); +} + +CoolingType_2_0 convertAidlCoolingType(const CoolingType& type) { + if (type < CoolingType::FAN || type > CoolingType::COMPONENT) { + return CoolingType_2_0::COMPONENT; + } + return static_cast(type); +} + +Temperature_2_0 convertAidlTemperature(const Temperature& temperature) { + Temperature_2_0 t = Temperature_2_0{ + convertAidlTemperatureType(temperature.type), temperature.name, temperature.value, + static_cast(temperature.throttlingStatus)}; + return t; +} + +CoolingDevice_2_0 convertAidlCoolingDevice(const CoolingDevice& cooling_device) { + CoolingDevice_2_0 t = + CoolingDevice_2_0{convertAidlCoolingType(cooling_device.type), cooling_device.name, + static_cast(cooling_device.value)}; + return t; +} +TemperatureThreshold_2_0 convertAidlTemperatureThreshold(const TemperatureThreshold& threshold) { + TemperatureThreshold_2_0 t = + TemperatureThreshold_2_0{convertAidlTemperatureType(threshold.type), threshold.name, + threshold.hotThrottlingThresholds.data(), + threshold.coldThrottlingThresholds.data(), NAN}; + return t; +} + +} // namespace + +// Methods from ::android::hardware::thermal::V1_0::IThermal follow. +Return ThermalHidlWrapper::getTemperatures(getTemperatures_cb _hidl_cb) { + hidl_vec ret_1_0; + setUnsupportedFailureAndCallback(_hidl_cb, ret_1_0); + return Void(); +} + +Return ThermalHidlWrapper::getCpuUsages( + std::function&)> _hidl_cb) { + hidl_vec ret_1_0; + setUnsupportedFailureAndCallback(_hidl_cb, ret_1_0); + return Void(); +} + +Return ThermalHidlWrapper::getCoolingDevices( + std::function&)> _hidl_cb) { + hidl_vec ret_1_0; + setUnsupportedFailureAndCallback(_hidl_cb, ret_1_0); + return Void(); +} + +// Methods from ::android::hardware::thermal::V2_0::IThermal follow. +Return ThermalHidlWrapper::getCurrentTemperatures( + bool filterType, TemperatureType_2_0 type, + std::function&)> _hidl_cb) { + hidl_vec ret_2_0; + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb, ret_2_0); + } + + std::vector ret_aidl; + ThermalStatus status; + ::ndk::ScopedAStatus a_status; + if (filterType) { + a_status = thermal_service_->getTemperaturesWithType(static_cast(type), + &ret_aidl); + } else { + a_status = thermal_service_->getTemperatures(&ret_aidl); + } + if (a_status.isOk()) { + std::vector ret; + for (const auto& temperature : ret_aidl) { + ret.push_back(convertAidlTemperature(temperature)); + } + _hidl_cb(status, hidl_vec(ret)); + } else { + setFailureAndCallback(_hidl_cb, ret_2_0, a_status.getMessage()); + } + return Void(); +} + +Return ThermalHidlWrapper::getTemperatureThresholds( + bool filterType, TemperatureType_2_0 type, + std::function&)> + _hidl_cb) { + hidl_vec ret_2_0; + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb, ret_2_0); + } + + std::vector ret_aidl; + ThermalStatus status; + ::ndk::ScopedAStatus a_status; + if (filterType) { + a_status = thermal_service_->getTemperatureThresholdsWithType( + static_cast(type), &ret_aidl); + } else { + a_status = thermal_service_->getTemperatureThresholds(&ret_aidl); + } + if (a_status.isOk()) { + std::vector ret; + for (const auto& threshold : ret_aidl) { + ret.push_back(convertAidlTemperatureThreshold(threshold)); + } + _hidl_cb(status, hidl_vec(ret)); + } else { + setFailureAndCallback(_hidl_cb, ret_2_0, a_status.getMessage()); + } + return Void(); +} + +Return ThermalHidlWrapper::registerThermalChangedCallback( + const sp& callback, bool filterType, TemperatureType_2_0 type, + std::function _hidl_cb) { + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb); + } + if (callback == nullptr) { + setFailureAndCallback(_hidl_cb, "Invalid nullptr callback"); + return Void(); + } + std::lock_guard _lock(callback_wrappers_mutex_); + for (const auto& callback_wrapper : callback_wrappers_) { + if (::android::hardware::interfacesEqual(callback_wrapper->callback_2_0_.get(), + callback.get())) { + setFailureAndCallback(_hidl_cb, "The callback was already registered through wrapper"); + return Void(); + } + } + std::shared_ptr callback_wrapper = + ndk::SharedRefBase::make(callback); + ::ndk::ScopedAStatus a_status; + ThermalStatus status; + if (filterType) { + a_status = thermal_service_->registerThermalChangedCallbackWithType( + callback_wrapper, static_cast(type)); + } else { + a_status = thermal_service_->registerThermalChangedCallback(callback_wrapper); + } + if (a_status.isOk()) { + callback_wrappers_.push_back(callback_wrapper); + _hidl_cb(status); + } else { + setFailureAndCallback(_hidl_cb, a_status.getMessage()); + } + return Void(); +} + +Return ThermalHidlWrapper::unregisterThermalChangedCallback( + const sp& callback, + std::function _hidl_cb) { + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb); + } + if (callback == nullptr) { + setFailureAndCallback(_hidl_cb, "Invalid nullptr callback"); + return Void(); + } + std::lock_guard _lock(callback_wrappers_mutex_); + for (auto it = callback_wrappers_.begin(); it != callback_wrappers_.end(); it++) { + auto callback_wrapper = *it; + if (::android::hardware::interfacesEqual(callback_wrapper->callback_2_0_.get(), + callback.get())) { + ::ndk::ScopedAStatus a_status; + ThermalStatus status; + a_status = thermal_service_->unregisterThermalChangedCallback(callback_wrapper); + if (a_status.isOk()) { + callback_wrappers_.erase(it); + _hidl_cb(status); + } else { + setFailureAndCallback(_hidl_cb, a_status.getMessage()); + } + return Void(); + } + } + setFailureAndCallback(_hidl_cb, "The callback was not registered through wrapper before"); + return Void(); +} + +Return ThermalHidlWrapper::getCurrentCoolingDevices( + bool filterType, CoolingType_2_0 type, + std::function&)> _hidl_cb) { + hidl_vec ret_2_0; + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb, ret_2_0); + } + + std::vector ret_aidl; + ThermalStatus status; + ::ndk::ScopedAStatus a_status; + if (filterType) { + a_status = thermal_service_->getCoolingDevicesWithType(static_cast(type), + &ret_aidl); + } else { + a_status = thermal_service_->getCoolingDevices(&ret_aidl); + } + if (a_status.isOk()) { + std::vector ret; + for (const auto& cooling_device : ret_aidl) { + ret.push_back(convertAidlCoolingDevice(cooling_device)); + } + _hidl_cb(status, hidl_vec(ret)); + } else { + setFailureAndCallback(_hidl_cb, ret_2_0, a_status.getMessage()); + } + return Void(); +} + +// Methods from ::android::hidl::base::V1_0::IBase follow. +Return ThermalHidlWrapper::debug(const hidl_handle& handle, + const hidl_vec& args) { + if (handle != nullptr && handle->numFds >= 1) { + int fd = handle->data[0]; + char** arr = new char*[args.size()]; + for (size_t i = 0; i < args.size(); i++) { + arr[i] = strdup(args[i].c_str()); + } + thermal_service_->dump(fd, (const char**)arr, args.size()); + } + return Void(); +} + +::ndk::ScopedAStatus ThermalHidlWrapper::IThermalChangedCallbackWrapper::notifyThrottling( + const Temperature& temperature) { + callback_2_0_->notifyThrottling(convertAidlTemperature(temperature)); + return ::ndk::ScopedAStatus::ok(); +} + +} // namespace thermal +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/thermal/utils/include/thermalutils/ThermalHidlWrapper.h b/thermal/utils/include/thermalutils/ThermalHidlWrapper.h new file mode 100644 index 0000000000..1fec10076f --- /dev/null +++ b/thermal/utils/include/thermalutils/ThermalHidlWrapper.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace thermal { + +using ::android::sp; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_handle; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; + +using IThermal_Aidl = ::aidl::android::hardware::thermal::IThermal; +using ::android::hardware::thermal::V1_0::CpuUsage; +using CoolingType_2_0 = ::android::hardware::thermal::V2_0::CoolingType; +using CoolingDevice_1_0 = ::android::hardware::thermal::V1_0::CoolingDevice; +using CoolingDevice_2_0 = ::android::hardware::thermal::V2_0::CoolingDevice; +using IThermal_2_0 = ::android::hardware::thermal::V2_0::IThermal; +using IThermalChangedCallback_2_0 = ::android::hardware::thermal::V2_0::IThermalChangedCallback; +using Temperature_1_0 = ::android::hardware::thermal::V1_0::Temperature; +using Temperature_2_0 = ::android::hardware::thermal::V2_0::Temperature; +using TemperatureType_2_0 = ::android::hardware::thermal::V2_0::TemperatureType; + +using ::android::hardware::thermal::V1_0::ThermalStatus; +using ::android::hardware::thermal::V1_0::ThermalStatusCode; + +using TemperatureThreshold_2_0 = ::android::hardware::thermal::V2_0::TemperatureThreshold; +using ThrottlingSeverity_2_0 = ::android::hardware::thermal::V2_0::ThrottlingSeverity; + +// This wrapper converts all Thermal HIDL 2.0 calls to AIDL calls and converts AIDL response to +// HIDL 2.0 response. +// +// For Thermal HIDL 1.0 calls, it returns unsupported error. +class ThermalHidlWrapper : public IThermal_2_0 { + public: + explicit ThermalHidlWrapper(::std::shared_ptr thermal_service) + : thermal_service_(std::move(thermal_service)) {} + + // Methods from ::android::hardware::thermal::V1_0::IThermal follow. + Return getTemperatures(getTemperatures_cb _hidl_cb) override; + Return getCpuUsages(getCpuUsages_cb _hidl_cb) override; + Return getCoolingDevices(getCoolingDevices_cb _hidl_cb) override; + + // Methods from ::android::hardware::thermal::V2_0::IThermal follow. + Return getCurrentTemperatures(bool filterType, TemperatureType_2_0 type, + getCurrentTemperatures_cb _hidl_cb) override; + Return getTemperatureThresholds(bool filterType, TemperatureType_2_0 type, + getTemperatureThresholds_cb _hidl_cb) override; + Return registerThermalChangedCallback( + const sp& callback, bool filterType, + TemperatureType_2_0 type, registerThermalChangedCallback_cb _hidl_cb) override; + Return unregisterThermalChangedCallback( + const sp& callback, + unregisterThermalChangedCallback_cb _hidl_cb) override; + Return getCurrentCoolingDevices(bool filterType, CoolingType_2_0 type, + getCurrentCoolingDevices_cb _hidl_cb) override; + + // Methods from ::android::hidl::base::V1_0::IBase follow. + Return debug(const hidl_handle& handle, const hidl_vec& args) override; + + private: + class IThermalChangedCallbackWrapper : public BnThermalChangedCallback { + public: + explicit IThermalChangedCallbackWrapper(const sp& callback_2_0) + : callback_2_0_(callback_2_0) {} + ::ndk::ScopedAStatus notifyThrottling(const Temperature& temperature) override; + sp callback_2_0_; + }; + + // Reference to thermal service. + ::std::shared_ptr thermal_service_; + // Mutex lock for read/write on callback wrappers. + std::mutex callback_wrappers_mutex_; + // All thermal changed callback wrappers registered. + ::std::vector> callback_wrappers_; +}; + +} // namespace thermal +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/thermal/utils/tests/Android.bp b/thermal/utils/tests/Android.bp new file mode 100644 index 0000000000..fd74e8b4e8 --- /dev/null +++ b/thermal/utils/tests/Android.bp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "ThermalHidlWrapperTest", + srcs: ["ThermalHidlWrapperTest.cpp"], + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + shared_libs: [ + "libbinder_ndk", + "android.hardware.thermal@1.0", + "android.hardware.thermal@2.0", + "android.hardware.thermal-V1-ndk", + ], + static_libs: [ + "libthermalutils", + "libgtest", + ], + test_suites: [ + "device-tests", + ], +} diff --git a/thermal/utils/tests/ThermalHidlWrapperTest.cpp b/thermal/utils/tests/ThermalHidlWrapperTest.cpp new file mode 100644 index 0000000000..1723a1afa8 --- /dev/null +++ b/thermal/utils/tests/ThermalHidlWrapperTest.cpp @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "thermal_hidl_wrapper_test" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::thermal { + +namespace { + +using ::android::sp; +using ::android::hardware::hidl_enum_range; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; + +using ::android::hardware::thermal::V1_0::ThermalStatus; +using ::android::hardware::thermal::V1_0::ThermalStatusCode; +using ::android::hardware::thermal::V2_0::CoolingDevice; +using ::android::hardware::thermal::V2_0::CoolingType; +using IThermal_2_0 = ::android::hardware::thermal::V2_0::IThermal; +using ::android::hardware::thermal::V2_0::IThermalChangedCallback; +using ::android::hardware::thermal::V2_0::Temperature; +using ::android::hardware::thermal::V2_0::TemperatureThreshold; +using ::android::hardware::thermal::V2_0::TemperatureType; +using ::android::hardware::thermal::V2_0::ThrottlingSeverity; + +constexpr char kCallbackNameNotifyThrottling[] = "notifyThrottling"; +static const Temperature kThrottleTemp = { + .type = TemperatureType::SKIN, + .name = "test temperature sensor", + .value = 98.6, + .throttlingStatus = ThrottlingSeverity::CRITICAL, +}; + +class ThermalCallbackArgs { + public: + Temperature temperature; +}; + +// Callback class for receiving thermal event notifications from main class +class ThermalCallback : public ::testing::VtsHalHidlTargetCallbackBase, + public IThermalChangedCallback { + public: + Return notifyThrottling(const Temperature& temperature) override { + ThermalCallbackArgs args; + args.temperature = temperature; + NotifyFromCallback(kCallbackNameNotifyThrottling, args); + return Void(); + } +}; + +// The main test class for THERMAL HIDL HAL 2.0. +class ThermalHidlWrapperTest : public ::testing::TestWithParam { + public: + void SetUp() override { + AIBinder* binder = AServiceManager_waitForService(GetParam().c_str()); + ASSERT_NE(binder, nullptr); + mThermal = sp::make(IThermal::fromBinder(ndk::SpAIBinder(binder))); + ASSERT_NE(mThermal, nullptr); + mThermalCallback = new (std::nothrow) ThermalCallback(); + ASSERT_NE(mThermalCallback, nullptr); + auto ret = mThermal->registerThermalChangedCallback( + mThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail if register again + ret = mThermal->registerThermalChangedCallback( + mThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + } + + void TearDown() override { + auto ret = mThermal->unregisterThermalChangedCallback( + mThermalCallback, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail if unregister again + ret = mThermal->unregisterThermalChangedCallback( + mThermalCallback, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + } + + protected: + sp mThermal; + sp mThermalCallback; +}; // class ThermalHidlWrapperTest + +// Test ThermalChangedCallback::notifyThrottling(). +// This just calls into and back from our local ThermalChangedCallback impl. +TEST_P(ThermalHidlWrapperTest, NotifyThrottlingTest) { + sp thermalCallback = new (std::nothrow) ThermalCallback(); + auto ret = thermalCallback->notifyThrottling(kThrottleTemp); + ASSERT_TRUE(ret.isOk()); + auto res = thermalCallback->WaitForCallback(kCallbackNameNotifyThrottling); + EXPECT_TRUE(res.no_timeout); + ASSERT_TRUE(res.args); + EXPECT_EQ(kThrottleTemp, res.args->temperature); +} + +// Test Thermal->registerThermalChangedCallback. +TEST_P(ThermalHidlWrapperTest, RegisterThermalChangedCallbackTest) { + // Expect to fail with same callback + auto ret = mThermal->registerThermalChangedCallback( + mThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::FAILURE, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail with null callback + ret = mThermal->registerThermalChangedCallback( + nullptr, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::FAILURE, status.code); }); + ASSERT_TRUE(ret.isOk()); + sp localThermalCallback = new (std::nothrow) ThermalCallback(); + // Expect to succeed with different callback + ret = mThermal->registerThermalChangedCallback( + localThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Remove the local callback + ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail with null callback + ret = mThermal->unregisterThermalChangedCallback(nullptr, [](ThermalStatus status) { + EXPECT_EQ(ThermalStatusCode::FAILURE, status.code); + }); + ASSERT_TRUE(ret.isOk()); +} + +// Test Thermal->unregisterThermalChangedCallback. +TEST_P(ThermalHidlWrapperTest, UnregisterThermalChangedCallbackTest) { + sp localThermalCallback = new (std::nothrow) ThermalCallback(); + // Expect to fail as the callback was not registered before + auto ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Register a local callback + ret = mThermal->registerThermalChangedCallback( + localThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to succeed with callback removed + ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail as the callback has been unregistered already + ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); +} + +// Sanity test for Thermal::getCurrentTemperatures(). +TEST_P(ThermalHidlWrapperTest, TemperatureTest) { + mThermal->getCurrentTemperatures(false, TemperatureType::SKIN, + [](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_LT(0u, temperatures[i].name.size()); + } + }); + auto types = hidl_enum_range(); + for (const auto& type : types) { + mThermal->getCurrentTemperatures( + true, type, [&type](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_EQ(type, temperatures[i].type); + EXPECT_LT(0u, temperatures[i].name.size()); + } + }); + } +} + +// Sanity test for Thermal::getTemperatureThresholds(). +TEST_P(ThermalHidlWrapperTest, TemperatureThresholdTest) { + mThermal->getTemperatureThresholds( + false, TemperatureType::SKIN, + [](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + }); + for (int i = static_cast(TemperatureType::UNKNOWN); + i <= static_cast(TemperatureType::POWER_AMPLIFIER); ++i) { + auto type = static_cast(i); + mThermal->getTemperatureThresholds( + true, type, + [&type](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_EQ(type, temperatures[i].type); + } + }); + } +} + +// Sanity test for Thermal::getCurrentCoolingDevices(). +TEST_P(ThermalHidlWrapperTest, CoolingDeviceTest) { + mThermal->getCurrentCoolingDevices( + false, CoolingType::CPU, + [](ThermalStatus status, hidl_vec cooling_devices) { + if (cooling_devices.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < cooling_devices.size(); ++i) { + EXPECT_LT(0u, cooling_devices[i].name.size()); + } + }); + for (int i = 0; i <= static_cast(CoolingType::COMPONENT); ++i) { + auto type = static_cast(i); + mThermal->getCurrentCoolingDevices( + true, type, [&type](ThermalStatus status, hidl_vec cooling_devices) { + if (cooling_devices.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < cooling_devices.size(); ++i) { + EXPECT_EQ(type, cooling_devices[i].type); + EXPECT_LT(0u, cooling_devices[i].name.size()); + } + }); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThermalHidlWrapperTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, ThermalHidlWrapperTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IThermal::descriptor)), + ::android::hardware::PrintInstanceNameToString); + +} // namespace + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} + +} // namespace aidl::android::hardware::thermal diff --git a/tv/cec/1.0/default/HdmiCec.cpp b/tv/cec/1.0/default/HdmiCec.cpp index 74de785e81..f05f610d4c 100644 --- a/tv/cec/1.0/default/HdmiCec.cpp +++ b/tv/cec/1.0/default/HdmiCec.cpp @@ -307,6 +307,9 @@ Return HdmiCec::getPhysicalAddress(getPhysicalAddress_cb _hidl_cb) { } Return HdmiCec::sendMessage(const CecMessage& message) { + if (message.body.size() > CEC_MESSAGE_BODY_MAX_LENGTH) { + return SendMessageResult::FAIL; + } cec_message_t legacyMessage { .initiator = static_cast(message.initiator), .destination = static_cast(message.destination), diff --git a/tv/cec/1.0/default/HdmiCecDefault.cpp b/tv/cec/1.0/default/HdmiCecDefault.cpp index 26ccb7d42e..2a5197cb4a 100644 --- a/tv/cec/1.0/default/HdmiCecDefault.cpp +++ b/tv/cec/1.0/default/HdmiCecDefault.cpp @@ -278,6 +278,10 @@ Return HdmiCecDefault::enableAudioReturnChannel(int32_t /*portId*/, bool / Return HdmiCecDefault::isConnected(int32_t portId) { uint16_t addr; + if (portId < 0 || portId >= mHdmiCecPorts.size()) { + LOG(ERROR) << "Port id is out of bounds, portId = " << portId; + return false; + } int ret = ioctl(mHdmiCecPorts[portId]->mCecFd, CEC_ADAP_G_PHYS_ADDR, &addr); if (ret) { LOG(ERROR) << "Is connected failed, Error = " << strerror(errno); diff --git a/tv/hdmi/cec/aidl/Android.bp b/tv/hdmi/cec/aidl/Android.bp index 1bd9e41a9d..53cb5a9246 100644 --- a/tv/hdmi/cec/aidl/Android.bp +++ b/tv/hdmi/cec/aidl/Android.bp @@ -26,4 +26,12 @@ aidl_interface { sdk_version: "module_current", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/.hash b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/.hash new file mode 100644 index 0000000000..8a30199a90 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/.hash @@ -0,0 +1 @@ +cd956e3a0c2e6ade71693c85e9f0aeffa221ea26 diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/AbortReason.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/AbortReason.aidl new file mode 100644 index 0000000000..45b973a74f --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/AbortReason.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@Backing(type="int") @VintfStability +enum AbortReason { + UNRECOGNIZED_MODE = 0, + NOT_IN_CORRECT_MODE = 1, + CANNOT_PROVIDE_SOURCE = 2, + INVALID_OPERAND = 3, + REFUSED = 4, + UNABLE_TO_DETERMINE = 5, +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecDeviceType.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecDeviceType.aidl new file mode 100644 index 0000000000..4f7e247bf7 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecDeviceType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@Backing(type="byte") @VintfStability +enum CecDeviceType { + INACTIVE = (-1) /* -1 */, + TV = 0, + RECORDER = 1, + TUNER = 3, + PLAYBACK = 4, + AUDIO_SYSTEM = 5, +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl new file mode 100644 index 0000000000..1fc9fb7eee --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@Backing(type="byte") @VintfStability +enum CecLogicalAddress { + TV = 0, + RECORDER_1 = 1, + RECORDER_2 = 2, + TUNER_1 = 3, + PLAYBACK_1 = 4, + AUDIO_SYSTEM = 5, + TUNER_2 = 6, + TUNER_3 = 7, + PLAYBACK_2 = 8, + RECORDER_3 = 9, + TUNER_4 = 10, + PLAYBACK_3 = 11, + BACKUP_1 = 12, + BACKUP_2 = 13, + FREE_USE = 14, + BROADCAST = 15, + UNREGISTERED = 15, +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecMessage.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecMessage.aidl new file mode 100644 index 0000000000..9de07ec8c8 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecMessage.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@VintfStability +parcelable CecMessage { + android.hardware.tv.hdmi.cec.CecLogicalAddress initiator; + android.hardware.tv.hdmi.cec.CecLogicalAddress destination; + byte[] body; + const int MAX_MESSAGE_BODY_LENGTH = 15; +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecMessageType.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecMessageType.aidl new file mode 100644 index 0000000000..20472f0192 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/CecMessageType.aidl @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@Backing(type="int") @VintfStability +enum CecMessageType { + FEATURE_ABORT = 0x00, + IMAGE_VIEW_ON = 0x04, + TUNER_STEP_INCREMENT = 0x05, + TUNER_STEP_DECREMENT = 0x06, + TUNER_DEVICE_STATUS = 0x07, + GIVE_TUNER_DEVICE_STATUS = 0x08, + RECORD_ON = 0x09, + RECORD_STATUS = 0x0A, + RECORD_OFF = 0x0B, + TEXT_VIEW_ON = 0x0D, + RECORD_TV_SCREEN = 0x0F, + GIVE_DECK_STATUS = 0x1A, + DECK_STATUS = 0x1B, + SET_MENU_LANGUAGE = 0x32, + CLEAR_ANALOG_TIMER = 0x33, + SET_ANALOG_TIMER = 0x34, + TIMER_STATUS = 0x35, + STANDBY = 0x36, + PLAY = 0x41, + DECK_CONTROL = 0x42, + TIMER_CLEARED_STATUS = 0x43, + USER_CONTROL_PRESSED = 0x44, + USER_CONTROL_RELEASED = 0x45, + GIVE_OSD_NAME = 0x46, + SET_OSD_NAME = 0x47, + SET_OSD_STRING = 0x64, + SET_TIMER_PROGRAM_TITLE = 0x67, + SYSTEM_AUDIO_MODE_REQUEST = 0x70, + GIVE_AUDIO_STATUS = 0x71, + SET_SYSTEM_AUDIO_MODE = 0x72, + REPORT_AUDIO_STATUS = 0x7A, + GIVE_SYSTEM_AUDIO_MODE_STATUS = 0x7D, + SYSTEM_AUDIO_MODE_STATUS = 0x7E, + ROUTING_CHANGE = 0x80, + ROUTING_INFORMATION = 0x81, + ACTIVE_SOURCE = 0x82, + GIVE_PHYSICAL_ADDRESS = 0x83, + REPORT_PHYSICAL_ADDRESS = 0x84, + REQUEST_ACTIVE_SOURCE = 0x85, + SET_STREAM_PATH = 0x86, + DEVICE_VENDOR_ID = 0x87, + VENDOR_COMMAND = 0x89, + VENDOR_REMOTE_BUTTON_DOWN = 0x8A, + VENDOR_REMOTE_BUTTON_UP = 0x8B, + GIVE_DEVICE_VENDOR_ID = 0x8C, + MENU_REQUEST = 0x8D, + MENU_STATUS = 0x8E, + GIVE_DEVICE_POWER_STATUS = 0x8F, + REPORT_POWER_STATUS = 0x90, + GET_MENU_LANGUAGE = 0x91, + SELECT_ANALOG_SERVICE = 0x92, + SELECT_DIGITAL_SERVICE = 0x93, + SET_DIGITAL_TIMER = 0x97, + CLEAR_DIGITAL_TIMER = 0x99, + SET_AUDIO_RATE = 0x9A, + INACTIVE_SOURCE = 0x9D, + CEC_VERSION = 0x9E, + GET_CEC_VERSION = 0x9F, + VENDOR_COMMAND_WITH_ID = 0xA0, + CLEAR_EXTERNAL_TIMER = 0xA1, + SET_EXTERNAL_TIMER = 0xA2, + REPORT_SHORT_AUDIO_DESCRIPTOR = 0xA3, + REQUEST_SHORT_AUDIO_DESCRIPTOR = 0xA4, + INITIATE_ARC = 0xC0, + REPORT_ARC_INITIATED = 0xC1, + REPORT_ARC_TERMINATED = 0xC2, + REQUEST_ARC_INITIATION = 0xC3, + REQUEST_ARC_TERMINATION = 0xC4, + TERMINATE_ARC = 0xC5, + ABORT = 0xFF, + GIVE_FEATURES = 0xA5, + REPORT_FEATURES = 0xA6, + REQUEST_CURRENT_LATENCY = 0xA7, + REPORT_CURRENT_LATENCY = 0xA8, +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/IHdmiCec.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/IHdmiCec.aidl new file mode 100644 index 0000000000..c6060d1f47 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/IHdmiCec.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@VintfStability +interface IHdmiCec { + android.hardware.tv.hdmi.cec.Result addLogicalAddress(in android.hardware.tv.hdmi.cec.CecLogicalAddress addr); + void clearLogicalAddress(); + void enableAudioReturnChannel(in int portId, in boolean enable); + int getCecVersion(); + int getPhysicalAddress(); + int getVendorId(); + android.hardware.tv.hdmi.cec.SendMessageResult sendMessage(in android.hardware.tv.hdmi.cec.CecMessage message); + void setCallback(in @nullable android.hardware.tv.hdmi.cec.IHdmiCecCallback callback); + void setLanguage(in String language); + void enableWakeupByOtp(in boolean value); + void enableCec(in boolean value); + void enableSystemCecControl(in boolean value); +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl new file mode 100644 index 0000000000..43fdfbdb21 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@VintfStability +interface IHdmiCecCallback { + oneway void onCecMessage(in android.hardware.tv.hdmi.cec.CecMessage message); +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/Result.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/Result.aidl new file mode 100644 index 0000000000..c6828efb4e --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/Result.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@Backing(type="byte") @VintfStability +enum Result { + SUCCESS = 0, + FAILURE_UNKNOWN = 1, + FAILURE_INVALID_ARGS = 2, + FAILURE_INVALID_STATE = 3, + FAILURE_NOT_SUPPORTED = 4, + FAILURE_BUSY = 5, +} diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/SendMessageResult.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/SendMessageResult.aidl new file mode 100644 index 0000000000..87b50c9af1 --- /dev/null +++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/1/android/hardware/tv/hdmi/cec/SendMessageResult.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.cec; +@Backing(type="byte") @VintfStability +enum SendMessageResult { + SUCCESS = 0, + NACK = 1, + BUSY = 2, + FAIL = 3, +} diff --git a/tv/hdmi/connection/aidl/Android.bp b/tv/hdmi/connection/aidl/Android.bp index b342c52424..ff7e166b9e 100644 --- a/tv/hdmi/connection/aidl/Android.bp +++ b/tv/hdmi/connection/aidl/Android.bp @@ -26,4 +26,12 @@ aidl_interface { sdk_version: "module_current", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/tv/hdmi/connection/aidl/TEST_MAPPING b/tv/hdmi/connection/aidl/TEST_MAPPING new file mode 100644 index 0000000000..13cf0c2155 --- /dev/null +++ b/tv/hdmi/connection/aidl/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VtsHalTvHdmiConnectionAidlTargetTest" + } + ] +} diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/.hash b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/.hash new file mode 100644 index 0000000000..e11a015a88 --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/.hash @@ -0,0 +1 @@ +85c26fa47f3c3062aa93ffc8bb0897a85c8cb118 diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl new file mode 100644 index 0000000000..ac35c99f97 --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.connection; +@VintfStability +parcelable HdmiPortInfo { + android.hardware.tv.hdmi.connection.HdmiPortType type; + int portId; + boolean cecSupported; + boolean arcSupported; + boolean eArcSupported; + int physicalAddress; +} diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HdmiPortType.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HdmiPortType.aidl new file mode 100644 index 0000000000..fc2d7e5290 --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HdmiPortType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.connection; +@Backing(type="byte") @VintfStability +enum HdmiPortType { + INPUT = 0, + OUTPUT = 1, +} diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HpdSignal.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HpdSignal.aidl new file mode 100644 index 0000000000..697da2955d --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/HpdSignal.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.connection; +@Backing(type="byte") @VintfStability +enum HpdSignal { + HDMI_HPD_PHYSICAL = 0, + HDMI_HPD_STATUS_BIT = 1, +} diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl new file mode 100644 index 0000000000..cf7c4bdb5e --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.connection; +@VintfStability +interface IHdmiConnection { + android.hardware.tv.hdmi.connection.HdmiPortInfo[] getPortInfo(); + boolean isConnected(in int portId); + void setCallback(in android.hardware.tv.hdmi.connection.IHdmiConnectionCallback callback); + void setHpdSignal(android.hardware.tv.hdmi.connection.HpdSignal signal, in int portId); + android.hardware.tv.hdmi.connection.HpdSignal getHpdSignal(in int portId); +} diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl new file mode 100644 index 0000000000..f9f6856197 --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.connection; +@VintfStability +interface IHdmiConnectionCallback { + oneway void onHotplugEvent(in boolean connected, in int portId); +} diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/Result.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/Result.aidl new file mode 100644 index 0000000000..93182c51f2 --- /dev/null +++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/1/android/hardware/tv/hdmi/connection/Result.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.connection; +@VintfStability +enum Result { + SUCCESS = 0, + FAILURE_UNKNOWN = 1, + FAILURE_INVALID_ARGS = 2, + FAILURE_INVALID_STATE = 3, + FAILURE_NOT_SUPPORTED = 4, +} diff --git a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp index be6247b47e..8f4411bd8e 100644 --- a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp +++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp @@ -44,7 +44,7 @@ ScopedAStatus HdmiConnectionMock::getPortInfo(std::vector* _aidl_r ScopedAStatus HdmiConnectionMock::isConnected(int32_t portId, bool* _aidl_return) { // Maintain port connection status and update on hotplug event if (portId <= mTotalPorts && portId >= 1) { - *_aidl_return = mPortConnectionStatus[portId]; + *_aidl_return = mPortConnectionStatus.at(portId - 1); } else { *_aidl_return = false; } @@ -135,10 +135,10 @@ void HdmiConnectionMock::handleHotplugMessage(unsigned char* msgBuf) { ALOGD("[halimp_aidl] hot plug port id %x, is connected %x", (msgBuf[0] & 0xf), (msgBuf[3] & 0xf)); - mPortConnectionStatus[portId] = connected; - if (mPortInfos[portId].type == HdmiPortType::OUTPUT) { + mPortConnectionStatus.at(portId - 1) = connected; + if (mPortInfos.at(portId - 1).type == HdmiPortType::OUTPUT) { mPhysicalAddress = (connected ? 0xffff : ((msgBuf[1] << 8) | (msgBuf[2]))); - mPortInfos[portId].physicalAddress = mPhysicalAddress; + mPortInfos.at(portId - 1).physicalAddress = mPhysicalAddress; ALOGD("[halimp_aidl] hot plug physical address %x", mPhysicalAddress); } diff --git a/tv/hdmi/connection/aidl/vts/functional/AndroidTest.xml b/tv/hdmi/connection/aidl/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..5a7fed0285 --- /dev/null +++ b/tv/hdmi/connection/aidl/vts/functional/AndroidTest.xml @@ -0,0 +1,33 @@ + + + + diff --git a/tv/hdmi/earc/aidl/Android.bp b/tv/hdmi/earc/aidl/Android.bp index d76cc1bb34..d08e46d9a3 100644 --- a/tv/hdmi/earc/aidl/Android.bp +++ b/tv/hdmi/earc/aidl/Android.bp @@ -27,4 +27,12 @@ aidl_interface { sdk_version: "module_current", }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.tv.hdmi.connection-V1"], + }, + ], + frozen: true, + } diff --git a/tv/hdmi/earc/aidl/TEST_MAPPING b/tv/hdmi/earc/aidl/TEST_MAPPING new file mode 100644 index 0000000000..ccc48fc859 --- /dev/null +++ b/tv/hdmi/earc/aidl/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VtsHalTvHdmiEArcAidlTargetTest" + } + ] +} diff --git a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/.hash b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/.hash new file mode 100644 index 0000000000..856086ea9d --- /dev/null +++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/.hash @@ -0,0 +1 @@ +101230f18c7b8438921e517e80eea4ccc7c1e463 diff --git a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArc.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArc.aidl new file mode 100644 index 0000000000..1ea7df75a8 --- /dev/null +++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArc.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.earc; +@VintfStability +interface IEArc { + void setEArcEnabled(in boolean enabled); + boolean isEArcEnabled(); + void setCallback(in android.hardware.tv.hdmi.earc.IEArcCallback callback); + android.hardware.tv.hdmi.earc.IEArcStatus getState(in int portId); + byte[] getLastReportedAudioCapabilities(in int portId); +} diff --git a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArcCallback.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArcCallback.aidl new file mode 100644 index 0000000000..1730dcf1bc --- /dev/null +++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArcCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.earc; +@VintfStability +interface IEArcCallback { + oneway void onStateChange(in android.hardware.tv.hdmi.earc.IEArcStatus status, in int portId); + oneway void onCapabilitiesReported(in byte[] rawCapabilities, in int portId); +} diff --git a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArcStatus.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArcStatus.aidl new file mode 100644 index 0000000000..6dcbd8d49e --- /dev/null +++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/IEArcStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.earc; +@Backing(type="byte") @VintfStability +enum IEArcStatus { + IDLE = 0, + EARC_PENDING = 1, + ARC_PENDING = 2, + EARC_CONNECTED = 3, +} diff --git a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/Result.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/Result.aidl new file mode 100644 index 0000000000..b248f41f40 --- /dev/null +++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/1/android/hardware/tv/hdmi/earc/Result.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.hdmi.earc; +@VintfStability +enum Result { + SUCCESS = 0, + FAILURE_UNKNOWN = 1, + FAILURE_INVALID_ARGS = 2, + FAILURE_NOT_SUPPORTED = 4, +} diff --git a/tv/hdmi/earc/aidl/default/EArcMock.cpp b/tv/hdmi/earc/aidl/default/EArcMock.cpp index 93395fc269..0e92fbd1a0 100644 --- a/tv/hdmi/earc/aidl/default/EArcMock.cpp +++ b/tv/hdmi/earc/aidl/default/EArcMock.cpp @@ -54,7 +54,7 @@ ScopedAStatus EArcMock::isEArcEnabled(bool* _aidl_return) { ScopedAStatus EArcMock::getState(int32_t portId, IEArcStatus* _aidl_return) { // Maintain port connection status and update on hotplug event if (portId <= mTotalPorts && portId >= 1) { - *_aidl_return = mPortStatus[portId]; + *_aidl_return = mPortStatus.at(portId - 1); } else { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } @@ -65,7 +65,7 @@ ScopedAStatus EArcMock::getState(int32_t portId, IEArcStatus* _aidl_return) { ScopedAStatus EArcMock::getLastReportedAudioCapabilities(int32_t portId, std::vector* _aidl_return) { if (portId <= mTotalPorts && portId >= 1) { - *_aidl_return = mCapabilities[portId]; + *_aidl_return = mCapabilities.at(portId - 1); } else { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } diff --git a/tv/hdmi/earc/aidl/vts/functional/AndroidTest.xml b/tv/hdmi/earc/aidl/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..12dd1e42d9 --- /dev/null +++ b/tv/hdmi/earc/aidl/vts/functional/AndroidTest.xml @@ -0,0 +1,33 @@ + + + + diff --git a/tv/input/OWNERS b/tv/input/OWNERS index a02291a3c2..ae65f674b0 100644 --- a/tv/input/OWNERS +++ b/tv/input/OWNERS @@ -1,3 +1,4 @@ +# Bug component: 105688 hgchen@google.com shubang@google.com quxiangfang@google.com diff --git a/tv/input/aidl/Android.bp b/tv/input/aidl/Android.bp new file mode 100644 index 0000000000..35f510a162 --- /dev/null +++ b/tv/input/aidl/Android.bp @@ -0,0 +1,40 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +aidl_interface { + name: "android.hardware.tv.input", + vendor_available: true, + srcs: ["android/hardware/tv/input/*.aidl"], + imports: [ + "android.hardware.common-V2", + "android.media.audio.common.types-V1", + "android.hardware.common.fmq-V1", + ], + stability: "vintf", + backend: { + java: { + sdk_version: "module_current", + }, + cpp: { + enabled: false, + }, + }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.media.audio.common.types-V1", + "android.hardware.common.fmq-V1", + ], + }, + ], + frozen: true, + +} diff --git a/tv/input/aidl/TEST_MAPPING b/tv/input/aidl/TEST_MAPPING new file mode 100644 index 0000000000..981e46fd35 --- /dev/null +++ b/tv/input/aidl/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VtsHalTvInputTargetTest" + } + ] +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/.hash b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/.hash new file mode 100644 index 0000000000..0bd248bcf0 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/.hash @@ -0,0 +1 @@ +b247370748c1e172b1279ecdc6d23d14b225bbdc diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/CableConnectionStatus.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/CableConnectionStatus.aidl new file mode 100644 index 0000000000..a48bdb11c6 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/CableConnectionStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum CableConnectionStatus { + UNKNOWN = 0, + CONNECTED = 1, + DISCONNECTED = 2, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/ITvInput.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/ITvInput.aidl new file mode 100644 index 0000000000..84fe2fb7d7 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/ITvInput.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +interface ITvInput { + void closeStream(in int deviceId, in int streamId); + android.hardware.tv.input.TvStreamConfig[] getStreamConfigurations(in int deviceId); + android.hardware.common.NativeHandle openStream(in int deviceId, in int streamId); + 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 queue, int deviceId, int streamId); + const int STATUS_UNKNOWN = 1; + const int STATUS_NO_RESOURCE = 2; + const int STATUS_INVALID_ARGUMENTS = 3; + const int STATUS_INVALID_STATE = 4; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/ITvInputCallback.aidl new file mode 100644 index 0000000000..974701341c --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/ITvInputCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +interface ITvInputCallback { + void notify(in android.hardware.tv.input.TvInputEvent event); + void notifyTvMessageEvent(in android.hardware.tv.input.TvMessageEvent event); +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputDeviceInfo.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputDeviceInfo.aidl new file mode 100644 index 0000000000..d0951467be --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputDeviceInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvInputDeviceInfo { + int deviceId; + android.hardware.tv.input.TvInputType type; + int portId; + android.hardware.tv.input.CableConnectionStatus cableConnectionStatus; + android.media.audio.common.AudioDevice audioDevice; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputEvent.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputEvent.aidl new file mode 100644 index 0000000000..cfa8a34c9e --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputEvent.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvInputEvent { + android.hardware.tv.input.TvInputEventType type; + android.hardware.tv.input.TvInputDeviceInfo deviceInfo; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputEventType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputEventType.aidl new file mode 100644 index 0000000000..a9f518ac85 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum TvInputEventType { + DEVICE_AVAILABLE = 1, + DEVICE_UNAVAILABLE = 2, + STREAM_CONFIGURATIONS_CHANGED = 3, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputType.aidl new file mode 100644 index 0000000000..7e44a7d653 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvInputType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum TvInputType { + OTHER = 1, + TUNER = 2, + COMPOSITE = 3, + SVIDEO = 4, + SCART = 5, + COMPONENT = 6, + VGA = 7, + DVI = 8, + HDMI = 9, + DISPLAY_PORT = 10, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessage.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessage.aidl new file mode 100644 index 0000000000..04cb099f97 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessage.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvMessage { + String subType; + long groupId; + int dataLengthBytes; + const long NO_GROUP_ID = (-1) /* -1 */; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessageEvent.aidl new file mode 100644 index 0000000000..94fe665d1d --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessageEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvMessageEvent { + android.hardware.tv.input.TvMessageEventType type; + int streamId; + android.hardware.tv.input.TvMessage[] messages; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessageEventType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessageEventType.aidl new file mode 100644 index 0000000000..3006198c68 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvMessageEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum TvMessageEventType { + WATERMARK = 1, + CLOSED_CAPTION = 2, + OTHER = 1000, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvStreamConfig.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvStreamConfig.aidl new file mode 100644 index 0000000000..8378ff3a87 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/1/android/hardware/tv/input/TvStreamConfig.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvStreamConfig { + int streamId; + int maxVideoWidth; + int maxVideoHeight; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/CableConnectionStatus.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/CableConnectionStatus.aidl new file mode 100644 index 0000000000..a48bdb11c6 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/CableConnectionStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum CableConnectionStatus { + UNKNOWN = 0, + CONNECTED = 1, + DISCONNECTED = 2, +} 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 new file mode 100644 index 0000000000..84fe2fb7d7 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInput.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +interface ITvInput { + void closeStream(in int deviceId, in int streamId); + android.hardware.tv.input.TvStreamConfig[] getStreamConfigurations(in int deviceId); + android.hardware.common.NativeHandle openStream(in int deviceId, in int streamId); + 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 queue, int deviceId, int streamId); + const int STATUS_UNKNOWN = 1; + const int STATUS_NO_RESOURCE = 2; + const int STATUS_INVALID_ARGUMENTS = 3; + const int STATUS_INVALID_STATE = 4; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl new file mode 100644 index 0000000000..974701341c --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/ITvInputCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +interface ITvInputCallback { + void notify(in android.hardware.tv.input.TvInputEvent event); + void notifyTvMessageEvent(in android.hardware.tv.input.TvMessageEvent event); +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputDeviceInfo.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputDeviceInfo.aidl new file mode 100644 index 0000000000..d0951467be --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputDeviceInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvInputDeviceInfo { + int deviceId; + android.hardware.tv.input.TvInputType type; + int portId; + android.hardware.tv.input.CableConnectionStatus cableConnectionStatus; + android.media.audio.common.AudioDevice audioDevice; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputEvent.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputEvent.aidl new file mode 100644 index 0000000000..cfa8a34c9e --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputEvent.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvInputEvent { + android.hardware.tv.input.TvInputEventType type; + android.hardware.tv.input.TvInputDeviceInfo deviceInfo; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputEventType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputEventType.aidl new file mode 100644 index 0000000000..a9f518ac85 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum TvInputEventType { + DEVICE_AVAILABLE = 1, + DEVICE_UNAVAILABLE = 2, + STREAM_CONFIGURATIONS_CHANGED = 3, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputType.aidl new file mode 100644 index 0000000000..7e44a7d653 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvInputType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum TvInputType { + OTHER = 1, + TUNER = 2, + COMPOSITE = 3, + SVIDEO = 4, + SCART = 5, + COMPONENT = 6, + VGA = 7, + DVI = 8, + HDMI = 9, + DISPLAY_PORT = 10, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessage.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessage.aidl new file mode 100644 index 0000000000..04cb099f97 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessage.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvMessage { + String subType; + long groupId; + int dataLengthBytes; + const long NO_GROUP_ID = (-1) /* -1 */; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl new file mode 100644 index 0000000000..94fe665d1d --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvMessageEvent { + android.hardware.tv.input.TvMessageEventType type; + int streamId; + android.hardware.tv.input.TvMessage[] messages; +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEventType.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEventType.aidl new file mode 100644 index 0000000000..3006198c68 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@Backing(type="int") @VintfStability +enum TvMessageEventType { + WATERMARK = 1, + CLOSED_CAPTION = 2, + OTHER = 1000, +} diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvStreamConfig.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvStreamConfig.aidl new file mode 100644 index 0000000000..8378ff3a87 --- /dev/null +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvStreamConfig.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.input; +@VintfStability +parcelable TvStreamConfig { + int streamId; + int maxVideoWidth; + int maxVideoHeight; +} diff --git a/tv/input/aidl/android/hardware/tv/input/CableConnectionStatus.aidl b/tv/input/aidl/android/hardware/tv/input/CableConnectionStatus.aidl new file mode 100644 index 0000000000..64b79ddb17 --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/CableConnectionStatus.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +/** + * Status of cable connection. + * This status is for devices having availability to detect the cable in a mechanical way, + * regardless of whether the connected external device is electrically on or not. + * If the device does not have such capability, you must use UNKNOWN. + */ +@VintfStability +@Backing(type="int") +enum CableConnectionStatus { + UNKNOWN = 0, + CONNECTED = 1, + DISCONNECTED = 2, +} diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl new file mode 100644 index 0000000000..c63e0aca0f --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/ITvInput.aidl @@ -0,0 +1,112 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +import android.hardware.common.NativeHandle; +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; +import android.hardware.tv.input.ITvInputCallback; +import android.hardware.tv.input.TvMessageEventType; +import android.hardware.tv.input.TvStreamConfig; + +@VintfStability +interface ITvInput { + /** + * ServiceSpecificException values for ITvInput requests + */ + const int STATUS_UNKNOWN = 1; + const int STATUS_NO_RESOURCE = 2; + const int STATUS_INVALID_ARGUMENTS = 3; + const int STATUS_INVALID_STATE = 4; + + /** + * Closes a specific stream in a device. + * + * @param deviceId Device ID for the stream to close. + * @param streamId Stream ID for the stream to close. + * @throws ServiceSpecificException with values from the ITvInput::STATUS_* constants + */ + void closeStream(in int deviceId, in int streamId); + + /** + * Gets stream configurations for a specific device. + * + * The configs object is valid only until the next + * STREAM_CONFIGURATIONS_CHANGED event. + * + * @param deviceId Device ID for the configurations. + * @return the array of available configurations. + * @throws ServiceSpecificException with values from the ITvInput::STATUS_* constants + */ + TvStreamConfig[] getStreamConfigurations(in int deviceId); + + /** + * Opens a specific stream in a device. + * + * @param deviceId Device ID for the stream to open. + * @param streamId Stream ID for the stream to open. Must be one of the + * stream IDs returned from getStreamConfigurations(). + * @return the handle for sideband stream. + * @throws ServiceSpecificException with values from the ITvInput::STATUS_* constants + */ + NativeHandle openStream(in int deviceId, in int streamId); + + /** + * Sets a callback for events. + * + * Note that initially no device is available in the client side, so the + * implementation must notify all the currently available devices including + * static devices via callback once callback is set. + * + * @param callback Callback object to pass events. + * @throws ServiceSpecificException with values from the ITvInput::STATUS_* constants + */ + void setCallback(in ITvInputCallback callback); + + /** + * Enables or disables TV message detection for the specified stream on the device. + * + * @param deviceId The ID of the device that contains the stream to set the flag for. + * @param streamId The ID of the stream to set the flag for. + * @param type The type of {@link android.hardware.tv.input.TvMessageEventType}. + * @param enabled {@code true} if you want to enable TV message detection + * {@code false} otherwise. + */ + void setTvMessageEnabled( + int deviceId, int streamId, in TvMessageEventType type, boolean enabled); + + /** + * Gets the TV message queue for the specified stream on the device. + * + * The FMQ is used to relay events that are parsed from the specified stream to the + * app or service responsible for processing the message. The HAL implementation + * is expected to parse these messages and add them to the queue as new events are + * detected from the stream based on whether or not they are enabled by + * {@link #setTvMessageEnabled(int, int, TvMessageEventType, boolean)}. + * + * This queue is expected to already contain the message data before calling + * {@link android.hardware.tv.input.ITvInputCallback#notifyTvMessageEvent}. + * The HAL implementation is expected to have already created the queue + * before the notification callback is called for the first time. + * + * @param deviceId The ID of the device that contains the stream to get the queue for. + * @param streamId THe ID of the stream to get the queue for. + * @return The descriptor of the TV message queue. + */ + void getTvMessageQueueDesc( + out MQDescriptor queue, int deviceId, int streamId); +} diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl new file mode 100644 index 0000000000..a3afd41fd5 --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +import android.hardware.tv.input.TvInputEvent; +import android.hardware.tv.input.TvMessageEvent; + +@VintfStability +interface ITvInputCallback { + /** + * Notifies the client that an event has occurred. For possible event types, + * check TvInputEventType. + * + * @param event Event passed to the client. + */ + void notify(in TvInputEvent event); + /** + * Notifies the client that an TV message event has occurred. For possible event types, + * check {@link android.hardware.tv.input.TvMessageEventType}. + * + * The first message in a list of messages contained in a + * {@link android.hardware.tv.input.TvMessageEvent} should always have a + * {@link android.hardware.tv.input.TvMessage#subType} of "device_id", + * otherwise the event is discarded. When the subType of a message is "device_id", the ID of + * the device that sent the message should be contained in + * {@link android.hardware.tv.input.TvMessage#groupId} + * + * Invoking this callback for the first time immediately triggers + * {@link android.hardware.tv.input.ITvInput#getTvMessageQueueDesc}. It is + * expected for the queue to be ready with + * the relevant messages for the event before this callback is called. + * + * @param event Event passed to the client. + */ + void notifyTvMessageEvent(in TvMessageEvent event); +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvInputDeviceInfo.aidl b/tv/input/aidl/android/hardware/tv/input/TvInputDeviceInfo.aidl new file mode 100644 index 0000000000..2782e90df7 --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvInputDeviceInfo.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +import android.hardware.tv.input.CableConnectionStatus; +import android.hardware.tv.input.TvInputType; +import android.media.audio.common.AudioDevice; + +@VintfStability +parcelable TvInputDeviceInfo { + int deviceId; + TvInputType type; + + /* HDMI port ID number. e.g. 2 for HDMI 2. */ + int portId; + + /* Cable connection status. */ + CableConnectionStatus cableConnectionStatus; + + /* Audio device info. */ + AudioDevice audioDevice; +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvInputEvent.aidl b/tv/input/aidl/android/hardware/tv/input/TvInputEvent.aidl new file mode 100644 index 0000000000..66ca7aa792 --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvInputEvent.aidl @@ -0,0 +1,32 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +import android.hardware.tv.input.TvInputDeviceInfo; +import android.hardware.tv.input.TvInputEventType; + +@VintfStability +parcelable TvInputEvent { + TvInputEventType type; + + /** + * TvInputEventType::DEVICE_AVAILABLE: all fields are relevant. + * TvInputEventType::DEVICE_UNAVAILABLE: only deviceId is relevant. + * TvInputEventType::STREAM_CONFIGURATIONS_CHANGED: only deviceId is relevant. + */ + TvInputDeviceInfo deviceInfo; +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvInputEventType.aidl b/tv/input/aidl/android/hardware/tv/input/TvInputEventType.aidl new file mode 100644 index 0000000000..fcbc3c223c --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvInputEventType.aidl @@ -0,0 +1,77 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +@VintfStability +@Backing(type="int") +enum TvInputEventType { + /** + * Hardware notifies the framework that a device is available. + * + * Note that DEVICE_AVAILABLE and DEVICE_UNAVAILABLE events do not represent + * hotplug events (i.e. plugging cable into or out of the physical port). + * These events notify the framework whether the port is available or not. + * For a concrete example, when a user plugs in or pulls out the HDMI cable + * from a HDMI port, it does not generate DEVICE_AVAILABLE and/or + * DEVICE_UNAVAILABLE events. However, if a user inserts a pluggable USB + * tuner into the Android device, it must generate a DEVICE_AVAILABLE event + * and when the port is removed, it must generate a DEVICE_UNAVAILABLE + * event. + * + * For hotplug events, please see STREAM_CONFIGURATION_CHANGED for more + * details. + * + * HAL implementation must register devices by using this event when the + * device boots up. The framework must recognize device reported via this + * event only. + */ + DEVICE_AVAILABLE = 1, + + /** + * Hardware notifies the framework that a device is unavailable. + * + * HAL implementation must generate this event when a device registered + * by DEVICE_AVAILABLE is no longer available. For example, + * the event can indicate that a USB tuner is plugged out from the Android + * device. + * + * Note that this event is not for indicating cable plugged out of the port; + * for that purpose, the implementation must use + * STREAM_CONFIGURATION_CHANGED event. This event represents the port itself + * being no longer available. + */ + DEVICE_UNAVAILABLE = 2, + + /** + * Stream configurations are changed. Client must regard all open streams + * at the specific device are closed, and must call + * getStreamConfigurations() again, opening some of them if necessary. + * + * HAL implementation must generate this event when the available stream + * configurations change for any reason. A typical use case of this event + * is to notify the framework that the input signal has changed resolution, + * or that the cable is plugged out so that the number of available streams + * is 0. + * + * The implementation must use this event to indicate hotplug status of the + * port. the framework regards input devices with no available streams as + * disconnected, so the implementation can generate this event with no + * available streams to indicate that this device is disconnected, and vice + * versa. + */ + STREAM_CONFIGURATIONS_CHANGED = 3, +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvInputType.aidl b/tv/input/aidl/android/hardware/tv/input/TvInputType.aidl new file mode 100644 index 0000000000..a0f8270b82 --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvInputType.aidl @@ -0,0 +1,35 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +/** + * Type of physical TV input. + */ +@VintfStability +@Backing(type="int") +enum TvInputType { + OTHER = 1, + TUNER = 2, + COMPOSITE = 3, + SVIDEO = 4, + SCART = 5, + COMPONENT = 6, + VGA = 7, + DVI = 8, + HDMI = 9, + DISPLAY_PORT = 10, +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl new file mode 100644 index 0000000000..afa48a942e --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvMessage.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +@VintfStability +parcelable TvMessage { + /** + * This value for TvMessage.groupId denotes that the message doesn't belong to any group. + */ + const long NO_GROUP_ID = -1; + /** + * Extended data type, like “ATSC A/336 Watermark”, “ATSC_CC”, etc. This type is opaque to the + * framework except when the subtype is "device_id". If the subtype is "device_id", the ID of + * device that sent the message should be contained in {@link #groupId}. + * + * The first message in a list of messages contained in + * {@link android.hardware.tv.input.TvMessageEvent} should always have the subtype "device_id", + * otherwise the event is discarded. + */ + String subType; + /** + * This group id is used to optionally identify messages that belong together, such as + * headers and bodies of the same event. For messages that do not have a group, this value + * should be -1. + * + * If {@link #subType} is "device_id", this value should contain the ID of the device that sent + * this message. + * + * As -1 is a reserved value, -1 should not be used as a valid groupId. + */ + long groupId; + int dataLengthBytes; +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl new file mode 100644 index 0000000000..74a078a45e --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl @@ -0,0 +1,28 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +import android.hardware.tv.input.TvMessage; +import android.hardware.tv.input.TvMessageEventType; + +@VintfStability +parcelable TvMessageEvent { + TvMessageEventType type; + + int streamId; + TvMessage[] messages; +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessageEventType.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessageEventType.aidl new file mode 100644 index 0000000000..518c7fc441 --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvMessageEventType.aidl @@ -0,0 +1,25 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +@VintfStability +@Backing(type="int") +enum TvMessageEventType { + WATERMARK = 1, + CLOSED_CAPTION = 2, + OTHER = 1000, +} diff --git a/tv/input/aidl/android/hardware/tv/input/TvStreamConfig.aidl b/tv/input/aidl/android/hardware/tv/input/TvStreamConfig.aidl new file mode 100644 index 0000000000..af86953dce --- /dev/null +++ b/tv/input/aidl/android/hardware/tv/input/TvStreamConfig.aidl @@ -0,0 +1,28 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.input; + +@VintfStability +parcelable TvStreamConfig { + int streamId; + + /* Maximum video width in pixel. */ + int maxVideoWidth; + + /* Maximum video height in pixel. */ + int maxVideoHeight; +} diff --git a/tv/input/aidl/default/Android.bp b/tv/input/aidl/default/Android.bp new file mode 100644 index 0000000000..05af6a94fb --- /dev/null +++ b/tv/input/aidl/default/Android.bp @@ -0,0 +1,37 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_binary { + name: "android.hardware.tv.input-service.example", + relative_install_path: "hw", + init_rc: ["input-default.rc"], + vintf_fragments: ["input-default.xml"], + vendor: true, + cflags: [ + "-Werror", + "-Wno-unused-parameter", + ], + srcs: [ + "TvInput.cpp", + "service.cpp", + ], + static_libs: [ + "libaidlcommonsupport", + ], + shared_libs: [ + "libbase", + "liblog", + "libfmq", + "libutils", + "libcutils", + "libbinder_ndk", + "android.hardware.tv.input-V1-ndk", + "android.hardware.common.fmq-V1-ndk", + ], +} diff --git a/tv/input/aidl/default/TvInput.cpp b/tv/input/aidl/default/TvInput.cpp new file mode 100644 index 0000000000..2ee8bcfec8 --- /dev/null +++ b/tv/input/aidl/default/TvInput.cpp @@ -0,0 +1,160 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "android.hardware.tv.input-service.example" + +#include + +#include "TvInput.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace input { + +TvInput::TvInput() {} + +void TvInput::init() { + // Set up TvInputDeviceInfo and TvStreamConfig + mDeviceInfos[0] = shared_ptr( + new TvInputDeviceInfoWrapper(0, TvInputType::TUNER, true)); + mDeviceInfos[1] = shared_ptr( + new TvInputDeviceInfoWrapper(1, TvInputType::HDMI, true)); + mDeviceInfos[3] = shared_ptr( + new TvInputDeviceInfoWrapper(3, TvInputType::DISPLAY_PORT, true)); + + mStreamConfigs[0] = { + {1, shared_ptr(new TvStreamConfigWrapper(1, 720, 1080, false))}}; + mStreamConfigs[1] = {{11, shared_ptr( + new TvStreamConfigWrapper(11, 360, 480, false))}}; + mStreamConfigs[3] = {{5, shared_ptr( + new TvStreamConfigWrapper(5, 1080, 1920, false))}}; +} + +::ndk::ScopedAStatus TvInput::setCallback(const shared_ptr& in_callback) { + ALOGV("%s", __FUNCTION__); + + mCallback = in_callback; + + TvInputEvent event; + event.type = TvInputEventType::DEVICE_AVAILABLE; + + event.deviceInfo = mDeviceInfos[0]->deviceInfo; + mCallback->notify(event); + + event.deviceInfo = mDeviceInfos[1]->deviceInfo; + mCallback->notify(event); + + event.deviceInfo = mDeviceInfos[3]->deviceInfo; + mCallback->notify(event); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TvInput::setTvMessageEnabled(int32_t deviceId, int32_t streamId, + TvMessageEventType in_type, bool enabled) { + ALOGV("%s", __FUNCTION__); + + if (mStreamConfigs.count(deviceId) == 0) { + ALOGW("Device with id %d isn't available", deviceId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + } + + mTvMessageEventEnabled[deviceId][streamId][in_type] = enabled; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TvInput::getTvMessageQueueDesc( + MQDescriptor* out_queue, int32_t in_deviceId, + int32_t in_streamId) { + ALOGV("%s", __FUNCTION__); + if (mStreamConfigs.count(in_deviceId) == 0) { + ALOGW("Device with id %d isn't available", in_deviceId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + } + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TvInput::getStreamConfigurations(int32_t in_deviceId, + vector* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (mStreamConfigs.count(in_deviceId) == 0) { + ALOGW("Device with id %d isn't available", in_deviceId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + } + + for (auto const& iconfig : mStreamConfigs[in_deviceId]) { + _aidl_return->push_back(iconfig.second->streamConfig); + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TvInput::openStream(int32_t in_deviceId, int32_t in_streamId, + NativeHandle* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (mStreamConfigs.count(in_deviceId) == 0 || + mStreamConfigs[in_deviceId].count(in_streamId) == 0) { + ALOGW("Stream with device id %d, stream id %d isn't available", in_deviceId, in_streamId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + } + if (mStreamConfigs[in_deviceId][in_streamId]->isOpen) { + ALOGW("Stream with device id %d, stream id %d is already opened", in_deviceId, in_streamId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_STATE); + } + mStreamConfigs[in_deviceId][in_streamId]->handle = createNativeHandle(in_streamId); + *_aidl_return = makeToAidl(mStreamConfigs[in_deviceId][in_streamId]->handle); + mStreamConfigs[in_deviceId][in_streamId]->isOpen = true; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TvInput::closeStream(int32_t in_deviceId, int32_t in_streamId) { + ALOGV("%s", __FUNCTION__); + + if (mStreamConfigs.count(in_deviceId) == 0 || + mStreamConfigs[in_deviceId].count(in_streamId) == 0) { + ALOGW("Stream with device id %d, stream id %d isn't available", in_deviceId, in_streamId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + } + if (!mStreamConfigs[in_deviceId][in_streamId]->isOpen) { + ALOGW("Stream with device id %d, stream id %d is already closed", in_deviceId, in_streamId); + return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_STATE); + } + native_handle_delete(mStreamConfigs[in_deviceId][in_streamId]->handle); + mStreamConfigs[in_deviceId][in_streamId]->handle = nullptr; + mStreamConfigs[in_deviceId][in_streamId]->isOpen = false; + return ::ndk::ScopedAStatus::ok(); +} + +native_handle_t* TvInput::createNativeHandle(int fd) { + native_handle_t* handle = native_handle_create(1, 1); + if (handle == nullptr) { + ALOGE("[TVInput] Failed to create native_handle %d", errno); + return nullptr; + } + handle->data[0] = dup(0); + handle->data[1] = fd; + return handle; +} + +} // namespace input +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/input/aidl/default/TvInput.h b/tv/input/aidl/default/TvInput.h new file mode 100644 index 0000000000..57769618e3 --- /dev/null +++ b/tv/input/aidl/default/TvInput.h @@ -0,0 +1,75 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include +#include +#include +#include "TvInputDeviceInfoWrapper.h" +#include "TvStreamConfigWrapper.h" + +using namespace android; +using namespace std; +using ::aidl::android::hardware::common::NativeHandle; +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace input { + +using TvMessageEnabledMap = std::unordered_map< + int32_t, std::unordered_map>>; + +class TvInput : public BnTvInput { + public: + TvInput(); + + ::ndk::ScopedAStatus setCallback(const shared_ptr& in_callback) override; + ::ndk::ScopedAStatus setTvMessageEnabled(int32_t deviceId, int32_t streamId, + TvMessageEventType in_type, bool enabled) override; + ::ndk::ScopedAStatus getTvMessageQueueDesc( + MQDescriptor* out_queue, int32_t in_deviceId, + int32_t in_streamId) override; + ::ndk::ScopedAStatus getStreamConfigurations(int32_t in_deviceId, + vector* _aidl_return) override; + ::ndk::ScopedAStatus openStream(int32_t in_deviceId, int32_t in_streamId, + NativeHandle* _aidl_return) override; + ::ndk::ScopedAStatus closeStream(int32_t in_deviceId, int32_t in_streamId) override; + void init(); + + private: + native_handle_t* createNativeHandle(int fd); + + shared_ptr mCallback; + map> mDeviceInfos; + map>> mStreamConfigs; + TvMessageEnabledMap mTvMessageEventEnabled; +}; + +} // namespace input +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/input/aidl/default/TvInputDeviceInfoWrapper.h b/tv/input/aidl/default/TvInputDeviceInfoWrapper.h new file mode 100644 index 0000000000..d844cc88fb --- /dev/null +++ b/tv/input/aidl/default/TvInputDeviceInfoWrapper.h @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace input { + +class TvInputDeviceInfoWrapper { + public: + TvInputDeviceInfoWrapper() {} + TvInputDeviceInfoWrapper(int32_t deviceId_, TvInputType type_, bool isAvailable_) { + deviceInfo.deviceId = deviceId_; + deviceInfo.type = type_; + isAvailable = isAvailable_; + } + + TvInputDeviceInfo deviceInfo; + bool isAvailable; +}; +} // namespace input +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/input/aidl/default/TvStreamConfigWrapper.h b/tv/input/aidl/default/TvStreamConfigWrapper.h new file mode 100644 index 0000000000..05c7ca35b2 --- /dev/null +++ b/tv/input/aidl/default/TvStreamConfigWrapper.h @@ -0,0 +1,50 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace input { + +class TvStreamConfigWrapper { + public: + TvStreamConfigWrapper() {} + TvStreamConfigWrapper(int32_t streamId_, int32_t maxVideoWidth_, int32_t maxVideoHeight_, + bool isOpen_) { + streamConfig.streamId = streamId_; + streamConfig.maxVideoWidth = maxVideoWidth_; + streamConfig.maxVideoHeight = maxVideoHeight_; + isOpen = isOpen_; + handle = nullptr; + } + + TvStreamConfig streamConfig; + bool isOpen; + native_handle_t* handle; +}; +} // namespace input +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/input/aidl/default/input-default.rc b/tv/input/aidl/default/input-default.rc new file mode 100644 index 0000000000..1958b5c292 --- /dev/null +++ b/tv/input/aidl/default/input-default.rc @@ -0,0 +1,5 @@ +service vendor.input-default /vendor/bin/hw/android.hardware.tv.input-service.example + interface aidl android.hardware.tv.input.ITvInput/default + class hal + user system + group system diff --git a/tv/input/aidl/default/input-default.xml b/tv/input/aidl/default/input-default.xml new file mode 100644 index 0000000000..38ba1512ba --- /dev/null +++ b/tv/input/aidl/default/input-default.xml @@ -0,0 +1,6 @@ + + + android.hardware.tv.input + ITvInput/default + + \ No newline at end of file diff --git a/tv/input/aidl/default/service.cpp b/tv/input/aidl/default/service.cpp new file mode 100644 index 0000000000..1021206153 --- /dev/null +++ b/tv/input/aidl/default/service.cpp @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "android.hardware.tv.input-service.example" + +#include +#include +#include +#include + +#include "TvInput.h" + +using ::aidl::android::hardware::tv::input::TvInput; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(8); + std::shared_ptr tvInput = ndk::SharedRefBase::make(); + tvInput->init(); + + const std::string instance = std::string() + TvInput::descriptor + "/default"; + binder_status_t status = + AServiceManager_addService(tvInput->asBinder().get(), instance.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reached +} diff --git a/tv/input/aidl/vts/functional/Android.bp b/tv/input/aidl/vts/functional/Android.bp new file mode 100644 index 0000000000..22487eafb1 --- /dev/null +++ b/tv/input/aidl/vts/functional/Android.bp @@ -0,0 +1,38 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_test { + name: "VtsHalTvInputTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + cflags: [ + "-Werror", + "-Wno-unused-parameter", + ], + srcs: ["VtsHalTvInputTargetTest.cpp"], + static_libs: [ + "android.media.audio.common.types-V1-ndk", + "android.hardware.common-V2-ndk", + "libaidlcommonsupport", + ], + test_suites: [ + "general-tests", + "vts", + ], + shared_libs: [ + "libbinder_ndk", + "libvndksupport", + "libfmq", + "android.hardware.common.fmq-V1-ndk", + "android.hardware.tv.input-V1-ndk", + ], + require_root: true, +} diff --git a/tv/input/aidl/vts/functional/AndroidTest.xml b/tv/input/aidl/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..5549102a8b --- /dev/null +++ b/tv/input/aidl/vts/functional/AndroidTest.xml @@ -0,0 +1,33 @@ + + + + diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp new file mode 100644 index 0000000000..8d3395b8d2 --- /dev/null +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp @@ -0,0 +1,367 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VtsHalTvInputTargetTest.h" + +#include +#include +#include +#include + +using namespace VtsHalTvInputTargetTest; + +TvInputAidlTest::TvInputCallback::TvInputCallback(shared_ptr parent) + : parent_(parent) {} + +::ndk::ScopedAStatus TvInputAidlTest::TvInputCallback::notify(const TvInputEvent& in_event) { + unique_lock lock(parent_->mutex_); + + switch (in_event.type) { + case TvInputEventType::DEVICE_AVAILABLE: + parent_->onDeviceAvailable(in_event.deviceInfo); + break; + case TvInputEventType::DEVICE_UNAVAILABLE: + parent_->onDeviceUnavailable(in_event.deviceInfo.deviceId); + break; + case TvInputEventType::STREAM_CONFIGURATIONS_CHANGED: + parent_->onStreamConfigurationsChanged(in_event.deviceInfo.deviceId); + break; + } + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TvInputAidlTest::TvInputCallback::notifyTvMessageEvent( + const TvMessageEvent& in_event) { + return ::ndk::ScopedAStatus::ok(); +} + +void TvInputAidlTest::SetUp() { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + tv_input_ = ITvInput::fromBinder(binder); + } else { + tv_input_ = nullptr; + } + ASSERT_NE(tv_input_, nullptr); + + tv_input_callback_ = + ::ndk::SharedRefBase::make(shared_ptr(this)); + ASSERT_NE(tv_input_callback_, nullptr); + + tv_input_->setCallback(tv_input_callback_); + // All events received within the timeout should be handled. + sleep(WAIT_FOR_EVENT_TIMEOUT); +} + +void TvInputAidlTest::TearDown() { + tv_input_ = nullptr; +} + +void TvInputAidlTest::onDeviceAvailable(const TvInputDeviceInfo& deviceInfo) { + ALOGD("onDeviceAvailable for device id %d", deviceInfo.deviceId); + device_info_.add(deviceInfo.deviceId, deviceInfo); +} + +void TvInputAidlTest::onDeviceUnavailable(int32_t deviceId) { + ALOGD("onDeviceUnavailable for device id %d", deviceId); + device_info_.removeItem(deviceId); + stream_config_.removeItem(deviceId); +} + +::ndk::ScopedAStatus TvInputAidlTest::onStreamConfigurationsChanged(int32_t deviceId) { + ALOGD("onStreamConfigurationsChanged for device id %d", deviceId); + return updateStreamConfigurations(deviceId); +} + +::ndk::ScopedAStatus TvInputAidlTest::updateStreamConfigurations(int32_t deviceId) { + stream_config_.removeItem(deviceId); + vector list; + ::ndk::ScopedAStatus status = tv_input_->getStreamConfigurations(deviceId, &list); + if (status.isOk()) { + stream_config_.add(deviceId, list); + } + return status; +} + +void TvInputAidlTest::updateAllStreamConfigurations() { + for (size_t i = 0; i < device_info_.size(); i++) { + int32_t device_id = device_info_.keyAt(i); + updateStreamConfigurations(device_id); + } +} + +vector TvInputAidlTest::getConfigIndices() { + vector indices; + for (size_t i = 0; i < stream_config_.size(); i++) { + if (stream_config_.valueAt(i).size() != 0) { + indices.push_back(i); + } + } + return indices; +} + +int32_t TvInputAidlTest::getNumNotIn(vector& nums) { + int32_t result = DEFAULT_ID; + int32_t size = static_cast(nums.size()); + for (int32_t i = 0; i < size; i++) { + // Put every element to its target position, if possible. + int32_t target_pos = nums[i]; + while (target_pos >= 0 && target_pos < size && i != target_pos && + nums[i] != nums[target_pos]) { + swap(nums[i], nums[target_pos]); + target_pos = nums[i]; + } + } + + for (int32_t i = 0; i < size; i++) { + if (nums[i] != i) { + return i; + } + } + return result; +} + +bool TvInputAidlTest::isValidHandle(NativeHandle& handle) { + if (handle.fds.empty()) { + return false; + } + for (size_t i = 0; i < handle.fds.size(); i++) { + int fd = handle.fds[i].get(); + if (fcntl(fd, F_GETFL) < 0) { + return false; + } + } + return true; +} + +/* + * GetStreamConfigTest: + * Calls updateStreamConfigurations() for each existing device + * Checks returned results + */ +TEST_P(TvInputAidlTest, GetStreamConfigTest) { + unique_lock lock(mutex_); + + for (size_t i = 0; i < device_info_.size(); i++) { + int32_t device_id = device_info_.keyAt(i); + ALOGD("GetStreamConfigTest: device_id=%d", device_id); + ASSERT_TRUE(updateStreamConfigurations(device_id).isOk()); + } +} + +/* + * OpenAndCloseStreamTest: + * Calls openStream() and then closeStream() for each existing stream + * Checks returned results + */ +TEST_P(TvInputAidlTest, OpenAndCloseStreamTest) { + unique_lock lock(mutex_); + + updateAllStreamConfigurations(); + + for (size_t j = 0; j < stream_config_.size(); j++) { + int32_t device_id = stream_config_.keyAt(j); + vector config = stream_config_.valueAt(j); + for (size_t i = 0; i < config.size(); i++) { + NativeHandle handle; + int32_t stream_id = config[i].streamId; + ALOGD("OpenAndCloseStreamTest: open stream, device_id=%d, stream_id=%d", device_id, + stream_id); + ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk()); + ASSERT_TRUE(isValidHandle(handle)); + + ALOGD("OpenAndCloseStreamTest: close stream, device_id=%d, stream_id=%d", device_id, + stream_id); + ASSERT_TRUE(tv_input_->closeStream(device_id, stream_id).isOk()); + } + } +} + +/* + * InvalidDeviceIdTest: + * Calls updateStreamConfigurations(), openStream(), and closeStream() + * for a non-existing device + * Checks returned results + * The results should be ITvInput::STATUS_INVALID_ARGUMENTS + */ +TEST_P(TvInputAidlTest, InvalidDeviceIdTest) { + unique_lock lock(mutex_); + + vector device_ids; + for (size_t i = 0; i < device_info_.size(); i++) { + device_ids.push_back(device_info_.keyAt(i)); + } + // Get a non-existing device ID. + int32_t id = getNumNotIn(device_ids); + ALOGD("InvalidDeviceIdTest: update stream config, device_id=%d", id); + ASSERT_TRUE(updateStreamConfigurations(id).getServiceSpecificError() == + ITvInput::STATUS_INVALID_ARGUMENTS); + + int32_t stream_id = 0; + NativeHandle handle; + + ALOGD("InvalidDeviceIdTest: open stream, device_id=%d, stream_id=%d", id, stream_id); + ASSERT_TRUE(tv_input_->openStream(id, stream_id, &handle).getServiceSpecificError() == + ITvInput::STATUS_INVALID_ARGUMENTS); + + ALOGD("InvalidDeviceIdTest: close stream, device_id=%d, stream_id=%d", id, stream_id); + ASSERT_TRUE(tv_input_->closeStream(id, stream_id).getServiceSpecificError() == + ITvInput::STATUS_INVALID_ARGUMENTS); +} + +/* + * InvalidStreamIdTest: + * Calls openStream(), and closeStream() for a non-existing stream + * Checks returned results + * The results should be ITvInput::STATUS_INVALID_ARGUMENTS + */ +TEST_P(TvInputAidlTest, InvalidStreamIdTest) { + unique_lock lock(mutex_); + + if (device_info_.isEmpty()) { + return; + } + updateAllStreamConfigurations(); + + int32_t device_id = device_info_.keyAt(0); + // Get a non-existing stream ID. + int32_t id = DEFAULT_ID; + if (stream_config_.indexOfKey(device_id) >= 0) { + vector stream_ids; + vector config = stream_config_.valueFor(device_id); + for (size_t i = 0; i < config.size(); i++) { + stream_ids.push_back(config[i].streamId); + } + id = getNumNotIn(stream_ids); + } + + NativeHandle handle; + + ALOGD("InvalidStreamIdTest: open stream, device_id=%d, stream_id=%d", device_id, id); + ASSERT_TRUE(tv_input_->openStream(device_id, id, &handle).getServiceSpecificError() == + ITvInput::STATUS_INVALID_ARGUMENTS); + + ALOGD("InvalidStreamIdTest: close stream, device_id=%d, stream_id=%d", device_id, id); + ASSERT_TRUE(tv_input_->closeStream(device_id, id).getServiceSpecificError() == + ITvInput::STATUS_INVALID_ARGUMENTS); +} + +/* + * OpenAnOpenedStreamsTest: + * Calls openStream() twice for a stream (if any) + * Checks returned results + * The result of the second call should be ITvInput::STATUS_INVALID_STATE + */ +TEST_P(TvInputAidlTest, OpenAnOpenedStreamsTest) { + unique_lock lock(mutex_); + + updateAllStreamConfigurations(); + vector indices = getConfigIndices(); + if (indices.empty()) { + return; + } + int32_t device_id = stream_config_.keyAt(indices[0]); + vector streamConfigs = stream_config_.valueAt(indices[0]); + if (streamConfigs.empty()) { + return; + } + int32_t stream_id = streamConfigs[0].streamId; + NativeHandle handle; + + ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); + ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk()); + ASSERT_TRUE(isValidHandle(handle)); + + ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); + ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).getServiceSpecificError() == + ITvInput::STATUS_INVALID_STATE); + + // close stream as subsequent tests assume no open streams + ALOGD("OpenAnOpenedStreamsTest: close stream, device_id=%d, stream_id=%d", device_id, + stream_id); + ASSERT_TRUE(tv_input_->closeStream(device_id, stream_id).isOk()); +} + +/* + * CloseStreamBeforeOpenTest: + * Calls closeStream() without calling openStream() for a stream (if any) + * Checks the returned result + * The result should be ITvInput::STATUS_INVALID_STATE + */ +TEST_P(TvInputAidlTest, CloseStreamBeforeOpenTest) { + unique_lock lock(mutex_); + + updateAllStreamConfigurations(); + vector indices = getConfigIndices(); + if (indices.empty()) { + return; + } + int32_t device_id = stream_config_.keyAt(indices[0]); + vector streamConfigs = stream_config_.valueAt(indices[0]); + if (streamConfigs.empty()) { + return; + } + int32_t stream_id = streamConfigs[0].streamId; + + ALOGD("CloseStreamBeforeOpenTest: close stream, device_id=%d, stream_id=%d", device_id, + stream_id); + ASSERT_TRUE(tv_input_->closeStream(device_id, stream_id).getServiceSpecificError() == + ITvInput::STATUS_INVALID_STATE); +} + +TEST_P(TvInputAidlTest, SetTvMessageEnabledTest) { + unique_lock lock(mutex_); + + updateAllStreamConfigurations(); + vector indices = getConfigIndices(); + if (indices.empty()) { + return; + } + int32_t device_id = stream_config_.keyAt(indices[0]); + vector streamConfigs = stream_config_.valueAt(indices[0]); + if (streamConfigs.empty()) { + return; + } + int32_t stream_id = streamConfigs[0].streamId; + ALOGD("SetTvMessageEnabledTest: device_id=%d, stream_id=%d", device_id, stream_id); + tv_input_->setTvMessageEnabled(device_id, stream_id, TvMessageEventType::WATERMARK, true); +} + +TEST_P(TvInputAidlTest, GetTvMessageQueueTest) { + unique_lock lock(mutex_); + + updateAllStreamConfigurations(); + vector indices = getConfigIndices(); + if (indices.empty()) { + return; + } + int32_t device_id = stream_config_.keyAt(indices[0]); + vector streamConfigs = stream_config_.valueAt(indices[0]); + if (streamConfigs.empty()) { + return; + } + int32_t stream_id = streamConfigs[0].streamId; + ALOGD("GetTvMessageQueueTest: device_id=%d, stream_id=%d", device_id, stream_id); + MQDescriptor queue; + tv_input_->getTvMessageQueueDesc(&queue, device_id, stream_id); +} + +INSTANTIATE_TEST_SUITE_P(PerInstance, TvInputAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITvInput::descriptor)), + android::PrintInstanceNameToString); + +// TODO remove from the allow list once the cf tv target is enabled for testing +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TvInputAidlTest); diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h new file mode 100644 index 0000000000..7e66a88a32 --- /dev/null +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h @@ -0,0 +1,99 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace aidl::android::hardware::tv::input; +using namespace std; +using ::aidl::android::hardware::common::NativeHandle; +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; + +#define WAIT_FOR_EVENT_TIMEOUT 5 +#define DEFAULT_ID INT32_MIN + +namespace VtsHalTvInputTargetTest { + +class TvInputAidlTest : public testing::TestWithParam { + public: + class TvInputCallback : public BnTvInputCallback { + public: + TvInputCallback(shared_ptr parent); + ::ndk::ScopedAStatus notify(const TvInputEvent& in_event) override; + ::ndk::ScopedAStatus notifyTvMessageEvent(const TvMessageEvent& in_event) override; + + private: + shared_ptr parent_; + }; + + virtual void SetUp() override; + virtual void TearDown() override; + + /* Called when a DEVICE_AVAILABLE event is received. */ + void onDeviceAvailable(const TvInputDeviceInfo& deviceInfo); + + /* Called when a DEVICE_UNAVAILABLE event is received. */ + void onDeviceUnavailable(int32_t deviceId); + + /* Called when a STREAM_CONFIGURATIONS_CHANGED event is received. */ + ::ndk::ScopedAStatus onStreamConfigurationsChanged(int32_t deviceId); + + /* Gets and updates the stream configurations for a device. */ + ::ndk::ScopedAStatus updateStreamConfigurations(int32_t deviceId); + + /* Gets and updates the stream configurations for all existing devices. */ + void updateAllStreamConfigurations(); + + /* Returns a list of indices of stream_config_ whose corresponding values are not empty. */ + vector getConfigIndices(); + + /* + * Returns DEFAULT_ID if there is no missing integer in the range [0, the size of nums). + * Otherwise, returns the smallest missing non-negative integer. + */ + int32_t getNumNotIn(vector& nums); + + /* Checks if a native handle contains valid file descriptor(s). */ + bool isValidHandle(NativeHandle& handle); + + protected: + shared_ptr tv_input_; + shared_ptr tv_input_callback_; + android::KeyedVector device_info_; + android::KeyedVector> stream_config_; + mutex mutex_; +}; + +} // namespace VtsHalTvInputTargetTest diff --git a/tv/tuner/OWNERS b/tv/tuner/OWNERS new file mode 100644 index 0000000000..83e090db2a --- /dev/null +++ b/tv/tuner/OWNERS @@ -0,0 +1,6 @@ +# Bug component: 136752 + +quxiangfang@google.com +shubang@google.com +hgchen@google.com +raychin@google.com diff --git a/tv/tuner/aidl/Android.bp b/tv/tuner/aidl/Android.bp index ecb744ccbf..6cbf362f53 100644 --- a/tv/tuner/aidl/Android.bp +++ b/tv/tuner/aidl/Android.bp @@ -32,6 +32,15 @@ aidl_interface { "android.hardware.common.fmq-V1", ], }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + }, + ], + frozen: true, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/.hash b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/.hash new file mode 100644 index 0000000000..59f22f4eec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/.hash @@ -0,0 +1 @@ +f8d74c149f04e76b6d622db2bd8e465dae24b08c diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioExtraMetaData.aidl new file mode 100644 index 0000000000..9db960926b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioExtraMetaData.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioExtraMetaData { + byte adFade; + byte adPan; + char versionTextTag; + byte adGainCenter; + byte adGainFront; + byte adGainSurround; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselection.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselection.aidl new file mode 100644 index 0000000000..ab0404e875 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselection.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioPreselection { + int preselectionId; + android.hardware.tv.tuner.AudioPreselectionLabel[] labels; + String language; + android.hardware.tv.tuner.AudioPreselectionRenderingIndicationType renderingIndication; + boolean hasAudioDescription; + boolean hasSpokenSubtitles; + boolean hasDialogueEnhancement; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselectionLabel.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselectionLabel.aidl new file mode 100644 index 0000000000..79f3b6f008 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselectionLabel.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioPreselectionLabel { + String language; + String text; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl new file mode 100644 index 0000000000..2977ff6ebc --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioPreselectionRenderingIndicationType { + NOT_INDICATED, + STEREO, + TWO_DIMENSIONAL, + THREE_DIMENSIONAL, + HEADPHONE, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPresentation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPresentation.aidl new file mode 100644 index 0000000000..eba820c6b5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioPresentation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioPresentation { + android.hardware.tv.tuner.AudioPreselection preselection; + int ac4ShortProgramId = (-1) /* -1 */; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioStreamType.aidl new file mode 100644 index 0000000000..4754bb121f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AudioStreamType.aidl @@ -0,0 +1,58 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioStreamType { + UNDEFINED, + PCM, + MP3, + MPEG1, + MPEG2, + MPEGH, + AAC, + AC3, + EAC3, + AC4, + DTS, + DTS_HD, + WMA, + OPUS, + VORBIS, + DRA, + AAC_ADTS, + AAC_LATM, + AAC_HE_ADTS, + AAC_HE_LATM, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AvStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AvStreamType.aidl new file mode 100644 index 0000000000..4d6acfffa1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/AvStreamType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union AvStreamType { + android.hardware.tv.tuner.VideoStreamType video = android.hardware.tv.tuner.VideoStreamType.UNDEFINED; + android.hardware.tv.tuner.AudioStreamType audio; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Constant.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Constant.aidl new file mode 100644 index 0000000000..1f7153b9c9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Constant.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum Constant { + INVALID_TS_PID = 0xFFFF, + INVALID_STREAM_ID = 0xFFFF, + INVALID_FILTER_ID = 0xFFFFFFFF, + INVALID_AV_SYNC_ID = 0xFFFFFFFF, + INVALID_MMTP_RECORD_EVENT_MPT_SEQUENCE_NUM = 0xFFFFFFFF, + INVALID_FIRST_MACROBLOCK_IN_SLICE = 0xFFFFFFFF, + INVALID_FRONTEND_SETTING_FREQUENCY = 0xFFFFFFFF, + INVALID_IP_FILTER_CONTEXT_ID = 0xFFFFFFFF, + INVALID_LTS_ID = 0xFFFFFFFF, + INVALID_FRONTEND_ID = 0xFFFFFFFF, + INVALID_LNB_ID = 0xFFFFFFFF, + INVALID_KEYTOKEN = 0x00, + INVALID_TABINFO_VERSION = 0xFFFFFFFF, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Constant64Bit.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Constant64Bit.aidl new file mode 100644 index 0000000000..ccbfd1a5c4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Constant64Bit.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="long") @VintfStability +enum Constant64Bit { + INVALID_FILTER_ID_64BIT = 0xFFFFFFFFFFFFFFFF, + INVALID_AV_SYNC_ID_64BIT = 0xFFFFFFFFFFFFFFFF, + INVALID_PRESENTATION_TIME_STAMP = 0xFFFFFFFFFFFFFFFF, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DataFormat.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DataFormat.aidl new file mode 100644 index 0000000000..5fb34baab5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DataFormat.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DataFormat { + TS, + PES, + ES, + SHV_TLV, + UNDEFINED, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl new file mode 100644 index 0000000000..91a04a436c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxAlpFilterSettings { + int packetType; + android.hardware.tv.tuner.DemuxAlpLengthType lengthType = android.hardware.tv.tuner.DemuxAlpLengthType.UNDEFINED; + android.hardware.tv.tuner.DemuxAlpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..6b15492768 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxAlpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterType.aidl new file mode 100644 index 0000000000..c164f19282 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpFilterType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxAlpFilterType { + UNDEFINED, + SECTION, + PTP, + PAYLOAD_THROUGH, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpLengthType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpLengthType.aidl new file mode 100644 index 0000000000..59edc34007 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxAlpLengthType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DemuxAlpLengthType { + UNDEFINED = 0, + WITHOUT_ADDITIONAL_HEADER, + WITH_ADDITIONAL_HEADER, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxCapabilities.aidl new file mode 100644 index 0000000000..49afb94b6b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxCapabilities.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxCapabilities { + int numDemux; + int numRecord; + int numPlayback; + int numTsFilter; + int numSectionFilter; + int numAudioFilter; + int numVideoFilter; + int numPesFilter; + int numPcrFilter; + long numBytesInSectionFilter; + int filterCaps; + int[] linkCaps; + boolean bTimeFilter; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl new file mode 100644 index 0000000000..3e5df2d635 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterAvSettings { + boolean isPassthrough; + boolean isSecureMemory; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl new file mode 100644 index 0000000000..8a05dbd6b8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterDownloadEvent { + int itemId; + int downloadId; + int mpuSequenceNumber; + int itemFragmentIndex; + int lastItemFragmentIndex; + int dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl new file mode 100644 index 0000000000..86ce646f69 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterDownloadSettings { + boolean useDownloadId; + int downloadId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterEvent.aidl new file mode 100644 index 0000000000..617f71cc34 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterEvent.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterEvent { + android.hardware.tv.tuner.DemuxFilterSectionEvent section; + android.hardware.tv.tuner.DemuxFilterMediaEvent media; + android.hardware.tv.tuner.DemuxFilterPesEvent pes; + android.hardware.tv.tuner.DemuxFilterTsRecordEvent tsRecord; + android.hardware.tv.tuner.DemuxFilterMmtpRecordEvent mmtpRecord; + android.hardware.tv.tuner.DemuxFilterDownloadEvent download; + android.hardware.tv.tuner.DemuxFilterIpPayloadEvent ipPayload; + android.hardware.tv.tuner.DemuxFilterTemiEvent temi; + android.hardware.tv.tuner.DemuxFilterMonitorEvent monitorEvent; + int startId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl new file mode 100644 index 0000000000..9134df35c2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterIpPayloadEvent { + int dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMainType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMainType.aidl new file mode 100644 index 0000000000..b78965dfd3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMainType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxFilterMainType { + UNDEFINED = 0, + TS = (1 << 0) /* 1 */, + MMTP = (1 << 1) /* 2 */, + IP = (1 << 2) /* 4 */, + TLV = (1 << 3) /* 8 */, + ALP = (1 << 4) /* 16 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl new file mode 100644 index 0000000000..61a955590e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterMediaEvent { + int streamId; + boolean isPtsPresent; + long pts; + boolean isDtsPresent; + long dts; + long dataLength; + long offset; + android.hardware.common.NativeHandle avMemory; + boolean isSecureMemory; + long avDataId; + int mpuSequenceNumber; + boolean isPesPrivateData; + android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData extraMetaData; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl new file mode 100644 index 0000000000..28caf19580 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterMediaEventExtraMetaData { + boolean noinit; + android.hardware.tv.tuner.AudioExtraMetaData audio; + android.hardware.tv.tuner.AudioPresentation[] audioPresentations = {}; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl new file mode 100644 index 0000000000..4e31ba8c73 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterMmtpRecordEvent { + int scHevcIndexMask; + long byteNumber; + long pts; + int mpuSequenceNumber; + int firstMbInSlice; + int tsIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl new file mode 100644 index 0000000000..177de7a0c1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterMonitorEvent { + android.hardware.tv.tuner.ScramblingStatus scramblingStatus = android.hardware.tv.tuner.ScramblingStatus.UNKNOWN; + int cid; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl new file mode 100644 index 0000000000..062650b2e3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxFilterMonitorEventType { + SCRAMBLING_STATUS = (1 << 0) /* 1 */, + IP_CID_CHANGE = (1 << 1) /* 2 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl new file mode 100644 index 0000000000..2420142149 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterPesDataSettings { + int streamId; + boolean isRaw; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl new file mode 100644 index 0000000000..3ddd5e0a35 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterPesEvent { + int streamId; + int dataLength; + int mpuSequenceNumber; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl new file mode 100644 index 0000000000..02c478f4c1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterRecordSettings { + int tsIndexMask; + android.hardware.tv.tuner.DemuxRecordScIndexType scIndexType = android.hardware.tv.tuner.DemuxRecordScIndexType.NONE; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl new file mode 100644 index 0000000000..8dfc60eb54 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterScIndexMask { + int scIndex; + int scAvc; + int scHevc; + int scVvc; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl new file mode 100644 index 0000000000..b666c7b6ba --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionBits { + byte[] filter; + byte[] mask; + byte[] mode; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl new file mode 100644 index 0000000000..199a09c747 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionEvent { + int tableId; + int version; + int sectionNum; + long dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl new file mode 100644 index 0000000000..7936e59001 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionSettings { + android.hardware.tv.tuner.DemuxFilterSectionSettingsCondition condition; + boolean isCheckCrc; + boolean isRepeat; + boolean isRaw; + int bitWidthOfLengthField; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl new file mode 100644 index 0000000000..0b101dece4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSectionSettingsCondition { + android.hardware.tv.tuner.DemuxFilterSectionBits sectionBits; + android.hardware.tv.tuner.DemuxFilterSectionSettingsConditionTableInfo tableInfo; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl new file mode 100644 index 0000000000..82d30cbf7e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionSettingsConditionTableInfo { + int tableId; + int version; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSettings.aidl new file mode 100644 index 0000000000..c12fde25ab --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSettings { + android.hardware.tv.tuner.DemuxTsFilterSettings ts; + android.hardware.tv.tuner.DemuxMmtpFilterSettings mmtp; + android.hardware.tv.tuner.DemuxIpFilterSettings ip; + android.hardware.tv.tuner.DemuxTlvFilterSettings tlv; + android.hardware.tv.tuner.DemuxAlpFilterSettings alp; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterStatus.aidl new file mode 100644 index 0000000000..cfc5838946 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DemuxFilterStatus { + DATA_READY = (1 << 0) /* 1 */, + LOW_WATER = (1 << 1) /* 2 */, + HIGH_WATER = (1 << 2) /* 4 */, + OVERFLOW = (1 << 3) /* 8 */, + NO_DATA = (1 << 4) /* 16 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSubType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSubType.aidl new file mode 100644 index 0000000000..2e2a774535 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterSubType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSubType { + android.hardware.tv.tuner.DemuxTsFilterType tsFilterType = android.hardware.tv.tuner.DemuxTsFilterType.UNDEFINED; + android.hardware.tv.tuner.DemuxMmtpFilterType mmtpFilterType; + android.hardware.tv.tuner.DemuxIpFilterType ipFilterType; + android.hardware.tv.tuner.DemuxTlvFilterType tlvFilterType; + android.hardware.tv.tuner.DemuxAlpFilterType alpFilterType; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl new file mode 100644 index 0000000000..ce158618e3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterTemiEvent { + long pts; + byte descrTag; + byte[] descrData; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl new file mode 100644 index 0000000000..5c27faf95d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterTsRecordEvent { + android.hardware.tv.tuner.DemuxPid pid; + int tsIndexMask; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; + long byteNumber; + long pts; + int firstMbInSlice; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterType.aidl new file mode 100644 index 0000000000..b2f499d65d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxFilterType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterType { + android.hardware.tv.tuner.DemuxFilterMainType mainType = android.hardware.tv.tuner.DemuxFilterMainType.UNDEFINED; + android.hardware.tv.tuner.DemuxFilterSubType subType; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxInfo.aidl new file mode 100644 index 0000000000..12f9dc8a05 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxInfo { + int filterTypes = android.hardware.tv.tuner.DemuxFilterMainType.UNDEFINED /* 0 */; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpAddress.aidl new file mode 100644 index 0000000000..a044a19d7e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpAddress.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxIpAddress { + android.hardware.tv.tuner.DemuxIpAddressIpAddress srcIpAddress; + android.hardware.tv.tuner.DemuxIpAddressIpAddress dstIpAddress; + int srcPort; + int dstPort; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl new file mode 100644 index 0000000000..62de08847e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxIpAddressIpAddress { + byte[] v4 = {}; + byte[] v6; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl new file mode 100644 index 0000000000..2b0610b4ef --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxIpFilterSettings { + android.hardware.tv.tuner.DemuxIpAddress ipAddr; + android.hardware.tv.tuner.DemuxIpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..daac2847a6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxIpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterType.aidl new file mode 100644 index 0000000000..7320aec497 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxIpFilterType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxIpFilterType { + UNDEFINED, + SECTION, + NTP, + IP_PAYLOAD, + IP, + PAYLOAD_THROUGH, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl new file mode 100644 index 0000000000..b22c564cf9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxMmtpFilterSettings { + int mmtpPid; + android.hardware.tv.tuner.DemuxMmtpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..4b23306818 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxMmtpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + android.hardware.tv.tuner.DemuxFilterAvSettings av; + android.hardware.tv.tuner.DemuxFilterPesDataSettings pesData; + android.hardware.tv.tuner.DemuxFilterRecordSettings record; + android.hardware.tv.tuner.DemuxFilterDownloadSettings download; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl new file mode 100644 index 0000000000..a89c5b1650 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxMmtpFilterType { + UNDEFINED, + SECTION, + PES, + MMTP, + AUDIO, + VIDEO, + RECORD, + DOWNLOAD, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxPid.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxPid.aidl new file mode 100644 index 0000000000..c452f35b36 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxPid.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxPid { + int tPid; + int mmtpPid; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl new file mode 100644 index 0000000000..ecb4e8b28e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxQueueNotifyBits { + DATA_READY = (1 << 0) /* 1 */, + DATA_CONSUMED = (1 << 1) /* 2 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl new file mode 100644 index 0000000000..5556bb2533 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxRecordScIndexType { + NONE, + SC, + SC_HEVC, + SC_AVC, + SC_VVC, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScAvcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScAvcIndex.aidl new file mode 100644 index 0000000000..5c5179304e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScAvcIndex.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScAvcIndex { + UNDEFINED = 0, + I_SLICE = (1 << 0) /* 1 */, + P_SLICE = (1 << 1) /* 2 */, + B_SLICE = (1 << 2) /* 4 */, + SI_SLICE = (1 << 3) /* 8 */, + SP_SLICE = (1 << 4) /* 16 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScHevcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScHevcIndex.aidl new file mode 100644 index 0000000000..d07bcb7ba3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScHevcIndex.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScHevcIndex { + UNDEFINED = 0, + SPS = (1 << 0) /* 1 */, + AUD = (1 << 1) /* 2 */, + SLICE_CE_BLA_W_LP = (1 << 2) /* 4 */, + SLICE_BLA_W_RADL = (1 << 3) /* 8 */, + SLICE_BLA_N_LP = (1 << 4) /* 16 */, + SLICE_IDR_W_RADL = (1 << 5) /* 32 */, + SLICE_IDR_N_LP = (1 << 6) /* 64 */, + SLICE_TRAIL_CRA = (1 << 7) /* 128 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScIndex.aidl new file mode 100644 index 0000000000..509c1abbc8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScIndex.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScIndex { + UNDEFINED = 0, + I_FRAME = (1 << 0) /* 1 */, + P_FRAME = (1 << 1) /* 2 */, + B_FRAME = (1 << 2) /* 4 */, + SEQUENCE = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScVvcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScVvcIndex.aidl new file mode 100644 index 0000000000..ac3a5e668f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxScVvcIndex.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScVvcIndex { + UNDEFINED = 0, + SLICE_IDR_W_RADL = (1 << 0) /* 1 */, + SLICE_IDR_N_LP = (1 << 1) /* 2 */, + SLICE_CRA = (1 << 2) /* 4 */, + SLICE_GDR = (1 << 3) /* 8 */, + VPS = (1 << 4) /* 16 */, + SPS = (1 << 5) /* 32 */, + AUD = (1 << 6) /* 64 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl new file mode 100644 index 0000000000..ddb61cea79 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxTlvFilterSettings { + int packetType; + boolean isCompressedIpPacket; + android.hardware.tv.tuner.DemuxTlvFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..a9d319803c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxTlvFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterType.aidl new file mode 100644 index 0000000000..bd9e583150 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTlvFilterType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTlvFilterType { + UNDEFINED, + SECTION, + TLV, + PAYLOAD_THROUGH, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl new file mode 100644 index 0000000000..d8d424f193 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxTsFilterSettings { + int tpid; + android.hardware.tv.tuner.DemuxTsFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..5d81bb6237 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxTsFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + android.hardware.tv.tuner.DemuxFilterAvSettings av; + android.hardware.tv.tuner.DemuxFilterPesDataSettings pesData; + android.hardware.tv.tuner.DemuxFilterRecordSettings record; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterType.aidl new file mode 100644 index 0000000000..8be0e95508 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsFilterType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTsFilterType { + UNDEFINED, + SECTION, + PES, + TS, + AUDIO, + VIDEO, + PCR, + RECORD, + TEMI, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsIndex.aidl new file mode 100644 index 0000000000..9ca684f4b2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DemuxTsIndex.aidl @@ -0,0 +1,56 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTsIndex { + FIRST_PACKET = (1 << 0) /* 1 */, + PAYLOAD_UNIT_START_INDICATOR = (1 << 1) /* 2 */, + CHANGE_TO_NOT_SCRAMBLED = (1 << 2) /* 4 */, + CHANGE_TO_EVEN_SCRAMBLED = (1 << 3) /* 8 */, + CHANGE_TO_ODD_SCRAMBLED = (1 << 4) /* 16 */, + DISCONTINUITY_INDICATOR = (1 << 5) /* 32 */, + RANDOM_ACCESS_INDICATOR = (1 << 6) /* 64 */, + PRIORITY_INDICATOR = (1 << 7) /* 128 */, + PCR_FLAG = (1 << 8) /* 256 */, + OPCR_FLAG = (1 << 9) /* 512 */, + SPLICING_POINT_FLAG = (1 << 10) /* 1024 */, + PRIVATE_DATA = (1 << 11) /* 2048 */, + ADAPTATION_EXTENSION_FLAG = (1 << 12) /* 4096 */, + MPT_INDEX_MPT = (1 << 16) /* 65536 */, + MPT_INDEX_VIDEO = (1 << 17) /* 131072 */, + MPT_INDEX_AUDIO = (1 << 18) /* 262144 */, + MPT_INDEX_TIMESTAMP_TARGET_VIDEO = (1 << 19) /* 524288 */, + MPT_INDEX_TIMESTAMP_TARGET_AUDIO = (1 << 20) /* 1048576 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DvrSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DvrSettings.aidl new file mode 100644 index 0000000000..26f864a08e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DvrSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DvrSettings { + android.hardware.tv.tuner.RecordSettings record; + android.hardware.tv.tuner.PlaybackSettings playback; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DvrType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DvrType.aidl new file mode 100644 index 0000000000..6dab74b301 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/DvrType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DvrType { + RECORD, + PLAYBACK, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FilterDelayHint.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FilterDelayHint.aidl new file mode 100644 index 0000000000..1fdafd2f09 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FilterDelayHint.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FilterDelayHint { + android.hardware.tv.tuner.FilterDelayHintType hintType = android.hardware.tv.tuner.FilterDelayHintType.INVALID; + int hintValue; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FilterDelayHintType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FilterDelayHintType.aidl new file mode 100644 index 0000000000..af35c70e5d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FilterDelayHintType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FilterDelayHintType { + INVALID, + TIME_DELAY_IN_MS, + DATA_SIZE_DELAY_IN_BYTES, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl new file mode 100644 index 0000000000..45aa2af498 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogAftFlag { + UNDEFINED, + AFT_TRUE, + AFT_FALSE, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl new file mode 100644 index 0000000000..46131be795 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAnalogCapabilities { + int typeCap; + int sifStandardCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogSettings.aidl new file mode 100644 index 0000000000..33e934739c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAnalogSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogType type = android.hardware.tv.tuner.FrontendAnalogType.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogAftFlag aftFlag = android.hardware.tv.tuner.FrontendAnalogAftFlag.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogSifStandard sifStandard = android.hardware.tv.tuner.FrontendAnalogSifStandard.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl new file mode 100644 index 0000000000..8d19461d06 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl @@ -0,0 +1,57 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogSifStandard { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + BG = (1 << 1) /* 2 */, + BG_A2 = (1 << 2) /* 4 */, + BG_NICAM = (1 << 3) /* 8 */, + I = (1 << 4) /* 16 */, + DK = (1 << 5) /* 32 */, + DK1_A2 = (1 << 6) /* 64 */, + DK2_A2 = (1 << 7) /* 128 */, + DK3_A2 = (1 << 8) /* 256 */, + DK_NICAM = (1 << 9) /* 512 */, + L = (1 << 10) /* 1024 */, + M = (1 << 11) /* 2048 */, + M_BTSC = (1 << 12) /* 4096 */, + M_A2 = (1 << 13) /* 8192 */, + M_EIAJ = (1 << 14) /* 16384 */, + I_NICAM = (1 << 15) /* 32768 */, + L_NICAM = (1 << 16) /* 65536 */, + L_PRIME = (1 << 17) /* 131072 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogType.aidl new file mode 100644 index 0000000000..bf8b00094c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAnalogType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogType { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + PAL = (1 << 1) /* 2 */, + PAL_M = (1 << 2) /* 4 */, + PAL_N = (1 << 3) /* 8 */, + PAL_60 = (1 << 4) /* 16 */, + NTSC = (1 << 5) /* 32 */, + NTSC_443 = (1 << 6) /* 64 */, + SECAM = (1 << 7) /* 128 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl new file mode 100644 index 0000000000..9704f40a1e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Bandwidth { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + BANDWIDTH_6MHZ = (1 << 1) /* 2 */, + BANDWIDTH_7MHZ = (1 << 2) /* 4 */, + BANDWIDTH_8MHZ = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl new file mode 100644 index 0000000000..b2a25c7d49 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3Capabilities { + int bandwidthCap; + int modulationCap; + int timeInterleaveModeCap; + int codeRateCap; + int fecCap; + byte demodOutputFormatCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl new file mode 100644 index 0000000000..2d09271942 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3CodeRate { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CODERATE_2_15 = (1 << 1) /* 2 */, + CODERATE_3_15 = (1 << 2) /* 4 */, + CODERATE_4_15 = (1 << 3) /* 8 */, + CODERATE_5_15 = (1 << 4) /* 16 */, + CODERATE_6_15 = (1 << 5) /* 32 */, + CODERATE_7_15 = (1 << 6) /* 64 */, + CODERATE_8_15 = (1 << 7) /* 128 */, + CODERATE_9_15 = (1 << 8) /* 256 */, + CODERATE_10_15 = (1 << 9) /* 512 */, + CODERATE_11_15 = (1 << 10) /* 1024 */, + CODERATE_12_15 = (1 << 11) /* 2048 */, + CODERATE_13_15 = (1 << 12) /* 4096 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl new file mode 100644 index 0000000000..22267e7d30 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendAtsc3DemodOutputFormat { + UNDEFINED = 0, + ATSC3_LINKLAYER_PACKET = (1 << 0) /* 1 */, + BASEBAND_PACKET = (1 << 1) /* 2 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl new file mode 100644 index 0000000000..2e229c0a46 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Fec { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + BCH_LDPC_16K = (1 << 1) /* 2 */, + BCH_LDPC_64K = (1 << 2) /* 4 */, + CRC_LDPC_16K = (1 << 3) /* 8 */, + CRC_LDPC_64K = (1 << 4) /* 16 */, + LDPC_16K = (1 << 5) /* 32 */, + LDPC_64K = (1 << 6) /* 64 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl new file mode 100644 index 0000000000..cbe8c1f0cc --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Modulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_QPSK = (1 << 1) /* 2 */, + MOD_16QAM = (1 << 2) /* 4 */, + MOD_64QAM = (1 << 3) /* 8 */, + MOD_256QAM = (1 << 4) /* 16 */, + MOD_1024QAM = (1 << 5) /* 32 */, + MOD_4096QAM = (1 << 6) /* 64 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl new file mode 100644 index 0000000000..6301f96c61 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3PlpSettings { + int plpId; + android.hardware.tv.tuner.FrontendAtsc3Modulation modulation = android.hardware.tv.tuner.FrontendAtsc3Modulation.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3CodeRate codeRate = android.hardware.tv.tuner.FrontendAtsc3CodeRate.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3Fec fec = android.hardware.tv.tuner.FrontendAtsc3Fec.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl new file mode 100644 index 0000000000..3cbb0d0337 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3Settings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendAtsc3Bandwidth bandwidth = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat demodOutputFormat = android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3PlpSettings[] plpSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl new file mode 100644 index 0000000000..4e706414f4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3TimeInterleaveMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CTI = (1 << 1) /* 2 */, + HTI = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl new file mode 100644 index 0000000000..c24afae7b0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtscCapabilities { + int modulationCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscModulation.aidl new file mode 100644 index 0000000000..7da48f1f83 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscModulation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtscModulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_8VSB = (1 << 2) /* 4 */, + MOD_16VSB = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscSettings.aidl new file mode 100644 index 0000000000..9121c12d5d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendAtscSettings.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtscSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAtscModulation modulation = android.hardware.tv.tuner.FrontendAtscModulation.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendBandwidth.aidl new file mode 100644 index 0000000000..5355637422 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendBandwidth { + android.hardware.tv.tuner.FrontendAtsc3Bandwidth atsc3 = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcBandwidth dvbc; + android.hardware.tv.tuner.FrontendDvbtBandwidth dvbt; + android.hardware.tv.tuner.FrontendIsdbtBandwidth isdbt; + android.hardware.tv.tuner.FrontendDtmbBandwidth dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl new file mode 100644 index 0000000000..61cbf12dd0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendCableTimeInterleaveMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + INTERLEAVING_128_1_0 = (1 << 1) /* 2 */, + INTERLEAVING_128_1_1 = (1 << 2) /* 4 */, + INTERLEAVING_64_2 = (1 << 3) /* 8 */, + INTERLEAVING_32_4 = (1 << 4) /* 16 */, + INTERLEAVING_16_8 = (1 << 5) /* 32 */, + INTERLEAVING_8_16 = (1 << 6) /* 64 */, + INTERLEAVING_128_2 = (1 << 7) /* 128 */, + INTERLEAVING_128_3 = (1 << 8) /* 256 */, + INTERLEAVING_128_4 = (1 << 9) /* 512 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendCapabilities.aidl new file mode 100644 index 0000000000..c9443b1782 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendCapabilities.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendCapabilities { + android.hardware.tv.tuner.FrontendAnalogCapabilities analogCaps; + android.hardware.tv.tuner.FrontendAtscCapabilities atscCaps; + android.hardware.tv.tuner.FrontendAtsc3Capabilities atsc3Caps; + android.hardware.tv.tuner.FrontendDtmbCapabilities dtmbCaps; + android.hardware.tv.tuner.FrontendDvbsCapabilities dvbsCaps; + android.hardware.tv.tuner.FrontendDvbcCapabilities dvbcCaps; + android.hardware.tv.tuner.FrontendDvbtCapabilities dvbtCaps; + android.hardware.tv.tuner.FrontendIsdbsCapabilities isdbsCaps; + android.hardware.tv.tuner.FrontendIsdbs3Capabilities isdbs3Caps; + android.hardware.tv.tuner.FrontendIsdbtCapabilities isdbtCaps; + @nullable android.hardware.tv.tuner.FrontendIptvCapabilities iptvCaps; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl new file mode 100644 index 0000000000..6f62d91c65 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbBandwidth { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + BANDWIDTH_8MHZ = (1 << 1) /* 2 */, + BANDWIDTH_6MHZ = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl new file mode 100644 index 0000000000..8d35104e09 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDtmbCapabilities { + int transmissionModeCap; + int bandwidthCap; + int modulationCap; + int codeRateCap; + int guardIntervalCap; + int interleaveModeCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl new file mode 100644 index 0000000000..d6be639739 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbCodeRate { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CODERATE_2_5 = (1 << 1) /* 2 */, + CODERATE_3_5 = (1 << 2) /* 4 */, + CODERATE_4_5 = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl new file mode 100644 index 0000000000..5626064634 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbGuardInterval { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + PN_420_VARIOUS = (1 << 1) /* 2 */, + PN_595_CONST = (1 << 2) /* 4 */, + PN_945_VARIOUS = (1 << 3) /* 8 */, + PN_420_CONST = (1 << 4) /* 16 */, + PN_945_CONST = (1 << 5) /* 32 */, + PN_RESERVED = (1 << 6) /* 64 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbModulation.aidl new file mode 100644 index 0000000000..036e64b7bf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbModulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbModulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CONSTELLATION_4QAM = (1 << 1) /* 2 */, + CONSTELLATION_4QAM_NR = (1 << 2) /* 4 */, + CONSTELLATION_16QAM = (1 << 3) /* 8 */, + CONSTELLATION_32QAM = (1 << 4) /* 16 */, + CONSTELLATION_64QAM = (1 << 5) /* 32 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbSettings.aidl new file mode 100644 index 0000000000..5f9b775db1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDtmbSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDtmbTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbBandwidth bandwidth = android.hardware.tv.tuner.FrontendDtmbBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbModulation modulation = android.hardware.tv.tuner.FrontendDtmbModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbCodeRate codeRate = android.hardware.tv.tuner.FrontendDtmbCodeRate.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDtmbGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl new file mode 100644 index 0000000000..12238871ed --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbTimeInterleaveMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + TIMER_INT_240 = (1 << 1) /* 2 */, + TIMER_INT_720 = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl new file mode 100644 index 0000000000..0498825d30 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbTransmissionMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + C1 = (1 << 1) /* 2 */, + C3780 = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl new file mode 100644 index 0000000000..985add1534 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbcAnnex { + UNDEFINED = 0, + A = (1 << 0) /* 1 */, + B = (1 << 1) /* 2 */, + C = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl new file mode 100644 index 0000000000..c253cfe452 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcBandwidth { + UNDEFINED = 0, + BANDWIDTH_5MHZ = (1 << 0) /* 1 */, + BANDWIDTH_6MHZ = (1 << 1) /* 2 */, + BANDWIDTH_7MHZ = (1 << 2) /* 4 */, + BANDWIDTH_8MHZ = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl new file mode 100644 index 0000000000..0c0e3ee5d0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbcCapabilities { + int modulationCap; + long fecCap; + byte annexCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcModulation.aidl new file mode 100644 index 0000000000..c18e83e82b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcModulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcModulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_16QAM = (1 << 1) /* 2 */, + MOD_32QAM = (1 << 2) /* 4 */, + MOD_64QAM = (1 << 3) /* 8 */, + MOD_128QAM = (1 << 4) /* 16 */, + MOD_256QAM = (1 << 5) /* 32 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl new file mode 100644 index 0000000000..a6fbc6de4e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcOuterFec { + UNDEFINED = 0, + OUTER_FEC_NONE, + OUTER_FEC_RS, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcSettings.aidl new file mode 100644 index 0000000000..6b2caedf83 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbcSettings.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbcSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendDvbcModulation modulation = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendDvbcOuterFec outerFec = android.hardware.tv.tuner.FrontendDvbcOuterFec.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcAnnex annex = android.hardware.tv.tuner.FrontendDvbcAnnex.UNDEFINED; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendCableTimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendCableTimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbcBandwidth.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl new file mode 100644 index 0000000000..43e8aee23b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsCapabilities { + int modulationCap; + long innerfecCap; + byte standard; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl new file mode 100644 index 0000000000..4c3d4e466a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsCodeRate { + android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; + boolean isLinear; + boolean isShortFrames; + int bitsPer1000Symbol; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsModulation.aidl new file mode 100644 index 0000000000..71957d5b72 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsModulation.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsModulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_QPSK = (1 << 1) /* 2 */, + MOD_8PSK = (1 << 2) /* 4 */, + MOD_16QAM = (1 << 3) /* 8 */, + MOD_16PSK = (1 << 4) /* 16 */, + MOD_32PSK = (1 << 5) /* 32 */, + MOD_ACM = (1 << 6) /* 64 */, + MOD_8APSK = (1 << 7) /* 128 */, + MOD_16APSK = (1 << 8) /* 256 */, + MOD_32APSK = (1 << 9) /* 512 */, + MOD_64APSK = (1 << 10) /* 1024 */, + MOD_128APSK = (1 << 11) /* 2048 */, + MOD_256APSK = (1 << 12) /* 4096 */, + MOD_RESERVED = (1 << 13) /* 8192 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsPilot.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsPilot.aidl new file mode 100644 index 0000000000..e3543b3c2f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsPilot.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsPilot { + UNDEFINED, + ON, + OFF, + AUTO, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl new file mode 100644 index 0000000000..2181abf9ef --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsRolloff { + UNDEFINED, + ROLLOFF_0_35, + ROLLOFF_0_25, + ROLLOFF_0_20, + ROLLOFF_0_15, + ROLLOFF_0_10, + ROLLOFF_0_5, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsScanType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsScanType.aidl new file mode 100644 index 0000000000..46edb56be2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsScanType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsScanType { + UNDEFINED = 0, + DIRECT, + DISEQC, + UNICABLE, + JESS, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsSettings.aidl new file mode 100644 index 0000000000..dab8888b65 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsSettings.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation modulation = android.hardware.tv.tuner.FrontendDvbsModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsCodeRate coderate; + int symbolRate; + android.hardware.tv.tuner.FrontendDvbsRolloff rolloff = android.hardware.tv.tuner.FrontendDvbsRolloff.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsPilot pilot = android.hardware.tv.tuner.FrontendDvbsPilot.UNDEFINED; + int inputStreamId; + android.hardware.tv.tuner.FrontendDvbsStandard standard = android.hardware.tv.tuner.FrontendDvbsStandard.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsVcmMode vcmMode = android.hardware.tv.tuner.FrontendDvbsVcmMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsScanType scanType = android.hardware.tv.tuner.FrontendDvbsScanType.UNDEFINED; + boolean isDiseqcRxMessage; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsStandard.aidl new file mode 100644 index 0000000000..bcb1c6da11 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsStandard.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbsStandard { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + S = (1 << 1) /* 2 */, + S2 = (1 << 2) /* 4 */, + S2X = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl new file mode 100644 index 0000000000..af874230a9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsVcmMode { + UNDEFINED, + AUTO, + MANUAL, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl new file mode 100644 index 0000000000..ff2d9e4762 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtBandwidth { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + BANDWIDTH_8MHZ = (1 << 1) /* 2 */, + BANDWIDTH_7MHZ = (1 << 2) /* 4 */, + BANDWIDTH_6MHZ = (1 << 3) /* 8 */, + BANDWIDTH_5MHZ = (1 << 4) /* 16 */, + BANDWIDTH_1_7MHZ = (1 << 5) /* 32 */, + BANDWIDTH_10MHZ = (1 << 6) /* 64 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl new file mode 100644 index 0000000000..a0e6ce2710 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbtCapabilities { + int transmissionModeCap; + int bandwidthCap; + int constellationCap; + int coderateCap; + int hierarchyCap; + int guardIntervalCap; + boolean isT2Supported; + boolean isMisoSupported; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl new file mode 100644 index 0000000000..8d2df06f30 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtCoderate { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CODERATE_1_2 = (1 << 1) /* 2 */, + CODERATE_2_3 = (1 << 2) /* 4 */, + CODERATE_3_4 = (1 << 3) /* 8 */, + CODERATE_5_6 = (1 << 4) /* 16 */, + CODERATE_7_8 = (1 << 5) /* 32 */, + CODERATE_3_5 = (1 << 6) /* 64 */, + CODERATE_4_5 = (1 << 7) /* 128 */, + CODERATE_6_7 = (1 << 8) /* 256 */, + CODERATE_8_9 = (1 << 9) /* 512 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl new file mode 100644 index 0000000000..4bd5691b9e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtConstellation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CONSTELLATION_QPSK = (1 << 1) /* 2 */, + CONSTELLATION_16QAM = (1 << 2) /* 4 */, + CONSTELLATION_64QAM = (1 << 3) /* 8 */, + CONSTELLATION_256QAM = (1 << 4) /* 16 */, + CONSTELLATION_QPSK_R = (1 << 5) /* 32 */, + CONSTELLATION_16QAM_R = (1 << 6) /* 64 */, + CONSTELLATION_64QAM_R = (1 << 7) /* 128 */, + CONSTELLATION_256QAM_R = (1 << 8) /* 256 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl new file mode 100644 index 0000000000..01c2b66b50 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtGuardInterval { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + INTERVAL_1_32 = (1 << 1) /* 2 */, + INTERVAL_1_16 = (1 << 2) /* 4 */, + INTERVAL_1_8 = (1 << 3) /* 8 */, + INTERVAL_1_4 = (1 << 4) /* 16 */, + INTERVAL_1_128 = (1 << 5) /* 32 */, + INTERVAL_19_128 = (1 << 6) /* 64 */, + INTERVAL_19_256 = (1 << 7) /* 128 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl new file mode 100644 index 0000000000..bd86479794 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtHierarchy { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + HIERARCHY_NON_NATIVE = (1 << 1) /* 2 */, + HIERARCHY_1_NATIVE = (1 << 2) /* 4 */, + HIERARCHY_2_NATIVE = (1 << 3) /* 8 */, + HIERARCHY_4_NATIVE = (1 << 4) /* 16 */, + HIERARCHY_NON_INDEPTH = (1 << 5) /* 32 */, + HIERARCHY_1_INDEPTH = (1 << 6) /* 64 */, + HIERARCHY_2_INDEPTH = (1 << 7) /* 128 */, + HIERARCHY_4_INDEPTH = (1 << 8) /* 256 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl new file mode 100644 index 0000000000..dc8e12c6ed --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtPlpMode { + UNDEFINED, + AUTO, + MANUAL, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtSettings.aidl new file mode 100644 index 0000000000..ec1277aa99 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtSettings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbtSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbtBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtConstellation constellation = android.hardware.tv.tuner.FrontendDvbtConstellation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy = android.hardware.tv.tuner.FrontendDvbtHierarchy.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate hpCoderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate lpCoderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + boolean isHighPriority; + android.hardware.tv.tuner.FrontendDvbtStandard standard = android.hardware.tv.tuner.FrontendDvbtStandard.UNDEFINED; + boolean isMiso; + android.hardware.tv.tuner.FrontendDvbtPlpMode plpMode = android.hardware.tv.tuner.FrontendDvbtPlpMode.UNDEFINED; + int plpId; + int plpGroupId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtStandard.aidl new file mode 100644 index 0000000000..080cc5cc84 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtStandard.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbtStandard { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + T = (1 << 1) /* 2 */, + T2 = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl new file mode 100644 index 0000000000..3731f8691d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtTransmissionMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MODE_2K = (1 << 1) /* 2 */, + MODE_8K = (1 << 2) /* 4 */, + MODE_4K = (1 << 3) /* 8 */, + MODE_1K = (1 << 4) /* 16 */, + MODE_16K = (1 << 5) /* 32 */, + MODE_32K = (1 << 6) /* 64 */, + MODE_8K_E = (1 << 7) /* 128 */, + MODE_16K_E = (1 << 8) /* 256 */, + MODE_32K_E = (1 << 9) /* 512 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendEventType.aidl new file mode 100644 index 0000000000..101e347153 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendEventType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendEventType { + LOCKED, + NO_SIGNAL, + LOST_LOCK, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendGuardInterval.aidl new file mode 100644 index 0000000000..15c738a47c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendGuardInterval.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendGuardInterval { + android.hardware.tv.tuner.FrontendDvbtGuardInterval dvbt = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtGuardInterval isdbt; + android.hardware.tv.tuner.FrontendDtmbGuardInterval dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInfo.aidl new file mode 100644 index 0000000000..d5bdd58505 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInfo.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendInfo { + android.hardware.tv.tuner.FrontendType type = android.hardware.tv.tuner.FrontendType.UNDEFINED; + long minFrequency; + long maxFrequency; + int minSymbolRate; + int maxSymbolRate; + long acquireRange; + int exclusiveGroupId; + android.hardware.tv.tuner.FrontendStatusType[] statusCaps; + android.hardware.tv.tuner.FrontendCapabilities frontendCaps; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInnerFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInnerFec.aidl new file mode 100644 index 0000000000..da91888d73 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInnerFec.aidl @@ -0,0 +1,92 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="long") @VintfStability +enum FrontendInnerFec { + FEC_UNDEFINED = 0, + AUTO = (1L << 0) /* 1 */, + FEC_1_2 = (1L << 1) /* 2 */, + FEC_1_3 = (1L << 2) /* 4 */, + FEC_1_4 = (1L << 3) /* 8 */, + FEC_1_5 = (1L << 4) /* 16 */, + FEC_2_3 = (1L << 5) /* 32 */, + FEC_2_5 = (1L << 6) /* 64 */, + FEC_2_9 = (1L << 7) /* 128 */, + FEC_3_4 = (1L << 8) /* 256 */, + FEC_3_5 = (1L << 9) /* 512 */, + FEC_4_5 = (1L << 10) /* 1024 */, + FEC_4_15 = (1L << 11) /* 2048 */, + FEC_5_6 = (1L << 12) /* 4096 */, + FEC_5_9 = (1L << 13) /* 8192 */, + FEC_6_7 = (1L << 14) /* 16384 */, + FEC_7_8 = (1L << 15) /* 32768 */, + FEC_7_9 = (1L << 16) /* 65536 */, + FEC_7_15 = (1L << 17) /* 131072 */, + FEC_8_9 = (1L << 18) /* 262144 */, + FEC_8_15 = (1L << 19) /* 524288 */, + FEC_9_10 = (1L << 20) /* 1048576 */, + FEC_9_20 = (1L << 21) /* 2097152 */, + FEC_11_15 = (1L << 22) /* 4194304 */, + FEC_11_20 = (1L << 23) /* 8388608 */, + FEC_11_45 = (1L << 24) /* 16777216 */, + FEC_13_18 = (1L << 25) /* 33554432 */, + FEC_13_45 = (1L << 26) /* 67108864 */, + FEC_14_45 = (1L << 27) /* 134217728 */, + FEC_23_36 = (1L << 28) /* 268435456 */, + FEC_25_36 = (1L << 29) /* 536870912 */, + FEC_26_45 = (1L << 30) /* 1073741824 */, + FEC_28_45 = (1L << 31) /* 2147483648 */, + FEC_29_45 = (1L << 32) /* 4294967296 */, + FEC_31_45 = (1L << 33) /* 8589934592 */, + FEC_32_45 = (1L << 34) /* 17179869184 */, + FEC_77_90 = (1L << 35) /* 34359738368 */, + FEC_2_15 = (1L << 36) /* 68719476736 */, + FEC_3_15 = (1L << 37) /* 137438953472 */, + FEC_5_15 = (1L << 38) /* 274877906944 */, + FEC_6_15 = (1L << 39) /* 549755813888 */, + FEC_9_15 = (1L << 40) /* 1099511627776 */, + FEC_10_15 = (1L << 41) /* 2199023255552 */, + FEC_12_15 = (1L << 42) /* 4398046511104 */, + FEC_13_15 = (1L << 43) /* 8796093022208 */, + FEC_18_30 = (1L << 44) /* 17592186044416 */, + FEC_20_30 = (1L << 45) /* 35184372088832 */, + FEC_90_180 = (1L << 46) /* 70368744177664 */, + FEC_96_180 = (1L << 47) /* 140737488355328 */, + FEC_104_180 = (1L << 48) /* 281474976710656 */, + FEC_128_180 = (1L << 49) /* 562949953421312 */, + FEC_132_180 = (1L << 50) /* 1125899906842624 */, + FEC_135_180 = (1L << 51) /* 2251799813685248 */, + FEC_140_180 = (1L << 52) /* 4503599627370496 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInterleaveMode.aidl new file mode 100644 index 0000000000..ac38731260 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendInterleaveMode { + android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode atsc3 = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendCableTimeInterleaveMode dvbc; + android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode dtmb; + android.hardware.tv.tuner.FrontendIsdbtTimeInterleaveMode isdbt; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl new file mode 100644 index 0000000000..543543df96 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIptvCapabilities { + int protocolCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettings.aidl new file mode 100644 index 0000000000..73582f3efb --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIptvSettings { + android.hardware.tv.tuner.FrontendIptvSettingsProtocol protocol = android.hardware.tv.tuner.FrontendIptvSettingsProtocol.UNDEFINED; + android.hardware.tv.tuner.FrontendIptvSettingsFec fec; + android.hardware.tv.tuner.FrontendIptvSettingsIgmp igmp = android.hardware.tv.tuner.FrontendIptvSettingsIgmp.UNDEFINED; + long bitrate; + android.hardware.tv.tuner.DemuxIpAddress ipAddr; + String contentUrl; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl new file mode 100644 index 0000000000..c3613772ef --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIptvSettingsFec { + android.hardware.tv.tuner.FrontendIptvSettingsFecType type; + int fecColNum; + int fecRowNum; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl new file mode 100644 index 0000000000..5806cc5018 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIptvSettingsFecType { + UNDEFINED = 0, + COLUMN = (1 << 0) /* 1 */, + ROW = (1 << 1) /* 2 */, + COLUMN_ROW = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl new file mode 100644 index 0000000000..43ae523f19 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIptvSettingsIgmp { + UNDEFINED = 0, + V1 = (1 << 0) /* 1 */, + V2 = (1 << 1) /* 2 */, + V3 = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl new file mode 100644 index 0000000000..2e4c47851b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIptvSettingsProtocol { + UNDEFINED = 0, + UDP = (1 << 0) /* 1 */, + RTP = (1 << 1) /* 2 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl new file mode 100644 index 0000000000..4be37c2006 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbs3Capabilities { + int modulationCap; + int coderateCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl new file mode 100644 index 0000000000..de865cae01 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Coderate { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CODERATE_1_3 = (1 << 1) /* 2 */, + CODERATE_2_5 = (1 << 2) /* 4 */, + CODERATE_1_2 = (1 << 3) /* 8 */, + CODERATE_3_5 = (1 << 4) /* 16 */, + CODERATE_2_3 = (1 << 5) /* 32 */, + CODERATE_3_4 = (1 << 6) /* 64 */, + CODERATE_7_9 = (1 << 7) /* 128 */, + CODERATE_4_5 = (1 << 8) /* 256 */, + CODERATE_5_6 = (1 << 9) /* 512 */, + CODERATE_7_8 = (1 << 10) /* 1024 */, + CODERATE_9_10 = (1 << 11) /* 2048 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl new file mode 100644 index 0000000000..adc902d591 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Modulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_BPSK = (1 << 1) /* 2 */, + MOD_QPSK = (1 << 2) /* 4 */, + MOD_8PSK = (1 << 3) /* 8 */, + MOD_16APSK = (1 << 4) /* 16 */, + MOD_32APSK = (1 << 5) /* 32 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl new file mode 100644 index 0000000000..c93cf2004a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Rolloff { + UNDEFINED, + ROLLOFF_0_03, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl new file mode 100644 index 0000000000..8c491d6fa2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbs3Settings { + long frequency; + long endFrequency; + int streamId; + android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbs3Modulation modulation = android.hardware.tv.tuner.FrontendIsdbs3Modulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbs3Coderate coderate = android.hardware.tv.tuner.FrontendIsdbs3Coderate.UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendIsdbs3Rolloff rolloff = android.hardware.tv.tuner.FrontendIsdbs3Rolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl new file mode 100644 index 0000000000..2cb892cd3d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbsCapabilities { + int modulationCap; + int coderateCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl new file mode 100644 index 0000000000..a0e436f540 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsCoderate { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CODERATE_1_2 = (1 << 1) /* 2 */, + CODERATE_2_3 = (1 << 2) /* 4 */, + CODERATE_3_4 = (1 << 3) /* 8 */, + CODERATE_5_6 = (1 << 4) /* 16 */, + CODERATE_7_8 = (1 << 5) /* 32 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl new file mode 100644 index 0000000000..61a21c397f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsModulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_BPSK = (1 << 1) /* 2 */, + MOD_QPSK = (1 << 2) /* 4 */, + MOD_TC8PSK = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl new file mode 100644 index 0000000000..b769231043 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsRolloff { + UNDEFINED, + ROLLOFF_0_35, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl new file mode 100644 index 0000000000..324fb6feb4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbsSettings { + long frequency; + long endFrequency; + int streamId; + android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsModulation modulation = android.hardware.tv.tuner.FrontendIsdbsModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsCoderate coderate = android.hardware.tv.tuner.FrontendIsdbsCoderate.UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendIsdbsRolloff rolloff = android.hardware.tv.tuner.FrontendIsdbsRolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl new file mode 100644 index 0000000000..77956b6278 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsStreamIdType { + STREAM_ID, + RELATIVE_STREAM_NUMBER, + UNDEFINED, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl new file mode 100644 index 0000000000..209620fddf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtBandwidth { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + BANDWIDTH_8MHZ = (1 << 1) /* 2 */, + BANDWIDTH_7MHZ = (1 << 2) /* 4 */, + BANDWIDTH_6MHZ = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl new file mode 100644 index 0000000000..dbf631b8c7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtCapabilities { + int modeCap; + int bandwidthCap; + int modulationCap; + int coderateCap; + int guardIntervalCap; + int timeInterleaveCap; + boolean isSegmentAuto; + boolean isFullSegment; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl new file mode 100644 index 0000000000..4236b7cf58 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtCoderate { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + CODERATE_1_2 = (1 << 1) /* 2 */, + CODERATE_2_3 = (1 << 2) /* 4 */, + CODERATE_3_4 = (1 << 3) /* 8 */, + CODERATE_5_6 = (1 << 4) /* 16 */, + CODERATE_7_8 = (1 << 5) /* 32 */, + CODERATE_3_5 = (1 << 6) /* 64 */, + CODERATE_4_5 = (1 << 7) /* 128 */, + CODERATE_6_7 = (1 << 8) /* 256 */, + CODERATE_8_9 = (1 << 9) /* 512 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl new file mode 100644 index 0000000000..86225e2ab1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtGuardInterval { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + INTERVAL_1_32 = (1 << 1) /* 2 */, + INTERVAL_1_16 = (1 << 2) /* 4 */, + INTERVAL_1_8 = (1 << 3) /* 8 */, + INTERVAL_1_4 = (1 << 4) /* 16 */, + INTERVAL_1_128 = (1 << 5) /* 32 */, + INTERVAL_19_128 = (1 << 6) /* 64 */, + INTERVAL_19_256 = (1 << 7) /* 128 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl new file mode 100644 index 0000000000..0055793439 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtLayerSettings { + android.hardware.tv.tuner.FrontendIsdbtModulation modulation = android.hardware.tv.tuner.FrontendIsdbtModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtCoderate coderate = android.hardware.tv.tuner.FrontendIsdbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtTimeInterleaveMode timeInterleave = android.hardware.tv.tuner.FrontendIsdbtTimeInterleaveMode.UNDEFINED; + int numOfSegment; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtMode.aidl new file mode 100644 index 0000000000..0e38c26370 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtMode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MODE_1 = (1 << 1) /* 2 */, + MODE_2 = (1 << 2) /* 4 */, + MODE_3 = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl new file mode 100644 index 0000000000..4474c83917 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtModulation { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + MOD_DQPSK = (1 << 1) /* 2 */, + MOD_QPSK = (1 << 2) /* 4 */, + MOD_16QAM = (1 << 3) /* 8 */, + MOD_64QAM = (1 << 4) /* 16 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl new file mode 100644 index 0000000000..1387e662de --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtPartialReceptionFlag { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + FALSE = (1 << 1) /* 2 */, + TRUE = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl new file mode 100644 index 0000000000..605bc210e5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendIsdbtBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtMode mode = android.hardware.tv.tuner.FrontendIsdbtMode.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendIsdbtGuardInterval.UNDEFINED; + int serviceAreaId; + android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag = android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtLayerSettings[] layerSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl new file mode 100644 index 0000000000..b9d76ee5b1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtTimeInterleaveMode { + UNDEFINED = 0, + AUTO = (1 << 0) /* 1 */, + INTERLEAVE_1_0 = (1 << 1) /* 2 */, + INTERLEAVE_1_4 = (1 << 2) /* 4 */, + INTERLEAVE_1_8 = (1 << 3) /* 8 */, + INTERLEAVE_1_16 = (1 << 4) /* 16 */, + INTERLEAVE_2_0 = (1 << 5) /* 32 */, + INTERLEAVE_2_2 = (1 << 6) /* 64 */, + INTERLEAVE_2_4 = (1 << 7) /* 128 */, + INTERLEAVE_2_8 = (1 << 8) /* 256 */, + INTERLEAVE_3_0 = (1 << 9) /* 512 */, + INTERLEAVE_3_1 = (1 << 10) /* 1024 */, + INTERLEAVE_3_2 = (1 << 11) /* 2048 */, + INTERLEAVE_3_4 = (1 << 12) /* 4096 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendModulation.aidl new file mode 100644 index 0000000000..6e396b0422 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendModulation.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendModulation { + android.hardware.tv.tuner.FrontendDvbcModulation dvbc = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation dvbs; + android.hardware.tv.tuner.FrontendDvbtConstellation dvbt; + android.hardware.tv.tuner.FrontendIsdbsModulation isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Modulation isdbs3; + android.hardware.tv.tuner.FrontendIsdbtModulation isdbt; + android.hardware.tv.tuner.FrontendAtscModulation atsc; + android.hardware.tv.tuner.FrontendAtsc3Modulation atsc3; + android.hardware.tv.tuner.FrontendDtmbModulation dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendModulationStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendModulationStatus.aidl new file mode 100644 index 0000000000..723fdd044b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendModulationStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendModulationStatus { + android.hardware.tv.tuner.FrontendDvbcModulation dvbc = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation dvbs; + android.hardware.tv.tuner.FrontendIsdbsModulation isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Modulation isdbs3; + android.hardware.tv.tuner.FrontendIsdbtModulation isdbt; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendRollOff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendRollOff.aidl new file mode 100644 index 0000000000..c5f8b8e8b7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendRollOff.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendRollOff { + android.hardware.tv.tuner.FrontendDvbsRolloff dvbs = android.hardware.tv.tuner.FrontendDvbsRolloff.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsRolloff isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Rolloff isdbs3; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..56ef3e3d13 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendScanAtsc3PlpInfo { + int plpId; + boolean bLlsFlag; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessage.aidl new file mode 100644 index 0000000000..e763cfb617 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendScanMessage { + boolean isLocked; + boolean isEnd; + int progressPercent; + long[] frequencies; + int[] symbolRates; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; + android.hardware.tv.tuner.FrontendAnalogType analogType; + int[] plpIds; + int[] groupIds; + int[] inputStreamIds; + android.hardware.tv.tuner.FrontendScanMessageStandard std; + android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] atsc3PlpInfos; + android.hardware.tv.tuner.FrontendModulation modulation; + android.hardware.tv.tuner.FrontendDvbcAnnex annex; + boolean isHighPriority; + int[] dvbtCellIds; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl new file mode 100644 index 0000000000..e163fc6670 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendScanMessageStandard { + android.hardware.tv.tuner.FrontendDvbsStandard sStd = android.hardware.tv.tuner.FrontendDvbsStandard.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtStandard tStd; + android.hardware.tv.tuner.FrontendAnalogSifStandard sifStd; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessageType.aidl new file mode 100644 index 0000000000..186dbd7550 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanMessageType.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendScanMessageType { + LOCKED, + END, + PROGRESS_PERCENT, + FREQUENCY, + SYMBOL_RATE, + HIERARCHY, + ANALOG_TYPE, + PLP_IDS, + GROUP_IDS, + INPUT_STREAM_IDS, + STANDARD, + ATSC3_PLP_INFO, + MODULATION, + DVBC_ANNEX, + HIGH_PRIORITY, + DVBT_CELL_IDS, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanType.aidl new file mode 100644 index 0000000000..cef02ccd75 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendScanType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendScanType { + SCAN_UNDEFINED = 0, + SCAN_AUTO = (1 << 0) /* 1 */, + SCAN_BLIND = (1 << 1) /* 2 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendSettings.aidl new file mode 100644 index 0000000000..9810ba6490 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendSettings.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendSettings { + android.hardware.tv.tuner.FrontendAnalogSettings analog; + android.hardware.tv.tuner.FrontendAtscSettings atsc; + android.hardware.tv.tuner.FrontendAtsc3Settings atsc3; + android.hardware.tv.tuner.FrontendDvbsSettings dvbs; + android.hardware.tv.tuner.FrontendDvbcSettings dvbc; + android.hardware.tv.tuner.FrontendDvbtSettings dvbt; + android.hardware.tv.tuner.FrontendIsdbsSettings isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Settings isdbs3; + android.hardware.tv.tuner.FrontendIsdbtSettings isdbt; + android.hardware.tv.tuner.FrontendDtmbSettings dtmb; + @nullable android.hardware.tv.tuner.FrontendIptvSettings iptv; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendSpectralInversion.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendSpectralInversion.aidl new file mode 100644 index 0000000000..14ec2fd4b9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendSpectralInversion.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendSpectralInversion { + UNDEFINED, + NORMAL, + INVERTED, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatus.aidl new file mode 100644 index 0000000000..b991ab6836 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatus.aidl @@ -0,0 +1,85 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendStatus { + boolean isDemodLocked; + int snr; + int ber; + int per; + int preBer; + int signalQuality; + int signalStrength; + int symbolRate; + android.hardware.tv.tuner.FrontendInnerFec innerFec; + android.hardware.tv.tuner.FrontendModulationStatus modulationStatus; + android.hardware.tv.tuner.FrontendSpectralInversion inversion; + android.hardware.tv.tuner.LnbVoltage lnbVoltage; + int plpId; + boolean isEWBS; + int agc; + boolean isLnaOn; + boolean[] isLayerError; + int mer; + long freqOffset; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; + boolean isRfLocked; + android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo[] plpInfo; + android.hardware.tv.tuner.FrontendModulation[] modulations; + int[] bers; + android.hardware.tv.tuner.FrontendInnerFec[] codeRates; + android.hardware.tv.tuner.FrontendBandwidth bandwidth; + android.hardware.tv.tuner.FrontendGuardInterval interval; + android.hardware.tv.tuner.FrontendTransmissionMode transmissionMode; + int uec; + int systemId; + android.hardware.tv.tuner.FrontendInterleaveMode[] interleaving; + int[] isdbtSegment; + int[] tsDataRate; + android.hardware.tv.tuner.FrontendRollOff rollOff; + boolean isMiso; + boolean isLinear; + boolean isShortFrames; + android.hardware.tv.tuner.FrontendIsdbtMode isdbtMode; + android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag; + int[] streamIdList; + int[] dvbtCellIds; + android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] allPlpInfo; + String iptvContentUrl = ""; + long iptvPacketsReceived; + long iptvPacketsLost; + int iptvWorstJitterMs; + int iptvAverageJitterMs; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..8f65925236 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendStatusAtsc3PlpInfo { + int plpId; + boolean isLocked; + int uec; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusReadiness.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusReadiness.aidl new file mode 100644 index 0000000000..13735fae8e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusReadiness.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusReadiness { + UNDEFINED, + UNAVAILABLE, + UNSTABLE, + STABLE, + UNSUPPORTED, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusType.aidl new file mode 100644 index 0000000000..9f34e8ddcf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -0,0 +1,85 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusType { + DEMOD_LOCK, + SNR, + BER, + PER, + PRE_BER, + SIGNAL_QUALITY, + SIGNAL_STRENGTH, + SYMBOL_RATE, + FEC, + MODULATION, + SPECTRAL, + LNB_VOLTAGE, + PLP_ID, + EWBS, + AGC, + LNA, + LAYER_ERROR, + MER, + FREQ_OFFSET, + HIERARCHY, + RF_LOCK, + ATSC3_PLP_INFO, + MODULATIONS, + BERS, + CODERATES, + BANDWIDTH, + GUARD_INTERVAL, + TRANSMISSION_MODE, + UEC, + T2_SYSTEM_ID, + INTERLEAVINGS, + ISDBT_SEGMENTS, + TS_DATA_RATES, + ROLL_OFF, + IS_MISO, + IS_LINEAR, + IS_SHORT_FRAMES, + ISDBT_MODE, + ISDBT_PARTIAL_RECEPTION_FLAG, + STREAM_ID_LIST, + DVBT_CELL_IDS, + ATSC3_ALL_PLP_INFO, + IPTV_CONTENT_URL, + IPTV_PACKETS_LOST, + IPTV_PACKETS_RECEIVED, + IPTV_WORST_JITTER_MS, + IPTV_AVERAGE_JITTER_MS, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendTransmissionMode.aidl new file mode 100644 index 0000000000..72c36419ec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendTransmissionMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendTransmissionMode { + android.hardware.tv.tuner.FrontendDvbtTransmissionMode dvbt = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtMode isdbt; + android.hardware.tv.tuner.FrontendDtmbTransmissionMode dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendType.aidl new file mode 100644 index 0000000000..455bbc0551 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/FrontendType.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendType { + UNDEFINED = 0, + ANALOG, + ATSC, + ATSC3, + DVBC, + DVBS, + DVBT, + ISDBS, + ISDBS3, + ISDBT, + DTMB, + IPTV, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDemux.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDemux.aidl new file mode 100644 index 0000000000..59ec92ba3b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDemux.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDemux { + void setFrontendDataSource(in int frontendId); + android.hardware.tv.tuner.IFilter openFilter(in android.hardware.tv.tuner.DemuxFilterType type, in int bufferSize, in android.hardware.tv.tuner.IFilterCallback cb); + android.hardware.tv.tuner.ITimeFilter openTimeFilter(); + int getAvSyncHwId(in android.hardware.tv.tuner.IFilter filter); + long getAvSyncTime(in int avSyncHwId); + void close(); + android.hardware.tv.tuner.IDvr openDvr(in android.hardware.tv.tuner.DvrType type, in int bufferSize, in android.hardware.tv.tuner.IDvrCallback cb); + void connectCiCam(in int ciCamId); + void disconnectCiCam(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDescrambler.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDescrambler.aidl new file mode 100644 index 0000000000..3cf3c044ba --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDescrambler.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDescrambler { + void setDemuxSource(in int demuxId); + void setKeyToken(in byte[] keyToken); + void addPid(in android.hardware.tv.tuner.DemuxPid pid, in android.hardware.tv.tuner.IFilter optionalSourceFilter); + void removePid(in android.hardware.tv.tuner.DemuxPid pid, in android.hardware.tv.tuner.IFilter optionalSourceFilter); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDvr.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDvr.aidl new file mode 100644 index 0000000000..4648712393 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDvr.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDvr { + void getQueueDesc(out android.hardware.common.fmq.MQDescriptor queue); + void configure(in android.hardware.tv.tuner.DvrSettings settings); + void attachFilter(in android.hardware.tv.tuner.IFilter filter); + void detachFilter(in android.hardware.tv.tuner.IFilter filter); + void start(); + void stop(); + void flush(); + void close(); + void setStatusCheckIntervalHint(in long milliseconds); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDvrCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDvrCallback.aidl new file mode 100644 index 0000000000..13c8644b7b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IDvrCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDvrCallback { + oneway void onPlaybackStatus(in android.hardware.tv.tuner.PlaybackStatus status); + oneway void onRecordStatus(in android.hardware.tv.tuner.RecordStatus status); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFilter.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFilter.aidl new file mode 100644 index 0000000000..32d9d64f73 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFilter.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFilter { + void getQueueDesc(out android.hardware.common.fmq.MQDescriptor queue); + void close(); + void configure(in android.hardware.tv.tuner.DemuxFilterSettings settings); + void configureAvStreamType(in android.hardware.tv.tuner.AvStreamType avStreamType); + void configureIpCid(in int ipCid); + void configureMonitorEvent(in int monitorEventTypes); + void start(); + void stop(); + void flush(); + long getAvSharedHandle(out android.hardware.common.NativeHandle avMemory); + int getId(); + long getId64Bit(); + void releaseAvHandle(in android.hardware.common.NativeHandle avMemory, in long avDataId); + void setDataSource(in android.hardware.tv.tuner.IFilter filter); + void setDelayHint(in android.hardware.tv.tuner.FilterDelayHint hint); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFilterCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFilterCallback.aidl new file mode 100644 index 0000000000..d8bedba451 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFilterCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFilterCallback { + oneway void onFilterEvent(in android.hardware.tv.tuner.DemuxFilterEvent[] events); + oneway void onFilterStatus(in android.hardware.tv.tuner.DemuxFilterStatus status); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFrontend.aidl new file mode 100644 index 0000000000..3e3ff4fad6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFrontend.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFrontend { + void setCallback(in android.hardware.tv.tuner.IFrontendCallback callback); + void tune(in android.hardware.tv.tuner.FrontendSettings settings); + void stopTune(); + void close(); + void scan(in android.hardware.tv.tuner.FrontendSettings settings, in android.hardware.tv.tuner.FrontendScanType type); + void stopScan(); + android.hardware.tv.tuner.FrontendStatus[] getStatus(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); + void setLnb(in int lnbId); + int linkCiCam(in int ciCamId); + void unlinkCiCam(in int ciCamId); + String getHardwareInfo(); + void removeOutputPid(int pid); + android.hardware.tv.tuner.FrontendStatusReadiness[] getFrontendStatusReadiness(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFrontendCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFrontendCallback.aidl new file mode 100644 index 0000000000..c22d280834 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/IFrontendCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFrontendCallback { + oneway void onEvent(in android.hardware.tv.tuner.FrontendEventType frontendEventType); + oneway void onScanMessage(in android.hardware.tv.tuner.FrontendScanMessageType type, in android.hardware.tv.tuner.FrontendScanMessage message); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ILnb.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ILnb.aidl new file mode 100644 index 0000000000..c3fdd87e62 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ILnb.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ILnb { + void setCallback(in android.hardware.tv.tuner.ILnbCallback callback); + void setVoltage(in android.hardware.tv.tuner.LnbVoltage voltage); + void setTone(in android.hardware.tv.tuner.LnbTone tone); + void setSatellitePosition(in android.hardware.tv.tuner.LnbPosition position); + void sendDiseqcMessage(in byte[] diseqcMessage); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ILnbCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ILnbCallback.aidl new file mode 100644 index 0000000000..42e84da4d1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ILnbCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ILnbCallback { + oneway void onDiseqcMessage(in byte[] diseqcMessage); + oneway void onEvent(in android.hardware.tv.tuner.LnbEventType lnbEventType); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ITimeFilter.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ITimeFilter.aidl new file mode 100644 index 0000000000..838eeba1d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ITimeFilter.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ITimeFilter { + void setTimeStamp(in long timeStamp); + void clearTimeStamp(); + long getTimeStamp(); + long getSourceTime(); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ITuner.aidl new file mode 100644 index 0000000000..732f3fd952 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ITuner.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@SuppressWarnings(value={"out-array"}) @VintfStability +interface ITuner { + int[] getFrontendIds(); + android.hardware.tv.tuner.IFrontend openFrontendById(in int frontendId); + android.hardware.tv.tuner.IDemux openDemux(out int[] demuxId); + android.hardware.tv.tuner.DemuxCapabilities getDemuxCaps(); + android.hardware.tv.tuner.IDescrambler openDescrambler(); + android.hardware.tv.tuner.FrontendInfo getFrontendInfo(in int frontendId); + int[] getLnbIds(); + android.hardware.tv.tuner.ILnb openLnbById(in int lnbId); + android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId); + void setLna(in boolean bEnable); + void setMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType, in int maxNumber); + int getMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType); + boolean isLnaSupported(); + int[] getDemuxIds(); + android.hardware.tv.tuner.IDemux openDemuxById(in int demuxId); + android.hardware.tv.tuner.DemuxInfo getDemuxInfo(in int demuxId); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbEventType.aidl new file mode 100644 index 0000000000..7bec809d7f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbEventType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbEventType { + DISEQC_RX_OVERFLOW, + DISEQC_RX_TIMEOUT, + DISEQC_RX_PARITY_ERROR, + LNB_OVERLOAD, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbPosition.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbPosition.aidl new file mode 100644 index 0000000000..a4a5740630 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbPosition.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbPosition { + UNDEFINED, + POSITION_A, + POSITION_B, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbTone.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbTone.aidl new file mode 100644 index 0000000000..06283540d9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbTone.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbTone { + NONE, + CONTINUOUS, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbVoltage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbVoltage.aidl new file mode 100644 index 0000000000..b18ff0e120 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/LnbVoltage.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbVoltage { + NONE, + VOLTAGE_5V, + VOLTAGE_11V, + VOLTAGE_12V, + VOLTAGE_13V, + VOLTAGE_14V, + VOLTAGE_15V, + VOLTAGE_18V, + VOLTAGE_19V, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/PlaybackSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/PlaybackSettings.aidl new file mode 100644 index 0000000000..e0dd5db071 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/PlaybackSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable PlaybackSettings { + int statusMask; + long lowThreshold; + long highThreshold; + android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; + long packetSize; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/PlaybackStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/PlaybackStatus.aidl new file mode 100644 index 0000000000..a8b63782f2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/PlaybackStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum PlaybackStatus { + SPACE_EMPTY = (1 << 0) /* 1 */, + SPACE_ALMOST_EMPTY = (1 << 1) /* 2 */, + SPACE_ALMOST_FULL = (1 << 2) /* 4 */, + SPACE_FULL = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/RecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/RecordSettings.aidl new file mode 100644 index 0000000000..de693cd2d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/RecordSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable RecordSettings { + int statusMask; + long lowThreshold; + long highThreshold; + android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; + long packetSize; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/RecordStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/RecordStatus.aidl new file mode 100644 index 0000000000..e06b6160db --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/RecordStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum RecordStatus { + DATA_READY = (1 << 0) /* 1 */, + LOW_WATER = (1 << 1) /* 2 */, + HIGH_WATER = (1 << 2) /* 4 */, + OVERFLOW = (1 << 3) /* 8 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Result.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Result.aidl new file mode 100644 index 0000000000..ae43350549 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum Result { + SUCCESS, + UNAVAILABLE, + NOT_INITIALIZED, + INVALID_STATE, + INVALID_ARGUMENT, + OUT_OF_MEMORY, + UNKNOWN_ERROR, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ScramblingStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ScramblingStatus.aidl new file mode 100644 index 0000000000..4d52de17c3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/ScramblingStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum ScramblingStatus { + UNKNOWN = (1 << 0) /* 1 */, + NOT_SCRAMBLED = (1 << 1) /* 2 */, + SCRAMBLED = (1 << 2) /* 4 */, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/VideoStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/VideoStreamType.aidl new file mode 100644 index 0000000000..530f4549d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/2/android/hardware/tv/tuner/VideoStreamType.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum VideoStreamType { + UNDEFINED, + RESERVED, + MPEG1, + MPEG2, + MPEG4P2, + AVC, + HEVC, + VC1, + VP8, + VP9, + AV1, + AVS, + AVS2, + VVC, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselection.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselection.aidl new file mode 100644 index 0000000000..ab0404e875 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselection.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioPreselection { + int preselectionId; + android.hardware.tv.tuner.AudioPreselectionLabel[] labels; + String language; + android.hardware.tv.tuner.AudioPreselectionRenderingIndicationType renderingIndication; + boolean hasAudioDescription; + boolean hasSpokenSubtitles; + boolean hasDialogueEnhancement; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionLabel.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionLabel.aidl new file mode 100644 index 0000000000..79f3b6f008 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionLabel.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioPreselectionLabel { + String language; + String text; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl new file mode 100644 index 0000000000..783511fea8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioPreselectionRenderingIndicationType { + NOT_INDICATED = 0, + STEREO = 1, + TWO_DIMENSIONAL = 2, + THREE_DIMENSIONAL = 3, + HEADPHONE = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPresentation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPresentation.aidl new file mode 100644 index 0000000000..96a6d987c9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioPresentation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioPresentation { + android.hardware.tv.tuner.AudioPreselection preselection; + int ac4ShortProgramId = -1; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl index ab36188069..28caf19580 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl @@ -37,4 +37,5 @@ package android.hardware.tv.tuner; union DemuxFilterMediaEventExtraMetaData { boolean noinit; android.hardware.tv.tuner.AudioExtraMetaData audio; + android.hardware.tv.tuner.AudioPresentation[] audioPresentations = {}; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl index 371e075617..8dfc60eb54 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -38,4 +38,5 @@ union DemuxFilterScIndexMask { int scIndex; int scAvc; int scHevc; + int scVvc; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl index 36b40ea5b9..1dc593ac18 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -39,4 +39,5 @@ enum DemuxFilterStatus { LOW_WATER = 2, HIGH_WATER = 4, OVERFLOW = 8, + NO_DATA = 16, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxInfo.aidl new file mode 100644 index 0000000000..872d9634d1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxInfo { + int filterTypes = 0; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl index 30ec29a23b..fb4430bbee 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -39,4 +39,5 @@ enum DemuxRecordScIndexType { SC = 1, SC_HEVC = 2, SC_AVC = 3, + SC_VVC = 4, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScVvcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScVvcIndex.aidl new file mode 100644 index 0000000000..3e08d26b59 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScVvcIndex.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScVvcIndex { + UNDEFINED = 0, + SLICE_IDR_W_RADL = 1, + SLICE_IDR_N_LP = 2, + SLICE_CRA = 4, + SLICE_GDR = 8, + VPS = 16, + SPS = 32, + AUD = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl index c013cd111a..c9443b1782 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl @@ -45,4 +45,5 @@ union FrontendCapabilities { android.hardware.tv.tuner.FrontendIsdbsCapabilities isdbsCaps; android.hardware.tv.tuner.FrontendIsdbs3Capabilities isdbs3Caps; android.hardware.tv.tuner.FrontendIsdbtCapabilities isdbtCaps; + @nullable android.hardware.tv.tuner.FrontendIptvCapabilities iptvCaps; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl new file mode 100644 index 0000000000..543543df96 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIptvCapabilities { + int protocolCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettings.aidl new file mode 100644 index 0000000000..73582f3efb --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIptvSettings { + android.hardware.tv.tuner.FrontendIptvSettingsProtocol protocol = android.hardware.tv.tuner.FrontendIptvSettingsProtocol.UNDEFINED; + android.hardware.tv.tuner.FrontendIptvSettingsFec fec; + android.hardware.tv.tuner.FrontendIptvSettingsIgmp igmp = android.hardware.tv.tuner.FrontendIptvSettingsIgmp.UNDEFINED; + long bitrate; + android.hardware.tv.tuner.DemuxIpAddress ipAddr; + String contentUrl; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl new file mode 100644 index 0000000000..c3613772ef --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIptvSettingsFec { + android.hardware.tv.tuner.FrontendIptvSettingsFecType type; + int fecColNum; + int fecRowNum; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl new file mode 100644 index 0000000000..50a12089ec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIptvSettingsFecType { + UNDEFINED = 0, + COLUMN = 1, + ROW = 2, + COLUMN_ROW = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl new file mode 100644 index 0000000000..aa0849658f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIptvSettingsIgmp { + UNDEFINED = 0, + V1 = 1, + V2 = 2, + V3 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl new file mode 100644 index 0000000000..08a01f1a36 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIptvSettingsProtocol { + UNDEFINED = 0, + UDP = 1, + RTP = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl index 7eae9df379..9810ba6490 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl @@ -45,4 +45,5 @@ union FrontendSettings { android.hardware.tv.tuner.FrontendIsdbs3Settings isdbs3; android.hardware.tv.tuner.FrontendIsdbtSettings isdbt; android.hardware.tv.tuner.FrontendDtmbSettings dtmb; + @nullable android.hardware.tv.tuner.FrontendIptvSettings iptv; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl index 1e0f5f0840..b991ab6836 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl @@ -77,4 +77,9 @@ union FrontendStatus { int[] streamIdList; int[] dvbtCellIds; android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] allPlpInfo; + String iptvContentUrl = ""; + long iptvPacketsReceived; + long iptvPacketsLost; + int iptvWorstJitterMs; + int iptvAverageJitterMs; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl index cd6ccb3dc1..379129960a 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -77,4 +77,9 @@ enum FrontendStatusType { STREAM_ID_LIST = 39, DVBT_CELL_IDS = 40, ATSC3_ALL_PLP_INFO = 41, + IPTV_CONTENT_URL = 42, + IPTV_PACKETS_LOST = 43, + IPTV_PACKETS_RECEIVED = 44, + IPTV_WORST_JITTER_MS = 45, + IPTV_AVERAGE_JITTER_MS = 46, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl index 99a120bcb3..cbf5b4701c 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Android Open Source Project + * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,4 +46,5 @@ enum FrontendType { ISDBS3 = 8, ISDBT = 9, DTMB = 10, + IPTV = 11, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl index 450cd79129..4648712393 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl @@ -43,4 +43,5 @@ interface IDvr { void stop(); void flush(); void close(); + void setStatusCheckIntervalHint(in long milliseconds); } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl index 0ff2da9aa1..732f3fd952 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl @@ -47,4 +47,8 @@ interface ITuner { void setLna(in boolean bEnable); void setMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType, in int maxNumber); int getMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType); + boolean isLnaSupported(); + int[] getDemuxIds(); + android.hardware.tv.tuner.IDemux openDemuxById(in int demuxId); + android.hardware.tv.tuner.DemuxInfo getDemuxInfo(in int demuxId); } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl index 9dfd686a69..dbb6033add 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl @@ -48,4 +48,5 @@ enum VideoStreamType { AV1 = 10, AVS = 11, AVS2 = 12, + VVC = 13, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselection.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselection.aidl new file mode 100644 index 0000000000..16ef0dd235 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselection.aidl @@ -0,0 +1,63 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.AudioPreselectionLabel; +import android.hardware.tv.tuner.AudioPreselectionRenderingIndicationType; + +/** + * Audio preselection metadata according to ETSI EN 300 468 V1.17.1. + * @hide + */ +@VintfStability +parcelable AudioPreselection { + /** + * Identifies this audio preselection. The value of this field shall match the corresponding + * field in the elementary stream. + */ + int preselectionId; + + /** + * Collection of audio preselection labels. + */ + AudioPreselectionLabel[] labels; + + /** + * ISO 639-2 3-character code. + */ + String language; + + /** + * A hint for a preferred reproduction channel layout. + */ + AudioPreselectionRenderingIndicationType renderingIndication; + + /** + * Audio preselection contains audio description for the visually impaired. + */ + boolean hasAudioDescription; + + /** + * Audio preselection contains spoken subtitles. + */ + boolean hasSpokenSubtitles; + + /** + * Audio preselection provides support for dialogue enhancement. + */ + boolean hasDialogueEnhancement; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionLabel.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionLabel.aidl new file mode 100644 index 0000000000..429b02675a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionLabel.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Audio preselection label according to ETSI EN 300 468 V1.17.1. + * @hide + */ +@VintfStability +parcelable AudioPreselectionLabel { + /** + * ISO 639-2 3-character code. + */ + String language; + + /** + * Text information, written in the language specified, pertaining to the preselection. + */ + String text; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl new file mode 100644 index 0000000000..963c55a3a8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPreselectionRenderingIndicationType.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Audio preselection audio rendering indication according to ETSI EN 300 468 V1.17.1. + * @hide + */ +@VintfStability +@Backing(type="int") +enum AudioPreselectionRenderingIndicationType { + /** + * No preference given for the reproduction channel layout. + */ + NOT_INDICATED, + + /** + * Preferred reproduction channel layout is stereo. + */ + STEREO, + + /** + * Preferred reproduction channel layout is two-dimensional (e.g. 5.1 multi-channel). + */ + TWO_DIMENSIONAL, + + /** + * Preferred reproduction channel layout is three-dimensional. + */ + THREE_DIMENSIONAL, + + /** + * Content is pre-rendered for consumption with headphones. + */ + HEADPHONE, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioPresentation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPresentation.aidl new file mode 100644 index 0000000000..50f9d902b9 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioPresentation.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.AudioPreselection; + +/** + * Audio presentation metadata. + * @hide + */ +@VintfStability +parcelable AudioPresentation { + /** + * Audio preselection. + */ + AudioPreselection preselection; + + /** + * Dolby AC-4 short program id specified in ETSI TS 103 190-2. For use in conjunction with + * an audio preselection to ensure contininuity of personalized experience during program + * transitions. + */ + int ac4ShortProgramId = -1; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl index f01952bc43..4ff33a28d4 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl @@ -17,6 +17,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.AudioExtraMetaData; +import android.hardware.tv.tuner.AudioPresentation; /** * Extra Meta Data for DemuxFilterMediaEvent. @@ -30,4 +31,9 @@ union DemuxFilterMediaEventExtraMetaData { boolean noinit; AudioExtraMetaData audio; + + /** + * Audio presentations available for user selection. + */ + AudioPresentation[] audioPresentations = {}; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl index 4036b06c8f..d53bc5b941 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -39,4 +39,9 @@ union DemuxFilterScIndexMask { * Indexes defined by DemuxScHevcIndex. */ int scHevc; + + /** + * Indexes defined by DemuxScVvcIndex. + */ + int scVvc; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl index e6f3b63b95..45a473ea5f 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -46,4 +46,9 @@ enum DemuxFilterStatus { * discarded. */ OVERFLOW = 1 << 3, + + /** + * Indicating there is no data coming to the filter. + */ + NO_DATA = 1 << 4, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxInfo.aidl new file mode 100644 index 0000000000..2720e2137e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxInfo.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 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.tuner; + +import android.hardware.tv.tuner.DemuxFilterMainType; + +/** + * Information for the Demux. + * @hide + */ +@VintfStability +parcelable DemuxInfo { + /** + * Bitwise OR of DemuxFilterMainTypes + */ + int filterTypes = DemuxFilterMainType.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl index 98427f774f..265b978702 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -42,4 +42,9 @@ enum DemuxRecordScIndexType { * Use Start Code index for AVC */ SC_AVC, + + /** + * Use Start Code index for VVC + */ + SC_VVC, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScVvcIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScVvcIndex.aidl new file mode 100644 index 0000000000..8b47f627f5 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScVvcIndex.aidl @@ -0,0 +1,62 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Indexes can be tagged by start point of slice groups according to ISO/IEC 23090-3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxScVvcIndex { + UNDEFINED = 0, + + /** + * Coded slice of an IDR picture or subpicture with RADL pictures. + */ + SLICE_IDR_W_RADL = 1 << 0, + + /** + * Coded slice of an IDR picture or subpicture without leading pictures. + */ + SLICE_IDR_N_LP = 1 << 1, + + /** + * Coded slice of a CRA (clean random access) picture or subpicture. + */ + SLICE_CRA = 1 << 2, + + /** + * Coded slice of a GDR (gradual decoder refresh) picture or subpicture. + */ + SLICE_GDR = 1 << 3, + + /** + * Video parameter set (non-VCL NALU). + */ + VPS = 1 << 4, + + /** + * Sequence parameter set (non-VCL NALU). + */ + SPS = 1 << 5, + + /** + * Access unit delimiter (non-VCL NALU). + */ + AUD = 1 << 6, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl index a6f14900d1..cfa1763e8d 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl @@ -23,6 +23,7 @@ import android.hardware.tv.tuner.FrontendDtmbCapabilities; import android.hardware.tv.tuner.FrontendDvbcCapabilities; import android.hardware.tv.tuner.FrontendDvbsCapabilities; import android.hardware.tv.tuner.FrontendDvbtCapabilities; +import android.hardware.tv.tuner.FrontendIptvCapabilities; import android.hardware.tv.tuner.FrontendIsdbs3Capabilities; import android.hardware.tv.tuner.FrontendIsdbsCapabilities; import android.hardware.tv.tuner.FrontendIsdbtCapabilities; @@ -51,4 +52,6 @@ union FrontendCapabilities { FrontendIsdbs3Capabilities isdbs3Caps; FrontendIsdbtCapabilities isdbtCaps; + + @nullable FrontendIptvCapabilities iptvCaps; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl new file mode 100644 index 0000000000..438492b289 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvCapabilities.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for IPTV Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIptvCapabilities { + /** + * Transmission protocols for IPTV (UDP / RTP) defined in FrontendIptvSettingsProtocol. + */ + int protocolCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettings.aidl new file mode 100644 index 0000000000..782695acac --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettings.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxIpAddress; +import android.hardware.tv.tuner.FrontendIptvSettingsFec; +import android.hardware.tv.tuner.FrontendIptvSettingsFecType; +import android.hardware.tv.tuner.FrontendIptvSettingsIgmp; +import android.hardware.tv.tuner.FrontendIptvSettingsProtocol; + +/** + * Frontend Settings for IPTV. + * @hide + */ +@VintfStability +parcelable FrontendIptvSettings { + FrontendIptvSettingsProtocol protocol = FrontendIptvSettingsProtocol.UNDEFINED; + + FrontendIptvSettingsFec fec; + + FrontendIptvSettingsIgmp igmp = FrontendIptvSettingsIgmp.UNDEFINED; + + long bitrate; + + /** + * Source and destination IP Address. + */ + DemuxIpAddress ipAddr; + + String contentUrl; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl new file mode 100644 index 0000000000..e12f06f2f2 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFec.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendIptvSettingsFecType; + +/** + * Configuration details for IPTV FEC. + * @hide + */ +@VintfStability +parcelable FrontendIptvSettingsFec { + FrontendIptvSettingsFecType type; + + /** + * The number of columns in the source block as well as the type of the repair packet. + */ + int fecColNum; + + /** + * The number of rows in the source block as well as the type of the repair packet. + */ + int fecRowNum; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl new file mode 100644 index 0000000000..421cbf839c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsFecType.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * FEC type for IPTV. + * TS 102 542-3-2 - V1.3.2 + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIptvSettingsFecType { + UNDEFINED = 0, + + COLUMN = 1 << 0, + + ROW = 1 << 1, + + COLUMN_ROW = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl new file mode 100644 index 0000000000..f6e39c889d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsIgmp.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * IGMP type for IPTV. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIptvSettingsIgmp { + UNDEFINED = 0, + + V1 = 1 << 0, + + V2 = 1 << 1, + + V3 = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl new file mode 100644 index 0000000000..0283445851 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIptvSettingsProtocol.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Protocol for IPTV. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIptvSettingsProtocol { + UNDEFINED = 0, + + UDP = 1 << 0, + + RTP = 1 << 1, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl index f78b2ae82b..e5a99e19a8 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl @@ -19,13 +19,14 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.FrontendAnalogSettings; import android.hardware.tv.tuner.FrontendAtsc3Settings; import android.hardware.tv.tuner.FrontendAtscSettings; +import android.hardware.tv.tuner.FrontendDtmbSettings; import android.hardware.tv.tuner.FrontendDvbcSettings; import android.hardware.tv.tuner.FrontendDvbsSettings; import android.hardware.tv.tuner.FrontendDvbtSettings; +import android.hardware.tv.tuner.FrontendIptvSettings; import android.hardware.tv.tuner.FrontendIsdbs3Settings; import android.hardware.tv.tuner.FrontendIsdbsSettings; import android.hardware.tv.tuner.FrontendIsdbtSettings; -import android.hardware.tv.tuner.FrontendDtmbSettings; /** * Signal Settings for Frontend. @@ -52,4 +53,6 @@ union FrontendSettings { FrontendIsdbtSettings isdbt; FrontendDtmbSettings dtmb; + + @nullable FrontendIptvSettings iptv; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl index b5d02016df..391f29be2a 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -26,8 +26,8 @@ import android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag; import android.hardware.tv.tuner.FrontendModulation; import android.hardware.tv.tuner.FrontendModulationStatus; import android.hardware.tv.tuner.FrontendRollOff; -import android.hardware.tv.tuner.FrontendSpectralInversion; import android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo; +import android.hardware.tv.tuner.FrontendSpectralInversion; import android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo; import android.hardware.tv.tuner.FrontendTransmissionMode; import android.hardware.tv.tuner.LnbVoltage; @@ -247,4 +247,29 @@ union FrontendStatus { * and not tuned PLPs for currently watching service. */ FrontendScanAtsc3PlpInfo[] allPlpInfo; + + /** + * IPTV Content URL + */ + String iptvContentUrl = ""; + + /** + * Packets Received (IPTV - UDP/RTP). + */ + long iptvPacketsReceived; + + /** + * Packets Lost (IPTV - RTP). + */ + long iptvPacketsLost; + + /** + * Worst jitter (milliseconds). + */ + int iptvWorstJitterMs; + + /** + * Average jitter (milliseconds). + */ + int iptvAverageJitterMs; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl index 8f3f2c56c1..6804b2daf2 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -234,4 +234,29 @@ enum FrontendStatusType { * and not tuned PLPs for currently watching service. */ ATSC3_ALL_PLP_INFO, + + /** + * IPTV Content URL. + */ + IPTV_CONTENT_URL, + + /** + * Number of packets lost. + */ + IPTV_PACKETS_LOST, + + /** + * Number of packets received. + */ + IPTV_PACKETS_RECEIVED, + + /** + * Worst jitter (milliseconds). + */ + IPTV_WORST_JITTER_MS, + + /** + * Average jitter (milliseconds). + */ + IPTV_AVERAGE_JITTER_MS, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl index 8ade389393..e8d343ee70 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Android Open Source Project + * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,4 +79,9 @@ enum FrontendType { * DTMB (Digital Terrestrial Multimedia Broadcast) standard. */ DTMB, + + /** + * ITU IPTV (ITU-T FG IPTV) + */ + IPTV, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl index 0534f9d884..4cb5b15e26 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl @@ -18,7 +18,6 @@ package android.hardware.tv.tuner; import android.hardware.common.fmq.MQDescriptor; import android.hardware.common.fmq.SynchronizedReadWrite; - import android.hardware.tv.tuner.DvrSettings; import android.hardware.tv.tuner.IFilter; @@ -101,4 +100,12 @@ interface IDvr { * instance any more and all methods should return a failure. */ void close(); + + /** + * Set status check time interval. + * + * This time interval hint will be used by the Dvr to decide how often + * to evaluate data. + */ + void setStatusCheckIntervalHint(in long milliseconds); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl index 03def33d46..9ead7dddf9 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl @@ -17,6 +17,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.DemuxCapabilities; +import android.hardware.tv.tuner.DemuxInfo; import android.hardware.tv.tuner.FrontendInfo; import android.hardware.tv.tuner.FrontendType; import android.hardware.tv.tuner.IDemux; @@ -65,7 +66,7 @@ interface ITuner { IDemux openDemux(out int[] demuxId); /** - * Retrieve the Demux's Capabilities. + * Retrieve the system wide Demux's Capabilities * * @return the Demux's Capabilities. */ @@ -125,6 +126,9 @@ interface ITuner { /** * Enable or Disable Low Noise Amplifier (LNA). * + * If the device doesn't support LNA, the HAL implement should set {@link Result#UNAVAILABLE} + * to EX_SERVICE_SPECIFIC as the service specific error. + * * @param bEnable true if activate LNA module; false if deactivate LNA */ void setLna(in boolean bEnable); @@ -148,4 +152,39 @@ interface ITuner { * @return the maximum usable number of the queried frontend type. */ int getMaxNumberOfFrontends(in FrontendType frontendType); + + /** + * Is Low Noise Amplifier (LNA) supported. + * + * @return true if supported, otherwise false + */ + boolean isLnaSupported(); + + /** + * Get Demux IDs + * + * It is used by the client to get all available demuxes' IDs. + * + * @return an array of IDs for the available Demuxes. + */ + int[] getDemuxIds(); + + /** + * Create a new instance of Demux given a demuxId. + * + * It is used by the client to create a demux instance. + * + * @param demuxId the id of the demux to be opened. + * + * @return the newly created demux interface. + */ + IDemux openDemuxById(in int demuxId); + + /** + * Retrieve the DemuxInfo of the specified Demux. + * + * @param demuxId the demux ID to query the DemuxInfo for. + * @return the DemuxInfo of the specified Demux by demuxId. + */ + DemuxInfo getDemuxInfo(in int demuxId); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl index 108d986bd8..bd000d2bae 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl @@ -84,4 +84,9 @@ enum VideoStreamType { * New Chinese Standard */ AVS2, + + /* + * ITU-T Rec. H.266 and ISO/IEC 23090-3 + */ + VVC, } diff --git a/tv/tuner/aidl/default/Android.bp b/tv/tuner/aidl/default/Android.bp index cb8f87b61e..65fa82163a 100644 --- a/tv/tuner/aidl/default/Android.bp +++ b/tv/tuner/aidl/default/Android.bp @@ -7,10 +7,9 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } -cc_binary { - name: "android.hardware.tv.tuner-service.example", +cc_defaults { + name: "tuner_hal_example_defaults", relative_install_path: "hw", - init_rc: ["tuner-default.rc"], vintf_fragments: ["tuner-default.xml"], vendor: true, compile_multilib: "first", @@ -30,7 +29,7 @@ cc_binary { ], shared_libs: [ "android.hardware.common.fmq-V1-ndk", - "android.hardware.tv.tuner-V1-ndk", + "android.hardware.tv.tuner-V2-ndk", "libbase", "libbinder_ndk", "libcutils", @@ -44,3 +43,18 @@ cc_binary { "media_plugin_headers", ], } + +cc_binary { + name: "android.hardware.tv.tuner-service.example", + defaults: ["tuner_hal_example_defaults"], + init_rc: ["tuner-default.rc"], +} + +cc_binary { + name: "android.hardware.tv.tuner-service.example-lazy", + defaults: ["tuner_hal_example_defaults"], + init_rc: ["tuner-default-lazy.rc"], + cflags: [ + "-DLAZY_HAL", + ], +} diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index a94b4ad38a..11e7131220 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -31,12 +31,17 @@ namespace tuner { #define WAIT_TIMEOUT 3000000000 -Demux::Demux(int32_t demuxId, std::shared_ptr tuner) { +Demux::Demux(int32_t demuxId, uint32_t filterTypes) { mDemuxId = demuxId; + mFilterTypes = filterTypes; +} + +void Demux::setTunerService(std::shared_ptr tuner) { mTuner = tuner; } Demux::~Demux() { + ALOGV("%s", __FUNCTION__); close(); } @@ -180,7 +185,10 @@ Demux::~Demux() { mRecordFilterIds.clear(); mFilters.clear(); mLastUsedFilterId = -1; - mTuner->removeDemux(mDemuxId); + if (mTuner != nullptr) { + mTuner->removeDemux(mDemuxId); + mTuner = nullptr; + } return ::ndk::ScopedAStatus::ok(); } @@ -342,6 +350,22 @@ uint16_t Demux::getFilterTpid(int64_t filterId) { return mFilters[filterId]->getTpid(); } +int32_t Demux::getDemuxId() { + return mDemuxId; +} + +bool Demux::isInUse() { + return mInUse; +} + +void Demux::setInUse(bool inUse) { + mInUse = inUse; +} + +void Demux::getDemuxInfo(DemuxInfo* demuxInfo) { + *demuxInfo = {.filterTypes = mFilterTypes}; +} + void Demux::startFrontendInputLoop() { ALOGD("[Demux] start frontend on demux"); // Stop current Frontend thread loop first, in case the user starts a new diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 7f0b0a7d62..7d7aee4c89 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -53,7 +53,7 @@ class Tuner; class Demux : public BnDemux { public: - Demux(int32_t demuxId, std::shared_ptr tuner); + Demux(int32_t demuxId, uint32_t filterTypes); ~Demux(); ::ndk::ScopedAStatus setFrontendDataSource(int32_t in_frontendId) override; @@ -98,6 +98,12 @@ class Demux : public BnDemux { void sendFrontendInputToRecord(vector data, uint16_t pid, uint64_t pts); bool startRecordFilterDispatcher(); + void getDemuxInfo(DemuxInfo* demuxInfo); + int32_t getDemuxId(); + bool isInUse(); + void setInUse(bool inUse); + void setTunerService(std::shared_ptr tuner); + private: // Tuner service std::shared_ptr mTuner; @@ -183,6 +189,9 @@ class Demux : public BnDemux { vector mPesOutput; const bool DEBUG_DEMUX = false; + + int32_t mFilterTypes; + bool mInUse = false; }; } // namespace tuner diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index c157bddeab..c046ae3130 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -154,6 +154,14 @@ Dvr::~Dvr() { return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Dvr::setStatusCheckIntervalHint(int64_t /* in_milliseconds */) { + ALOGV("%s", __FUNCTION__); + + // There is no active polling in this default implementation, + // so directly return ok here. + return ::ndk::ScopedAStatus::ok(); +} + bool Dvr::createDvrMQ() { ALOGV("%s", __FUNCTION__); @@ -427,7 +435,7 @@ bool Dvr::startFilterDispatcher(bool isVirtualFrontend, bool isRecording) { map>::iterator it; // Handle the output data per filter type for (it = mFilters.begin(); it != mFilters.end(); it++) { - if (mDemux->startFilterHandler(it->first).isOk()) { + if (!mDemux->startFilterHandler(it->first).isOk()) { return false; } } diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index 6ff71cd13f..293c533cfc 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -70,6 +70,7 @@ class Dvr : public BnDvr { ::ndk::ScopedAStatus stop() override; ::ndk::ScopedAStatus flush() override; ::ndk::ScopedAStatus close() override; + ::ndk::ScopedAStatus setStatusCheckIntervalHint(int64_t in_milliseconds) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 769ebe21ee..ba9602e272 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -329,7 +329,8 @@ Filter::~Filter() { // All the filter event callbacks in start are for testing purpose. switch (mType.mainType) { case DemuxFilterMainType::TS: - createMediaEvent(events); + createMediaEvent(events, false); + createMediaEvent(events, true); createTsRecordEvent(events); createTemiEvent(events); break; @@ -432,12 +433,12 @@ Filter::~Filter() { if (mSharedAvMemHandle != nullptr) { *out_avMemory = ::android::dupToAidl(mSharedAvMemHandle); - *_aidl_return = BUFFER_SIZE_16M; + *_aidl_return = BUFFER_SIZE; mUsingSharedAvMem = true; return ::ndk::ScopedAStatus::ok(); } - int av_fd = createAvIonFd(BUFFER_SIZE_16M); + int av_fd = createAvIonFd(BUFFER_SIZE); if (av_fd < 0) { return ::ndk::ScopedAStatus::fromServiceSpecificError( static_cast(Result::OUT_OF_MEMORY)); @@ -454,7 +455,7 @@ Filter::~Filter() { mUsingSharedAvMem = true; *out_avMemory = ::android::dupToAidl(mSharedAvMemHandle); - *_aidl_return = BUFFER_SIZE_16M; + *_aidl_return = BUFFER_SIZE; return ::ndk::ScopedAStatus::ok(); } @@ -691,6 +692,8 @@ DemuxFilterStatus Filter::checkFilterStatusChange(uint32_t availableToWrite, return DemuxFilterStatus::OVERFLOW; } else if (availableToRead > highThreshold) { return DemuxFilterStatus::HIGH_WATER; + } else if (availableToRead == 0) { + return DemuxFilterStatus::NO_DATA; } else if (availableToRead < lowThreshold) { return DemuxFilterStatus::LOW_WATER; } @@ -793,7 +796,8 @@ void Filter::updateRecordOutput(vector& data) { } if (prefix == 0x000001) { // TODO handle mulptiple Pes filters - mPesSizeLeft = (mFilterOutput[i + 8] << 8) | mFilterOutput[i + 9]; + mPesSizeLeft = (static_cast(mFilterOutput[i + 8]) << 8) | + static_cast(mFilterOutput[i + 9]); mPesSizeLeft += 6; if (DEBUG_FILTER) { ALOGD("[Filter] pes data length %d", mPesSizeLeft); @@ -803,7 +807,7 @@ void Filter::updateRecordOutput(vector& data) { } } - int endPoint = min(184, mPesSizeLeft); + uint32_t endPoint = min(184u, mPesSizeLeft); // append data and check size vector::const_iterator first = mFilterOutput.begin() + i + 4; vector::const_iterator last = mFilterOutput.begin() + i + 4 + endPoint; @@ -852,11 +856,17 @@ void Filter::updateRecordOutput(vector& data) { return ::ndk::ScopedAStatus::ok(); } +// Read PES (Packetized Elementary Stream) Packets from TransportStreams +// as defined in ISO/IEC 13818-1 Section 2.4.3.6. Create MediaEvents +// containing only their data without TS or PES headers. ::ndk::ScopedAStatus Filter::startMediaFilterHandler() { if (mFilterOutput.empty()) { return ::ndk::ScopedAStatus::ok(); } + // mPts being set before our MediaFilterHandler begins indicates that all + // metadata has already been handled. We can therefore create an event + // with the existing data. This method is used when processing ES files. ::ndk::ScopedAStatus result; if (mPts) { result = createMediaFilterEventWithIon(mFilterOutput); @@ -867,16 +877,38 @@ void Filter::updateRecordOutput(vector& data) { } for (int i = 0; i < mFilterOutput.size(); i += 188) { + // Every packet has a 4 Byte TS Header preceding it + uint32_t headerSize = 4; + if (mPesSizeLeft == 0) { - uint32_t prefix = (mFilterOutput[i + 4] << 16) | (mFilterOutput[i + 5] << 8) | - mFilterOutput[i + 6]; + // Packet Start Code Prefix is defined as the first 3 bytes of + // the PES Header and should always have the value 0x000001 + uint32_t prefix = (static_cast(mFilterOutput[i + 4]) << 16) | + (static_cast(mFilterOutput[i + 5]) << 8) | + static_cast(mFilterOutput[i + 6]); if (DEBUG_FILTER) { ALOGD("[Filter] prefix %d", prefix); } if (prefix == 0x000001) { - // TODO handle mulptiple Pes filters - mPesSizeLeft = (mFilterOutput[i + 8] << 8) | mFilterOutput[i + 9]; - mPesSizeLeft += 6; + // TODO handle multiple Pes filters + // Location of PES fields from ISO/IEC 13818-1 Section 2.4.3.6 + mPesSizeLeft = (static_cast(mFilterOutput[i + 8]) << 8) | + static_cast(mFilterOutput[i + 9]); + bool hasPts = static_cast(mFilterOutput[i + 11]) & 0x80; + uint8_t optionalFieldsLength = static_cast(mFilterOutput[i + 12]); + headerSize += 9 + optionalFieldsLength; + + if (hasPts) { + // Pts is a 33-bit field which is stored across 5 bytes, with + // bits in between as reserved fields which must be ignored + mPts = 0; + mPts |= (static_cast(mFilterOutput[i + 13]) & 0x0e) << 29; + mPts |= (static_cast(mFilterOutput[i + 14]) & 0xff) << 22; + mPts |= (static_cast(mFilterOutput[i + 15]) & 0xfe) << 14; + mPts |= (static_cast(mFilterOutput[i + 16]) & 0xff) << 7; + mPts |= (static_cast(mFilterOutput[i + 17]) & 0xfe) >> 1; + } + if (DEBUG_FILTER) { ALOGD("[Filter] pes data length %d", mPesSizeLeft); } @@ -885,10 +917,10 @@ void Filter::updateRecordOutput(vector& data) { } } - int endPoint = min(184, mPesSizeLeft); + uint32_t endPoint = min(188u - headerSize, mPesSizeLeft); // append data and check size - vector::const_iterator first = mFilterOutput.begin() + i + 4; - vector::const_iterator last = mFilterOutput.begin() + i + 4 + endPoint; + vector::const_iterator first = mFilterOutput.begin() + i + headerSize; + vector::const_iterator last = mFilterOutput.begin() + i + headerSize + endPoint; mPesOutput.insert(mPesOutput.end(), first, last); // size does not match then continue mPesSizeLeft -= endPoint; @@ -900,7 +932,8 @@ void Filter::updateRecordOutput(vector& data) { } result = createMediaFilterEventWithIon(mPesOutput); - if (result.isOk()) { + if (!result.isOk()) { + mFilterOutput.clear(); return result; } } @@ -961,24 +994,65 @@ void Filter::updateRecordOutput(vector& data) { return ::ndk::ScopedAStatus::ok(); } +// Read PSI (Program Specific Information) Sections from TransportStreams +// as defined in ISO/IEC 13818-1 Section 2.4.4 bool Filter::writeSectionsAndCreateEvent(vector& data) { // TODO check how many sections has been read ALOGD("[Filter] section handler"); - if (!writeDataToFilterMQ(data)) { - return false; - } - DemuxFilterSectionEvent secEvent; - secEvent = { - // temp dump meta data - .tableId = 0, - .version = 1, - .sectionNum = 1, - .dataLength = static_cast(data.size()), - }; - { - std::lock_guard lock(mFilterEventsLock); - mFilterEvents.push_back(DemuxFilterEvent::make(secEvent)); + // Transport Stream Packets are 188 bytes long, as defined in the + // Introduction of ISO/IEC 13818-1 + for (int i = 0; i < data.size(); i += 188) { + if (mSectionSizeLeft == 0) { + // Location for sectionSize as defined by Section 2.4.4 + // Note that the first 4 bytes skipped are the TsHeader + mSectionSizeLeft = ((static_cast(data[i + 5]) & 0x0f) << 8) | + static_cast(data[i + 6]); + mSectionSizeLeft += 3; + if (DEBUG_FILTER) { + ALOGD("[Filter] section data length %d", mSectionSizeLeft); + } + } + + // 184 bytes per packet is derived by subtracting the 4 byte length of + // the TsHeader from its 188 byte packet size + uint32_t endPoint = min(184u, mSectionSizeLeft); + // append data and check size + vector::const_iterator first = data.begin() + i + 4; + vector::const_iterator last = data.begin() + i + 4 + endPoint; + mSectionOutput.insert(mSectionOutput.end(), first, last); + // size does not match then continue + mSectionSizeLeft -= endPoint; + if (DEBUG_FILTER) { + ALOGD("[Filter] section data left %d", mSectionSizeLeft); + } + if (mSectionSizeLeft > 0) { + continue; + } + + if (!writeDataToFilterMQ(mSectionOutput)) { + mSectionOutput.clear(); + return false; + } + + DemuxFilterSectionEvent secEvent; + secEvent = { + // temp dump meta data + .tableId = 0, + .version = 1, + .sectionNum = 1, + .dataLength = static_cast(mSectionOutput.size()), + }; + if (DEBUG_FILTER) { + ALOGD("[Filter] assembled section data length %" PRIu64, secEvent.dataLength); + } + + { + std::lock_guard lock(mFilterEventsLock); + mFilterEvents.push_back( + DemuxFilterEvent::make(secEvent)); + } + mSectionOutput.clear(); } return true; @@ -1148,15 +1222,7 @@ bool Filter::sameFile(int fd1, int fd2) { return (stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino); } -void Filter::createMediaEvent(vector& events) { - AudioExtraMetaData audio; - audio.adFade = 1; - audio.adPan = 2; - audio.versionTextTag = 3; - audio.adGainCenter = 4; - audio.adGainFront = 5; - audio.adGainSurround = 6; - +void Filter::createMediaEvent(vector& events, bool isAudioPresentation) { DemuxFilterMediaEvent mediaEvent; mediaEvent.streamId = 1; mediaEvent.isPtsPresent = true; @@ -1166,9 +1232,45 @@ void Filter::createMediaEvent(vector& events) { mediaEvent.isSecureMemory = true; mediaEvent.mpuSequenceNumber = 6; mediaEvent.isPesPrivateData = true; - mediaEvent.extraMetaData.set(audio); - int av_fd = createAvIonFd(BUFFER_SIZE_16M); + if (isAudioPresentation) { + AudioPresentation audioPresentation0{ + .preselection.preselectionId = 0, + .preselection.labels = {{"en", "Commentator"}, {"es", "Comentarista"}}, + .preselection.language = "en", + .preselection.renderingIndication = + AudioPreselectionRenderingIndicationType::THREE_DIMENSIONAL, + .preselection.hasAudioDescription = false, + .preselection.hasSpokenSubtitles = false, + .preselection.hasDialogueEnhancement = true, + .ac4ShortProgramId = 42}; + AudioPresentation audioPresentation1{ + .preselection.preselectionId = 1, + .preselection.labels = {{"en", "Crowd"}, {"es", "Multitud"}}, + .preselection.language = "en", + .preselection.renderingIndication = + AudioPreselectionRenderingIndicationType::THREE_DIMENSIONAL, + .preselection.hasAudioDescription = false, + .preselection.hasSpokenSubtitles = false, + .preselection.hasDialogueEnhancement = false, + .ac4ShortProgramId = 42}; + vector audioPresentations; + audioPresentations.push_back(audioPresentation0); + audioPresentations.push_back(audioPresentation1); + mediaEvent.extraMetaData.set( + audioPresentations); + } else { + AudioExtraMetaData audio; + audio.adFade = 1; + audio.adPan = 2; + audio.versionTextTag = 3; + audio.adGainCenter = 4; + audio.adGainFront = 5; + audio.adGainSurround = 6; + mediaEvent.extraMetaData.set(audio); + } + + int av_fd = createAvIonFd(BUFFER_SIZE); if (av_fd == -1) { return; } diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index e301249e81..0985296657 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -50,7 +50,8 @@ using ::android::AidlMessageQueue; using ::android::hardware::EventFlag; using FilterMQ = AidlMessageQueue; -const uint32_t BUFFER_SIZE_16M = 0x1000000; + +const uint32_t BUFFER_SIZE = 0x800000; // 8 MB class Demux; class Dvr; @@ -229,7 +230,7 @@ class Filter : public BnFilter { ::ndk::ScopedAStatus createShareMemMediaEvents(vector& output); bool sameFile(int fd1, int fd2); - void createMediaEvent(vector&); + void createMediaEvent(vector&, bool isAudioPresentation); void createTsRecordEvent(vector&); void createMmtpRecordEvent(vector&); void createSectionEvent(vector&); @@ -256,9 +257,13 @@ class Filter : public BnFilter { std::mutex mFilterOutputLock; std::mutex mRecordFilterOutputLock; + // handle single Section filter + uint32_t mSectionSizeLeft = 0; + vector mSectionOutput; + // temp handle single PES filter // TODO handle mulptiple Pes filters - int mPesSizeLeft = 0; + uint32_t mPesSizeLeft = 0; vector mPesOutput; // A map from data id to ion handle diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 3f7797cead..cd072bfe8d 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -28,10 +28,10 @@ namespace hardware { namespace tv { namespace tuner { -Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) { +Frontend::Frontend(FrontendType type, int32_t id) { mType = type; mId = id; - mTuner = tuner; + mTuner = nullptr; // Init callback to nullptr mCallback = nullptr; @@ -164,20 +164,39 @@ Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) }; break; } + case FrontendType::IPTV: { + mFrontendCaps.set(FrontendIptvCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::IPTV_CONTENT_URL, + FrontendStatusType::IPTV_PACKETS_LOST, + FrontendStatusType::IPTV_PACKETS_RECEIVED, + FrontendStatusType::IPTV_AVERAGE_JITTER_MS, + FrontendStatusType::IPTV_WORST_JITTER_MS, + }; + break; + } default: { break; } } } -Frontend::~Frontend() {} +Frontend::~Frontend() { + ALOGV("%s", __FUNCTION__); + mCallback = nullptr; + mIsLocked = false; + mTuner = nullptr; +} ::ndk::ScopedAStatus Frontend::close() { ALOGV("%s", __FUNCTION__); // Reset callback mCallback = nullptr; mIsLocked = false; - mTuner->removeFrontend(mId); + if (mTuner != nullptr) { + mTuner->removeFrontend(mId); + } + mTuner = nullptr; return ::ndk::ScopedAStatus::ok(); } @@ -202,7 +221,10 @@ Frontend::~Frontend() {} static_cast(Result::INVALID_STATE)); } - mTuner->frontendStartTune(mId); + if (mType != FrontendType::IPTV) { + mTuner->frontendStartTune(mId); + } + mCallback->onEvent(FrontendEventType::LOCKED); mIsLocked = true; @@ -233,6 +255,10 @@ Frontend::~Frontend() {} return ::ndk::ScopedAStatus::ok(); } +void Frontend::setTunerService(std::shared_ptr tuner) { + mTuner = tuner; +} + void Frontend::scanThreadLoop() { if (mIsLocked) { FrontendScanMessage msg; @@ -863,6 +889,26 @@ void Frontend::scanThreadLoop() { status.set(infos); break; } + case FrontendStatusType::IPTV_CONTENT_URL: { + status.set(""); + break; + } + case FrontendStatusType::IPTV_PACKETS_LOST: { + status.set(5); + break; + } + case FrontendStatusType::IPTV_PACKETS_RECEIVED: { + status.set(5); + break; + } + case FrontendStatusType::IPTV_WORST_JITTER_MS: { + status.set(5); + break; + } + case FrontendStatusType::IPTV_AVERAGE_JITTER_MS: { + status.set(5); + break; + } default: { continue; } diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 1d9ab53a61..85bd636cc4 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -34,7 +34,7 @@ class Tuner; class Frontend : public BnFrontend { public: - Frontend(FrontendType type, int32_t id, std::shared_ptr tuner); + Frontend(FrontendType type, int32_t id); ::ndk::ScopedAStatus setCallback( const std::shared_ptr& in_callback) override; @@ -62,6 +62,7 @@ class Frontend : public BnFrontend { string getSourceFile(); bool isLocked(); void getFrontendInfo(FrontendInfo* _aidl_return); + void setTunerService(std::shared_ptr tuner); private: virtual ~Frontend(); diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index fa74288b09..197d866b28 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -17,6 +17,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "android.hardware.tv.tuner-service.example-Tuner" +#include #include #include @@ -37,17 +38,18 @@ Tuner::Tuner() {} void Tuner::init() { // Static Frontends array to maintain local frontends information // Array index matches their FrontendId in the default impl - mFrontendSize = 10; - mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0, this->ref()); - mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1, this->ref()); - mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2, this->ref()); - mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3, this->ref()); - mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4, this->ref()); - mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5, this->ref()); - mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6, this->ref()); - mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7, this->ref()); - mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, this->ref()); - mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, this->ref()); + mFrontendSize = 11; + mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0); + mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1); + mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2); + mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3); + mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4); + mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5); + mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6); + mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7); + mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8); + mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9); + mFrontends[10] = ndk::SharedRefBase::make(FrontendType::IPTV, 10); mMaxUsableFrontends[FrontendType::ISDBS] = 1; mMaxUsableFrontends[FrontendType::ATSC3] = 1; @@ -59,6 +61,17 @@ void Tuner::init() { mMaxUsableFrontends[FrontendType::ATSC] = 1; mMaxUsableFrontends[FrontendType::ISDBS3] = 1; mMaxUsableFrontends[FrontendType::DTMB] = 1; + mMaxUsableFrontends[FrontendType::IPTV] = 1; + + mDemuxes[0] = + ndk::SharedRefBase::make(0, (static_cast(DemuxFilterMainType::TS) | + static_cast(DemuxFilterMainType::MMTP) | + static_cast(DemuxFilterMainType::TLV))); + mDemuxes[1] = + ndk::SharedRefBase::make(1, (static_cast(DemuxFilterMainType::MMTP) | + static_cast(DemuxFilterMainType::TLV))); + mDemuxes[2] = ndk::SharedRefBase::make(2, static_cast(DemuxFilterMainType::IP)); + mDemuxes[3] = ndk::SharedRefBase::make(3, static_cast(DemuxFilterMainType::TS)); mLnbs.resize(2); mLnbs[0] = ndk::SharedRefBase::make(0); @@ -78,6 +91,28 @@ Tuner::~Tuner() {} return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Tuner::getDemuxInfo(int32_t in_demuxId, DemuxInfo* _aidl_return) { + if (mDemuxes.find(in_demuxId) == mDemuxes.end()) { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } else { + mDemuxes[in_demuxId]->getDemuxInfo(_aidl_return); + return ::ndk::ScopedAStatus::ok(); + } +} + +::ndk::ScopedAStatus Tuner::getDemuxIds(std::vector* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + int numOfDemuxes = mDemuxes.size(); + _aidl_return->resize(numOfDemuxes); + int i = 0; + for (auto e = mDemuxes.begin(); e != mDemuxes.end(); e++) { + (*_aidl_return)[i++] = e->first; + } + return ::ndk::ScopedAStatus::ok(); +} + ::ndk::ScopedAStatus Tuner::openFrontendById(int32_t in_frontendId, std::shared_ptr* _aidl_return) { ALOGV("%s", __FUNCTION__); @@ -89,21 +124,54 @@ Tuner::~Tuner() {} static_cast(Result::INVALID_ARGUMENT)); } + mFrontends[in_frontendId]->setTunerService(this->ref()); *_aidl_return = mFrontends[in_frontendId]; return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Tuner::openDemuxById(int32_t in_demuxId, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (mDemuxes.find(in_demuxId) == mDemuxes.end()) { + ALOGW("[ WARN ] Demux with id %d isn't available", in_demuxId); + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + + if (mDemuxes[in_demuxId]->isInUse()) { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNAVAILABLE)); + } else { + mDemuxes[in_demuxId]->setTunerService(this->ref()); + mDemuxes[in_demuxId]->setInUse(true); + + *_aidl_return = mDemuxes[in_demuxId]; + return ::ndk::ScopedAStatus::ok(); + } +} + ::ndk::ScopedAStatus Tuner::openDemux(std::vector* out_demuxId, std::shared_ptr* _aidl_return) { ALOGV("%s", __FUNCTION__); - mLastUsedId += 1; - mDemuxes[mLastUsedId] = ndk::SharedRefBase::make(mLastUsedId, this->ref()); + bool found = false; + int32_t demuxId = 0; + for (auto e = mDemuxes.begin(); e != mDemuxes.end(); e++) { + if (!e->second->isInUse()) { + found = true; + demuxId = e->second->getDemuxId(); + } + } - out_demuxId->push_back(mLastUsedId); - *_aidl_return = mDemuxes[mLastUsedId]; - - return ::ndk::ScopedAStatus::ok(); + if (found) { + out_demuxId->push_back(demuxId); + return openDemuxById(demuxId, _aidl_return); + } else { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNAVAILABLE)); + } } ::ndk::ScopedAStatus Tuner::getDemuxCaps(DemuxCapabilities* _aidl_return) { @@ -114,6 +182,18 @@ Tuner::~Tuner() {} // Support time filter testing _aidl_return->bTimeFilter = true; + // set filterCaps as the bitwize OR of all the demux' caps + std::vector demuxIds; + getDemuxIds(&demuxIds); + int32_t filterCaps = 0; + + for (int i = 0; i < demuxIds.size(); i++) { + DemuxInfo demuxInfo; + getDemuxInfo(demuxIds[i], &demuxInfo); + filterCaps |= demuxInfo.filterTypes; + } + _aidl_return->filterCaps = filterCaps; + return ::ndk::ScopedAStatus::ok(); } @@ -203,6 +283,13 @@ std::shared_ptr Tuner::getFrontendById(int32_t frontendId) { return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Tuner::isLnaSupported(bool* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + *_aidl_return = true; + return ::ndk::ScopedAStatus::ok(); +} + binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) { ALOGV("%s", __FUNCTION__); { @@ -242,13 +329,13 @@ void Tuner::removeDemux(int32_t demuxId) { break; } } - mDemuxes.erase(demuxId); + mDemuxes[demuxId]->setInUse(false); } void Tuner::removeFrontend(int32_t frontendId) { map::iterator it = mFrontendToDemux.find(frontendId); if (it != mFrontendToDemux.end()) { - mDemuxes.erase(it->second); + mDemuxes[it->second]->setInUse(false); } mFrontendToDemux.erase(frontendId); } diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index ad73003eeb..26569336ef 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -46,7 +46,11 @@ class Tuner : public BnTuner { std::shared_ptr* _aidl_return) override; ::ndk::ScopedAStatus openDemux(std::vector* out_demuxId, std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus openDemuxById(int32_t in_demuxId, + std::shared_ptr* _aidl_return) override; ::ndk::ScopedAStatus getDemuxCaps(DemuxCapabilities* _aidl_return) override; + ::ndk::ScopedAStatus getDemuxInfo(int32_t in_demuxId, DemuxInfo* _aidl_return) override; + ::ndk::ScopedAStatus getDemuxIds(std::vector* _aidl_return) override; ::ndk::ScopedAStatus openDescrambler(std::shared_ptr* _aidl_return) override; ::ndk::ScopedAStatus getFrontendInfo(int32_t in_frontendId, FrontendInfo* _aidl_return) override; @@ -61,6 +65,7 @@ class Tuner : public BnTuner { int32_t in_maxNumber) override; ::ndk::ScopedAStatus getMaxNumberOfFrontends(FrontendType in_frontendType, int32_t* _aidl_return) override; + ::ndk::ScopedAStatus isLnaSupported(bool* _aidl_return) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; @@ -76,12 +81,10 @@ class Tuner : public BnTuner { // Static mFrontends array to maintain local frontends information map> mFrontends; map mFrontendToDemux; - map> mDemuxes; + map> mDemuxes; // use demuxId as the key in + // this sample implementation // To maintain how many Frontends we have int mFrontendSize; - // The last used demux id. Initial value is -1. - // First used id will be 0. - int32_t mLastUsedId = -1; vector> mLnbs; map mMaxUsableFrontends; }; diff --git a/tv/tuner/aidl/default/service.cpp b/tv/tuner/aidl/default/service.cpp index ac8d779c28..aa9f796744 100644 --- a/tv/tuner/aidl/default/service.cpp +++ b/tv/tuner/aidl/default/service.cpp @@ -26,12 +26,19 @@ using ::aidl::android::hardware::tv::tuner::Tuner; int main() { - ABinderProcess_setThreadPoolMaxThreadCount(8); + ABinderProcess_setThreadPoolMaxThreadCount(16); std::shared_ptr tuner = ndk::SharedRefBase::make(); tuner->init(); + binder_status_t status; const std::string instance = std::string() + Tuner::descriptor + "/default"; - binder_status_t status = AServiceManager_addService(tuner->asBinder().get(), instance.c_str()); +#ifdef LAZY_HAL + ALOGD("Start as a lazy HAL"); + status = AServiceManager_registerLazyService(tuner->asBinder().get(), instance.c_str()); +#else + ALOGD("Start as a normal HAL"); + status = AServiceManager_addService(tuner->asBinder().get(), instance.c_str()); +#endif CHECK(status == STATUS_OK); ABinderProcess_joinThreadPool(); diff --git a/tv/tuner/aidl/default/tuner-default-lazy.rc b/tv/tuner/aidl/default/tuner-default-lazy.rc new file mode 100644 index 0000000000..6b3b183e3c --- /dev/null +++ b/tv/tuner/aidl/default/tuner-default-lazy.rc @@ -0,0 +1,9 @@ +service vendor.tuner-default-lazy /vendor/bin/hw/android.hardware.tv.tuner-service.example-lazy + class hal + user media + group mediadrm drmrpc + ioprio rt 4 + task_profiles ProcessCapacityHigh + interface aidl android.hardware.tv.tuner.ITuner/default + oneshot + disabled diff --git a/tv/tuner/aidl/default/tuner-default.rc b/tv/tuner/aidl/default/tuner-default.rc index d0248c2216..f9315ae28f 100644 --- a/tv/tuner/aidl/default/tuner-default.rc +++ b/tv/tuner/aidl/default/tuner-default.rc @@ -3,5 +3,6 @@ service vendor.tuner-default /vendor/bin/hw/android.hardware.tv.tuner-service.ex user media group mediadrm drmrpc ioprio rt 4 - writepid /dev/cpuset/foreground/tasks + task_profiles ProcessCapacityHigh onrestart restart media.tuner + interface aidl android.hardware.tv.tuner.ITuner/default diff --git a/tv/tuner/aidl/default/tuner-default.xml b/tv/tuner/aidl/default/tuner-default.xml index f0d03adcea..bff8ff01ed 100644 --- a/tv/tuner/aidl/default/tuner-default.xml +++ b/tv/tuner/aidl/default/tuner-default.xml @@ -2,5 +2,6 @@ android.hardware.tv.tuner ITuner/default + 2 diff --git a/tv/tuner/aidl/vts/OWNERS b/tv/tuner/aidl/vts/OWNERS index bf2b609f3e..5b33bf2a5d 100644 --- a/tv/tuner/aidl/vts/OWNERS +++ b/tv/tuner/aidl/vts/OWNERS @@ -1,3 +1,5 @@ +# Bug component: 136752 + hgchen@google.com shubang@google.com quxiangfang@google.com diff --git a/tv/tuner/aidl/vts/functional/Android.bp b/tv/tuner/aidl/vts/functional/Android.bp index e5fb1e6b22..513007b4a8 100644 --- a/tv/tuner/aidl/vts/functional/Android.bp +++ b/tv/tuner/aidl/vts/functional/Android.bp @@ -51,9 +51,10 @@ cc_test { "android.hardware.cas@1.0", "android.hardware.cas@1.1", "android.hardware.cas@1.2", + "android.hardware.cas-V1-ndk", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", - "android.hardware.tv.tuner-V1-ndk", + "android.hardware.tv.tuner-V2-ndk", "libaidlcommonsupport", "libfmq", "libcutils", diff --git a/tv/tuner/aidl/vts/functional/DemuxTests.cpp b/tv/tuner/aidl/vts/functional/DemuxTests.cpp index 9de01e1eab..b2fca6f7f1 100644 --- a/tv/tuner/aidl/vts/functional/DemuxTests.cpp +++ b/tv/tuner/aidl/vts/functional/DemuxTests.cpp @@ -16,6 +16,12 @@ #include "DemuxTests.h" +AssertionResult DemuxTests::getDemuxIds(std::vector& demuxIds) { + ndk::ScopedAStatus status; + status = mService->getDemuxIds(&demuxIds); + return AssertionResult(status.isOk()); +} + AssertionResult DemuxTests::openDemux(std::shared_ptr& demux, int32_t& demuxId) { std::vector id; auto status = mService->openDemux(&id, &mDemux); @@ -26,6 +32,14 @@ AssertionResult DemuxTests::openDemux(std::shared_ptr& demux, int32_t& d return AssertionResult(status.isOk()); } +AssertionResult DemuxTests::openDemuxById(int32_t demuxId, std::shared_ptr& demux) { + auto status = mService->openDemuxById(demuxId, &mDemux); + if (status.isOk()) { + demux = mDemux; + } + return AssertionResult(status.isOk()); +} + AssertionResult DemuxTests::setDemuxFrontendDataSource(int32_t frontendId) { EXPECT_TRUE(mDemux) << "Test with openDemux first."; auto status = mDemux->setFrontendDataSource(frontendId); @@ -33,14 +47,15 @@ AssertionResult DemuxTests::setDemuxFrontendDataSource(int32_t frontendId) { } AssertionResult DemuxTests::getDemuxCaps(DemuxCapabilities& demuxCaps) { - if (!mDemux) { - ALOGW("[vts] Test with openDemux first."); - return failure(); - } auto status = mService->getDemuxCaps(&demuxCaps); return AssertionResult(status.isOk()); } +AssertionResult DemuxTests::getDemuxInfo(int32_t demuxId, DemuxInfo& demuxInfo) { + auto status = mService->getDemuxInfo(demuxId, &demuxInfo); + return AssertionResult(status.isOk()); +} + AssertionResult DemuxTests::getAvSyncId(std::shared_ptr filter, int32_t& avSyncHwId) { EXPECT_TRUE(mDemux) << "Demux is not opened yet."; diff --git a/tv/tuner/aidl/vts/functional/DemuxTests.h b/tv/tuner/aidl/vts/functional/DemuxTests.h index 7698de33b3..b58cf70823 100644 --- a/tv/tuner/aidl/vts/functional/DemuxTests.h +++ b/tv/tuner/aidl/vts/functional/DemuxTests.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -32,11 +33,14 @@ class DemuxTests { public: void setService(std::shared_ptr tuner) { mService = tuner; } + AssertionResult getDemuxIds(std::vector& demuxIds); AssertionResult openDemux(std::shared_ptr& demux, int32_t& demuxId); + AssertionResult openDemuxById(int32_t demuxId, std::shared_ptr& demux); AssertionResult setDemuxFrontendDataSource(int32_t frontendId); AssertionResult getAvSyncId(std::shared_ptr filter, int32_t& avSyncHwId); AssertionResult getAvSyncTime(int32_t avSyncId); AssertionResult getDemuxCaps(DemuxCapabilities& demuxCaps); + AssertionResult getDemuxInfo(int32_t demuxId, DemuxInfo& demuxInfo); AssertionResult closeDemux(); protected: diff --git a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp index 157fa0479e..f4855c2a5a 100644 --- a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp +++ b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp @@ -19,71 +19,115 @@ using namespace std; AssertionResult DescramblerTests::createCasPlugin(int32_t caSystemId) { - auto status = mMediaCasService->isSystemIdSupported(caSystemId); - if (!status.isOk() || !status) { - ALOGW("[vts] Failed to check isSystemIdSupported."); - return failure(); + mCasListener = ::ndk::SharedRefBase::make(); + + if (mMediaCasServiceAidl != nullptr) { + bool rst = false; + ScopedAStatus status = mMediaCasServiceAidl->isSystemIdSupported(caSystemId, &rst); + if (!status.isOk() || !rst) { + ALOGW("[vts] Failed to check isSystemIdSupported for AIDL service."); + return failure(); + } + status = mMediaCasServiceAidl->createPlugin(caSystemId, mCasListener, &mCasAidl); + if (!status.isOk()) { + ALOGW("[vts] Failed to createPlugin for AIDL service."); + return failure(); + } + } else { + auto status = mMediaCasServiceHidl->isSystemIdSupported(caSystemId); + if (!status.isOk() || !status) { + ALOGW("[vts] Failed to check isSystemIdSupported for HIDL service."); + return failure(); + } + auto pluginStatus = mMediaCasServiceHidl->createPluginExt( + caSystemId, sp(mCasListener.get())); + if (!pluginStatus.isOk()) { + ALOGW("[vts] Failed to createPluginExt for HIDL service."); + return failure(); + } + mCasHidl = ICasHidl::castFrom(pluginStatus); + if (mCasHidl == nullptr) { + ALOGW("[vts] Failed to get ICas for HIDL service."); + return failure(); + } } - mCasListener = new MediaCasListener(); - auto pluginStatus = mMediaCasService->createPluginExt(caSystemId, mCasListener); - if (!pluginStatus.isOk()) { - ALOGW("[vts] Failed to createPluginExt."); - return failure(); - } - mCas = ICas::castFrom(pluginStatus); - if (mCas == nullptr) { - ALOGW("[vts] Failed to get ICas."); - return failure(); - } return success(); } AssertionResult DescramblerTests::openCasSession(vector& sessionId, - vector& hidlPvtData) { - Status sessionStatus; - SessionIntent intent = SessionIntent::LIVE; - ScramblingMode mode = ScramblingMode::RESERVED; - auto returnVoid = - mCas->openSession_1_2(intent, mode, [&](Status status, const hidl_vec& id) { - sessionStatus = status; - sessionId = id; - }); - if (!returnVoid.isOk() || (sessionStatus != Status::OK)) { - ALOGW("[vts] Failed to open cas session."); - mCas->closeSession(sessionId); - return failure(); - } - - if (hidlPvtData.size() > 0) { - auto status = mCas->setSessionPrivateData(sessionId, hidlPvtData); - if (status != android::hardware::cas::V1_0::Status::OK) { - ALOGW("[vts] Failed to set session private data"); - mCas->closeSession(sessionId); + vector& pvtData) { + if (mMediaCasServiceAidl != nullptr) { + SessionIntentAidl intent = SessionIntentAidl::LIVE; + ScramblingModeAidl mode = ScramblingModeAidl::RESERVED; + std::vector sessionId; + ScopedAStatus status = mCasAidl->openSession(intent, mode, &sessionId); + if (!status.isOk()) { + ALOGW("[vts] Failed to open cas session for AIDL service."); + mCasAidl->closeSession(sessionId); return failure(); } + + if (pvtData.size() > 0) { + ScopedAStatus status = mCasAidl->setSessionPrivateData(sessionId, pvtData); + if (!status.isOk()) { + ALOGW("[vts] Failed to set session private data for AIDL service."); + mCasAidl->closeSession(sessionId); + return failure(); + } + } + } else { + Status sessionStatus; + SessionIntentHidl intent = SessionIntentHidl::LIVE; + ScramblingModeHidl mode = ScramblingModeHidl::RESERVED; + auto returnVoid = mCasHidl->openSession_1_2( + intent, mode, [&](Status status, const hidl_vec& id) { + sessionStatus = status; + sessionId = id; + }); + if (!returnVoid.isOk() || (sessionStatus != Status::OK)) { + ALOGW("[vts] Failed to open cas session for HIDL service."); + mCasHidl->closeSession(sessionId); + return failure(); + } + + if (pvtData.size() > 0) { + auto status = mCasHidl->setSessionPrivateData(sessionId, pvtData); + if (status != android::hardware::cas::V1_0::Status::OK) { + ALOGW("[vts] Failed to set session private data for HIDL service."); + mCasHidl->closeSession(sessionId); + return failure(); + } + } } return success(); } AssertionResult DescramblerTests::getKeyToken(int32_t caSystemId, string& provisonStr, - vector& hidlPvtData, - vector& token) { + vector& pvtData, vector& token) { if (createCasPlugin(caSystemId) != success()) { ALOGW("[vts] createCasPlugin failed."); return failure(); } if (provisonStr.size() > 0) { - auto returnStatus = mCas->provision(hidl_string(provisonStr)); - if (returnStatus != android::hardware::cas::V1_0::Status::OK) { - ALOGW("[vts] provision failed."); - return failure(); + if (mMediaCasServiceAidl != nullptr) { + ScopedAStatus status = mCasAidl->provision(provisonStr); + if (!status.isOk()) { + ALOGW("[vts] provision failed for AIDL service."); + return failure(); + } + } else { + auto returnStatus = mCasHidl->provision(hidl_string(provisonStr)); + if (returnStatus != android::hardware::cas::V1_0::Status::OK) { + ALOGW("[vts] provision failed for HIDL service."); + return failure(); + } } } - return openCasSession(token, hidlPvtData); + return openCasSession(token, pvtData); } AssertionResult DescramblerTests::openDescrambler(int32_t demuxId) { diff --git a/tv/tuner/aidl/vts/functional/DescramblerTests.h b/tv/tuner/aidl/vts/functional/DescramblerTests.h index f0b769141a..bab1a88f09 100644 --- a/tv/tuner/aidl/vts/functional/DescramblerTests.h +++ b/tv/tuner/aidl/vts/functional/DescramblerTests.h @@ -30,11 +30,17 @@ #include #include +#include +#include +#include +#include +#include #include #include #include #include +using ::aidl::android::hardware::cas::BnCasListener; using android::Condition; using android::Mutex; using android::sp; @@ -42,19 +48,26 @@ using android::hardware::hidl_string; using android::hardware::hidl_vec; using android::hardware::Return; using android::hardware::Void; -using android::hardware::cas::V1_2::ICas; -using android::hardware::cas::V1_2::ICasListener; -using android::hardware::cas::V1_2::IMediaCasService; -using android::hardware::cas::V1_2::ScramblingMode; -using android::hardware::cas::V1_2::SessionIntent; using android::hardware::cas::V1_2::Status; using android::hardware::cas::V1_2::StatusEvent; +using ICasAidl = ::aidl::android::hardware::cas::ICas; +using ICasHidl = android::hardware::cas::V1_2::ICas; +using ICasListenerHidl = android::hardware::cas::V1_2::ICasListener; +using IMediaCasServiceAidl = ::aidl::android::hardware::cas::IMediaCasService; +using IMediaCasServiceHidl = android::hardware::cas::V1_2::IMediaCasService; +using ScramblingModeAidl = ::aidl::android::hardware::cas::ScramblingMode; +using ScramblingModeHidl = android::hardware::cas::V1_2::ScramblingMode; +using SessionIntentAidl = ::aidl::android::hardware::cas::SessionIntent; +using SessionIntentHidl = android::hardware::cas::V1_2::SessionIntent; +using ::ndk::ScopedAStatus; using ::testing::AssertionResult; using namespace aidl::android::hardware::tv::tuner; -class MediaCasListener : public ICasListener { +const std::string MEDIA_CAS_AIDL_SERVICE_NAME = "android.hardware.cas.IMediaCasService/default"; + +class MediaCasListener : public ICasListenerHidl, public BnCasListener { public: virtual Return onEvent(int32_t /*event*/, int32_t /*arg*/, const hidl_vec& /*data*/) override { @@ -70,12 +83,33 @@ class MediaCasListener : public ICasListener { virtual Return onStatusUpdate(StatusEvent /*event*/, int32_t /*arg*/) override { return Void(); } + + ScopedAStatus onEvent(int32_t /*in_event*/, int32_t /*in_arg*/, + const std::vector& /*in_data*/) override { + return ScopedAStatus::ok(); + } + + ScopedAStatus onSessionEvent(const std::vector& /*in_sessionId*/, int32_t /*in_event*/, + int32_t /*in_arg*/, + const std::vector& /*in_data*/) override { + return ScopedAStatus::ok(); + } + + ScopedAStatus onStatusUpdate(::aidl::android::hardware::cas::StatusEvent /*in_event*/, + int32_t /*in_number*/) override { + return ScopedAStatus::ok(); + } }; class DescramblerTests { public: void setService(std::shared_ptr tuner) { mService = tuner; } - void setCasService(sp casService) { mMediaCasService = casService; } + void setCasServiceHidl(sp casService) { + mMediaCasServiceHidl = casService; + } + void setCasServiceAidl(std::shared_ptr casService) { + mMediaCasServiceAidl = casService; + } AssertionResult setKeyToken(std::vector& token); AssertionResult openDescrambler(int32_t demuxId); @@ -95,12 +129,13 @@ class DescramblerTests { std::shared_ptr mService; std::shared_ptr mDescrambler; - android::sp mCas; - android::sp mMediaCasService; - android::sp mCasListener; + std::shared_ptr mCasAidl; + android::sp mCasHidl; + std::shared_ptr mMediaCasServiceAidl; + android::sp mMediaCasServiceHidl; + std::shared_ptr mCasListener; private: - AssertionResult openCasSession(std::vector& sessionId, - std::vector& hidlPvtData); + AssertionResult openCasSession(std::vector& sessionId, std::vector& pvtData); AssertionResult createCasPlugin(int32_t caSystemId); }; diff --git a/tv/tuner/aidl/vts/functional/DvrTests.cpp b/tv/tuner/aidl/vts/functional/DvrTests.cpp index a9c3b51063..50f4de297e 100644 --- a/tv/tuner/aidl/vts/functional/DvrTests.cpp +++ b/tv/tuner/aidl/vts/functional/DvrTests.cpp @@ -323,3 +323,41 @@ void DvrTests::closeDvrRecord() { ASSERT_TRUE(mDvrRecord); ASSERT_TRUE(mDvrRecord->close().isOk()); } + +AssertionResult DvrTests::setPlaybackStatusCheckIntervalHint(int64_t milliseconds) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrPlayback) << "Test with openDvr first."; + + status = mDvrPlayback->setStatusCheckIntervalHint(milliseconds); + + if (getDvrPlaybackInterfaceVersion() < 2) { + return AssertionResult(status.getStatus() == STATUS_UNKNOWN_TRANSACTION); + } + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::setRecordStatusCheckIntervalHint(int64_t milliseconds) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrRecord) << "Test with openDvr first."; + + status = mDvrRecord->setStatusCheckIntervalHint(milliseconds); + + if (getDvrRecordInterfaceVersion() < 2) { + return AssertionResult(status.getStatus() == STATUS_UNKNOWN_TRANSACTION); + } + return AssertionResult(status.isOk()); +} + +int32_t DvrTests::getDvrPlaybackInterfaceVersion() { + int32_t version; + mDvrPlayback->getInterfaceVersion(&version); + return version; +} + +int32_t DvrTests::getDvrRecordInterfaceVersion() { + int32_t version; + mDvrRecord->getInterfaceVersion(&version); + return version; +} diff --git a/tv/tuner/aidl/vts/functional/DvrTests.h b/tv/tuner/aidl/vts/functional/DvrTests.h index 6662637d54..a88ba244e7 100644 --- a/tv/tuner/aidl/vts/functional/DvrTests.h +++ b/tv/tuner/aidl/vts/functional/DvrTests.h @@ -162,8 +162,12 @@ class DvrTests { AssertionResult startDvrPlayback(); AssertionResult stopDvrRecord(); AssertionResult startDvrRecord(); + AssertionResult setPlaybackStatusCheckIntervalHint(int64_t milliseconds); + AssertionResult setRecordStatusCheckIntervalHint(int64_t milliseconds); void closeDvrPlayback(); void closeDvrRecord(); + int32_t getDvrPlaybackInterfaceVersion(); + int32_t getDvrRecordInterfaceVersion(); protected: static AssertionResult failure() { return ::testing::AssertionFailure(); } diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index a1f51dfe1a..b0f614ed9b 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include - #include "FrontendTests.h" +#include + ndk::ScopedAStatus FrontendCallback::onEvent(FrontendEventType frontendEventType) { android::Mutex::Autolock autoLock(mMsgLock); ALOGD("[vts] frontend event received. Type: %d", frontendEventType); @@ -323,7 +323,10 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, FrontendStatusType type = statusTypes[i]; switch (type) { case FrontendStatusType::MODULATIONS: { - // TODO: verify modulations + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); break; } case FrontendStatusType::BERS: { @@ -340,11 +343,13 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, break; } case FrontendStatusType::GUARD_INTERVAL: { - // TODO: verify interval + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); break; } case FrontendStatusType::TRANSMISSION_MODE: { - // TODO: verify tranmission mode + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); break; } case FrontendStatusType::UEC: { @@ -379,7 +384,8 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, break; } case FrontendStatusType::ROLL_OFF: { - // TODO: verify roll off + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); break; } case FrontendStatusType::IS_MISO: { @@ -428,6 +434,31 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, expectStatuses[i].get().begin())); break; } + case FrontendStatusType::IPTV_CONTENT_URL: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::IPTV_PACKETS_LOST: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::IPTV_PACKETS_RECEIVED: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::IPTV_WORST_JITTER_MS: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::IPTV_AVERAGE_JITTER_MS: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } default: { continue; } @@ -599,9 +630,10 @@ void FrontendTests::statusReadinessTest(FrontendConfig frontendConf) { ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/)); // TODO: find a better way to push all frontend status types - for (int32_t i = 0; i < static_cast(FrontendStatusType::ATSC3_ALL_PLP_INFO); i++) { + for (int32_t i = 0; i <= static_cast(FrontendStatusType::ATSC3_ALL_PLP_INFO); i++) { allTypes.push_back(static_cast(i)); } + ndk::ScopedAStatus status = mFrontend->getFrontendStatusReadiness(allTypes, &readiness); ASSERT_TRUE(status.isOk()); ASSERT_TRUE(readiness.size() == allTypes.size()); diff --git a/tv/tuner/aidl/vts/functional/LnbTests.h b/tv/tuner/aidl/vts/functional/LnbTests.h index d6b5a259ca..a21e68daa0 100644 --- a/tv/tuner/aidl/vts/functional/LnbTests.h +++ b/tv/tuner/aidl/vts/functional/LnbTests.h @@ -25,6 +25,8 @@ #include #include +#define INVALID_LNB_ID -1 + using android::Condition; using android::Mutex; diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 07e3e3cbe2..9db82c893d 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -129,8 +129,8 @@ void TunerBroadcastAidlTest::broadcastSingleFilterTest(FilterConfig filterConf, mFrontendTests.getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); - if (mLnbId) { - ASSERT_TRUE(mFrontendTests.setLnb(*mLnbId)); + if (mLnbId != INVALID_LNB_ID) { + ASSERT_TRUE(mFrontendTests.setLnb(mLnbId)); } if (frontendConf.isSoftwareFe) { mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[live.dvrSoftwareFeId]); @@ -162,18 +162,19 @@ void TunerBroadcastAidlTest::broadcastSingleFilterTestWithLnb(FilterConfig filte ASSERT_TRUE(mLnbTests.getLnbIds(ids)); ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); - mLnbId = &ids[0]; + mLnbId = ids[0]; } else { - mLnbId = (int32_t*)malloc(sizeof(int32_t)); - ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); + ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, mLnbId)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConf.position)); - broadcastSingleFilterTest(filterConf, frontendConf); + if (!frontendConf.isSoftwareFe) { + broadcastSingleFilterTest(filterConf, frontendConf); + } ASSERT_TRUE(mLnbTests.closeLnb()); - mLnbId = nullptr; + mLnbId = INVALID_LNB_ID; } void TunerBroadcastAidlTest::mediaFilterUsingSharedMemoryTest(FilterConfig filterConf, @@ -240,6 +241,28 @@ void TunerPlaybackAidlTest::playbackSingleFilterTest(FilterConfig filterConf, Dv ASSERT_TRUE(mDemuxTests.closeDemux()); } +void TunerPlaybackAidlTest::setStatusCheckIntervalHintTest(int64_t statusCheckIntervalHint, + DvrConfig dvrConf) { + int32_t demuxId; + std::shared_ptr demux; + + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + mDvrTests.setDemux(demux); + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrConf.type, dvrConf.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrConf.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + + ASSERT_TRUE(mDvrTests.setPlaybackStatusCheckIntervalHint(statusCheckIntervalHint)); + + mDvrTests.startPlaybackInputThread(dvrConf.playbackInputFile, + dvrConf.settings.get()); + ASSERT_TRUE(mDvrTests.startDvrPlayback()); + mDvrTests.stopPlaybackThread(); + ASSERT_TRUE(mDvrTests.stopDvrPlayback()); + mDvrTests.closeDvrPlayback(); + ASSERT_TRUE(mDemuxTests.closeDemux()); +} + void TunerRecordAidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, DvrConfig dvrConf, LnbConfig lnbConf) { @@ -248,10 +271,9 @@ void TunerRecordAidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, ASSERT_TRUE(mLnbTests.getLnbIds(ids)); ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); - mLnbId = &ids[0]; + mLnbId = ids[0]; } else { - mLnbId = (int32_t*)malloc(sizeof(int32_t)); - ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); + ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, mLnbId)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); @@ -260,9 +282,11 @@ void TunerRecordAidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, for (auto msgName : lnbRecord.diseqcMsgs) { ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); } - recordSingleFilterTest(filterConf, frontendConf, dvrConf); + if (!frontendConf.isSoftwareFe) { + recordSingleFilterTest(filterConf, frontendConf, dvrConf, Dataflow_Context::LNBRECORD); + } ASSERT_TRUE(mLnbTests.closeLnb()); - mLnbId = nullptr; + mLnbId = INVALID_LNB_ID; } void TunerRecordAidlTest::attachSingleFilterToRecordDvrTest(FilterConfig filterConf, @@ -318,29 +342,47 @@ void TunerRecordAidlTest::attachSingleFilterToRecordDvrTest(FilterConfig filterC } void TunerRecordAidlTest::recordSingleFilterTest(FilterConfig filterConf, - FrontendConfig frontendConf, DvrConfig dvrConf) { + FrontendConfig frontendConf, DvrConfig dvrConf, + Dataflow_Context context) { int32_t demuxId; std::shared_ptr demux; ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); mDvrTests.setDemux(demux); DvrConfig dvrSourceConfig; - if (record.hasFrontendConnection) { + if (context == Dataflow_Context::RECORD) { + if (record.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[record.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDvrTests(&mDvrTests); + } else { + dvrSourceConfig = dvrMap[record.dvrSourceId]; + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + } + } else if (context == Dataflow_Context::LNBRECORD) { + // If function arrives here, frontend should not be software, so no need to configure a dvr + // source or dvr fe connection that might be used for recording without an Lnb int32_t feId; mFrontendTests.getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); - if (frontendConf.isSoftwareFe) { - mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[record.dvrSoftwareFeId]); + if (mLnbId != INVALID_LNB_ID) { + ASSERT_TRUE(mFrontendTests.setLnb(mLnbId)); + } else { + FAIL(); } ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); mFrontendTests.setDvrTests(&mDvrTests); - } else { - dvrSourceConfig = dvrMap[record.dvrSourceId]; - ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); - ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); - ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); } int64_t filterId; @@ -360,24 +402,31 @@ void TunerRecordAidlTest::recordSingleFilterTest(FilterConfig filterConf, ASSERT_TRUE(mDvrTests.startDvrRecord()); ASSERT_TRUE(mFilterTests.startFilter(filterId)); - if (record.hasFrontendConnection) { + if (context == Dataflow_Context::RECORD) { + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + } else { + // Start DVR Source + mDvrTests.startPlaybackInputThread( + dvrSourceConfig.playbackInputFile, + dvrSourceConfig.settings.get()); + ASSERT_TRUE(mDvrTests.startDvrPlayback()); + } + } else if (context == Dataflow_Context::LNBRECORD) { ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); - } else { - // Start DVR Source - mDvrTests.startPlaybackInputThread( - dvrSourceConfig.playbackInputFile, - dvrSourceConfig.settings.get()); - ASSERT_TRUE(mDvrTests.startDvrPlayback()); } - mDvrTests.testRecordOutput(); mDvrTests.stopRecordThread(); - if (record.hasFrontendConnection) { + if (context == Dataflow_Context::RECORD) { + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + } else { + mDvrTests.stopPlaybackThread(); + ASSERT_TRUE(mDvrTests.stopDvrPlayback()); + } + } else if (context == Dataflow_Context::LNBRECORD) { ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); - } else { - mDvrTests.stopPlaybackThread(); - ASSERT_TRUE(mDvrTests.stopDvrPlayback()); } ASSERT_TRUE(mFilterTests.stopFilter(filterId)); @@ -386,39 +435,99 @@ void TunerRecordAidlTest::recordSingleFilterTest(FilterConfig filterConf, ASSERT_TRUE(mFilterTests.closeFilter(filterId)); mDvrTests.closeDvrRecord(); - if (record.hasFrontendConnection) { + if (context == Dataflow_Context::RECORD) { + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } else { + mDvrTests.closeDvrPlayback(); + } + } else if (context == Dataflow_Context::LNBRECORD) { ASSERT_TRUE(mFrontendTests.closeFrontend()); - } else { - mDvrTests.closeDvrPlayback(); } ASSERT_TRUE(mDemuxTests.closeDemux()); } +void TunerRecordAidlTest::setStatusCheckIntervalHintTest(int64_t statusCheckIntervalHint, + FrontendConfig frontendConf, + DvrConfig dvrConf) { + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + mDvrTests.setDemux(demux); + + DvrConfig dvrSourceConfig; + if (record.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + } else { + dvrSourceConfig = dvrMap[record.dvrSourceId]; + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + } + + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrConf.type, dvrConf.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrRecord(dvrConf.settings)); + ASSERT_TRUE(mDvrTests.getDvrRecordMQDescriptor()); + + ASSERT_TRUE(mDvrTests.setRecordStatusCheckIntervalHint(statusCheckIntervalHint)); + + ASSERT_TRUE(mDvrTests.startDvrRecord()); + ASSERT_TRUE(mDvrTests.stopDvrRecord()); + mDvrTests.closeDvrRecord(); + ASSERT_TRUE(mDemuxTests.closeDemux()); + + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } +} + void TunerDescramblerAidlTest::scrambledBroadcastTest(set mediaFilterConfs, FrontendConfig frontendConf, - DescramblerConfig descConfig) { + DescramblerConfig descConfig, + Dataflow_Context context) { int32_t demuxId; std::shared_ptr demux; ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); DvrConfig dvrSourceConfig; - if (descrambling.hasFrontendConnection) { + if (context == Dataflow_Context::DESCRAMBLING) { + if (descrambling.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[descrambling.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDemux(demux); + } else { + dvrSourceConfig = dvrMap[descrambling.dvrSourceId]; + mDvrTests.setDemux(demux); + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + } + } else if (context == Dataflow_Context::LNBDESCRAMBLING) { int32_t feId; mFrontendTests.getFrontendIdByType(frontendConf.type, feId); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); - if (frontendConf.isSoftwareFe) { - mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[descrambling.dvrSoftwareFeId]); + if (mLnbId != INVALID_LNB_ID) { + ASSERT_TRUE(mFrontendTests.setLnb(mLnbId)); + } else { + // If, for some reason, the test got here without failing. We fail it here. + ALOGD("mLnbId is null. Something went wrong. Exiting ScrambledBroadcastWithLnbId."); + FAIL(); } ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); mFrontendTests.setDemux(demux); - } else { - dvrSourceConfig = dvrMap[descrambling.dvrSourceId]; - mDvrTests.setDemux(demux); - ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); - ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); - ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); } set filterIds; @@ -449,24 +558,32 @@ void TunerDescramblerAidlTest::scrambledBroadcastTest(set m ASSERT_TRUE(mFilterTests.startFilter(*id)); } - if (descrambling.hasFrontendConnection) { - // tune test + if (context == Dataflow_Context::DESCRAMBLING) { + if (descrambling.hasFrontendConnection) { + // tune test + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + } else { + // Start DVR Source + mDvrTests.startPlaybackInputThread( + dvrSourceConfig.playbackInputFile, + dvrSourceConfig.settings.get()); + ASSERT_TRUE(mDvrTests.startDvrPlayback()); + } + } else if (context == Dataflow_Context::LNBDESCRAMBLING) { ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); - } else { - // Start DVR Source - mDvrTests.startPlaybackInputThread( - dvrSourceConfig.playbackInputFile, - dvrSourceConfig.settings.get()); - ASSERT_TRUE(mDvrTests.startDvrPlayback()); } ASSERT_TRUE(filterDataOutputTest()); - if (descrambling.hasFrontendConnection) { + if (context == Dataflow_Context::DESCRAMBLING) { + if (descrambling.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + } else { + mDvrTests.stopPlaybackThread(); + ASSERT_TRUE(mDvrTests.stopDvrPlayback()); + } + } else if (context == Dataflow_Context::LNBDESCRAMBLING) { ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); - } else { - mDvrTests.stopPlaybackThread(); - ASSERT_TRUE(mDvrTests.stopDvrPlayback()); } for (id = filterIds.begin(); id != filterIds.end(); id++) { @@ -480,37 +597,80 @@ void TunerDescramblerAidlTest::scrambledBroadcastTest(set m ASSERT_TRUE(mFilterTests.closeFilter(*id)); } - if (descrambling.hasFrontendConnection) { + if (context == Dataflow_Context::DESCRAMBLING) { + if (descrambling.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } else { + mDvrTests.closeDvrPlayback(); + } + } else if (context == Dataflow_Context::LNBDESCRAMBLING) { ASSERT_TRUE(mFrontendTests.closeFrontend()); - } else { - mDvrTests.closeDvrPlayback(); } ASSERT_TRUE(mDemuxTests.closeDemux()); } +void TunerDescramblerAidlTest::scrambledBroadcastTestWithLnb( + set& mediaFilterConfs, FrontendConfig& frontendConf, + DescramblerConfig& descConfig, LnbConfig& lnbConfig) { + // We can test the Lnb individually and make sure it functions properly. If the frontend is + // software, we cannot test the whole dataflow. If the frontend is hardware, we can + if (lnbConfig.name.compare(emptyHardwareId) == 0) { + vector ids; + ASSERT_TRUE(mLnbTests.getLnbIds(ids)); + ASSERT_TRUE(ids.size() > 0); + ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); + mLnbId = ids[0]; + } else { + ASSERT_TRUE(mLnbTests.openLnbByName(lnbConfig.name, mLnbId)); + } + // Once Lnb is opened, test some of its basic functionality + ASSERT_TRUE(mLnbTests.setLnbCallback()); + ASSERT_TRUE(mLnbTests.setVoltage(lnbConfig.voltage)); + ASSERT_TRUE(mLnbTests.setTone(lnbConfig.tone)); + ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConfig.position)); + if (!frontendConf.isSoftwareFe) { + ALOGD("Frontend is not software, testing entire dataflow."); + scrambledBroadcastTest(mediaFilterConfs, frontendConf, descConfig, + Dataflow_Context::LNBDESCRAMBLING); + } else { + ALOGD("Frontend is software, did not test the entire dataflow, but tested the Lnb " + "individually."); + } + ASSERT_TRUE(mLnbTests.closeLnb()); + mLnbId = INVALID_LNB_ID; +} + TEST_P(TunerLnbAidlTest, SendDiseqcMessageToLnb) { description("Open and configure an Lnb with specific settings then send a diseqc msg to it."); if (!lnbLive.support) { return; } - if (lnbMap[lnbLive.lnbId].name.compare(emptyHardwareId) == 0) { - vector ids; - ASSERT_TRUE(mLnbTests.getLnbIds(ids)); - ASSERT_TRUE(ids.size() > 0); - ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); - } else { - int32_t id; - ASSERT_TRUE(mLnbTests.openLnbByName(lnbMap[lnbLive.lnbId].name, id)); + vector lnbLive_configs = generateLnbLiveConfigurations(); + if (lnbLive_configs.empty()) { + ALOGD("No frontends that support satellites."); + return; } - ASSERT_TRUE(mLnbTests.setLnbCallback()); - ASSERT_TRUE(mLnbTests.setVoltage(lnbMap[lnbLive.lnbId].voltage)); - ASSERT_TRUE(mLnbTests.setTone(lnbMap[lnbLive.lnbId].tone)); - ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbMap[lnbLive.lnbId].position)); - for (auto msgName : lnbLive.diseqcMsgs) { - ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); + for (auto& combination : lnbLive_configs) { + lnbLive = combination; + if (lnbMap[lnbLive.lnbId].name.compare(emptyHardwareId) == 0) { + vector ids; + ASSERT_TRUE(mLnbTests.getLnbIds(ids)); + ASSERT_TRUE(ids.size() > 0); + ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); + } else { + int32_t id; + ASSERT_TRUE(mLnbTests.openLnbByName(lnbMap[lnbLive.lnbId].name, id)); + } + ASSERT_TRUE(mLnbTests.setLnbCallback()); + ASSERT_TRUE(mLnbTests.setVoltage(lnbMap[lnbLive.lnbId].voltage)); + ASSERT_TRUE(mLnbTests.setTone(lnbMap[lnbLive.lnbId].tone)); + ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbMap[lnbLive.lnbId].position)); + for (auto msgName : lnbLive.diseqcMsgs) { + ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); + } + ASSERT_TRUE(mLnbTests.closeLnb()); } - ASSERT_TRUE(mLnbTests.closeLnb()); } TEST_P(TunerDemuxAidlTest, openDemux) { @@ -518,17 +678,49 @@ TEST_P(TunerDemuxAidlTest, openDemux) { if (!live.hasFrontendConnection) { return; } - int32_t feId; - int32_t demuxId; - std::shared_ptr demux; - mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); - ASSERT_TRUE(feId != INVALID_ID); - ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); - ASSERT_TRUE(mFrontendTests.setFrontendCallback()); - ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); - ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); - ASSERT_TRUE(mDemuxTests.closeDemux()); - ASSERT_TRUE(mFrontendTests.closeFrontend()); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } +} + +TEST_P(TunerDemuxAidlTest, openDemuxById) { + description("Open (with id) and close a Demux."); + std::vector demuxIds; + ASSERT_TRUE(mDemuxTests.getDemuxIds(demuxIds)); + for (int i = 0; i < demuxIds.size(); i++) { + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemuxById(demuxIds[i], demux)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + } +} + +TEST_P(TunerDemuxAidlTest, getDemuxInfo) { + description("Check getDemuxInfo against demux caps"); + std::vector demuxIds; + ASSERT_TRUE(mDemuxTests.getDemuxIds(demuxIds)); + int32_t combinedFilterTypes = 0; + for (int i = 0; i < demuxIds.size(); i++) { + DemuxInfo demuxInfo; + ASSERT_TRUE(mDemuxTests.getDemuxInfo(demuxIds[i], demuxInfo)); + combinedFilterTypes |= demuxInfo.filterTypes; + } + if (demuxIds.size() > 0) { + DemuxCapabilities demuxCaps; + ASSERT_TRUE(mDemuxTests.getDemuxCaps(demuxCaps)); + ASSERT_TRUE(demuxCaps.filterCaps == combinedFilterTypes); + } } TEST_P(TunerDemuxAidlTest, getAvSyncTime) { @@ -536,40 +728,45 @@ TEST_P(TunerDemuxAidlTest, getAvSyncTime) { if (!live.hasFrontendConnection) { return; } - if (live.pcrFilterId.compare(emptyHardwareId) == 0) { - return; - } - int32_t feId; - int32_t demuxId; - std::shared_ptr demux; - int64_t mediaFilterId; - int64_t pcrFilterId; - int32_t avSyncHwId; - std::shared_ptr mediaFilter; + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + if (live.pcrFilterId.compare(emptyHardwareId) == 0) { + continue; + } + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + int64_t mediaFilterId; + int64_t pcrFilterId; + int32_t avSyncHwId; + std::shared_ptr mediaFilter; - mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); - ASSERT_TRUE(feId != INVALID_ID); - ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); - ASSERT_TRUE(mFrontendTests.setFrontendCallback()); - ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); - ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); - mFilterTests.setDemux(demux); - ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.videoFilterId].type, - filterMap[live.videoFilterId].bufferSize)); - ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(mediaFilterId)); - ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.videoFilterId].settings, mediaFilterId)); - mediaFilter = mFilterTests.getFilterById(mediaFilterId); - ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.pcrFilterId].type, - filterMap[live.pcrFilterId].bufferSize)); - ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(pcrFilterId)); - ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.pcrFilterId].settings, pcrFilterId)); - ASSERT_TRUE(mDemuxTests.getAvSyncId(mediaFilter, avSyncHwId)); - ASSERT_TRUE(pcrFilterId == avSyncHwId); - ASSERT_TRUE(mDemuxTests.getAvSyncTime(pcrFilterId)); - ASSERT_TRUE(mFilterTests.closeFilter(pcrFilterId)); - ASSERT_TRUE(mFilterTests.closeFilter(mediaFilterId)); - ASSERT_TRUE(mDemuxTests.closeDemux()); - ASSERT_TRUE(mFrontendTests.closeFrontend()); + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.videoFilterId].type, + filterMap[live.videoFilterId].bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(mediaFilterId)); + ASSERT_TRUE( + mFilterTests.configFilter(filterMap[live.videoFilterId].settings, mediaFilterId)); + mediaFilter = mFilterTests.getFilterById(mediaFilterId); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.pcrFilterId].type, + filterMap[live.pcrFilterId].bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(pcrFilterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.pcrFilterId].settings, pcrFilterId)); + ASSERT_TRUE(mDemuxTests.getAvSyncId(mediaFilter, avSyncHwId)); + ASSERT_TRUE(pcrFilterId == avSyncHwId); + ASSERT_TRUE(mDemuxTests.getAvSyncTime(pcrFilterId)); + ASSERT_TRUE(mFilterTests.closeFilter(pcrFilterId)); + ASSERT_TRUE(mFilterTests.closeFilter(mediaFilterId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } } TEST_P(TunerFilterAidlTest, StartFilterInDemux) { @@ -578,7 +775,11 @@ TEST_P(TunerFilterAidlTest, StartFilterInDemux) { return; } // TODO use parameterized tests - configSingleFilterInDemuxTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + configSingleFilterInDemuxTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + } } TEST_P(TunerFilterAidlTest, ConfigIpFilterInDemuxWithCid) { @@ -587,10 +788,14 @@ TEST_P(TunerFilterAidlTest, ConfigIpFilterInDemuxWithCid) { if (!live.hasFrontendConnection) { return; } - if (live.ipFilterId.compare(emptyHardwareId) == 0) { - return; + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + if (live.ipFilterId.compare(emptyHardwareId) == 0) { + continue; + } + configSingleFilterInDemuxTest(filterMap[live.ipFilterId], frontendMap[live.frontendId]); } - configSingleFilterInDemuxTest(filterMap[live.ipFilterId], frontendMap[live.frontendId]); } TEST_P(TunerFilterAidlTest, ReconfigFilterToReceiveStartId) { @@ -599,8 +804,13 @@ TEST_P(TunerFilterAidlTest, ReconfigFilterToReceiveStartId) { return; } // TODO use parameterized tests - reconfigSingleFilterInDemuxTest(filterMap[live.videoFilterId], filterMap[live.videoFilterId], - frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + reconfigSingleFilterInDemuxTest(filterMap[live.videoFilterId], + filterMap[live.videoFilterId], + frontendMap[live.frontendId]); + } } TEST_P(TunerFilterAidlTest, SetFilterLinkage) { @@ -637,7 +847,11 @@ TEST_P(TunerFilterAidlTest, testTimeFilter) { return; } // TODO use parameterized tests - testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); + auto timeFilter_configs = generateTimeFilterConfigurations(); + for (auto& configuration : timeFilter_configs) { + timeFilter = configuration; + testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); + } } static bool isEventProducingFilter(const FilterConfig& filterConfig) { @@ -839,10 +1053,16 @@ TEST_P(TunerFilterAidlTest, FilterDelayHintTest) { TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsSectionFilterTest) { description("Feed ts data from playback and configure Ts section filter to get output"); - if (!playback.support || playback.sectionFilterId.compare(emptyHardwareId) == 0) { + if (!playback.support) { return; } - playbackSingleFilterTest(filterMap[playback.sectionFilterId], dvrMap[playback.dvrId]); + vector playback_configs = generatePlaybackConfigs(); + for (auto& configuration : playback_configs) { + if (configuration.sectionFilterId.compare(emptyHardwareId) != 0) { + playback = configuration; + playbackSingleFilterTest(filterMap[playback.sectionFilterId], dvrMap[playback.dvrId]); + } + } } TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsAudioFilterTest) { @@ -850,7 +1070,11 @@ TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsAudioFilterTest) { if (!playback.support) { return; } - playbackSingleFilterTest(filterMap[playback.audioFilterId], dvrMap[playback.dvrId]); + vector playback_configs = generatePlaybackConfigs(); + for (auto& configuration : playback_configs) { + playback = configuration; + playbackSingleFilterTest(filterMap[playback.audioFilterId], dvrMap[playback.dvrId]); + } } TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsVideoFilterTest) { @@ -858,7 +1082,23 @@ TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsVideoFilterTest) { if (!playback.support) { return; } - playbackSingleFilterTest(filterMap[playback.videoFilterId], dvrMap[playback.dvrId]); + vector playback_configs = generatePlaybackConfigs(); + for (auto& configuration : playback_configs) { + playback = configuration; + playbackSingleFilterTest(filterMap[playback.videoFilterId], dvrMap[playback.dvrId]); + } +} + +TEST_P(TunerPlaybackAidlTest, SetStatusCheckIntervalHintToPlaybackTest) { + description("Set status check interval hint to playback test."); + if (!playback.support) { + return; + } + vector playback_configs = generatePlaybackConfigs(); + for (auto& configuration : playback_configs) { + playback = configuration; + setStatusCheckIntervalHintTest(STATUS_CHECK_INTERVAL_MS, dvrMap[playback.dvrId]); + } } TEST_P(TunerRecordAidlTest, RecordDataFlowWithTsRecordFilterTest) { @@ -866,8 +1106,12 @@ TEST_P(TunerRecordAidlTest, RecordDataFlowWithTsRecordFilterTest) { if (!record.support) { return; } - recordSingleFilterTest(filterMap[record.recordFilterId], frontendMap[record.frontendId], - dvrMap[record.dvrRecordId]); + auto record_configs = generateRecordConfigurations(); + for (auto& configuration : record_configs) { + record = configuration; + recordSingleFilterTest(filterMap[record.recordFilterId], frontendMap[record.frontendId], + dvrMap[record.dvrRecordId], Dataflow_Context::RECORD); + } } TEST_P(TunerRecordAidlTest, AttachFiltersToRecordTest) { @@ -876,8 +1120,13 @@ TEST_P(TunerRecordAidlTest, AttachFiltersToRecordTest) { if (!record.support) { return; } - attachSingleFilterToRecordDvrTest(filterMap[record.recordFilterId], - frontendMap[record.frontendId], dvrMap[record.dvrRecordId]); + auto record_configs = generateRecordConfigurations(); + for (auto& configuration : record_configs) { + record = configuration; + attachSingleFilterToRecordDvrTest(filterMap[record.recordFilterId], + frontendMap[record.frontendId], + dvrMap[record.dvrRecordId]); + } } TEST_P(TunerRecordAidlTest, LnbRecordDataFlowWithTsRecordFilterTest) { @@ -885,9 +1134,30 @@ TEST_P(TunerRecordAidlTest, LnbRecordDataFlowWithTsRecordFilterTest) { if (!lnbRecord.support) { return; } - recordSingleFilterTestWithLnb(filterMap[lnbRecord.recordFilterId], - frontendMap[lnbRecord.frontendId], dvrMap[lnbRecord.dvrRecordId], - lnbMap[lnbRecord.lnbId]); + vector lnbRecord_configs = generateLnbRecordConfigurations(); + if (lnbRecord_configs.empty()) { + ALOGD("No frontends that support satellites."); + return; + } + for (auto& configuration : lnbRecord_configs) { + lnbRecord = configuration; + recordSingleFilterTestWithLnb(filterMap[lnbRecord.recordFilterId], + frontendMap[lnbRecord.frontendId], + dvrMap[lnbRecord.dvrRecordId], lnbMap[lnbRecord.lnbId]); + } +} + +TEST_P(TunerRecordAidlTest, SetStatusCheckIntervalHintToRecordTest) { + description("Set status check interval hint to record test."); + if (!record.support) { + return; + } + auto record_configs = generateRecordConfigurations(); + for (auto& configuration : record_configs) { + record = configuration; + setStatusCheckIntervalHintTest(STATUS_CHECK_INTERVAL_MS, frontendMap[record.frontendId], + dvrMap[record.dvrRecordId]); + } } TEST_P(TunerFrontendAidlTest, TuneFrontend) { @@ -895,7 +1165,11 @@ TEST_P(TunerFrontendAidlTest, TuneFrontend) { if (!live.hasFrontendConnection) { return; } - mFrontendTests.tuneTest(frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + mFrontendTests.tuneTest(frontendMap[live.frontendId]); + } } TEST_P(TunerFrontendAidlTest, AutoScanFrontend) { @@ -903,7 +1177,11 @@ TEST_P(TunerFrontendAidlTest, AutoScanFrontend) { if (!scan.hasFrontendConnection) { return; } - mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_AUTO); + vector scan_configs = generateScanConfigurations(); + for (auto& configuration : scan_configs) { + scan = configuration; + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_AUTO); + } } TEST_P(TunerFrontendAidlTest, BlindScanFrontend) { @@ -911,7 +1189,11 @@ TEST_P(TunerFrontendAidlTest, BlindScanFrontend) { if (!scan.hasFrontendConnection) { return; } - mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); + vector scan_configs = generateScanConfigurations(); + for (auto& configuration : scan_configs) { + scan = configuration; + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); + } } TEST_P(TunerFrontendAidlTest, TuneFrontendWithFrontendSettings) { @@ -919,7 +1201,11 @@ TEST_P(TunerFrontendAidlTest, TuneFrontendWithFrontendSettings) { if (!live.hasFrontendConnection) { return; } - mFrontendTests.tuneTest(frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + mFrontendTests.tuneTest(frontendMap[live.frontendId]); + } } TEST_P(TunerFrontendAidlTest, BlindScanFrontendWithEndFrequency) { @@ -927,7 +1213,11 @@ TEST_P(TunerFrontendAidlTest, BlindScanFrontendWithEndFrequency) { if (!scan.hasFrontendConnection) { return; } - mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); + vector scan_configs = generateScanConfigurations(); + for (auto& configuration : scan_configs) { + scan = configuration; + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); + } } TEST_P(TunerFrontendAidlTest, LinkToCiCam) { @@ -935,10 +1225,14 @@ TEST_P(TunerFrontendAidlTest, LinkToCiCam) { if (!live.hasFrontendConnection) { return; } - if (!frontendMap[live.frontendId].canConnectToCiCam) { - return; + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + if (!frontendMap[live.frontendId].canConnectToCiCam) { + continue; + } + mFrontendTests.tuneTest(frontendMap[live.frontendId]); } - mFrontendTests.tuneTest(frontendMap[live.frontendId]); } TEST_P(TunerFrontendAidlTest, getHardwareInfo) { @@ -946,7 +1240,11 @@ TEST_P(TunerFrontendAidlTest, getHardwareInfo) { if (!live.hasFrontendConnection) { return; } - mFrontendTests.debugInfoTest(frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + mFrontendTests.debugInfoTest(frontendMap[live.frontendId]); + } } TEST_P(TunerFrontendAidlTest, maxNumberOfFrontends) { @@ -962,7 +1260,11 @@ TEST_P(TunerFrontendAidlTest, statusReadinessTest) { if (!live.hasFrontendConnection) { return; } - mFrontendTests.statusReadinessTest(frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + mFrontendTests.statusReadinessTest(frontendMap[live.frontendId]); + } } TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { @@ -970,7 +1272,11 @@ TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { if (!live.hasFrontendConnection) { return; } - broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + } } TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowAudioFilterTest) { @@ -978,7 +1284,11 @@ TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowAudioFilterTest) { if (!live.hasFrontendConnection) { return; } - broadcastSingleFilterTest(filterMap[live.audioFilterId], frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + broadcastSingleFilterTest(filterMap[live.audioFilterId], frontendMap[live.frontendId]); + } } TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowSectionFilterTest) { @@ -986,10 +1296,14 @@ TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowSectionFilterTest) { if (!live.hasFrontendConnection) { return; } - if (live.sectionFilterId.compare(emptyHardwareId) == 0) { - return; + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + if (live.sectionFilterId.compare(emptyHardwareId) == 0) { + continue; + } + broadcastSingleFilterTest(filterMap[live.sectionFilterId], frontendMap[live.frontendId]); } - broadcastSingleFilterTest(filterMap[live.sectionFilterId], frontendMap[live.frontendId]); } TEST_P(TunerBroadcastAidlTest, IonBufferTest) { @@ -997,7 +1311,11 @@ TEST_P(TunerBroadcastAidlTest, IonBufferTest) { if (!live.hasFrontendConnection) { return; } - broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + } } TEST_P(TunerBroadcastAidlTest, LnbBroadcastDataFlowVideoFilterTest) { @@ -1005,8 +1323,16 @@ TEST_P(TunerBroadcastAidlTest, LnbBroadcastDataFlowVideoFilterTest) { if (!lnbLive.support) { return; } - broadcastSingleFilterTestWithLnb(filterMap[lnbLive.videoFilterId], - frontendMap[lnbLive.frontendId], lnbMap[lnbLive.lnbId]); + vector lnbLive_configs = generateLnbLiveConfigurations(); + if (lnbLive_configs.empty()) { + ALOGD("No frontends that support satellites."); + return; + } + for (auto& combination : lnbLive_configs) { + lnbLive = combination; + broadcastSingleFilterTestWithLnb(filterMap[lnbLive.videoFilterId], + frontendMap[lnbLive.frontendId], lnbMap[lnbLive.lnbId]); + } } TEST_P(TunerBroadcastAidlTest, MediaFilterWithSharedMemoryHandle) { @@ -1014,7 +1340,12 @@ TEST_P(TunerBroadcastAidlTest, MediaFilterWithSharedMemoryHandle) { if (!live.hasFrontendConnection) { return; } - mediaFilterUsingSharedMemoryTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); + auto live_configs = generateLiveConfigurations(); + for (auto& configuration : live_configs) { + live = configuration; + mediaFilterUsingSharedMemoryTest(filterMap[live.videoFilterId], + frontendMap[live.frontendId]); + } } TEST_P(TunerDescramblerAidlTest, CreateDescrambler) { @@ -1022,25 +1353,34 @@ TEST_P(TunerDescramblerAidlTest, CreateDescrambler) { if (!descrambling.support) { return; } - int32_t demuxId; - std::shared_ptr demux; - ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); - - if (descrambling.hasFrontendConnection) { - int32_t feId; - mFrontendTests.getFrontendIdByType(frontendMap[descrambling.frontendId].type, feId); - ASSERT_TRUE(feId != INVALID_ID); - ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); - ASSERT_TRUE(mFrontendTests.setFrontendCallback()); - ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + vector descrambling_configs = + generateDescramblingConfigurations(); + if (descrambling_configs.empty()) { + ALOGD("No valid descrambling combinations in the configuration file."); + return; } + for (auto& combination : descrambling_configs) { + descrambling = combination; + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); - ASSERT_TRUE(mDescramblerTests.openDescrambler(demuxId)); - ASSERT_TRUE(mDescramblerTests.closeDescrambler()); - ASSERT_TRUE(mDemuxTests.closeDemux()); + if (descrambling.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendMap[descrambling.frontendId].type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + } - if (descrambling.hasFrontendConnection) { - ASSERT_TRUE(mFrontendTests.closeFrontend()); + ASSERT_TRUE(mDescramblerTests.openDescrambler(demuxId)); + ASSERT_TRUE(mDescramblerTests.closeDescrambler()); + ASSERT_TRUE(mDemuxTests.closeDemux()); + + if (descrambling.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } } } @@ -1049,11 +1389,42 @@ TEST_P(TunerDescramblerAidlTest, ScrambledBroadcastDataFlowMediaFiltersTest) { if (!descrambling.support) { return; } - set filterConfs; - filterConfs.insert(static_cast(filterMap[descrambling.audioFilterId])); - filterConfs.insert(static_cast(filterMap[descrambling.videoFilterId])); - scrambledBroadcastTest(filterConfs, frontendMap[descrambling.frontendId], - descramblerMap[descrambling.descramblerId]); + vector descrambling_configs = + generateDescramblingConfigurations(); + if (descrambling_configs.empty()) { + ALOGD("No valid descrambling combinations in the configuration file."); + return; + } + for (auto& combination : descrambling_configs) { + descrambling = combination; + set filterConfs; + filterConfs.insert(static_cast(filterMap[descrambling.audioFilterId])); + filterConfs.insert(static_cast(filterMap[descrambling.videoFilterId])); + scrambledBroadcastTest(filterConfs, frontendMap[descrambling.frontendId], + descramblerMap[descrambling.descramblerId], + Dataflow_Context::DESCRAMBLING); + } +} + +TEST_P(TunerDescramblerAidlTest, ScrambledBroadcastDataFlowMediaFiltersTestWithLnb) { + description("Test media filters in scrambled broadcast use case with Lnb"); + if (!lnbDescrambling.support) { + return; + } + auto lnbDescrambling_configs = generateLnbDescramblingConfigurations(); + if (lnbDescrambling_configs.empty()) { + ALOGD("No frontends that support satellites."); + return; + } + for (auto& configuration : lnbDescrambling_configs) { + lnbDescrambling = configuration; + set filterConfs; + filterConfs.insert(static_cast(filterMap[lnbDescrambling.audioFilterId])); + filterConfs.insert(static_cast(filterMap[lnbDescrambling.videoFilterId])); + scrambledBroadcastTestWithLnb(filterConfs, frontendMap[lnbDescrambling.frontendId], + descramblerMap[lnbDescrambling.descramblerId], + lnbMap[lnbDescrambling.lnbId]); + } } INSTANTIATE_TEST_SUITE_P(PerInstance, TunerBroadcastAidlTest, diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h index 7f80d90c82..8ad6ee0d43 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h @@ -36,11 +36,17 @@ bool initConfiguration() { initFrontendConfig(); initFilterConfig(); initDvrConfig(); + initTimeFilterConfig(); + initDescramblerConfig(); + initLnbConfig(); + initDiseqcMsgsConfig(); connectHardwaresToTestCases(); if (!validateConnections()) { ALOGW("[vts] failed to validate connections."); return false; } + determineDataFlows(); + return true; } @@ -58,6 +64,24 @@ AssertionResult filterDataOutputTestBase(FilterTests& tests) { return success(); } +void clearIds() { + lnbIds.clear(); + diseqcMsgs.clear(); + frontendIds.clear(); + ipFilterIds.clear(); + pcrFilterIds.clear(); + recordDvrIds.clear(); + timeFilterIds.clear(); + descramblerIds.clear(); + audioFilterIds.clear(); + videoFilterIds.clear(); + playbackDvrIds.clear(); + recordFilterIds.clear(); + sectionFilterIds.clear(); +} + +enum class Dataflow_Context { LNBRECORD, RECORD, DESCRAMBLING, LNBDESCRAMBLING }; + class TunerLnbAidlTest : public testing::TestWithParam { public: virtual void SetUp() override { @@ -73,6 +97,11 @@ class TunerLnbAidlTest : public testing::TestWithParam { mLnbTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -101,6 +130,11 @@ class TunerDemuxAidlTest : public testing::TestWithParam { mFilterTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -124,13 +158,18 @@ class TunerFilterAidlTest : public testing::TestWithParam { mService = nullptr; } ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); mFilterTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -197,6 +236,11 @@ class TunerPlaybackAidlTest : public testing::TestWithParam { mDvrTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -211,6 +255,8 @@ class TunerPlaybackAidlTest : public testing::TestWithParam { AssertionResult filterDataOutputTest(); void playbackSingleFilterTest(FilterConfig filterConf, DvrConfig dvrConf); + + void setStatusCheckIntervalHintTest(int64_t milliseconds, DvrConfig dvrConf); }; GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerPlaybackAidlTest); @@ -225,7 +271,7 @@ class TunerRecordAidlTest : public testing::TestWithParam { mService = nullptr; } ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -234,6 +280,11 @@ class TunerRecordAidlTest : public testing::TestWithParam { mLnbTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -244,7 +295,9 @@ class TunerRecordAidlTest : public testing::TestWithParam { void recordSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, DvrConfig dvrConf, LnbConfig lnbConf); void recordSingleFilterTest(FilterConfig filterConf, FrontendConfig frontendConf, - DvrConfig dvrConf); + DvrConfig dvrConf, Dataflow_Context context); + void setStatusCheckIntervalHintTest(int64_t milliseconds, FrontendConfig frontendConf, + DvrConfig dvrConf); std::shared_ptr mService; FrontendTests mFrontendTests; @@ -254,7 +307,7 @@ class TunerRecordAidlTest : public testing::TestWithParam { LnbTests mLnbTests; private: - int32_t* mLnbId = nullptr; + int32_t mLnbId = INVALID_LNB_ID; }; GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerRecordAidlTest); @@ -269,11 +322,16 @@ class TunerFrontendAidlTest : public testing::TestWithParam { mService = nullptr; } ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -295,7 +353,7 @@ class TunerBroadcastAidlTest : public testing::TestWithParam { mService = nullptr; } ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -304,6 +362,11 @@ class TunerBroadcastAidlTest : public testing::TestWithParam { mDvrTests.setService(mService); } + virtual void TearDown() override { + clearIds(); + mService = nullptr; + } + protected: static void description(const std::string& description) { RecordProperty("description", description); @@ -324,7 +387,7 @@ class TunerBroadcastAidlTest : public testing::TestWithParam { void mediaFilterUsingSharedMemoryTest(FilterConfig filterConf, FrontendConfig frontendConf); private: - int32_t* mLnbId = nullptr; + int32_t mLnbId = INVALID_LNB_ID; }; GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerBroadcastAidlTest); @@ -338,16 +401,37 @@ class TunerDescramblerAidlTest : public testing::TestWithParam { } else { mService = nullptr; } - mCasService = IMediaCasService::getService(); ASSERT_NE(mService, nullptr); - ASSERT_NE(mCasService, nullptr); + + // Get IMediaCasService. Try getting AIDL service first, if AIDL does not exist, try HIDL. + if (AServiceManager_isDeclared(MEDIA_CAS_AIDL_SERVICE_NAME.c_str())) { + ::ndk::SpAIBinder binder( + AServiceManager_waitForService(MEDIA_CAS_AIDL_SERVICE_NAME.c_str())); + mCasServiceAidl = IMediaCasServiceAidl::fromBinder(binder); + } else { + mCasServiceAidl = nullptr; + } + if (mCasServiceAidl == nullptr) { + mCasServiceHidl = IMediaCasServiceHidl::getService(); + } + ASSERT_TRUE(mCasServiceAidl != nullptr || mCasServiceHidl != nullptr); ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); mDvrTests.setService(mService); mDescramblerTests.setService(mService); - mDescramblerTests.setCasService(mCasService); + if (mCasServiceAidl != nullptr) { + mDescramblerTests.setCasServiceAidl(mCasServiceAidl); + } else { + mDescramblerTests.setCasServiceHidl(mCasServiceHidl); + } + mLnbTests.setService(mService); + } + + virtual void TearDown() override { + clearIds(); + mService = nullptr; } protected: @@ -356,16 +440,25 @@ class TunerDescramblerAidlTest : public testing::TestWithParam { } void scrambledBroadcastTest(set mediaFilterConfs, - FrontendConfig frontendConf, DescramblerConfig descConfig); + FrontendConfig frontendConf, DescramblerConfig descConfig, + Dataflow_Context context); + void scrambledBroadcastTestWithLnb(set& mediaFilterConfs, + FrontendConfig& frontendConf, DescramblerConfig& descConfig, + LnbConfig& lnbConfig); AssertionResult filterDataOutputTest(); std::shared_ptr mService; - android::sp mCasService; + sp mCasServiceHidl; + std::shared_ptr mCasServiceAidl; FrontendTests mFrontendTests; DemuxTests mDemuxTests; FilterTests mFilterTests; DescramblerTests mDescramblerTests; DvrTests mDvrTests; + LnbTests mLnbTests; + + private: + int32_t mLnbId = INVALID_LNB_ID; }; GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerDescramblerAidlTest); diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h index 5f1f9c5385..516cb62f04 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h @@ -55,6 +55,7 @@ const int32_t FMQ_SIZE_16M = 0x1000000; const string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1.xml"; #define FILTER_MAIN_TYPE_BIT_COUNT 5 +#define STATUS_CHECK_INTERVAL_MS 100L // Hardware configs static map frontendMap; @@ -74,6 +75,512 @@ static DescramblingHardwareConnections descrambling; static LnbLiveHardwareConnections lnbLive; static LnbRecordHardwareConnections lnbRecord; static TimeFilterHardwareConnections timeFilter; +static LnbDescramblingHardwareConnections lnbDescrambling; + +/* + * This function takes in a 2d vector of device Id's + * The n vectors correlate to the ids for n different devices (eg frontends, filters) + * The resultant 2d vector is every combination of id's with 1 id from each vector + */ +inline vector> generateIdCombinations(vector>& ids) { + vector> combinations; + + // The index of each vector in ids that will be used in the next combination + // EG {0, 2} means combo {ids[0][0] ids[1][2]} will be next + const int size = static_cast(ids.size()); + vector indexes_used_in_combination(size, 0); + + // The vector number from ids whose elements we will cycle through to make combinations. + // First, start at the right most vector + int cycled_vector = size - 1; + + while (cycled_vector >= 0) { + // Make a combination (one at a time) + vector combo; + for (size_t i = 0; i < indexes_used_in_combination.size(); ++i) { + const int combo_index = indexes_used_in_combination[i]; + combo.push_back(ids[i][combo_index]); + } + combinations.push_back(combo); + + // Find the right most vector that still has space [elements left] to cycle through and + // create a combination + while (cycled_vector >= 0 && + indexes_used_in_combination[cycled_vector] == ids[cycled_vector].size() - 1) { + cycled_vector--; + } + + // Use this check to avoid segmentation faults + if (cycled_vector >= 0) { + // Once found, we have a vector we can cycle through, so increase to its next element + indexes_used_in_combination[cycled_vector]++; + + // Reset the other vectors to the right to their first element so we can cycle through + // them again with the new element from cycled vector + for (size_t i = cycled_vector + 1; i < indexes_used_in_combination.size(); ++i) { + indexes_used_in_combination[i] = 0; + } + + // all the vectors to the right were reset, so we can cycle through them again + // Start at the furthest right vector + cycled_vector = size - 1; + } + } + + return combinations; +} + +/* + * index 0 - playback dvr + * index 1 - audio filters + * index 2 - optional section filters + */ +static inline vector generatePlaybackCombinations() { + vector combinations; + vector sectionFilterIds_optional = sectionFilterIds; + sectionFilterIds_optional.push_back(emptyHardwareId); + vector> deviceIds{playbackDvrIds, audioFilterIds, sectionFilterIds_optional}; + + const int dvrIndex = 0; + const int audioFilterIndex = 1; + const int sectionFilterIndex = 2; + + auto idCombinations = generateIdCombinations(deviceIds); + for (auto& combo : idCombinations) { + DvrPlaybackHardwareConnections mPlayback; + mPlayback.dvrId = combo[dvrIndex]; + mPlayback.audioFilterId = combo[audioFilterIndex]; + mPlayback.sectionFilterId = combo[sectionFilterIndex]; + const int videoFilterIndex = + find(audioFilterIds.begin(), audioFilterIds.end(), mPlayback.audioFilterId) - + audioFilterIds.begin(); + mPlayback.videoFilterId = videoFilterIds[videoFilterIndex]; + combinations.push_back(mPlayback); + } + + return combinations; +} + +static inline vector generatePlaybackConfigs() { + vector playback_configs; + if (configuredPlayback) { + ALOGD("Using DVR playback configuration provided."); + playback_configs = {playback}; + } else { + ALOGD("Dvr playback not provided. Generating possible combinations. Consider adding it to " + "the configuration file."); + playback_configs = generatePlaybackCombinations(); + } + + return playback_configs; +} + +/* + * index 0 - frontends + * index 1 - audio filters + * index 2 - lnbs + */ +static inline vector generateLnbLiveCombinations() { + vector combinations; + vector> deviceIds{frontendIds, audioFilterIds, lnbIds}; + + const int frontendIndex = 0; + const int audioFilterIndex = 1; + const int lnbIndex = 2; + + // TODO: Find a better way to vary diseqcMsgs, if at all + auto idCombinations = generateIdCombinations(deviceIds); + for (auto& combo : idCombinations) { + const string feId = combo[frontendIndex]; + auto type = frontendMap[feId].type; + if (type == FrontendType::DVBS || type == FrontendType::ISDBS || + type == FrontendType::ISDBS3) { + LnbLiveHardwareConnections mLnbLive; + mLnbLive.frontendId = feId; + mLnbLive.audioFilterId = combo[audioFilterIndex]; + const int videoFilterIndex = + find(audioFilterIds.begin(), audioFilterIds.end(), mLnbLive.audioFilterId) - + audioFilterIds.begin(); + mLnbLive.videoFilterId = videoFilterIds[videoFilterIndex]; + mLnbLive.lnbId = combo[lnbIndex]; + mLnbLive.diseqcMsgs = diseqcMsgs; + combinations.push_back(mLnbLive); + } + } + + return combinations; +} + +static inline vector generateLnbLiveConfigurations() { + vector lnbLive_configs; + if (configuredLnbLive) { + ALOGD("Using LnbLive configuration provided."); + lnbLive_configs = {lnbLive}; + } else { + ALOGD("LnbLive not provided. Generating possible combinations. Consider adding it to the " + "configuration file."); + lnbLive_configs = generateLnbLiveCombinations(); + } + + return lnbLive_configs; +} + +static inline vector generateScanCombinations() { + vector combinations; + + for (auto& id : frontendIds) { + ScanHardwareConnections mScan; + mScan.frontendId = id; + combinations.push_back(mScan); + } + + return combinations; +} + +static inline vector generateScanConfigurations() { + vector scan_configs; + if (configuredScan) { + ALOGD("Using scan configuration provided."); + scan_configs = {scan}; + } else { + ALOGD("Scan not provided. Generating possible combinations. Consider adding it to " + "the configuration file."); + scan_configs = generateScanCombinations(); + } + + return scan_configs; +} + +/* + * index 0 - frontends + * index 1 - record filter + * index 2 - Record Dvr + * index 3 - Lnb + */ +static inline vector generateLnbRecordCombinations() { + vector combinations; + vector> deviceIds{frontendIds, recordFilterIds, recordDvrIds, lnbIds}; + + const int frontendIndex = 0; + const int recordFilterIndex = 1; + const int dvrIndex = 2; + const int lnbIndex = 3; + + auto idCombinations = generateIdCombinations(deviceIds); + // TODO : Find a better way to vary diseqcMsgs, if at all + for (auto& combo : idCombinations) { + const string feId = combo[frontendIndex]; + auto type = frontendMap[feId].type; + if (type == FrontendType::DVBS || type == FrontendType::ISDBS || + type == FrontendType::ISDBS3) { + LnbRecordHardwareConnections mLnbRecord; + mLnbRecord.frontendId = feId; + mLnbRecord.recordFilterId = combo[recordFilterIndex]; + mLnbRecord.dvrRecordId = combo[dvrIndex]; + mLnbRecord.lnbId = combo[lnbIndex]; + mLnbRecord.diseqcMsgs = diseqcMsgs; + combinations.push_back(mLnbRecord); + } + } + + return combinations; +} + +static inline vector generateLnbRecordConfigurations() { + vector lnbRecord_configs; + if (configuredLnbRecord) { + ALOGD("Using LnbRecord configuration provided."); + lnbRecord_configs = {lnbRecord}; + } else { + ALOGD("LnbRecord not provided. Generating possible combinations. Consider adding it to " + "the configuration file."); + lnbRecord_configs = generateLnbRecordCombinations(); + } + + return lnbRecord_configs; +} + +/* + * index 0 - decramblers + * index 1 - frontends + * index 2 - audio filters + * index 3 - Dvr SW Fe Connections + * index 4 - DVR Source Connections + */ +static inline vector generateDescramblingCombinations() { + vector combinations; + vector mfrontendIds = frontendIds; + vector mDvrFeConnectionIds = playbackDvrIds; + vector mDvrSourceConnectionIds = playbackDvrIds; + + // Add the empty hardware id to each vector to include combinations where these 3 fields might + // be optional + mfrontendIds.push_back(emptyHardwareId); + mDvrFeConnectionIds.push_back(emptyHardwareId); + mDvrSourceConnectionIds.push_back(emptyHardwareId); + + const int descramblerIndex = 0; + const int frontendIndex = 1; + const int audioFilterIndex = 2; + const int dvrFeIdIndex = 3; + const int dvrSourceIdIndex = 4; + + vector> deviceIds{descramblerIds, mfrontendIds, audioFilterIds, + mDvrFeConnectionIds, mDvrSourceConnectionIds}; + auto idCombinations = generateIdCombinations(deviceIds); + for (auto& combo : idCombinations) { + DescramblingHardwareConnections mDescrambling; + const string feId = combo[frontendIndex]; + const string dvrSwFeId = combo[dvrFeIdIndex]; + const string dvrSourceId = combo[dvrSourceIdIndex]; + mDescrambling.hasFrontendConnection = feId.compare(emptyHardwareId) == 0 ? false : true; + if (!mDescrambling.hasFrontendConnection) { + if (dvrSourceId.compare(emptyHardwareId) == 0) { + // If combination does not have a frontend or dvr source connection, do not include + // it + continue; + } + } else { + if (frontendMap[feId].isSoftwareFe && dvrSwFeId.compare(emptyHardwareId) == 0) { + // If combination has a software frontend and no dvr->software frontend connection, + // do not include it + continue; + } + } + if (dvrSwFeId.compare(dvrSourceId) == 0) { + // If dvr->software frontend connection is the same as dvr source input to tuner, do not + // include it. + continue; + } + mDescrambling.frontendId = feId; + mDescrambling.audioFilterId = combo[audioFilterIndex]; + const int videoFilterIndex = + find(audioFilterIds.begin(), audioFilterIds.end(), mDescrambling.audioFilterId) - + audioFilterIds.begin(); + mDescrambling.videoFilterId = videoFilterIds[videoFilterIndex]; + mDescrambling.dvrSoftwareFeId = dvrSwFeId; + mDescrambling.dvrSourceId = dvrSourceId; + mDescrambling.descramblerId = combo[descramblerIndex]; + combinations.push_back(mDescrambling); + } + + return combinations; +} + +static inline vector generateDescramblingConfigurations() { + vector descrambling_configs; + if (configuredDescrambling) { + ALOGD("Using Descrambling configuration provided."); + descrambling_configs = {descrambling}; + } else { + ALOGD("Descrambling not provided. Generating possible combinations. Consider adding it to " + "the " + "configuration file."); + descrambling_configs = generateDescramblingCombinations(); + } + + return descrambling_configs; +} + +static inline vector generateTimeFilterCombinations() { + vector combinations; + + for (auto& id : timeFilterIds) { + TimeFilterHardwareConnections mTimeFilter; + mTimeFilter.timeFilterId = id; + combinations.push_back(mTimeFilter); + } + + return combinations; +} + +static inline vector generateTimeFilterConfigurations() { + vector timeFilter_configs; + if (configuredTimeFilter) { + ALOGD("Using TimeFilter configuration provided."); + timeFilter_configs = {timeFilter}; + } else { + ALOGD("TimeFilter not provided. Generating possible combinations. Consider adding it to " + "the " + "configuration file."); + timeFilter_configs = generateTimeFilterCombinations(); + } + + return timeFilter_configs; +} + +/* + * index 0 - frontends + * index 1 - record dvrs + * index 2 - record filters + */ +static inline vector generateRecordCombinations() { + vector combinations; + + const int frontendIdIndex = 0; + const int recordDvrIndex = 1; + const int recordFilterIndex = 2; + + vector> deviceIds{frontendIds, recordDvrIds, recordFilterIds}; + + auto idCombinations = generateIdCombinations(deviceIds); + for (auto& combo : idCombinations) { + DvrRecordHardwareConnections mRecord; + const string feId = combo[frontendIdIndex]; + mRecord.hasFrontendConnection = true; + if (frontendMap[feId].isSoftwareFe) { + // If we have a software frontend, do not include configuration for testing. + continue; + } + mRecord.frontendId = feId; + mRecord.support = true; + mRecord.dvrSourceId = emptyHardwareId; + mRecord.dvrSoftwareFeId = emptyHardwareId; + mRecord.recordFilterId = combo[recordFilterIndex]; + mRecord.dvrRecordId = combo[recordDvrIndex]; + combinations.push_back(mRecord); + } + + return combinations; +} + +static inline vector generateRecordConfigurations() { + vector record_configs; + if (configuredRecord) { + ALOGD("Using Record configuration provided."); + record_configs = {record}; + } else { + ALOGD("Record not provided. Generating possible combinations. Consider adding it to " + "the " + "configuration file."); + record_configs = generateRecordCombinations(); + } + + return record_configs; +} + +/* + * index 0 - frontends + * index 1 - audio filters + * index 2 - playback dvrs + * index 3 - section Filters + */ +static inline vector generateLiveCombinations() { + vector combinations; + vector mSectionFilterIds = sectionFilterIds; + vector mDvrSwConnectionIds = playbackDvrIds; + + // Adding the empty hardware id to cover cases where fields are optional + mSectionFilterIds.push_back(emptyHardwareId); + mDvrSwConnectionIds.push_back(emptyHardwareId); + + const int frontendIdIndex = 0; + const int audioFilterIdIndex = 1; + const int dvrSwConnectionIdIndex = 2; + const int sectionFilterIdIndex = 3; + + vector> deviceIds{frontendIds, audioFilterIds, mDvrSwConnectionIds, + mSectionFilterIds}; + + auto idCombinations = generateIdCombinations(deviceIds); + for (auto& combo : idCombinations) { + LiveBroadcastHardwareConnections mLive; + const string feId = combo[frontendIdIndex]; + const string dvrSwConnectionId = combo[dvrSwConnectionIdIndex]; + mLive.hasFrontendConnection = true; + + if (frontendMap[feId].isSoftwareFe && dvrSwConnectionId.compare(emptyHardwareId) == 0) { + // If the frontend is a software frontend and there is no dvr playback connected, do not + // include configuration + continue; + } + mLive.frontendId = feId; + mLive.dvrSoftwareFeId = dvrSwConnectionId; + mLive.audioFilterId = combo[audioFilterIdIndex]; + const int videoFilterIdIndex = + find(audioFilterIds.begin(), audioFilterIds.end(), mLive.audioFilterId) - + audioFilterIds.begin(); + mLive.videoFilterId = videoFilterIds[videoFilterIdIndex]; + mLive.sectionFilterId = combo[sectionFilterIdIndex]; + + if (pcrFilterIds.empty()) { + // If pcr Filters have not been provided, set it to empty hardware id + mLive.pcrFilterId = emptyHardwareId; + } else { + // If pcr Filters have been provided, use the first index if there is only 1, or choose + // the filter that corresponds to the correct audio and video filter pair + const int pcrFilterIdIndex = pcrFilterIds.size() == 1 ? 0 : videoFilterIdIndex; + mLive.pcrFilterId = pcrFilterIds[pcrFilterIdIndex]; + } + + combinations.push_back(mLive); + } + + return combinations; +} + +static inline vector generateLiveConfigurations() { + vector live_configs; + if (configuredLive) { + ALOGD("Using Live configuration provided."); + live_configs = {live}; + } else { + ALOGD("Live not provided. Generating possible combinations. Consider adding it to " + "the " + "configuration file."); + live_configs = generateLiveCombinations(); + } + + return live_configs; +} + +static inline vector generateLnbDescramblingCombinations() { + vector combinations; + vector> deviceIds{frontendIds, audioFilterIds, lnbIds, descramblerIds}; + + const int frontendIdIndex = 0; + const int audioFilterIdIndex = 1; + const int lnbIdIndex = 2; + const int descramblerIdIndex = 3; + + auto idCombinations = generateIdCombinations(deviceIds); + // TODO : Find a better way to vary diseqcMsgs, if at all + for (auto& combo : idCombinations) { + const string feId = combo[frontendIdIndex]; + auto type = frontendMap[feId].type; + if (type == FrontendType::DVBS || type == FrontendType::ISDBS || + type == FrontendType::ISDBS3) { + LnbDescramblingHardwareConnections mLnbDescrambling; + mLnbDescrambling.support = true; + mLnbDescrambling.frontendId = feId; + mLnbDescrambling.audioFilterId = combo[audioFilterIdIndex]; + const int videoFilterIdIndex = find(audioFilterIds.begin(), audioFilterIds.end(), + mLnbDescrambling.audioFilterId) - + audioFilterIds.begin(); + mLnbDescrambling.videoFilterId = videoFilterIds[videoFilterIdIndex]; + mLnbDescrambling.lnbId = combo[lnbIdIndex]; + mLnbDescrambling.descramblerId = combo[descramblerIdIndex]; + mLnbDescrambling.diseqcMsgs = diseqcMsgs; + combinations.push_back(mLnbDescrambling); + } + } + + return combinations; +} + +static inline vector generateLnbDescramblingConfigurations() { + vector lnbDescrambling_configs; + if (configuredLnbDescrambling) { + ALOGD("Using LnbDescrambling configuration provided"); + lnbDescrambling_configs = {lnbDescrambling}; + } else { + ALOGD("LnbDescrambling not provided. Generating possible combinations. Consider adding it " + "to the configuration file."); + lnbDescrambling_configs = generateLnbDescramblingCombinations(); + } + + return lnbDescrambling_configs; +} /** Config all the frontends that would be used in the tests */ inline void initFrontendConfig() { @@ -162,13 +669,141 @@ inline void initDvrConfig() { TunerTestingConfigAidlReader1_0::readDvrConfig1_0(dvrMap); }; +inline void initTimeFilterConfig() { + // Read customized config + TunerTestingConfigAidlReader1_0::readTimeFilterConfig1_0(timeFilterMap); +}; + +inline void initDescramblerConfig() { + // Read customized config + TunerTestingConfigAidlReader1_0::readDescramblerConfig1_0(descramblerMap); +} + +inline void initLnbConfig() { + // Read customized config + TunerTestingConfigAidlReader1_0::readLnbConfig1_0(lnbMap); +}; + +inline void initDiseqcMsgsConfig() { + // Read customized config + TunerTestingConfigAidlReader1_0::readDiseqcMessages(diseqcMsgMap); +}; + +inline void determineScan() { + if (!frontendMap.empty()) { + scan.hasFrontendConnection = true; + ALOGD("Can support scan"); + } +} + +inline void determineTimeFilter() { + if (!timeFilterMap.empty()) { + timeFilter.support = true; + ALOGD("Can support time filter"); + } +} + +inline void determineDvrPlayback() { + if (!playbackDvrIds.empty() && !audioFilterIds.empty() && !videoFilterIds.empty()) { + playback.support = true; + ALOGD("Can support dvr playback"); + } +} + +inline void determineLnbLive() { + if (!audioFilterIds.empty() && !videoFilterIds.empty() && !frontendMap.empty() && + !lnbMap.empty()) { + lnbLive.support = true; + ALOGD("Can support lnb live"); + } +} + +inline void determineLnbRecord() { + if (!frontendMap.empty() && !recordFilterIds.empty() && !recordDvrIds.empty() && + !lnbMap.empty()) { + lnbRecord.support = true; + ALOGD("Can support lnb record"); + } +} + +inline void determineLive() { + if (videoFilterIds.empty() || audioFilterIds.empty() || frontendMap.empty()) { + return; + } + if (hasSwFe && !hasHwFe && dvrMap.empty()) { + ALOGD("Cannot configure Live. Only software frontends and no dvr connections"); + return; + } + ALOGD("Can support live"); + live.hasFrontendConnection = true; +} + +inline void determineDescrambling() { + if (descramblerMap.empty() || audioFilterIds.empty() || videoFilterIds.empty()) { + return; + } + if (frontendMap.empty() && playbackDvrIds.empty()) { + ALOGD("Cannot configure descrambling. No frontends or playback dvr's"); + return; + } + if (hasSwFe && !hasHwFe && playbackDvrIds.empty()) { + ALOGD("cannot configure descrambling. Only SW frontends and no playback dvr's"); + return; + } + ALOGD("Can support descrambling"); + descrambling.support = true; +} + +inline void determineDvrRecord() { + if (recordDvrIds.empty() || recordFilterIds.empty()) { + return; + } + if (frontendMap.empty() && playbackDvrIds.empty()) { + ALOGD("Cannot support dvr record. No frontends and no playback dvr's"); + return; + } + if (hasSwFe && !hasHwFe && playbackDvrIds.empty()) { + ALOGD("Cannot support dvr record. Only SW frontends and no playback dvr's"); + return; + } + ALOGD("Can support dvr record."); + record.support = true; +} + +inline void determineLnbDescrambling() { + if (frontendIds.empty() || audioFilterIds.empty() || videoFilterIds.empty() || lnbIds.empty() || + descramblerIds.empty()) { + return; + } + ALOGD("Can support LnbDescrambling."); + lnbDescrambling.support = true; +} + /** Read the vendor configurations of which hardware to use for each test cases/data flows */ inline void connectHardwaresToTestCases() { TunerTestingConfigAidlReader1_0::connectLiveBroadcast(live); TunerTestingConfigAidlReader1_0::connectScan(scan); TunerTestingConfigAidlReader1_0::connectDvrRecord(record); + TunerTestingConfigAidlReader1_0::connectTimeFilter(timeFilter); + TunerTestingConfigAidlReader1_0::connectDescrambling(descrambling); + TunerTestingConfigAidlReader1_0::connectLnbLive(lnbLive); + TunerTestingConfigAidlReader1_0::connectLnbRecord(lnbRecord); + TunerTestingConfigAidlReader1_0::connectDvrPlayback(playback); + TunerTestingConfigAidlReader1_0::connectLnbDescrambling(lnbDescrambling); }; +inline void determineDataFlows() { + determineScan(); + determineTimeFilter(); + determineDvrPlayback(); + determineLnbLive(); + determineLnbRecord(); + determineLive(); + determineDescrambling(); + determineDvrRecord(); + determineLnbDescrambling(); +} + inline bool validateConnections() { if (record.support && !record.hasFrontendConnection && record.dvrSourceId.compare(emptyHardwareId) == 0) { @@ -183,6 +818,18 @@ inline bool validateConnections() { feIsValid &= record.support && record.hasFrontendConnection ? frontendMap.find(record.frontendId) != frontendMap.end() : true; + feIsValid &= descrambling.support && descrambling.hasFrontendConnection + ? frontendMap.find(descrambling.frontendId) != frontendMap.end() + : true; + + feIsValid &= lnbLive.support ? frontendMap.find(lnbLive.frontendId) != frontendMap.end() : true; + + feIsValid &= + lnbRecord.support ? frontendMap.find(lnbRecord.frontendId) != frontendMap.end() : true; + + feIsValid &= lnbDescrambling.support + ? frontendMap.find(lnbDescrambling.frontendId) != frontendMap.end() + : true; if (!feIsValid) { ALOGW("[vts config] dynamic config fe connection is invalid."); @@ -204,6 +851,20 @@ inline bool validateConnections() { dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end(); } + if (descrambling.support) { + if (descrambling.hasFrontendConnection) { + if (frontendMap[descrambling.frontendId].isSoftwareFe) { + dvrIsValid &= dvrMap.find(descrambling.dvrSoftwareFeId) != dvrMap.end(); + } + } else { + dvrIsValid &= dvrMap.find(descrambling.dvrSourceId) != dvrMap.end(); + } + } + + dvrIsValid &= lnbRecord.support ? dvrMap.find(lnbRecord.dvrRecordId) != dvrMap.end() : true; + + dvrIsValid &= playback.support ? dvrMap.find(playback.dvrId) != dvrMap.end() : true; + if (!dvrIsValid) { ALOGW("[vts config] dynamic config dvr connection is invalid."); return false; @@ -216,10 +877,120 @@ inline bool validateConnections() { filterIsValid &= record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true; + filterIsValid &= descrambling.support + ? filterMap.find(descrambling.videoFilterId) != filterMap.end() && + filterMap.find(descrambling.audioFilterId) != filterMap.end() + : true; + + for (auto& filterId : descrambling.extraFilters) { + filterIsValid &= filterMap.find(filterId) != filterMap.end(); + } + + filterIsValid &= lnbLive.support + ? filterMap.find(lnbLive.audioFilterId) != filterMap.end() && + filterMap.find(lnbLive.videoFilterId) != filterMap.end() + : true; + + filterIsValid &= + lnbRecord.support ? filterMap.find(lnbRecord.recordFilterId) != filterMap.end() : true; + + for (auto& filterId : lnbRecord.extraFilters) { + filterIsValid &= filterMap.find(filterId) != filterMap.end(); + } + + for (auto& filterId : lnbLive.extraFilters) { + filterIsValid &= filterMap.find(filterId) != filterMap.end(); + } + + filterIsValid &= playback.support + ? filterMap.find(playback.audioFilterId) != filterMap.end() && + filterMap.find(playback.videoFilterId) != filterMap.end() + : true; + filterIsValid &= playback.sectionFilterId.compare(emptyHardwareId) == 0 + ? true + : filterMap.find(playback.sectionFilterId) != filterMap.end(); + + for (auto& filterId : playback.extraFilters) { + filterIsValid &= + playback.hasExtraFilters ? filterMap.find(filterId) != filterMap.end() : true; + } + + filterIsValid &= + lnbDescrambling.support + ? filterMap.find(lnbDescrambling.audioFilterId) != filterMap.end() && + filterMap.find(lnbDescrambling.videoFilterId) != filterMap.end() + : true; + if (!filterIsValid) { ALOGW("[vts config] dynamic config filter connection is invalid."); return false; } + if (audioFilterIds.size() != videoFilterIds.size()) { + ALOGW("[vts config] the number of audio and video filters should be equal"); + return false; + } + + if (!pcrFilterIds.empty() && pcrFilterIds.size() != 1 && + pcrFilterIds.size() != audioFilterIds.size()) { + ALOGW("[vts config] When more than 1 pcr filter is configured, the number of pcr filters " + "must equal the number of audio and video filters."); + return false; + } + + bool timeFilterIsValid = + timeFilter.support ? timeFilterMap.find(timeFilter.timeFilterId) != timeFilterMap.end() + : true; + + if (!timeFilterIsValid) { + ALOGW("[vts config] dynamic config time filter connection is invalid."); + } + + bool descramblerIsValid = + descrambling.support + ? descramblerMap.find(descrambling.descramblerId) != descramblerMap.end() + : true; + + descramblerIsValid &= + lnbDescrambling.support + ? descramblerMap.find(lnbDescrambling.descramblerId) != descramblerMap.end() + : true; + + if (!descramblerIsValid) { + ALOGW("[vts config] dynamic config descrambler connection is invalid."); + return false; + } + + bool lnbIsValid = lnbLive.support ? lnbMap.find(lnbLive.lnbId) != lnbMap.end() : true; + + lnbIsValid &= lnbRecord.support ? lnbMap.find(lnbRecord.lnbId) != lnbMap.end() : true; + + lnbIsValid &= + lnbDescrambling.support ? lnbMap.find(lnbDescrambling.lnbId) != lnbMap.end() : true; + + if (!lnbIsValid) { + ALOGW("[vts config] dynamic config lnb connection is invalid."); + return false; + } + + bool diseqcMsgsIsValid = true; + + for (auto& msg : lnbRecord.diseqcMsgs) { + diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end(); + } + + for (auto& msg : lnbLive.diseqcMsgs) { + diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end(); + } + + for (auto& msg : lnbDescrambling.diseqcMsgs) { + diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end(); + } + + if (!diseqcMsgsIsValid) { + ALOGW("[vts config] dynamic config diseqcMsg is invalid."); + return false; + } + return true; } diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index 189f5fdf77..9517520c18 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -62,10 +62,37 @@ using namespace std; using namespace aidl::android::hardware::tv::tuner; using namespace android::media::tuner::testing::configuration::V1_0; +static bool hasHwFe = false; +static bool hasSwFe = false; +static bool configFileRead = false; +static bool configuredLive = false; +static bool configuredScan = false; +static bool configuredRecord = false; +static bool configuredLnbLive = false; +static bool configuredPlayback = false; +static bool configuredLnbRecord = false; +static bool configuredTimeFilter = false; +static bool configuredDescrambling = false; +static bool configuredLnbDescrambling = false; + const string emptyHardwareId = ""; static string mConfigFilePath; +static vector playbackDvrIds; +static vector ipFilterIds; +static vector recordDvrIds; +static vector pcrFilterIds; +static vector timeFilterIds; +static vector audioFilterIds; +static vector videoFilterIds; +static vector recordFilterIds; +static vector sectionFilterIds; +static vector frontendIds; +static vector lnbIds; +static vector diseqcMsgs; +static vector descramblerIds; + #define PROVISION_STR \ "{ " \ " \"id\": 21140844, " \ @@ -137,6 +164,7 @@ struct LiveBroadcastHardwareConnections { string ipFilterId; string pcrFilterId; /* list string of extra filters; */ + vector extraFilters; }; struct ScanHardwareConnections { @@ -146,12 +174,13 @@ struct ScanHardwareConnections { struct DvrPlaybackHardwareConnections { bool support; + bool hasExtraFilters = false; string frontendId; string dvrId; string audioFilterId; string videoFilterId; string sectionFilterId; - /* list string of extra filters; */ + vector extraFilters; }; struct DvrRecordHardwareConnections { @@ -173,7 +202,7 @@ struct DescramblingHardwareConnections { string videoFilterId; string descramblerId; string dvrSourceId; - /* list string of extra filters; */ + vector extraFilters; }; struct LnbLiveHardwareConnections { @@ -183,7 +212,7 @@ struct LnbLiveHardwareConnections { string videoFilterId; string lnbId; vector diseqcMsgs; - /* list string of extra filters; */ + vector extraFilters; }; struct LnbRecordHardwareConnections { @@ -193,7 +222,7 @@ struct LnbRecordHardwareConnections { string recordFilterId; string lnbId; vector diseqcMsgs; - /* list string of extra filters; */ + vector extraFilters; }; struct TimeFilterHardwareConnections { @@ -201,6 +230,16 @@ struct TimeFilterHardwareConnections { string timeFilterId; }; +struct LnbDescramblingHardwareConnections { + bool support; + string frontendId; + string audioFilterId; + string videoFilterId; + string lnbId; + string descramblerId; + vector diseqcMsgs; +}; + struct TunerTestingConfigAidlReader1_0 { public: static void setConfigFilePath(string path) { mConfigFilePath = path; } @@ -248,6 +287,7 @@ struct TunerTestingConfigAidlReader1_0 { auto frontends = *hardwareConfig.getFirstFrontends(); for (auto feConfig : frontends.getFrontend()) { string id = feConfig.getId(); + frontendIds.push_back(id); if (id.compare(string("FE_DEFAULT")) == 0) { // overrid default frontendMap.erase(string("FE_DEFAULT")); @@ -263,6 +303,9 @@ struct TunerTestingConfigAidlReader1_0 { break; case FrontendTypeEnum::ATSC: type = FrontendType::ATSC; + frontendMap[id].settings.set< + FrontendSettings::Tag::atsc>( + readAtscFrontendSettings(feConfig)); break; case FrontendTypeEnum::ATSC3: type = FrontendType::ATSC3; @@ -283,12 +326,16 @@ struct TunerTestingConfigAidlReader1_0 { } case FrontendTypeEnum::ISDBS: type = FrontendType::ISDBS; + frontendMap[id].settings.set( + readIsdbsFrontendSettings(feConfig)); break; case FrontendTypeEnum::ISDBS3: type = FrontendType::ISDBS3; break; case FrontendTypeEnum::ISDBT: type = FrontendType::ISDBT; + frontendMap[id].settings.set( + readIsdbtFrontendSettings(feConfig)); break; case FrontendTypeEnum::DTMB: type = FrontendType::DTMB; @@ -302,6 +349,11 @@ struct TunerTestingConfigAidlReader1_0 { } frontendMap[id].type = type; frontendMap[id].isSoftwareFe = feConfig.getIsSoftwareFrontend(); + if (frontendMap[id].isSoftwareFe) { + hasSwFe = true; + } else { + hasHwFe = true; + } // TODO: b/182519645 complete the tune status config frontendMap[id].tuneStatusTypes = types; frontendMap[id].expectTuneStatuses = statuses; @@ -376,11 +428,13 @@ struct TunerTestingConfigAidlReader1_0 { DvrType type; switch (dvrConfig.getType()) { case DvrTypeEnum::PLAYBACK: + playbackDvrIds.push_back(id); type = DvrType::PLAYBACK; dvrMap[id].settings.set( readPlaybackSettings(dvrConfig)); break; case DvrTypeEnum::RECORD: + recordDvrIds.push_back(id); type = DvrType::RECORD; dvrMap[id].settings.set( readRecordSettings(dvrConfig)); @@ -404,6 +458,7 @@ struct TunerTestingConfigAidlReader1_0 { auto lnbs = *hardwareConfig.getFirstLnbs(); for (auto lnbConfig : lnbs.getLnb()) { string id = lnbConfig.getId(); + lnbIds.push_back(id); if (lnbConfig.hasName()) { lnbMap[id].name = lnbConfig.getName(); } else { @@ -422,6 +477,7 @@ struct TunerTestingConfigAidlReader1_0 { auto descramblers = *hardwareConfig.getFirstDescramblers(); for (auto descramblerConfig : descramblers.getDescrambler()) { string id = descramblerConfig.getId(); + descramblerIds.push_back(id); descramblerMap[id].casSystemId = static_cast(descramblerConfig.getCasSystemId()); if (descramblerConfig.hasProvisionStr()) { @@ -447,6 +503,7 @@ struct TunerTestingConfigAidlReader1_0 { auto msgs = *hardwareConfig.getFirstDiseqcMessages(); for (auto msgConfig : msgs.getDiseqcMessage()) { string name = msgConfig.getMsgName(); + diseqcMsgs.push_back(name); for (uint8_t atom : msgConfig.getMsgBody()) { diseqcMsgMap[name].push_back(atom); } @@ -460,6 +517,7 @@ struct TunerTestingConfigAidlReader1_0 { auto timeFilters = *hardwareConfig.getFirstTimeFilters(); for (auto timeFilterConfig : timeFilters.getTimeFilter()) { string id = timeFilterConfig.getId(); + timeFilterIds.push_back(id); timeFilterMap[id].timeStamp = static_cast(timeFilterConfig.getTimeStamp()); } } @@ -469,6 +527,7 @@ struct TunerTestingConfigAidlReader1_0 { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasClearLiveBroadcast()) { live.hasFrontendConnection = true; + configuredLive = true; } else { live.hasFrontendConnection = false; return; @@ -496,12 +555,17 @@ struct TunerTestingConfigAidlReader1_0 { } else { live.ipFilterId = emptyHardwareId; } + if (liveConfig.hasOptionalFilters()) { + auto optionalFilters = liveConfig.getOptionalFilters(); + live.extraFilters = optionalFilters; + } } static void connectScan(ScanHardwareConnections& scan) { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasScan()) { scan.hasFrontendConnection = true; + configuredScan = true; } else { scan.hasFrontendConnection = false; return; @@ -514,6 +578,7 @@ struct TunerTestingConfigAidlReader1_0 { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasDvrPlayback()) { playback.support = true; + configuredPlayback = true; } else { playback.support = false; return; @@ -527,12 +592,17 @@ struct TunerTestingConfigAidlReader1_0 { } else { playback.sectionFilterId = emptyHardwareId; } + if (playbackConfig.hasOptionalFilters()) { + auto optionalFilters = playbackConfig.getOptionalFilters(); + playback.extraFilters = optionalFilters; + } } static void connectDvrRecord(DvrRecordHardwareConnections& record) { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasDvrRecord()) { record.support = true; + configuredRecord = true; } else { record.support = false; return; @@ -557,6 +627,7 @@ struct TunerTestingConfigAidlReader1_0 { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasDescrambling()) { descrambling.support = true; + configuredDescrambling = true; } else { descrambling.support = false; return; @@ -576,12 +647,17 @@ struct TunerTestingConfigAidlReader1_0 { descrambling.hasFrontendConnection = false; descrambling.dvrSourceId = descConfig.getDvrSourceConnection(); } + if (descConfig.hasOptionalFilters()) { + auto optionalFilters = descConfig.getOptionalFilters(); + descrambling.extraFilters = optionalFilters; + } } static void connectLnbLive(LnbLiveHardwareConnections& lnbLive) { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasLnbLive()) { lnbLive.support = true; + configuredLnbLive = true; } else { lnbLive.support = false; return; @@ -596,12 +672,17 @@ struct TunerTestingConfigAidlReader1_0 { lnbLive.diseqcMsgs.push_back(msgName); } } + if (lnbLiveConfig.hasOptionalFilters()) { + auto optionalFilters = lnbLiveConfig.getOptionalFilters(); + lnbLive.extraFilters = optionalFilters; + } } static void connectLnbRecord(LnbRecordHardwareConnections& lnbRecord) { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasLnbRecord()) { lnbRecord.support = true; + configuredLnbRecord = true; } else { lnbRecord.support = false; return; @@ -616,12 +697,17 @@ struct TunerTestingConfigAidlReader1_0 { lnbRecord.diseqcMsgs.push_back(msgName); } } + if (lnbRecordConfig.hasOptionalFilters()) { + auto optionalFilters = lnbRecordConfig.getOptionalFilters(); + lnbRecord.extraFilters = optionalFilters; + } } static void connectTimeFilter(TimeFilterHardwareConnections& timeFilter) { auto dataFlow = getDataFlowConfiguration(); if (dataFlow.hasTimeFilter()) { timeFilter.support = true; + configuredTimeFilter = true; } else { timeFilter.support = false; return; @@ -630,6 +716,28 @@ struct TunerTestingConfigAidlReader1_0 { timeFilter.timeFilterId = timeFilterConfig.getTimeFilterConnection(); } + static void connectLnbDescrambling(LnbDescramblingHardwareConnections& lnbDescrambling) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasLnbDescrambling()) { + lnbDescrambling.support = true; + configuredLnbDescrambling = true; + } else { + lnbDescrambling.support = false; + return; + } + auto lnbDescramblingConfig = *dataFlow.getFirstLnbDescrambling(); + lnbDescrambling.frontendId = lnbDescramblingConfig.getFrontendConnection(); + lnbDescrambling.audioFilterId = lnbDescramblingConfig.getAudioFilterConnection(); + lnbDescrambling.videoFilterId = lnbDescramblingConfig.getVideoFilterConnection(); + lnbDescrambling.lnbId = lnbDescramblingConfig.getLnbConnection(); + lnbDescrambling.descramblerId = lnbDescramblingConfig.getDescramblerConnection(); + if (lnbDescramblingConfig.hasDiseqcMsgSender()) { + for (auto& msgName : lnbDescramblingConfig.getDiseqcMsgSender()) { + lnbDescrambling.diseqcMsgs.push_back(msgName); + } + } + } + private: static FrontendDvbtSettings readDvbtFrontendSettings(Frontend feConfig) { ALOGW("[ConfigReader] fe type is dvbt"); @@ -677,25 +785,115 @@ struct TunerTestingConfigAidlReader1_0 { ALOGW("[ConfigReader] no more dvbs settings"); return dvbsSettings; } - dvbsSettings.symbolRate = static_cast( - feConfig.getFirstDvbsFrontendSettings_optional()->getSymbolRate()); - dvbsSettings.inputStreamId = static_cast( - feConfig.getFirstDvbsFrontendSettings_optional()->getInputStreamId()); auto dvbs = feConfig.getFirstDvbsFrontendSettings_optional(); - if (dvbs->hasScanType()) { - dvbsSettings.scanType = static_cast(dvbs->getScanType()); - } - if (dvbs->hasIsDiseqcRxMessage()) { - dvbsSettings.isDiseqcRxMessage = dvbs->getIsDiseqcRxMessage(); - } + dvbsSettings.symbolRate = static_cast(dvbs->getSymbolRate()); + dvbsSettings.inputStreamId = static_cast(dvbs->getInputStreamId()); + dvbsSettings.scanType = static_cast(dvbs->getScanType()); + dvbsSettings.isDiseqcRxMessage = dvbs->getIsDiseqcRxMessage(); + dvbsSettings.inversion = static_cast(dvbs->getInversion()); + dvbsSettings.modulation = static_cast(dvbs->getModulation()); + dvbsSettings.rolloff = static_cast(dvbs->getRolloff()); + dvbsSettings.pilot = static_cast(dvbs->getPilot()); + dvbsSettings.standard = static_cast(dvbs->getStandard()); + dvbsSettings.vcmMode = static_cast(dvbs->getVcmMode()); return dvbsSettings; } + static FrontendAtscSettings readAtscFrontendSettings(Frontend& feConfig) { + ALOGW("[ConfigReader] fe type is atsc"); + FrontendAtscSettings atscSettings{ + .frequency = (int64_t)feConfig.getFrequency(), + }; + if (feConfig.hasEndFrequency()) { + atscSettings.endFrequency = (int64_t)feConfig.getEndFrequency(); + } + if (!feConfig.hasAtscFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more atsc settings"); + return atscSettings; + } + auto atsc = feConfig.getFirstAtscFrontendSettings_optional(); + atscSettings.inversion = static_cast(atsc->getInversion()); + atscSettings.modulation = static_cast(atsc->getModulation()); + return atscSettings; + } + + static FrontendIsdbsSettings readIsdbsFrontendSettings(Frontend& feConfig) { + ALOGW("[ConfigReader] fe type is isdbs"); + FrontendIsdbsSettings isdbsSettings{.frequency = (int64_t)feConfig.getFrequency()}; + if (feConfig.hasEndFrequency()) { + isdbsSettings.endFrequency = (int64_t)feConfig.getEndFrequency(); + } + if (!feConfig.hasIsdbsFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more isdbs settings"); + return isdbsSettings; + } + auto isdbs = feConfig.getFirstIsdbsFrontendSettings_optional(); + isdbsSettings.streamId = (int32_t)isdbs->getStreamId(); + isdbsSettings.symbolRate = (int32_t)isdbs->getSymbolRate(); + isdbsSettings.modulation = static_cast(isdbs->getModulation()); + isdbsSettings.coderate = static_cast(isdbs->getCoderate()); + isdbsSettings.rolloff = static_cast(isdbs->getRolloff()); + isdbsSettings.streamIdType = + static_cast(isdbs->getStreamIdType()); + return isdbsSettings; + } + + static FrontendIsdbtSettings readIsdbtFrontendSettings(Frontend& feConfig) { + ALOGW("[ConfigReader] fe type is isdbt"); + FrontendIsdbtSettings isdbtSettings{ + .frequency = (int64_t)feConfig.getFrequency(), + }; + if (feConfig.hasEndFrequency()) { + isdbtSettings.endFrequency = (int64_t)feConfig.getEndFrequency(); + } + if (!feConfig.hasIsdbtFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more isdbt settings"); + return isdbtSettings; + } + auto isdbt = feConfig.getFirstIsdbtFrontendSettings_optional(); + isdbtSettings.inversion = static_cast(isdbt->getInversion()); + isdbtSettings.bandwidth = static_cast(isdbt->getBandwidth()); + isdbtSettings.mode = static_cast(isdbt->getMode()); + isdbtSettings.guardInterval = + static_cast(isdbt->getGuardInterval()); + isdbtSettings.serviceAreaId = (int32_t)isdbt->getServiceAreaId(); + isdbtSettings.partialReceptionFlag = + static_cast(isdbt->getPartialReceptionFlag()); + if (!isdbt->hasFrontendIsdbtLayerSettings()) { + ALOGW("[ConfigReader] no isdbt layer settings"); + return isdbtSettings; + } + auto layerSettings = isdbt->getFirstFrontendIsdbtLayerSettings(); + ::aidl::android::hardware::tv::tuner::FrontendIsdbtLayerSettings mLayerSettings; + mLayerSettings.modulation = + static_cast(layerSettings->getModulation()); + mLayerSettings.coderate = static_cast(layerSettings->getCoderate()); + mLayerSettings.timeInterleave = + static_cast(layerSettings->getTimeInterleave()); + mLayerSettings.numOfSegment = (int32_t)layerSettings->getNumOfSegment(); + isdbtSettings.layerSettings.push_back(mLayerSettings); + return isdbtSettings; + } + static bool readFilterTypeAndSettings(Filter filterConfig, DemuxFilterType& type, DemuxFilterSettings& settings) { auto mainType = filterConfig.getMainType(); auto subType = filterConfig.getSubType(); + if (subType == FilterSubTypeEnum::AUDIO) { + audioFilterIds.push_back(filterConfig.getId()); + } else if (subType == FilterSubTypeEnum::VIDEO) { + videoFilterIds.push_back(filterConfig.getId()); + } else if (subType == FilterSubTypeEnum::RECORD) { + recordFilterIds.push_back(filterConfig.getId()); + } else if (subType == FilterSubTypeEnum::SECTION) { + sectionFilterIds.push_back(filterConfig.getId()); + } else if (subType == FilterSubTypeEnum::PCR) { + pcrFilterIds.push_back(filterConfig.getId()); + } else if (subType == FilterSubTypeEnum::IP) { + ipFilterIds.push_back(filterConfig.getId()); + } + switch (mainType) { case FilterMainTypeEnum::TS: { ALOGW("[ConfigReader] filter main type is ts"); diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt index 383d49f452..dbd3486e67 100644 --- a/tv/tuner/config/api/current.txt +++ b/tv/tuner/config/api/current.txt @@ -1,6 +1,14 @@ // Signature format: 2.0 package android.media.tuner.testing.configuration.V1_0 { + public class AtscFrontendSettings { + ctor public AtscFrontendSettings(); + method @Nullable public java.math.BigInteger getInversion(); + method @Nullable public java.math.BigInteger getModulation(); + method public void setInversion(@Nullable java.math.BigInteger); + method public void setModulation(@Nullable java.math.BigInteger); + } + public class AvFilterSettings { ctor public AvFilterSettings(); method @Nullable public short getAudioStreamType_optional(); @@ -19,6 +27,7 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Descrambling getDescrambling(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrPlayback getDvrPlayback(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrRecord getDvrRecord(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbDescrambling getLnbDescrambling(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbLive getLnbLive(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbRecord getLnbRecord(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Scan getScan(); @@ -27,6 +36,7 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setDescrambling(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Descrambling); method public void setDvrPlayback(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrPlayback); method public void setDvrRecord(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrRecord); + method public void setLnbDescrambling(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbDescrambling); method public void setLnbLive(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbLive); method public void setLnbRecord(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbRecord); method public void setScan(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Scan); @@ -39,6 +49,7 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public String getDvrSoftwareFeConnection(); method @Nullable public String getFrontendConnection(); method @Nullable public String getIpFilterConnection(); + method @Nullable public java.util.List getOptionalFilters(); method @Nullable public String getPcrFilterConnection(); method @Nullable public String getSectionFilterConnection(); method @Nullable public String getVideoFilterConnection(); @@ -46,6 +57,7 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setDvrSoftwareFeConnection(@Nullable String); method public void setFrontendConnection(@Nullable String); method public void setIpFilterConnection(@Nullable String); + method public void setOptionalFilters(@Nullable java.util.List); method public void setPcrFilterConnection(@Nullable String); method public void setSectionFilterConnection(@Nullable String); method public void setVideoFilterConnection(@Nullable String); @@ -59,6 +71,7 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public String getDvrSourceConnection(); method @Nullable public String getFrontendConnection(); method @Nullable public boolean getHasFrontendConnection(); + method @Nullable public java.util.List getOptionalFilters(); method @Nullable public String getVideoFilterConnection(); method public void setAudioFilterConnection(@Nullable String); method public void setDescramblerConnection(@Nullable String); @@ -66,6 +79,7 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setDvrSourceConnection(@Nullable String); method public void setFrontendConnection(@Nullable String); method public void setHasFrontendConnection(@Nullable boolean); + method public void setOptionalFilters(@Nullable java.util.List); method public void setVideoFilterConnection(@Nullable String); } @@ -73,10 +87,12 @@ package android.media.tuner.testing.configuration.V1_0 { ctor public DataFlowConfiguration.DvrPlayback(); method @Nullable public String getAudioFilterConnection(); method @Nullable public String getDvrConnection(); + method @Nullable public java.util.List getOptionalFilters(); method @Nullable public String getSectionFilterConnection(); method @Nullable public String getVideoFilterConnection(); method public void setAudioFilterConnection(@Nullable String); method public void setDvrConnection(@Nullable String); + method public void setOptionalFilters(@Nullable java.util.List); method public void setSectionFilterConnection(@Nullable String); method public void setVideoFilterConnection(@Nullable String); } @@ -97,17 +113,35 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setRecordFilterConnection(@Nullable String); } + public static class DataFlowConfiguration.LnbDescrambling { + ctor public DataFlowConfiguration.LnbDescrambling(); + method @Nullable public String getAudioFilterConnection(); + method @Nullable public String getDescramblerConnection(); + method @Nullable public java.util.List getDiseqcMsgSender(); + method @Nullable public String getFrontendConnection(); + method @Nullable public String getLnbConnection(); + method @Nullable public String getVideoFilterConnection(); + method public void setAudioFilterConnection(@Nullable String); + method public void setDescramblerConnection(@Nullable String); + method public void setDiseqcMsgSender(@Nullable java.util.List); + method public void setFrontendConnection(@Nullable String); + method public void setLnbConnection(@Nullable String); + method public void setVideoFilterConnection(@Nullable String); + } + public static class DataFlowConfiguration.LnbLive { ctor public DataFlowConfiguration.LnbLive(); method @Nullable public String getAudioFilterConnection(); method @Nullable public java.util.List getDiseqcMsgSender(); method @Nullable public String getFrontendConnection(); method @Nullable public String getLnbConnection(); + method @Nullable public java.util.List getOptionalFilters(); method @Nullable public String getVideoFilterConnection(); method public void setAudioFilterConnection(@Nullable String); method public void setDiseqcMsgSender(@Nullable java.util.List); method public void setFrontendConnection(@Nullable String); method public void setLnbConnection(@Nullable String); + method public void setOptionalFilters(@Nullable java.util.List); method public void setVideoFilterConnection(@Nullable String); } @@ -117,11 +151,13 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public String getDvrRecordConnection(); method @Nullable public String getFrontendConnection(); method @Nullable public String getLnbConnection(); + method @Nullable public java.util.List getOptionalFilters(); method @Nullable public String getRecordFilterConnection(); method public void setDiseqcMsgSender(@Nullable java.util.List); method public void setDvrRecordConnection(@Nullable String); method public void setFrontendConnection(@Nullable String); method public void setLnbConnection(@Nullable String); + method public void setOptionalFilters(@Nullable java.util.List); method public void setRecordFilterConnection(@Nullable String); } @@ -160,13 +196,25 @@ package android.media.tuner.testing.configuration.V1_0 { public class DvbsFrontendSettings { ctor public DvbsFrontendSettings(); method @Nullable public java.math.BigInteger getInputStreamId(); + method @Nullable public java.math.BigInteger getInversion(); method @Nullable public boolean getIsDiseqcRxMessage(); + method @Nullable public java.math.BigInteger getModulation(); + method @Nullable public java.math.BigInteger getPilot(); + method @Nullable public java.math.BigInteger getRolloff(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DvbsScanType getScanType(); + method @Nullable public java.math.BigInteger getStandard(); method @Nullable public java.math.BigInteger getSymbolRate(); + method @Nullable public java.math.BigInteger getVcmMode(); method public void setInputStreamId(@Nullable java.math.BigInteger); + method public void setInversion(@Nullable java.math.BigInteger); method public void setIsDiseqcRxMessage(@Nullable boolean); + method public void setModulation(@Nullable java.math.BigInteger); + method public void setPilot(@Nullable java.math.BigInteger); + method public void setRolloff(@Nullable java.math.BigInteger); method public void setScanType(@Nullable android.media.tuner.testing.configuration.V1_0.DvbsScanType); + method public void setStandard(@Nullable java.math.BigInteger); method public void setSymbolRate(@Nullable java.math.BigInteger); + method public void setVcmMode(@Nullable java.math.BigInteger); } public enum DvbsScanType { @@ -310,6 +358,7 @@ package android.media.tuner.testing.configuration.V1_0 { public class Frontend { ctor public Frontend(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.AtscFrontendSettings getAtscFrontendSettings_optional(); method @Nullable public java.math.BigInteger getConnectToCicamId(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DvbsFrontendSettings getDvbsFrontendSettings_optional(); method @Nullable public android.media.tuner.testing.configuration.V1_0.DvbtFrontendSettings getDvbtFrontendSettings_optional(); @@ -317,8 +366,11 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public java.math.BigInteger getFrequency(); method @Nullable public String getId(); method @Nullable public boolean getIsSoftwareFrontend(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.IsdbsFrontendSettings getIsdbsFrontendSettings_optional(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.IsdbtFrontendSettings getIsdbtFrontendSettings_optional(); method @Nullable public java.math.BigInteger getRemoveOutputPid(); method @Nullable public android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum getType(); + method public void setAtscFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.AtscFrontendSettings); method public void setConnectToCicamId(@Nullable java.math.BigInteger); method public void setDvbsFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.DvbsFrontendSettings); method public void setDvbtFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.DvbtFrontendSettings); @@ -326,10 +378,24 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setFrequency(@Nullable java.math.BigInteger); method public void setId(@Nullable String); method public void setIsSoftwareFrontend(@Nullable boolean); + method public void setIsdbsFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.IsdbsFrontendSettings); + method public void setIsdbtFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.IsdbtFrontendSettings); method public void setRemoveOutputPid(@Nullable java.math.BigInteger); method public void setType(@Nullable android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum); } + public class FrontendIsdbtLayerSettings { + ctor public FrontendIsdbtLayerSettings(); + method @Nullable public java.math.BigInteger getCoderate(); + method @Nullable public java.math.BigInteger getModulation(); + method @Nullable public java.math.BigInteger getNumOfSegment(); + method @Nullable public java.math.BigInteger getTimeInterleave(); + method public void setCoderate(@Nullable java.math.BigInteger); + method public void setModulation(@Nullable java.math.BigInteger); + method public void setNumOfSegment(@Nullable java.math.BigInteger); + method public void setTimeInterleave(@Nullable java.math.BigInteger); + } + public enum FrontendTypeEnum { method @NonNull public String getRawName(); enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ANALOG; @@ -422,6 +488,40 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setSrcPort(@Nullable long); } + public class IsdbsFrontendSettings { + ctor public IsdbsFrontendSettings(); + method @Nullable public java.math.BigInteger getCoderate(); + method @Nullable public java.math.BigInteger getModulation(); + method @Nullable public java.math.BigInteger getRolloff(); + method @Nullable public java.math.BigInteger getStreamId(); + method @Nullable public java.math.BigInteger getStreamIdType(); + method @Nullable public java.math.BigInteger getSymbolRate(); + method public void setCoderate(@Nullable java.math.BigInteger); + method public void setModulation(@Nullable java.math.BigInteger); + method public void setRolloff(@Nullable java.math.BigInteger); + method public void setStreamId(@Nullable java.math.BigInteger); + method public void setStreamIdType(@Nullable java.math.BigInteger); + method public void setSymbolRate(@Nullable java.math.BigInteger); + } + + public class IsdbtFrontendSettings { + ctor public IsdbtFrontendSettings(); + method @Nullable public java.math.BigInteger getBandwidth(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.FrontendIsdbtLayerSettings getFrontendIsdbtLayerSettings(); + method @Nullable public java.math.BigInteger getGuardInterval(); + method @Nullable public java.math.BigInteger getInversion(); + method @Nullable public java.math.BigInteger getMode(); + method @Nullable public java.math.BigInteger getPartialReceptionFlag(); + method @Nullable public java.math.BigInteger getServiceAreaId(); + method public void setBandwidth(@Nullable java.math.BigInteger); + method public void setFrontendIsdbtLayerSettings(@Nullable android.media.tuner.testing.configuration.V1_0.FrontendIsdbtLayerSettings); + method public void setGuardInterval(@Nullable java.math.BigInteger); + method public void setInversion(@Nullable java.math.BigInteger); + method public void setMode(@Nullable java.math.BigInteger); + method public void setPartialReceptionFlag(@Nullable java.math.BigInteger); + method public void setServiceAreaId(@Nullable java.math.BigInteger); + } + public class Lnb { ctor public Lnb(); method @Nullable public String getId(); @@ -462,6 +562,12 @@ package android.media.tuner.testing.configuration.V1_0 { enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_5V; } + public class OptionalFilter { + ctor public OptionalFilter(); + method @Nullable public String getFilterId(); + method public void setFilterId(@Nullable String); + } + public class RecordFilterSettings { ctor public RecordFilterSettings(); method @Nullable public android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum getScIndexType(); diff --git a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml index fefe86edab..f74af7e099 100644 --- a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml +++ b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml @@ -1,19 +1,15 @@ - - - + + + + + + + + + + + + + + + @@ -116,7 +133,6 @@ This section contains configurations of all the dvrs that would be used in the tests. - This section is optional and can be skipped if DVR is not supported. - The users can configure 1 or more dvr elements in the dvrs sections. - Each dvr element contain the following attributes: "id": unique id of the dvr that could be used to connect to the test the "dataFlowConfiguration" @@ -140,8 +156,21 @@ statusMask="15" lowThreshold="4096" highThreshold="32767" dataFormat="ES" packetSize="188" inputFilePath="/data/local/tmp/test.es"/> + + + + + + + + + + + + + - @@ -151,13 +180,39 @@ ipFilterConnection="FILTER_IP_IP_0" dvrSoftwareFeConnection="DVR_PLAYBACK_1"/> - + + + + + + + + diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd index 59abd9aa61..c51ac5183c 100644 --- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd +++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd @@ -77,8 +77,41 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -109,16 +142,16 @@ - + + - + + + + @@ -617,7 +650,7 @@ - + @@ -638,7 +671,7 @@ - + @@ -651,7 +684,7 @@ - + @@ -675,7 +708,7 @@ - + @@ -685,6 +718,7 @@ + @@ -692,6 +726,16 @@ + + + + + + + + + + @@ -729,4 +773,7 @@ + + + diff --git a/usb/aidl/Android.bp b/usb/aidl/Android.bp index 4f59f02024..b82f6d5043 100644 --- a/usb/aidl/Android.bp +++ b/usb/aidl/Android.bp @@ -39,6 +39,12 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], + frozen: true, } diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/.hash b/usb/aidl/aidl_api/android.hardware.usb/2/.hash new file mode 100644 index 0000000000..ce43da6c53 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/.hash @@ -0,0 +1 @@ +6c1263ce61606107f41a9edb66be1783d5881f00 diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/AltModeData.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/AltModeData.aidl new file mode 100644 index 0000000000..d25ee84151 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/AltModeData.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not us e this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +union AltModeData { + android.hardware.usb.AltModeData.DisplayPortAltModeData displayPortAltModeData; + @VintfStability + parcelable DisplayPortAltModeData { + android.hardware.usb.DisplayPortAltModeStatus partnerSinkStatus = android.hardware.usb.DisplayPortAltModeStatus.UNKNOWN; + android.hardware.usb.DisplayPortAltModeStatus cableStatus = android.hardware.usb.DisplayPortAltModeStatus.UNKNOWN; + android.hardware.usb.DisplayPortAltModePinAssignment pinAssignment = android.hardware.usb.DisplayPortAltModePinAssignment.NONE; + boolean hpd = false; + android.hardware.usb.LinkTrainingStatus linkTrainingStatus = android.hardware.usb.LinkTrainingStatus.UNKNOWN; + } +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ComplianceWarning.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ComplianceWarning.aidl new file mode 100644 index 0000000000..8b67070bc6 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ComplianceWarning.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum ComplianceWarning { + OTHER = 1, + DEBUG_ACCESSORY = 2, + BC_1_2 = 3, + MISSING_RP = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantDetectionStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantDetectionStatus.aidl new file mode 100644 index 0000000000..24c69664f7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantDetectionStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum ContaminantDetectionStatus { + NOT_SUPPORTED = 0, + DISABLED = 1, + NOT_DETECTED = 2, + DETECTED = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantProtectionMode.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantProtectionMode.aidl new file mode 100644 index 0000000000..99798693ff --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantProtectionMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum ContaminantProtectionMode { + NONE = 0, + FORCE_SINK = 1, + FORCE_SOURCE = 2, + FORCE_DISABLE = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantProtectionStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantProtectionStatus.aidl new file mode 100644 index 0000000000..9642261444 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/ContaminantProtectionStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum ContaminantProtectionStatus { + NONE = 0, + FORCE_SINK = 1, + FORCE_SOURCE = 2, + FORCE_DISABLE = 3, + DISABLED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/DisplayPortAltModePinAssignment.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/DisplayPortAltModePinAssignment.aidl new file mode 100644 index 0000000000..5908117e9e --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/DisplayPortAltModePinAssignment.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum DisplayPortAltModePinAssignment { + NONE = 0, + A = 1, + B = 2, + C = 3, + D = 4, + E = 5, + F = 6, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/DisplayPortAltModeStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/DisplayPortAltModeStatus.aidl new file mode 100644 index 0000000000..dc69b98955 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/DisplayPortAltModeStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum DisplayPortAltModeStatus { + UNKNOWN = 0, + NOT_CAPABLE = 1, + CAPABLE = 2, + ENABLED = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/IUsb.aidl new file mode 100644 index 0000000000..859f52652b --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/IUsb.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +interface IUsb { + oneway void enableContaminantPresenceDetection(in String portName, in boolean enable, long transactionId); + oneway void enableUsbData(in String portName, boolean enable, long transactionId); + oneway void enableUsbDataWhileDocked(in String portName, long transactionId); + oneway void queryPortStatus(long transactionId); + oneway void setCallback(in android.hardware.usb.IUsbCallback callback); + oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); + oneway void limitPowerTransfer(in String portName, boolean limit, long transactionId); + oneway void resetUsbPort(in String portName, long transactionId); +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/IUsbCallback.aidl new file mode 100644 index 0000000000..4abfaec53b --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/IUsbCallback.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +interface IUsbCallback { + oneway void notifyPortStatusChange(in android.hardware.usb.PortStatus[] currentPortStatus, in android.hardware.usb.Status retval); + oneway void notifyRoleSwitchStatus(in String portName, in android.hardware.usb.PortRole newRole, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyEnableUsbDataStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyEnableUsbDataWhileDockedStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyContaminantEnabledStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyQueryPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyLimitPowerTransferStatus(in String portName, boolean limit, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyResetUsbPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/LinkTrainingStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/LinkTrainingStatus.aidl new file mode 100644 index 0000000000..1f0b2dcca7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/LinkTrainingStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum LinkTrainingStatus { + UNKNOWN = 0, + SUCCESS = 1, + FAILURE = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PlugOrientation.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PlugOrientation.aidl new file mode 100644 index 0000000000..e2185444b1 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PlugOrientation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum PlugOrientation { + UNKNOWN = 0, + UNPLUGGED = 1, + PLUGGED_UNKNOWN = 2, + PLUGGED_NORMAL = 3, + PLUGGED_FLIPPED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortDataRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortDataRole.aidl new file mode 100644 index 0000000000..105b316775 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortDataRole.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum PortDataRole { + NONE = 0, + HOST = 1, + DEVICE = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortMode.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortMode.aidl new file mode 100644 index 0000000000..34e43343ad --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortMode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum PortMode { + NONE = 0, + UFP = 1, + DFP = 2, + DRP = 3, + AUDIO_ACCESSORY = 4, + DEBUG_ACCESSORY = 5, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortPowerRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortPowerRole.aidl new file mode 100644 index 0000000000..0e6f3fb426 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortPowerRole.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum PortPowerRole { + NONE = 0, + SOURCE = 1, + SINK = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortRole.aidl new file mode 100644 index 0000000000..c66aeccde9 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortRole.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +union PortRole { + android.hardware.usb.PortPowerRole powerRole = android.hardware.usb.PortPowerRole.NONE; + android.hardware.usb.PortDataRole dataRole; + android.hardware.usb.PortMode mode; +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortStatus.aidl new file mode 100644 index 0000000000..cefddba719 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PortStatus.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +parcelable PortStatus { + String portName; + android.hardware.usb.PortDataRole currentDataRole = android.hardware.usb.PortDataRole.NONE; + android.hardware.usb.PortPowerRole currentPowerRole = android.hardware.usb.PortPowerRole.NONE; + android.hardware.usb.PortMode currentMode = android.hardware.usb.PortMode.NONE; + boolean canChangeMode; + boolean canChangeDataRole; + boolean canChangePowerRole; + android.hardware.usb.PortMode[] supportedModes; + android.hardware.usb.ContaminantProtectionMode[] supportedContaminantProtectionModes; + boolean supportsEnableContaminantPresenceProtection; + android.hardware.usb.ContaminantProtectionStatus contaminantProtectionStatus = android.hardware.usb.ContaminantProtectionStatus.NONE; + boolean supportsEnableContaminantPresenceDetection; + android.hardware.usb.ContaminantDetectionStatus contaminantDetectionStatus = android.hardware.usb.ContaminantDetectionStatus.NOT_SUPPORTED; + android.hardware.usb.UsbDataStatus[] usbDataStatus; + boolean powerTransferLimited; + android.hardware.usb.PowerBrickStatus powerBrickStatus; + boolean supportsComplianceWarnings = false; + android.hardware.usb.ComplianceWarning[] complianceWarnings = {}; + android.hardware.usb.PlugOrientation plugOrientation = android.hardware.usb.PlugOrientation.UNKNOWN; + android.hardware.usb.AltModeData[] supportedAltModes = {}; +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PowerBrickStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PowerBrickStatus.aidl new file mode 100644 index 0000000000..01d2fdd9f7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/PowerBrickStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum PowerBrickStatus { + UNKNOWN = 0, + CONNECTED = 1, + NOT_CONNECTED = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/Status.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/Status.aidl new file mode 100644 index 0000000000..f28fc2a70e --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/Status.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum Status { + SUCCESS = 0, + ERROR = 1, + INVALID_ARGUMENT = 2, + UNRECOGNIZED_ROLE = 3, + NOT_SUPPORTED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/UsbDataStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/UsbDataStatus.aidl new file mode 100644 index 0000000000..b976852b3e --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/2/android/hardware/usb/UsbDataStatus.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +enum UsbDataStatus { + UNKNOWN = 0, + ENABLED = 1, + DISABLED_OVERHEAT = 2, + DISABLED_CONTAMINANT = 3, + DISABLED_DOCK = 4, + DISABLED_FORCE = 5, + DISABLED_DEBUG = 6, + DISABLED_DOCK_HOST_MODE = 7, + DISABLED_DOCK_DEVICE_MODE = 8, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl new file mode 100644 index 0000000000..d25ee84151 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/AltModeData.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not us e this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@VintfStability +union AltModeData { + android.hardware.usb.AltModeData.DisplayPortAltModeData displayPortAltModeData; + @VintfStability + parcelable DisplayPortAltModeData { + android.hardware.usb.DisplayPortAltModeStatus partnerSinkStatus = android.hardware.usb.DisplayPortAltModeStatus.UNKNOWN; + android.hardware.usb.DisplayPortAltModeStatus cableStatus = android.hardware.usb.DisplayPortAltModeStatus.UNKNOWN; + android.hardware.usb.DisplayPortAltModePinAssignment pinAssignment = android.hardware.usb.DisplayPortAltModePinAssignment.NONE; + boolean hpd = false; + android.hardware.usb.LinkTrainingStatus linkTrainingStatus = android.hardware.usb.LinkTrainingStatus.UNKNOWN; + } +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl new file mode 100644 index 0000000000..8b67070bc6 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum ComplianceWarning { + OTHER = 1, + DEBUG_ACCESSORY = 2, + BC_1_2 = 3, + MISSING_RP = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/DisplayPortAltModePinAssignment.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/DisplayPortAltModePinAssignment.aidl new file mode 100644 index 0000000000..5908117e9e --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/DisplayPortAltModePinAssignment.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum DisplayPortAltModePinAssignment { + NONE = 0, + A = 1, + B = 2, + C = 3, + D = 4, + E = 5, + F = 6, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/DisplayPortAltModeStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/DisplayPortAltModeStatus.aidl new file mode 100644 index 0000000000..dc69b98955 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/DisplayPortAltModeStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum DisplayPortAltModeStatus { + UNKNOWN = 0, + NOT_CAPABLE = 1, + CAPABLE = 2, + ENABLED = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl index f866c1eb5b..859f52652b 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl @@ -41,5 +41,5 @@ interface IUsb { oneway void setCallback(in android.hardware.usb.IUsbCallback callback); oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); oneway void limitPowerTransfer(in String portName, boolean limit, long transactionId); - oneway void resetUsbPort(in String portName,long transactionId); + oneway void resetUsbPort(in String portName, long transactionId); } diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/LinkTrainingStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/LinkTrainingStatus.aidl new file mode 100644 index 0000000000..1f0b2dcca7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/LinkTrainingStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum LinkTrainingStatus { + UNKNOWN = 0, + SUCCESS = 1, + FAILURE = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PlugOrientation.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PlugOrientation.aidl new file mode 100644 index 0000000000..e2185444b1 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PlugOrientation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb; +@Backing(type="int") @VintfStability +enum PlugOrientation { + UNKNOWN = 0, + UNPLUGGED = 1, + PLUGGED_UNKNOWN = 2, + PLUGGED_NORMAL = 3, + PLUGGED_FLIPPED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl index dfd99fb249..cefddba719 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl @@ -50,4 +50,8 @@ parcelable PortStatus { android.hardware.usb.UsbDataStatus[] usbDataStatus; boolean powerTransferLimited; android.hardware.usb.PowerBrickStatus powerBrickStatus; + boolean supportsComplianceWarnings = false; + android.hardware.usb.ComplianceWarning[] complianceWarnings = {}; + android.hardware.usb.PlugOrientation plugOrientation = android.hardware.usb.PlugOrientation.UNKNOWN; + android.hardware.usb.AltModeData[] supportedAltModes = {}; } diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl index e2c0cfbef1..b976852b3e 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl @@ -41,4 +41,6 @@ enum UsbDataStatus { DISABLED_DOCK = 4, DISABLED_FORCE = 5, DISABLED_DEBUG = 6, + DISABLED_DOCK_HOST_MODE = 7, + DISABLED_DOCK_DEVICE_MODE = 8, } diff --git a/usb/aidl/android/hardware/usb/AltModeData.aidl b/usb/aidl/android/hardware/usb/AltModeData.aidl new file mode 100644 index 0000000000..0b1e06a878 --- /dev/null +++ b/usb/aidl/android/hardware/usb/AltModeData.aidl @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not us e 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.usb; + +import android.hardware.usb.DisplayPortAltModePinAssignment; +import android.hardware.usb.DisplayPortAltModeStatus; +import android.hardware.usb.LinkTrainingStatus; + +@VintfStability +union AltModeData { + /** + * Holds data necessary to communicate the current DisplayPort + * Alt Mode status. + */ + @VintfStability + parcelable DisplayPortAltModeData { + /** + * Indicates the current DisplayPort Alt Mode Status of + * the port partner acting as a DisplayPort sink. + */ + DisplayPortAltModeStatus partnerSinkStatus = DisplayPortAltModeStatus.UNKNOWN; + /** + * Indicates the current status of the attached DisplayPort + * Alt Mode cable/adapter. + */ + DisplayPortAltModeStatus cableStatus = DisplayPortAltModeStatus.UNKNOWN; + /** + * Indicates the DisplayPort Alt Mode pin assignment + * negotiated between the device, port partner, and cable. + */ + DisplayPortAltModePinAssignment pinAssignment = DisplayPortAltModePinAssignment.NONE; + /** + * Indicates DisplayPort Hot Plug Detection (HPD) status for a partner + * sink device. If true, then a DisplayPort Alt Mode partner sink is + * connected and powered on, and if false, the partner sink is not + * powered or no partner sink is connected. + */ + boolean hpd = false; + /** + * Indicates the current status of DisplayPort link training over USB-C + * for the attached DisplayPort Alt Mode partner sink. + */ + LinkTrainingStatus linkTrainingStatus = LinkTrainingStatus.UNKNOWN; + } + DisplayPortAltModeData displayPortAltModeData; +} diff --git a/usb/aidl/android/hardware/usb/ComplianceWarning.aidl b/usb/aidl/android/hardware/usb/ComplianceWarning.aidl new file mode 100644 index 0000000000..4c18a310a4 --- /dev/null +++ b/usb/aidl/android/hardware/usb/ComplianceWarning.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.usb; + +@VintfStability +@Backing(type="int") +/** + * Indicates the potential non-compliance reasons for the + * connected USB Type-C port partner which could be a power + * source, accessory or cable. Applicable for USB-C receptacles + * in Android devices. + */ +enum ComplianceWarning { + /** + * Used to indicate Type-C sources/cables/accessories/ports + * whose issue is not listed below but do not meet + * specification requirements from including but not limited to + * USB Type-C Cable and Connector Specification, Universal Serial Bus + * Power Delivery Specification, and Universal Serial Bus + * 1.x/2.0/3.x/4.0. + */ + OTHER = 1, + /** + * Used to indicate Type-C port partner + * (cable/accessory/source) that identifies itself as debug + * accessory source as defined in USB Type-C Cable and + * Connector Specification. However, the specification + * states that this is meant for debug only and shall not + * be used for with commercial products. + */ + DEBUG_ACCESSORY = 2, + /** + * Used to indicate Type-C port partner that does not + * identify itself as one of the charging port types + * (SDP/CDP/DCP etc) as defined by Battery Charging v1.2 + * Specification. + */ + BC_1_2 = 3, + /** + * Used to indicate Type-C sources/cables that are missing + * pull up resistors on the CC pins as required by USB + * Type-C Cable and Connector Specification. + */ + MISSING_RP = 4, +} diff --git a/usb/aidl/android/hardware/usb/DisplayPortAltModePinAssignment.aidl b/usb/aidl/android/hardware/usb/DisplayPortAltModePinAssignment.aidl new file mode 100644 index 0000000000..d3284e5d25 --- /dev/null +++ b/usb/aidl/android/hardware/usb/DisplayPortAltModePinAssignment.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.usb; + +@VintfStability +@Backing(type="int") +/** + * Indicates DisplayPort Alt Mode pin assignments whose port + * pin configurations are as defined by DisplayPort Alt Mode + * v1.0 for deprecated pin assignments A, B, and F and + * DisplayPort Alt Mode v2.x for pin assignments C, D, and E. + * + */ +enum DisplayPortAltModePinAssignment { + /** + * Indicates that the pin assignment has not yet been + * configured, the attached cable/adapter does not support + * DisplayPort Alt Mode, or no cable/adapter is attached. + */ + NONE = 0, + /** + * Intended for use with USB-C-to-USB-C cables and with + * adapters from USB-C to other video formats using + * four lanes for DisplayPort transmission, and is + * restricted by the USB Type-C r1.0 Active Cable + * definition. + */ + A = 1, + /** + * Intended for use with USB-C-to-USB-C cables and with + * adapters from USB-C to other video formats using + * two lanes for DisplayPort transmission and two for + * USB SuperSpeed,and is restricted by the USB Type-C + * r1.0 Active Cable definition. + */ + B = 2, + /** + * Intended for use with USB-C-to-USB-C cables and with + * adapters from USB-C to other video formats using + * four lanes for DisplayPort transmission. + */ + C = 3, + /** + * Intended for use with USB-C-to-USB-C cables and with + * adapters from USB-C to other video formats using + * two lanes for DisplayPort transmission and two for + * USB SuperSpeed. + */ + D = 4, + /** + * Intended for use with adapters from USB-C-to-DP plugs + * or receptacles. + */ + E = 5, + /** + * Intended for use with adapters from USB-C-to-DP plugs + * or receptacles that also support two lanes of USB + * SuperSpeed. + */ + F = 6, +} diff --git a/usb/aidl/android/hardware/usb/DisplayPortAltModeStatus.aidl b/usb/aidl/android/hardware/usb/DisplayPortAltModeStatus.aidl new file mode 100644 index 0000000000..275ed15ff3 --- /dev/null +++ b/usb/aidl/android/hardware/usb/DisplayPortAltModeStatus.aidl @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.usb; + +@VintfStability +@Backing(type="int") +/** + * Port Partners: + * Indicates the current status of the of DisplayPort Alt Mode + * partner, which can either be a DisplayPort Alt Mode source + * (ex. computer, tablet, phone) or DisplayPort Alt Mode sink + * (monitor, hub, adapter). + * + * Cables: + * Indicates the current status of the Type-C cable/adapter + * connected to the local Android device. + * + */ +enum DisplayPortAltModeStatus { + /** + * Port Partners: + * The port partner status is currently unknown for one of + * the following reasons: + * 1. No port partner is connected to the device + * 2. The USB Power Delivery Discover Identity command + * has not been issued to the port partner via SOP + * messaging. + * + * Cables: + * The cable’s capabilities are not yet known to the + * device, or no cable is plugged in. + */ + UNKNOWN = 0, + /** + * Port Partners: + * The current port partner does not list DisplayPort as + * one of its Alt Modes,does not list the capability to + * act as a DisplayPort Source or Sink device, or a compatible + * configuration could not be established. + * + * Cables: + * The cable/adapter’s capabilities do not list DisplayPort + * as one of its Alt Modes, or a compatible configuration could + * not be established. + */ + NOT_CAPABLE = 1, + /** + * Port Partners: + * The current port partner lists compatible DisplayPort + * capabilities with the device, however may not yet have + * entered DisplayPort Alt Mode or has configured its + * port for data transmission. + * + * Cables: + * The Type-C cable/adapter’s capabilities have been + * discovered and list DisplayPort Alt Mode as one of its + * capabilities, however may not yet have entered DisplayPort + * Alt Mode or has been configured for data transmission. + */ + CAPABLE = 2, + /** + * Port Partners: + * The port partner and device are both configured for + * DisplayPort Alt Mode. + * + * Cables: + * The Type-C cable/adapter is configured for DisplayPort + * Alt Mode. + */ + ENABLED = 3, +} diff --git a/usb/aidl/android/hardware/usb/LinkTrainingStatus.aidl b/usb/aidl/android/hardware/usb/LinkTrainingStatus.aidl new file mode 100644 index 0000000000..9f3b3c3a22 --- /dev/null +++ b/usb/aidl/android/hardware/usb/LinkTrainingStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.usb; + +@VintfStability +@Backing(type="int") +/** + * Indicates the current status of DisplayPort link training over USB-C for the + * attached DisplayPort Alt Mode partner sink as described in DisplayPort + * v1.4/2.1. + */ +enum LinkTrainingStatus { + /* + * Indicates the link training result is not available because link training + * has not completed or initiated yet. + */ + UNKNOWN = 0, + /* + * Indicates that link training has completed and optimal settings for data + * transmission between the sink and source device have successfully been + * negotiated. + */ + SUCCESS = 1, + /* + * Indicates that link training has failed and the link initialization has + * terminated. + */ + FAILURE = 2, +} diff --git a/usb/aidl/android/hardware/usb/PlugOrientation.aidl b/usb/aidl/android/hardware/usb/PlugOrientation.aidl new file mode 100644 index 0000000000..3c09cfed2a --- /dev/null +++ b/usb/aidl/android/hardware/usb/PlugOrientation.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.usb; + +@VintfStability +@Backing(type="int") +/** + * Used to indicate plug orientation as defined by USB Type-C + * Cable and Connector Specification. + */ +enum PlugOrientation { + UNKNOWN = 0, + UNPLUGGED = 1, + /** + * The device can detect that a plug is inserted, but + * the plug may not present a normal or flipped orientation. + */ + PLUGGED_UNKNOWN = 2, + PLUGGED_NORMAL = 3, + PLUGGED_FLIPPED = 4, +} diff --git a/usb/aidl/android/hardware/usb/PortStatus.aidl b/usb/aidl/android/hardware/usb/PortStatus.aidl index 51bee71389..daed13ca7c 100644 --- a/usb/aidl/android/hardware/usb/PortStatus.aidl +++ b/usb/aidl/android/hardware/usb/PortStatus.aidl @@ -16,9 +16,12 @@ package android.hardware.usb; +import android.hardware.usb.AltModeData; +import android.hardware.usb.ComplianceWarning; import android.hardware.usb.ContaminantDetectionStatus; import android.hardware.usb.ContaminantProtectionMode; import android.hardware.usb.ContaminantProtectionStatus; +import android.hardware.usb.PlugOrientation; import android.hardware.usb.PortDataRole; import android.hardware.usb.PortMode; import android.hardware.usb.PortPowerRole; @@ -101,7 +104,8 @@ parcelable PortStatus { /** * Current status of contaminant detection algorithm. */ - ContaminantDetectionStatus contaminantDetectionStatus = ContaminantDetectionStatus.NOT_SUPPORTED; + ContaminantDetectionStatus contaminantDetectionStatus = + ContaminantDetectionStatus.NOT_SUPPORTED; /** * UsbData status of the port. * Lists reasons for USB data being disabled. @@ -115,4 +119,25 @@ parcelable PortStatus { * Denotes whether Power brick is connected. */ PowerBrickStatus powerBrickStatus; + /** + * True if the hal implementation can support identifying + * non compliant USB power source/cable/accessory. False other + * otherwise. + */ + boolean supportsComplianceWarnings = false; + /** + * List of reasons as to why the attached USB + * power source/cable/accessory is non compliant. + */ + ComplianceWarning[] complianceWarnings = {}; + /** + * Indicates the current orientation of the cable/adapter + * plugged into the device. + */ + PlugOrientation plugOrientation = PlugOrientation.UNKNOWN; + /** + * Lists Alt Modes supported by the device and holds their + * current information. + */ + AltModeData[] supportedAltModes = {}; } diff --git a/usb/aidl/android/hardware/usb/UsbDataStatus.aidl b/usb/aidl/android/hardware/usb/UsbDataStatus.aidl index 4b6a41a01e..e6b5f55153 100644 --- a/usb/aidl/android/hardware/usb/UsbDataStatus.aidl +++ b/usb/aidl/android/hardware/usb/UsbDataStatus.aidl @@ -35,7 +35,8 @@ enum UsbDataStatus { */ DISABLED_CONTAMINANT = 3, /** - * USB data is disabled due to dock. + * DISABLED_DOCK implies both DISABLED_DOCK_HOST_MODE + * and DISABLED_DOCK_DEVICE_MODE. */ DISABLED_DOCK = 4, /** @@ -45,5 +46,13 @@ enum UsbDataStatus { /** * USB data disabled for debug. */ - DISABLED_DEBUG = 6 + DISABLED_DEBUG = 6, + /** + * USB Host mode is disabled due to a docking event. + */ + DISABLED_DOCK_HOST_MODE = 7, + /** + * USB device mode disabled due to a docking event. + */ + DISABLED_DOCK_DEVICE_MODE = 8, } diff --git a/usb/aidl/default/Android.bp b/usb/aidl/default/Android.bp index ad331f97ce..472e732d45 100644 --- a/usb/aidl/default/Android.bp +++ b/usb/aidl/default/Android.bp @@ -34,7 +34,7 @@ cc_binary { "Usb.cpp", ], shared_libs: [ - "android.hardware.usb-V1-ndk", + "android.hardware.usb-V2-ndk", "libbase", "libbinder_ndk", "libcutils", diff --git a/usb/aidl/default/Usb.cpp b/usb/aidl/default/Usb.cpp index 7e738c477f..593dd4f4c6 100644 --- a/usb/aidl/default/Usb.cpp +++ b/usb/aidl/default/Usb.cpp @@ -123,6 +123,15 @@ Status queryMoistureDetectionStatus(std::vector *currentPortStatus) return Status::SUCCESS; } +Status queryNonCompliantChargerStatus(std::vector *currentPortStatus) { + string reasons, path; + + for (int i = 0; i < currentPortStatus->size(); i++) { + (*currentPortStatus)[i].supportsComplianceWarnings = false; + } + return Status::SUCCESS; +} + string appendRoleNodeHelper(const string &portName, PortRole::Tag tag) { string node(kTypecPath + portName); @@ -508,11 +517,11 @@ Status getPortStatusHelper(std::vector *currentPortStatus) { (*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::ENABLED); ALOGI("%d:%s connected:%d canChangeMode:%d canChagedata:%d canChangePower:%d " - "usbDataEnabled:%d", - i, port.first.c_str(), port.second, - (*currentPortStatus)[i].canChangeMode, - (*currentPortStatus)[i].canChangeDataRole, - (*currentPortStatus)[i].canChangePowerRole, 0); + "usbDataEnabled:%d plugOrientation:%d", + i, port.first.c_str(), port.second, (*currentPortStatus)[i].canChangeMode, + (*currentPortStatus)[i].canChangeDataRole, + (*currentPortStatus)[i].canChangePowerRole, 0, + (*currentPortStatus)[i].plugOrientation); } return Status::SUCCESS; @@ -527,6 +536,7 @@ void queryVersionHelper(android::hardware::usb::Usb *usb, pthread_mutex_lock(&usb->mLock); status = getPortStatusHelper(currentPortStatus); queryMoistureDetectionStatus(currentPortStatus); + queryNonCompliantChargerStatus(currentPortStatus); if (usb->mCallback != NULL) { ScopedAStatus ret = usb->mCallback->notifyPortStatusChange(*currentPortStatus, status); diff --git a/usb/aidl/default/android.hardware.usb-service.example.xml b/usb/aidl/default/android.hardware.usb-service.example.xml index 6088194890..c3f07f5270 100644 --- a/usb/aidl/default/android.hardware.usb-service.example.xml +++ b/usb/aidl/default/android.hardware.usb-service.example.xml @@ -1,7 +1,7 @@ android.hardware.usb - 1 + 2 IUsb default diff --git a/usb/aidl/vts/Android.bp b/usb/aidl/vts/Android.bp index 00a7c93ec3..d0e0eecb3f 100644 --- a/usb/aidl/vts/Android.bp +++ b/usb/aidl/vts/Android.bp @@ -34,7 +34,7 @@ cc_test { "libbinder_ndk", ], static_libs: [ - "android.hardware.usb-V1-ndk", + "android.hardware.usb-V2-ndk", ], test_suites: [ "general-tests", diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp index ea2f985766..e9aa65bc8d 100644 --- a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp +++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp @@ -42,15 +42,22 @@ #define TIMEOUT_PERIOD 10 +using ::aidl::android::hardware::usb::AltModeData; using ::aidl::android::hardware::usb::BnUsbCallback; +using ::aidl::android::hardware::usb::ComplianceWarning; +using ::aidl::android::hardware::usb::DisplayPortAltModePinAssignment; +using ::aidl::android::hardware::usb::DisplayPortAltModeStatus; using ::aidl::android::hardware::usb::IUsb; using ::aidl::android::hardware::usb::IUsbCallback; +using ::aidl::android::hardware::usb::LinkTrainingStatus; +using ::aidl::android::hardware::usb::PlugOrientation; using ::aidl::android::hardware::usb::PortDataRole; using ::aidl::android::hardware::usb::PortMode; using ::aidl::android::hardware::usb::PortPowerRole; using ::aidl::android::hardware::usb::PortRole; using ::aidl::android::hardware::usb::PortStatus; using ::aidl::android::hardware::usb::Status; +using ::aidl::android::hardware::usb::UsbDataStatus; using ::ndk::ScopedAStatus; using ::ndk::SpAIBinder; @@ -247,6 +254,9 @@ class UsbAidlTest : public testing::TestWithParam { std::mutex usb_mtx; std::condition_variable usb_cv; int usb_count = 0; + + // Stores usb version + int32_t usb_version; }; /* @@ -279,6 +289,42 @@ TEST_P(UsbAidlTest, queryPortStatus) { ALOGI("UsbAidlTest queryPortStatus end: %s", usb_last_port_status.portName.c_str()); } +/* + * Query port status to Check to see whether only one of DISABLED_DOCK, + * DISABLED_DOCK_DEVICE_MODE, DISABLED_DOCK_HOST_MODE is set at the most. + * The callback parameters are checked to see if the transaction id + * matches. + */ +TEST_P(UsbAidlTest, DisabledDataStatusCheck) { + int disabledCount = 0; + + ALOGI("UsbAidlTest DataStatusCheck start"); + auto retVersion = usb->getInterfaceVersion(&usb_version); + ASSERT_TRUE(retVersion.isOk()) << retVersion; + if (usb_version < 2) { + ALOGI("UsbAidlTest skipping DataStatusCheck on older interface versions"); + GTEST_SKIP(); + } + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + ALOGI("UsbAidlTest DataStatusCheck portName: %s", usb_last_port_status.portName.c_str()); + if (usb_last_port_status.usbDataStatus.size() > 1) { + for (UsbDataStatus dataStatus : usb_last_port_status.usbDataStatus) { + if (dataStatus == UsbDataStatus::DISABLED_DOCK || + dataStatus == UsbDataStatus::DISABLED_DOCK_DEVICE_MODE || + dataStatus == UsbDataStatus::DISABLED_DOCK_HOST_MODE) { + disabledCount++; + } + } + } + EXPECT_GE(1, disabledCount); + ALOGI("UsbAidlTest DataStatusCheck end"); +} + /* * Trying to switch a non-existent port should fail. * This test case tried to switch the port with empty @@ -560,6 +606,135 @@ TEST_P(UsbAidlTest, DISABLED_resetUsbPort) { ALOGI("UsbAidlTest resetUsbPort end"); } +/* + * Test charger compliance warning + * The test asserts that complianceWarnings is + * empty when the feature is not supported. i.e. + * supportsComplianceWarning is false. + */ +TEST_P(UsbAidlTest, nonCompliantChargerStatus) { + ALOGI("UsbAidlTest nonCompliantChargerStatus start"); + auto retVersion = usb->getInterfaceVersion(&usb_version); + ASSERT_TRUE(retVersion.isOk()) << retVersion; + if (usb_version < 2) { + ALOGI("UsbAidlTest skipping nonCompliantChargerStatus on older interface versions"); + GTEST_SKIP(); + } + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.supportsComplianceWarnings) { + EXPECT_TRUE(usb_last_port_status.complianceWarnings.empty()); + } + + ALOGI("UsbAidlTest nonCompliantChargerStatus end"); +} + +/* + * Test charger compliance warning values + * The test asserts that complianceWarning values + * are valid. + */ +TEST_P(UsbAidlTest, nonCompliantChargerValues) { + ALOGI("UsbAidlTest nonCompliantChargerValues start"); + auto retVersion = usb->getInterfaceVersion(&usb_version); + ASSERT_TRUE(retVersion.isOk()) << retVersion; + if (usb_version < 2) { + ALOGI("UsbAidlTest skipping nonCompliantChargerValues on older interface versions"); + GTEST_SKIP(); + } + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + // Current compliance values range from [1, 4] + if (usb_last_port_status.supportsComplianceWarnings) { + for (auto warning : usb_last_port_status.complianceWarnings) { + EXPECT_TRUE((int)warning >= (int)ComplianceWarning::OTHER); + EXPECT_TRUE((int)warning <= (int)ComplianceWarning::MISSING_RP); + } + } + + ALOGI("UsbAidlTest nonCompliantChargerValues end"); +} + +/* + * Test PlugOrientation Values are within range in PortStatus + */ +TEST_P(UsbAidlTest, plugOrientationValues) { + ALOGI("UsbAidlTest plugOrientationValues start"); + auto retVersion = usb->getInterfaceVersion(&usb_version); + ASSERT_TRUE(retVersion.isOk()) << retVersion; + if (usb_version < 2) { + ALOGI("UsbAidlTest skipping plugOrientationValues on older interface versions"); + GTEST_SKIP(); + } + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + EXPECT_TRUE((int)usb_last_port_status.plugOrientation >= (int)PlugOrientation::UNKNOWN); + EXPECT_TRUE((int)usb_last_port_status.plugOrientation <= (int)PlugOrientation::PLUGGED_FLIPPED); +} + +/* + * Test DisplayPortAltMode Values when DisplayPort Alt Mode + * is active. + */ +TEST_P(UsbAidlTest, dpAltModeValues) { + ALOGI("UsbAidlTest dpAltModeValues start"); + auto retVersion = usb->getInterfaceVersion(&usb_version); + ASSERT_TRUE(retVersion.isOk()) << retVersion; + if (usb_version < 2) { + ALOGI("UsbAidlTest skipping dpAltModeValues on older interface versions"); + GTEST_SKIP(); + } + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + // Discover DisplayPort Alt Mode + for (AltModeData altMode : usb_last_port_status.supportedAltModes) { + if (altMode.getTag() == AltModeData::displayPortAltModeData) { + AltModeData::DisplayPortAltModeData displayPortAltModeData = + altMode.get(); + EXPECT_TRUE((int)displayPortAltModeData.partnerSinkStatus >= + (int)DisplayPortAltModeStatus::UNKNOWN); + EXPECT_TRUE((int)displayPortAltModeData.partnerSinkStatus <= + (int)DisplayPortAltModeStatus::ENABLED); + + EXPECT_TRUE((int)displayPortAltModeData.cableStatus >= + (int)DisplayPortAltModeStatus::UNKNOWN); + EXPECT_TRUE((int)displayPortAltModeData.cableStatus <= + (int)DisplayPortAltModeStatus::ENABLED); + + EXPECT_TRUE((int)displayPortAltModeData.pinAssignment >= + (int)DisplayPortAltModePinAssignment::NONE); + EXPECT_TRUE((int)displayPortAltModeData.pinAssignment <= + (int)DisplayPortAltModePinAssignment::F); + + EXPECT_TRUE((int)displayPortAltModeData.linkTrainingStatus >= + (int)LinkTrainingStatus::UNKNOWN); + EXPECT_TRUE((int)displayPortAltModeData.pinAssignment <= (int)LinkTrainingStatus::FAILURE); + } + } + + ALOGI("UsbAidlTest dpAltModeValues end"); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, UsbAidlTest, diff --git a/usb/gadget/aidl/Android.bp b/usb/gadget/aidl/Android.bp index cb8560aebc..eb1996b0b8 100644 --- a/usb/gadget/aidl/Android.bp +++ b/usb/gadget/aidl/Android.bp @@ -34,4 +34,12 @@ aidl_interface { sdk_version: "module_current", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/.hash b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/.hash new file mode 100644 index 0000000000..ea51eecbda --- /dev/null +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/.hash @@ -0,0 +1 @@ +cb628c69682659911bca5c1d04042adba7f0de4b diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/GadgetFunction.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/GadgetFunction.aidl new file mode 100644 index 0000000000..0cf58441e7 --- /dev/null +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/GadgetFunction.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb.gadget; +@VintfStability +parcelable GadgetFunction { + const long NONE = 0; + const long ADB = 1; + const long ACCESSORY = (1 << 1) /* 2 */; + const long MTP = (1 << 2) /* 4 */; + const long MIDI = (1 << 3) /* 8 */; + const long PTP = (1 << 4) /* 16 */; + const long RNDIS = (1 << 5) /* 32 */; + const long AUDIO_SOURCE = (1 << 6) /* 64 */; + const long UVC = (1 << 7) /* 128 */; + const long NCM = (1 << 10) /* 1024 */; +} diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/IUsbGadget.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/IUsbGadget.aidl new file mode 100644 index 0000000000..b5c0b5c253 --- /dev/null +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/IUsbGadget.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb.gadget; +@VintfStability +interface IUsbGadget { + oneway void setCurrentUsbFunctions(in long functions, in android.hardware.usb.gadget.IUsbGadgetCallback callback, in long timeoutMs, long transactionId); + oneway void getCurrentUsbFunctions(in android.hardware.usb.gadget.IUsbGadgetCallback callback, long transactionId); + oneway void getUsbSpeed(in android.hardware.usb.gadget.IUsbGadgetCallback callback, long transactionId); + oneway void reset(in android.hardware.usb.gadget.IUsbGadgetCallback callback, long transactionId); +} diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/IUsbGadgetCallback.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/IUsbGadgetCallback.aidl new file mode 100644 index 0000000000..b2b0e5ad58 --- /dev/null +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/IUsbGadgetCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb.gadget; +@VintfStability +interface IUsbGadgetCallback { + oneway void setCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId); + oneway void getCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId); + oneway void getUsbSpeedCb(in android.hardware.usb.gadget.UsbSpeed speed, long transactionId); + oneway void resetCb(in android.hardware.usb.gadget.Status status, long transactionId); +} diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/Status.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/Status.aidl new file mode 100644 index 0000000000..bdcf6854fe --- /dev/null +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/Status.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb.gadget; +@Backing(type="int") @VintfStability +enum Status { + SUCCESS = 0, + ERROR = 1, + FUNCTIONS_APPLIED = 2, + FUNCTIONS_NOT_APPLIED = 3, + CONFIGURATION_NOT_SUPPORTED = 4, +} diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/UsbSpeed.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/UsbSpeed.aidl new file mode 100644 index 0000000000..fea35098c3 --- /dev/null +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/1/android/hardware/usb/gadget/UsbSpeed.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.usb.gadget; +@Backing(type="int") @VintfStability +enum UsbSpeed { + UNKNOWN = (-1) /* -1 */, + LOWSPEED = 0, + FULLSPEED = 1, + HIGHSPEED = 2, + SUPERSPEED = 3, + SUPERSPEED_10Gb = 4, + SUPERSPEED_20Gb = 5, + USB4_GEN2_10Gb = 6, + USB4_GEN2_20Gb = 7, + USB4_GEN3_20Gb = 8, + USB4_GEN3_40Gb = 9, +} diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl index c3f26d5efd..78b79e46e3 100644 --- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/GadgetFunction.aidl @@ -36,11 +36,12 @@ package android.hardware.usb.gadget; parcelable GadgetFunction { const long NONE = 0; const long ADB = 1; - const long ACCESSORY = 2; - const long MTP = 4; - const long MIDI = 8; - const long PTP = 16; - const long RNDIS = 32; - const long AUDIO_SOURCE = 64; - const long NCM = 1024; + const long ACCESSORY = (1 << 1); + const long MTP = (1 << 2); + const long MIDI = (1 << 3); + const long PTP = (1 << 4); + const long RNDIS = (1 << 5); + const long AUDIO_SOURCE = (1 << 6); + const long UVC = (1 << 7); + const long NCM = (1 << 10); } diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadget.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadget.aidl index ef45f8be3a..b5c0b5c253 100644 --- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadget.aidl +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadget.aidl @@ -37,5 +37,5 @@ interface IUsbGadget { oneway void setCurrentUsbFunctions(in long functions, in android.hardware.usb.gadget.IUsbGadgetCallback callback, in long timeoutMs, long transactionId); oneway void getCurrentUsbFunctions(in android.hardware.usb.gadget.IUsbGadgetCallback callback, long transactionId); oneway void getUsbSpeed(in android.hardware.usb.gadget.IUsbGadgetCallback callback, long transactionId); - oneway void reset(); + oneway void reset(in android.hardware.usb.gadget.IUsbGadgetCallback callback, long transactionId); } diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl index 9de68de72d..b2b0e5ad58 100644 --- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/IUsbGadgetCallback.aidl @@ -37,4 +37,5 @@ interface IUsbGadgetCallback { oneway void setCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId); oneway void getCurrentUsbFunctionsCb(in long functions, in android.hardware.usb.gadget.Status status, long transactionId); oneway void getUsbSpeedCb(in android.hardware.usb.gadget.UsbSpeed speed, long transactionId); + oneway void resetCb(in android.hardware.usb.gadget.Status status, long transactionId); } diff --git a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl index 0f54ee5a6b..7d4fa17400 100644 --- a/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl +++ b/usb/gadget/aidl/aidl_api/android.hardware.usb.gadget/current/android/hardware/usb/gadget/UsbSpeed.aidl @@ -34,11 +34,15 @@ package android.hardware.usb.gadget; @Backing(type="int") @VintfStability enum UsbSpeed { - UNKNOWN = 0, - LOWSPEED = 1, - FULLSPEED = 2, - HIGHSPEED = 3, - SUPERSPEED = 4, - SUPERSPEED_10Gb = 5, - SUPERSPEED_20Gb = 6, + UNKNOWN = (-1), + LOWSPEED = 0, + FULLSPEED = 1, + HIGHSPEED = 2, + SUPERSPEED = 3, + SUPERSPEED_10Gb = 4, + SUPERSPEED_20Gb = 5, + USB4_GEN2_10Gb = 6, + USB4_GEN2_20Gb = 7, + USB4_GEN3_20Gb = 8, + USB4_GEN3_40Gb = 9, } diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl index d82b427621..dd7ee3771f 100644 --- a/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl +++ b/usb/gadget/aidl/android/hardware/usb/gadget/GadgetFunction.aidl @@ -50,6 +50,10 @@ parcelable GadgetFunction { * AOAv2.0 - Audio Source function. */ const long AUDIO_SOURCE = 1 << 6; + /** + * UVC - Universal Video Class function. + */ + const long UVC = 1 << 7; /** * NCM - NCM function. */ diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl index da644d64e7..a0c61ae923 100644 --- a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl +++ b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadget.aidl @@ -16,7 +16,6 @@ package android.hardware.usb.gadget; -import android.hardware.usb.gadget.GadgetFunction; import android.hardware.usb.gadget.IUsbGadgetCallback; @VintfStability @@ -60,6 +59,10 @@ oneway interface IUsbGadget { * This function is used to reset USB gadget driver. * Performs USB data connection reset. The connection will disconnect and * reconnect. + * + * @param callback IUsbGadgetCallback::resetCb used to propagate + * the result of requesting resetUsbGadget. + * @param transactionId ID to be used when invoking the callback. */ - void reset(); + void reset(in IUsbGadgetCallback callback, long transactionId); } diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl index 5a682d6bfb..cd9a662beb 100644 --- a/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl +++ b/usb/gadget/aidl/android/hardware/usb/gadget/IUsbGadgetCallback.aidl @@ -16,7 +16,6 @@ package android.hardware.usb.gadget; -import android.hardware.usb.gadget.GadgetFunction; import android.hardware.usb.gadget.Status; import android.hardware.usb.gadget.UsbSpeed; @@ -60,4 +59,12 @@ oneway interface IUsbGadgetCallback { * @param transactionId ID to be used when invoking the callback. */ void getUsbSpeedCb(in UsbSpeed speed, long transactionId); + + /** + * Callback function used to propagate the result of requesting + * resetUsbGadget. + * @param status SUCCESS if current request succeeded. FAILURE otherwise. + * @param transactionId current transactionId sent during reset request. + */ + void resetCb(in Status status, long transactionId); } diff --git a/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl b/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl index 0492757ab6..2a3fb93e95 100644 --- a/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl +++ b/usb/gadget/aidl/android/hardware/usb/gadget/UsbSpeed.aidl @@ -22,29 +22,55 @@ enum UsbSpeed { /** * UNKNOWN - Not Connected or Unsupported Speed */ - UNKNOWN = 0, + UNKNOWN = -1, + /** * USB Low Speed */ - LOWSPEED = 1, + LOWSPEED = 0, + /** * USB Full Speed */ - FULLSPEED = 2, + FULLSPEED = 1, + /** * USB High Speed */ - HIGHSPEED = 3, + HIGHSPEED = 2, + /** * USB Super Speed */ - SUPERSPEED = 4, + SUPERSPEED = 3, + /** * USB Super Speed 10Gbps */ - SUPERSPEED_10Gb = 5, + SUPERSPEED_10Gb = 4, + /** * USB Super Speed 20Gbps */ - SUPERSPEED_20Gb = 6, + SUPERSPEED_20Gb = 5, + + /** + * USB4 Gen2 x 1 (10Gbps) + */ + USB4_GEN2_10Gb = 6, + + /** + * USB4 Gen2 x 2 (20Gbps) + */ + USB4_GEN2_20Gb = 7, + + /** + * USB4 Gen3 x 1 (20Gbps) + */ + USB4_GEN3_20Gb = 8, + + /** + * USB4 Gen3 x 2 (40Gbps) + */ + USB4_GEN3_40Gb = 9, } diff --git a/usb/gadget/aidl/default/UsbGadget.cpp b/usb/gadget/aidl/default/UsbGadget.cpp index 51f7f5b817..72d59c132f 100644 --- a/usb/gadget/aidl/default/UsbGadget.cpp +++ b/usb/gadget/aidl/default/UsbGadget.cpp @@ -40,7 +40,8 @@ constexpr char kI2CPath[] = "/sys/devices/platform/10d50000.hsi2c/i2c-"; constexpr char kAccessoryLimitCurrent[] = "i2c-max77759tcpc/usb_limit_accessory_current"; constexpr char kAccessoryLimitCurrentEnable[] = "i2c-max77759tcpc/usb_limit_accessory_enable"; -UsbGadget::UsbGadget() : mGadgetIrqPath("") {} +UsbGadget::UsbGadget() : mGadgetIrqPath("") { +} Status UsbGadget::getUsbGadgetIrqPath() { std::string irqs; @@ -84,8 +85,8 @@ Status UsbGadget::getUsbGadgetIrqPath() { return Status::SUCCESS; } -void currentFunctionsAppliedCallback(bool functionsApplied, void* payload) { - UsbGadget* gadget = (UsbGadget*)payload; +void currentFunctionsAppliedCallback(bool functionsApplied, void *payload) { + UsbGadget *gadget = (UsbGadget *)payload; gadget->mCurrentUsbFunctionsApplied = functionsApplied; } @@ -95,17 +96,17 @@ ScopedAStatus UsbGadget::getCurrentUsbFunctions(const shared_ptrgetCurrentUsbFunctionsCb( - mCurrentUsbFunctions, - mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED, - in_transactionId); + mCurrentUsbFunctions, + mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED : Status::FUNCTIONS_NOT_APPLIED, + in_transactionId); if (!ret.isOk()) ALOGE("Call to getCurrentUsbFunctionsCb failed %s", ret.getDescription().c_str()); return ScopedAStatus::ok(); } -ScopedAStatus UsbGadget::getUsbSpeed(const shared_ptr& callback, - int64_t in_transactionId) { +ScopedAStatus UsbGadget::getUsbSpeed(const shared_ptr &callback, + int64_t in_transactionId) { std::string current_speed; if (ReadFileToString(SPEED_PATH, ¤t_speed)) { current_speed = Trim(current_speed); @@ -132,7 +133,8 @@ ScopedAStatus UsbGadget::getUsbSpeed(const shared_ptr& callb if (callback) { ScopedAStatus ret = callback->getUsbSpeedCb(mUsbSpeed, in_transactionId); - if (!ret.isOk()) ALOGE("Call to getUsbSpeedCb failed %s", ret.getDescription().c_str()); + if (!ret.isOk()) + ALOGE("Call to getUsbSpeedCb failed %s", ret.getDescription().c_str()); } return ScopedAStatus::ok(); @@ -142,15 +144,19 @@ Status UsbGadget::tearDownGadget() { return Status::SUCCESS; } -ScopedAStatus UsbGadget::reset() { +ScopedAStatus UsbGadget::reset(const shared_ptr &callback, + int64_t in_transactionId) { + if (callback) + callback->resetCb(Status::SUCCESS, in_transactionId); return ScopedAStatus::ok(); } -Status UsbGadget::setupFunctions(long functions, const shared_ptr& callback, - uint64_t timeout, int64_t in_transactionId) { +Status UsbGadget::setupFunctions(long functions, + const shared_ptr &callback, uint64_t timeout, + int64_t in_transactionId) { bool ffsEnabled = false; if (timeout == 0) { - ALOGI("timeout not setup"); + ALOGI("timeout not setup"); } if ((functions & GadgetFunction::ADB) != 0) { @@ -172,12 +178,12 @@ Status UsbGadget::setupFunctions(long functions, const shared_ptrd_type == DT_DIR) { @@ -196,8 +202,9 @@ Status getI2cBusHelper(string* name) { } ScopedAStatus UsbGadget::setCurrentUsbFunctions(int64_t functions, - const shared_ptr& callback, - int64_t timeoutMs, int64_t in_transactionId) { + const shared_ptr &callback, + int64_t timeoutMs, + int64_t in_transactionId) { std::unique_lock lk(mLockSetCurrentFunction); std::string current_usb_power_operation_mode, current_usb_type; std::string usb_limit_sink_enable; @@ -212,7 +219,8 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(int64_t functions, accessoryCurrentLimitEnablePath = kI2CPath + path + "/" + kAccessoryLimitCurrentEnable; // Get the gadget IRQ number before tearDownGadget() - if (mGadgetIrqPath.empty()) getUsbGadgetIrqPath(); + if (mGadgetIrqPath.empty()) + getUsbGadgetIrqPath(); // Unlink the gadget and stop the monitor if running. Status status = tearDownGadget(); @@ -223,13 +231,13 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(int64_t functions, ALOGI("Returned from tearDown gadget"); // Leave the gadget pulled down to give time for the host to sense disconnect. - // usleep(kDisconnectWaitUs); + //usleep(kDisconnectWaitUs); if (functions == GadgetFunction::NONE) { if (callback == NULL) - return ScopedAStatus::fromServiceSpecificErrorWithMessage(-1, "callback == NULL"); - ScopedAStatus ret = - callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId); + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + -1, "callback == NULL"); + ScopedAStatus ret = callback->setCurrentUsbFunctionsCb(functions, Status::SUCCESS, in_transactionId); if (!ret.isOk()) ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.getDescription().c_str()); return ScopedAStatus::fromServiceSpecificErrorWithMessage( @@ -259,9 +267,10 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(int64_t functions, if (ReadFileToString(CURRENT_USB_POWER_OPERATION_MODE_PATH, ¤t_usb_power_operation_mode)) current_usb_power_operation_mode = Trim(current_usb_power_operation_mode); - if (functions & GadgetFunction::ACCESSORY && current_usb_type == "Unknown SDP [CDP] DCP" && + if (functions & GadgetFunction::ACCESSORY && + current_usb_type == "Unknown SDP [CDP] DCP" && (current_usb_power_operation_mode == "default" || - current_usb_power_operation_mode == "1.5A")) { + current_usb_power_operation_mode == "1.5A")) { if (!WriteStringToFile("1300000", accessoryCurrentLimitPath)) { ALOGI("Write 1.3A to limit current fail"); } else { @@ -276,7 +285,8 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(int64_t functions, ALOGI("Usb Gadget setcurrent functions called successfully"); return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Usb Gadget setcurrent functions called successfully"); + -1, "Usb Gadget setcurrent functions called successfully"); + error: ALOGI("Usb Gadget setcurrent functions failed"); @@ -287,10 +297,10 @@ error: if (!ret.isOk()) ALOGE("Error while calling setCurrentUsbFunctionsCb %s", ret.getDescription().c_str()); return ScopedAStatus::fromServiceSpecificErrorWithMessage( - -1, "Error while calling setCurrentUsbFunctionsCb"); + -1, "Error while calling setCurrentUsbFunctionsCb"); } } // namespace gadget } // namespace usb } // namespace hardware } // namespace android -} // namespace aidl +} // aidl diff --git a/usb/gadget/aidl/default/UsbGadget.h b/usb/gadget/aidl/default/UsbGadget.h index 5060194268..5eaaa48550 100644 --- a/usb/gadget/aidl/default/UsbGadget.h +++ b/usb/gadget/aidl/default/UsbGadget.h @@ -16,16 +16,16 @@ #pragma once +#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -43,16 +43,16 @@ namespace usb { namespace gadget { using ::aidl::android::hardware::usb::gadget::GadgetFunction; -using ::aidl::android::hardware::usb::gadget::IUsbGadget; using ::aidl::android::hardware::usb::gadget::IUsbGadgetCallback; +using ::aidl::android::hardware::usb::gadget::IUsbGadget; using ::aidl::android::hardware::usb::gadget::Status; using ::aidl::android::hardware::usb::gadget::UsbSpeed; using ::android::base::GetProperty; -using ::android::base::ParseUint; -using ::android::base::ReadFileToString; using ::android::base::SetProperty; -using ::android::base::Trim; +using ::android::base::ParseUint; using ::android::base::unique_fd; +using ::android::base::ReadFileToString; +using ::android::base::Trim; using ::android::base::WriteStringToFile; using ::ndk::ScopedAStatus; using ::std::shared_ptr; @@ -65,19 +65,19 @@ constexpr char kSmpAffinityList[] = "/smp_affinity_list"; #ifndef UDC_PATH #define UDC_PATH "/sys/class/udc/11110000.dwc3/" #endif -// static MonitorFfs monitorFfs(kGadgetName); +//static MonitorFfs monitorFfs(kGadgetName); #define SPEED_PATH UDC_PATH "current_speed" #define BIG_CORE "6" #define MEDIUM_CORE "4" -#define POWER_SUPPLY_PATH "/sys/class/power_supply/usb/" -#define USB_PORT0_PATH "/sys/class/typec/port0/" +#define POWER_SUPPLY_PATH "/sys/class/power_supply/usb/" +#define USB_PORT0_PATH "/sys/class/typec/port0/" -#define CURRENT_MAX_PATH POWER_SUPPLY_PATH "current_max" -#define CURRENT_USB_TYPE_PATH POWER_SUPPLY_PATH "usb_type" -#define CURRENT_USB_POWER_OPERATION_MODE_PATH USB_PORT0_PATH "power_operation_mode" +#define CURRENT_MAX_PATH POWER_SUPPLY_PATH "current_max" +#define CURRENT_USB_TYPE_PATH POWER_SUPPLY_PATH "usb_type" +#define CURRENT_USB_POWER_OPERATION_MODE_PATH USB_PORT0_PATH "power_operation_mode" struct UsbGadget : public BnUsbGadget { UsbGadget(); @@ -90,26 +90,27 @@ struct UsbGadget : public BnUsbGadget { UsbSpeed mUsbSpeed; ScopedAStatus setCurrentUsbFunctions(int64_t functions, - const shared_ptr& callback, - int64_t timeoutMs, int64_t in_transactionId) override; + const shared_ptr &callback, + int64_t timeoutMs, int64_t in_transactionId) override; - ScopedAStatus getCurrentUsbFunctions(const shared_ptr& callback, - int64_t in_transactionId) override; + ScopedAStatus getCurrentUsbFunctions(const shared_ptr &callback, + int64_t in_transactionId) override; - ScopedAStatus reset() override; + ScopedAStatus reset(const shared_ptr &callback, + int64_t in_transactionId) override; - ScopedAStatus getUsbSpeed(const shared_ptr& callback, - int64_t in_transactionId) override; + ScopedAStatus getUsbSpeed(const shared_ptr &callback, + int64_t in_transactionId) override; private: Status tearDownGadget(); Status getUsbGadgetIrqPath(); - Status setupFunctions(long functions, const shared_ptr& callback, - uint64_t timeout, int64_t in_transactionId); + Status setupFunctions(long functions, const shared_ptr &callback, + uint64_t timeout, int64_t in_transactionId); }; } // namespace gadget } // namespace usb } // namespace hardware } // namespace android -} // namespace aidl +} // aidl diff --git a/usb/gadget/aidl/default/service_gadget.cpp b/usb/gadget/aidl/default/service_gadget.cpp index 88678ab9e0..7efbadd516 100644 --- a/usb/gadget/aidl/default/service_gadget.cpp +++ b/usb/gadget/aidl/default/service_gadget.cpp @@ -22,8 +22,7 @@ int main() { ABinderProcess_setThreadPoolMaxThreadCount(0); std::shared_ptr usbgadget = ndk::SharedRefBase::make(); const std::string instance = std::string() + UsbGadget::descriptor + "/default"; - binder_status_t status = - AServiceManager_addService(usbgadget->asBinder().get(), instance.c_str()); + binder_status_t status = AServiceManager_addService(usbgadget->asBinder().get(), instance.c_str()); CHECK(status == STATUS_OK); ABinderProcess_joinThreadPool(); return -1; diff --git a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl index 00cb8e0772..6ee5799ffe 100644 --- a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl +++ b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl @@ -71,8 +71,8 @@ interface IUwbChip { * The UCI message format is as per UCI protocol and it is * defined in "FiRa Consortium - UCI Generic Specification_v1.0" specification at FiRa * consortium. - * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. - * TODO(b/196004116): Link to the published specification. + * + * UCI 1.1 specification: https://groups.firaconsortium.org/wg/members/document/1949. * * This method may queue writes and return immediately, or it may block until data is written. * Implementation must guarantee that writes are executed in order. diff --git a/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl b/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl index 75853cd97c..f31aeba1a5 100755 --- a/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl +++ b/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl @@ -28,8 +28,7 @@ oneway interface IUwbClientCallback { * can use to pass incoming data to the stack. These include UCI * responses and notifications from the UWB subsystem. * - * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. - * TODO(b/196004116): Link to the published specification. + * UCI 1.1 specification: https://groups.firaconsortium.org/wg/members/document/1949. * * @param data UCI packet sent. */ diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl index 4cf2496ac8..4207574108 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl @@ -24,8 +24,8 @@ package android.hardware.uwb.fira_android; @Backing(type="int") enum UwbVendorReasonCodes { /** - * Use values from the vendor specific reason code range: 0x80 – 0xFF defined in Table 16 of - * UCI specification. + * Use values from the vendor specific reason code range: 0x80 – 0xFF defined in + * Table 15 (state change with reason codes) of UCI specification. */ /** Fira specific */ diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp index f50a5e744f..c88cb594f9 100644 --- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp +++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp @@ -602,10 +602,11 @@ TEST_P(VibratorAidl, ComposeCallback) { EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode()) << toString(primitive); - //TODO(b/187207798): revert back to conservative timeout values once - //latencies have been fixed - EXPECT_EQ(completionFuture.wait_for(duration * 4), std::future_status::ready) - << toString(primitive); + // TODO(b/261130361): Investigate why latency from driver and hardware will cause test + // to fail when wait duration is ~40ms or less. + EXPECT_EQ(completionFuture.wait_for(duration + std::chrono::milliseconds(50)), + std::future_status::ready) + << toString(primitive); end = high_resolution_clock::now(); elapsed = std::chrono::duration_cast(end - start); diff --git a/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc b/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc deleted file mode 100644 index ee8c818d90..0000000000 --- a/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc +++ /dev/null @@ -1,14 +0,0 @@ -service vendor.wifi_hal_legacy /vendor/bin/hw/android.hardware.wifi@1.0-service-lazy - interface android.hardware.wifi@1.0::IWifi default - interface android.hardware.wifi@1.1::IWifi default - interface android.hardware.wifi@1.2::IWifi default - interface android.hardware.wifi@1.3::IWifi default - interface android.hardware.wifi@1.4::IWifi default - interface android.hardware.wifi@1.5::IWifi default - interface android.hardware.wifi@1.6::IWifi default - oneshot - disabled - class hal - capabilities NET_ADMIN NET_RAW SYS_MODULE - user wifi - group wifi gps diff --git a/wifi/1.6/default/android.hardware.wifi@1.0-service.rc b/wifi/1.6/default/android.hardware.wifi@1.0-service.rc deleted file mode 100644 index 18f40d0bb5..0000000000 --- a/wifi/1.6/default/android.hardware.wifi@1.0-service.rc +++ /dev/null @@ -1,12 +0,0 @@ -service vendor.wifi_hal_legacy /vendor/bin/hw/android.hardware.wifi@1.0-service - interface android.hardware.wifi@1.0::IWifi default - interface android.hardware.wifi@1.1::IWifi default - interface android.hardware.wifi@1.2::IWifi default - interface android.hardware.wifi@1.3::IWifi default - interface android.hardware.wifi@1.4::IWifi default - interface android.hardware.wifi@1.5::IWifi default - interface android.hardware.wifi@1.6::IWifi default - class hal - capabilities NET_ADMIN NET_RAW SYS_MODULE - user wifi - group wifi gps diff --git a/wifi/1.6/default/android.hardware.wifi@1.0-service.xml b/wifi/1.6/default/android.hardware.wifi@1.0-service.xml deleted file mode 100644 index 771fbaaf42..0000000000 --- a/wifi/1.6/default/android.hardware.wifi@1.0-service.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - android.hardware.wifi - hwbinder - 1.6 - - IWifi - default - - - diff --git a/wifi/1.6/default/hidl_callback_util.h b/wifi/1.6/default/hidl_callback_util.h deleted file mode 100644 index aab0ae5393..0000000000 --- a/wifi/1.6/default/hidl_callback_util.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2017 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. - */ - -#ifndef HIDL_CALLBACK_UTIL_H_ -#define HIDL_CALLBACK_UTIL_H_ - -#include - -#include -#include - -namespace { -// Type of callback invoked by the death handler. -using on_death_cb_function = std::function; - -// Private class used to keep track of death of individual -// callbacks stored in HidlCallbackHandler. -template -class HidlDeathHandler : public android::hardware::hidl_death_recipient { - public: - HidlDeathHandler(const on_death_cb_function& user_cb_function) - : cb_function_(user_cb_function) {} - ~HidlDeathHandler() = default; - - // Death notification for callbacks. - void serviceDied(uint64_t cookie, - const android::wp& /* who */) override { - cb_function_(cookie); - } - - private: - on_death_cb_function cb_function_; - - DISALLOW_COPY_AND_ASSIGN(HidlDeathHandler); -}; -} // namespace - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -namespace hidl_callback_util { -template -// Provides a class to manage callbacks for the various HIDL interfaces and -// handle the death of the process hosting each callback. -class HidlCallbackHandler { - public: - HidlCallbackHandler() - : death_handler_(new HidlDeathHandler( - std::bind(&HidlCallbackHandler::onObjectDeath, this, std::placeholders::_1))) {} - ~HidlCallbackHandler() = default; - - bool addCallback(const sp& cb) { - // TODO(b/33818800): Can't compare proxies yet. So, use the cookie - // (callback proxy's raw pointer) to track the death of individual - // clients. - uint64_t cookie = reinterpret_cast(cb.get()); - for (const auto& s : cb_set_) { - if (interfacesEqual(cb, s)) { - LOG(ERROR) << "Duplicate death notification registration"; - return true; - } - } - if (!cb->linkToDeath(death_handler_, cookie)) { - LOG(ERROR) << "Failed to register death notification"; - return false; - } - cb_set_.insert(cb); - return true; - } - - const std::set>& getCallbacks() { return cb_set_; } - - // Death notification for callbacks. - void onObjectDeath(uint64_t cookie) { - CallbackType* cb = reinterpret_cast(cookie); - const auto& iter = cb_set_.find(cb); - if (iter == cb_set_.end()) { - LOG(ERROR) << "Unknown callback death notification received"; - return; - } - cb_set_.erase(iter); - LOG(DEBUG) << "Dead callback removed from list"; - } - - void invalidate() { - for (const sp& cb : cb_set_) { - if (!cb->unlinkToDeath(death_handler_)) { - LOG(ERROR) << "Failed to deregister death notification"; - } - } - cb_set_.clear(); - } - - private: - std::set> cb_set_; - sp> death_handler_; - - DISALLOW_COPY_AND_ASSIGN(HidlCallbackHandler); -}; - -} // namespace hidl_callback_util -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android -#endif // HIDL_CALLBACK_UTIL_H_ diff --git a/wifi/1.6/default/hidl_return_util.h b/wifi/1.6/default/hidl_return_util.h deleted file mode 100644 index a0efac2c57..0000000000 --- a/wifi/1.6/default/hidl_return_util.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef HIDL_RETURN_UTIL_H_ -#define HIDL_RETURN_UTIL_H_ - -#include "hidl_sync_util.h" -#include "wifi_status_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -namespace hidl_return_util { -using namespace android::hardware::wifi::V1_0; - -/** - * These utility functions are used to invoke a method on the provided - * HIDL interface object. - * These functions checks if the provided HIDL interface object is valid. - * a) if valid, Invokes the corresponding internal implementation function of - * the HIDL method. It then invokes the HIDL continuation callback with - * the status and any returned values. - * b) if invalid, invokes the HIDL continuation callback with the - * provided error status and default values. - */ -// Use for HIDL methods which return only an instance of WifiStatus. -template -Return validateAndCall(ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, - Args&&... args) { - const auto lock = hidl_sync_util::acquireGlobalLock(); - if (obj->isValid()) { - hidl_cb((obj->*work)(std::forward(args)...)); - } else { - hidl_cb(createWifiStatus(status_code_if_invalid)); - } - return Void(); -} - -// Use for HIDL methods which return only an instance of WifiStatus. -// This version passes the global lock acquired to the body of the method. -// Note: Only used by IWifi::stop() currently. -template -Return validateAndCallWithLock(ObjT* obj, WifiStatusCode status_code_if_invalid, - WorkFuncT&& work, - const std::function& hidl_cb, - Args&&... args) { - auto lock = hidl_sync_util::acquireGlobalLock(); - if (obj->isValid()) { - hidl_cb((obj->*work)(&lock, std::forward(args)...)); - } else { - hidl_cb(createWifiStatus(status_code_if_invalid)); - } - return Void(); -} - -// Use for HIDL methods which return instance of WifiStatus and a single return -// value. -template -Return validateAndCall(ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, - Args&&... args) { - const auto lock = hidl_sync_util::acquireGlobalLock(); - if (obj->isValid()) { - const auto& ret_pair = (obj->*work)(std::forward(args)...); - const WifiStatus& status = std::get<0>(ret_pair); - const auto& ret_value = std::get<1>(ret_pair); - hidl_cb(status, ret_value); - } else { - hidl_cb(createWifiStatus(status_code_if_invalid), - typename std::remove_reference::type()); - } - return Void(); -} - -// Use for HIDL methods which return instance of WifiStatus and 2 return -// values. -template -Return validateAndCall( - ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, Args&&... args) { - const auto lock = hidl_sync_util::acquireGlobalLock(); - if (obj->isValid()) { - const auto& ret_tuple = (obj->*work)(std::forward(args)...); - const WifiStatus& status = std::get<0>(ret_tuple); - const auto& ret_value1 = std::get<1>(ret_tuple); - const auto& ret_value2 = std::get<2>(ret_tuple); - hidl_cb(status, ret_value1, ret_value2); - } else { - hidl_cb(createWifiStatus(status_code_if_invalid), - typename std::remove_reference::type(), - typename std::remove_reference::type()); - } - return Void(); -} - -} // namespace hidl_return_util -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android -#endif // HIDL_RETURN_UTIL_H_ diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp deleted file mode 100644 index 2112b260f3..0000000000 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ /dev/null @@ -1,3007 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "hidl_struct_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -namespace hidl_struct_util { - -using V1_6::NanConfigRequestSupplemental; - -WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_channel_width type); - -hidl_string safeConvertChar(const char* str, size_t max_len) { - const char* c = str; - size_t size = 0; - while (*c && (unsigned char)*c < 128 && size < max_len) { - ++size; - ++c; - } - return hidl_string(str, size); -} - -IWifiChip::ChipCapabilityMask convertLegacyLoggerFeatureToHidlChipCapability(uint32_t feature) { - using HidlChipCaps = IWifiChip::ChipCapabilityMask; - switch (feature) { - case legacy_hal::WIFI_LOGGER_MEMORY_DUMP_SUPPORTED: - return HidlChipCaps::DEBUG_MEMORY_FIRMWARE_DUMP; - case legacy_hal::WIFI_LOGGER_DRIVER_DUMP_SUPPORTED: - return HidlChipCaps::DEBUG_MEMORY_DRIVER_DUMP; - case legacy_hal::WIFI_LOGGER_CONNECT_EVENT_SUPPORTED: - return HidlChipCaps::DEBUG_RING_BUFFER_CONNECT_EVENT; - case legacy_hal::WIFI_LOGGER_POWER_EVENT_SUPPORTED: - return HidlChipCaps::DEBUG_RING_BUFFER_POWER_EVENT; - case legacy_hal::WIFI_LOGGER_WAKE_LOCK_SUPPORTED: - return HidlChipCaps::DEBUG_RING_BUFFER_WAKELOCK_EVENT; - }; - CHECK(false) << "Unknown legacy feature: " << feature; - return {}; -} - -IWifiStaIface::StaIfaceCapabilityMask convertLegacyLoggerFeatureToHidlStaIfaceCapability( - uint32_t feature) { - using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask; - switch (feature) { - case legacy_hal::WIFI_LOGGER_PACKET_FATE_SUPPORTED: - return HidlStaIfaceCaps::DEBUG_PACKET_FATE; - }; - CHECK(false) << "Unknown legacy feature: " << feature; - return {}; -} - -V1_5::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability(uint64_t feature) { - using HidlChipCaps = V1_5::IWifiChip::ChipCapabilityMask; - switch (feature) { - case WIFI_FEATURE_SET_TX_POWER_LIMIT: - return HidlChipCaps::SET_TX_POWER_LIMIT; - case WIFI_FEATURE_USE_BODY_HEAD_SAR: - return HidlChipCaps::USE_BODY_HEAD_SAR; - case WIFI_FEATURE_D2D_RTT: - return HidlChipCaps::D2D_RTT; - case WIFI_FEATURE_D2AP_RTT: - return HidlChipCaps::D2AP_RTT; - case WIFI_FEATURE_INFRA_60G: - return HidlChipCaps::WIGIG; - case WIFI_FEATURE_SET_LATENCY_MODE: - return HidlChipCaps::SET_LATENCY_MODE; - case WIFI_FEATURE_P2P_RAND_MAC: - return HidlChipCaps::P2P_RAND_MAC; - }; - CHECK(false) << "Unknown legacy feature: " << feature; - return {}; -} - -IWifiStaIface::StaIfaceCapabilityMask convertLegacyFeatureToHidlStaIfaceCapability( - uint64_t feature) { - using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask; - switch (feature) { - case WIFI_FEATURE_GSCAN: - return HidlStaIfaceCaps::BACKGROUND_SCAN; - case WIFI_FEATURE_LINK_LAYER_STATS: - return HidlStaIfaceCaps::LINK_LAYER_STATS; - case WIFI_FEATURE_RSSI_MONITOR: - return HidlStaIfaceCaps::RSSI_MONITOR; - case WIFI_FEATURE_CONTROL_ROAMING: - return HidlStaIfaceCaps::CONTROL_ROAMING; - case WIFI_FEATURE_IE_WHITELIST: - return HidlStaIfaceCaps::PROBE_IE_WHITELIST; - case WIFI_FEATURE_SCAN_RAND: - return HidlStaIfaceCaps::SCAN_RAND; - case WIFI_FEATURE_INFRA_5G: - return HidlStaIfaceCaps::STA_5G; - case WIFI_FEATURE_HOTSPOT: - return HidlStaIfaceCaps::HOTSPOT; - case WIFI_FEATURE_PNO: - return HidlStaIfaceCaps::PNO; - case WIFI_FEATURE_TDLS: - return HidlStaIfaceCaps::TDLS; - case WIFI_FEATURE_TDLS_OFFCHANNEL: - return HidlStaIfaceCaps::TDLS_OFFCHANNEL; - case WIFI_FEATURE_CONFIG_NDO: - return HidlStaIfaceCaps::ND_OFFLOAD; - case WIFI_FEATURE_MKEEP_ALIVE: - return HidlStaIfaceCaps::KEEP_ALIVE; - }; - CHECK(false) << "Unknown legacy feature: " << feature; - return {}; -} - -bool convertLegacyFeaturesToHidlChipCapabilities(uint64_t legacy_feature_set, - uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps) { - if (!hidl_caps) { - return false; - } - *hidl_caps = {}; - using HidlChipCaps = IWifiChip::ChipCapabilityMask; - for (const auto feature : {legacy_hal::WIFI_LOGGER_MEMORY_DUMP_SUPPORTED, - legacy_hal::WIFI_LOGGER_DRIVER_DUMP_SUPPORTED, - legacy_hal::WIFI_LOGGER_CONNECT_EVENT_SUPPORTED, - legacy_hal::WIFI_LOGGER_POWER_EVENT_SUPPORTED, - legacy_hal::WIFI_LOGGER_WAKE_LOCK_SUPPORTED}) { - if (feature & legacy_logger_feature_set) { - *hidl_caps |= convertLegacyLoggerFeatureToHidlChipCapability(feature); - } - } - std::vector features = {WIFI_FEATURE_SET_TX_POWER_LIMIT, - WIFI_FEATURE_USE_BODY_HEAD_SAR, - WIFI_FEATURE_D2D_RTT, - WIFI_FEATURE_D2AP_RTT, - WIFI_FEATURE_INFRA_60G, - WIFI_FEATURE_SET_LATENCY_MODE, - WIFI_FEATURE_P2P_RAND_MAC}; - for (const auto feature : features) { - if (feature & legacy_feature_set) { - *hidl_caps |= convertLegacyFeatureToHidlChipCapability(feature); - } - } - - // There are no flags for these 3 in the legacy feature set. Adding them to - // the set because all the current devices support it. - *hidl_caps |= HidlChipCaps::DEBUG_RING_BUFFER_VENDOR_DATA; - *hidl_caps |= HidlChipCaps::DEBUG_HOST_WAKE_REASON_STATS; - *hidl_caps |= HidlChipCaps::DEBUG_ERROR_ALERTS; - return true; -} - -WifiDebugRingBufferFlags convertLegacyDebugRingBufferFlagsToHidl(uint32_t flag) { - switch (flag) { - case WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES: - return WifiDebugRingBufferFlags::HAS_BINARY_ENTRIES; - case WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES: - return WifiDebugRingBufferFlags::HAS_ASCII_ENTRIES; - }; - CHECK(false) << "Unknown legacy flag: " << flag; - return {}; -} - -bool convertLegacyDebugRingBufferStatusToHidl( - const legacy_hal::wifi_ring_buffer_status& legacy_status, - WifiDebugRingBufferStatus* hidl_status) { - if (!hidl_status) { - return false; - } - *hidl_status = {}; - hidl_status->ringName = safeConvertChar(reinterpret_cast(legacy_status.name), - sizeof(legacy_status.name)); - hidl_status->flags = 0; - for (const auto flag : - {WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES, WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES}) { - if (flag & legacy_status.flags) { - hidl_status->flags |= static_cast::type>( - convertLegacyDebugRingBufferFlagsToHidl(flag)); - } - } - hidl_status->ringId = legacy_status.ring_id; - hidl_status->sizeInBytes = legacy_status.ring_buffer_byte_size; - // Calculate free size of the ring the buffer. We don't need to send the - // exact read/write pointers that were there in the legacy HAL interface. - if (legacy_status.written_bytes >= legacy_status.read_bytes) { - hidl_status->freeSizeInBytes = legacy_status.ring_buffer_byte_size - - (legacy_status.written_bytes - legacy_status.read_bytes); - } else { - hidl_status->freeSizeInBytes = legacy_status.read_bytes - legacy_status.written_bytes; - } - hidl_status->verboseLevel = legacy_status.verbose_level; - return true; -} - -bool convertLegacyVectorOfDebugRingBufferStatusToHidl( - const std::vector& legacy_status_vec, - std::vector* hidl_status_vec) { - if (!hidl_status_vec) { - return false; - } - *hidl_status_vec = {}; - for (const auto& legacy_status : legacy_status_vec) { - WifiDebugRingBufferStatus hidl_status; - if (!convertLegacyDebugRingBufferStatusToHidl(legacy_status, &hidl_status)) { - return false; - } - hidl_status_vec->push_back(hidl_status); - } - return true; -} - -bool convertLegacyWakeReasonStatsToHidl(const legacy_hal::WakeReasonStats& legacy_stats, - WifiDebugHostWakeReasonStats* hidl_stats) { - if (!hidl_stats) { - return false; - } - *hidl_stats = {}; - hidl_stats->totalCmdEventWakeCnt = legacy_stats.wake_reason_cnt.total_cmd_event_wake; - hidl_stats->cmdEventWakeCntPerType = legacy_stats.cmd_event_wake_cnt; - hidl_stats->totalDriverFwLocalWakeCnt = legacy_stats.wake_reason_cnt.total_driver_fw_local_wake; - hidl_stats->driverFwLocalWakeCntPerType = legacy_stats.driver_fw_local_wake_cnt; - hidl_stats->totalRxPacketWakeCnt = legacy_stats.wake_reason_cnt.total_rx_data_wake; - hidl_stats->rxPktWakeDetails.rxUnicastCnt = - legacy_stats.wake_reason_cnt.rx_wake_details.rx_unicast_cnt; - hidl_stats->rxPktWakeDetails.rxMulticastCnt = - legacy_stats.wake_reason_cnt.rx_wake_details.rx_multicast_cnt; - hidl_stats->rxPktWakeDetails.rxBroadcastCnt = - legacy_stats.wake_reason_cnt.rx_wake_details.rx_broadcast_cnt; - hidl_stats->rxMulticastPkWakeDetails.ipv4RxMulticastAddrCnt = - legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.ipv4_rx_multicast_addr_cnt; - hidl_stats->rxMulticastPkWakeDetails.ipv6RxMulticastAddrCnt = - legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.ipv6_rx_multicast_addr_cnt; - hidl_stats->rxMulticastPkWakeDetails.otherRxMulticastAddrCnt = - legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.other_rx_multicast_addr_cnt; - hidl_stats->rxIcmpPkWakeDetails.icmpPkt = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp_pkt; - hidl_stats->rxIcmpPkWakeDetails.icmp6Pkt = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_pkt; - hidl_stats->rxIcmpPkWakeDetails.icmp6Ra = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ra; - hidl_stats->rxIcmpPkWakeDetails.icmp6Na = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_na; - hidl_stats->rxIcmpPkWakeDetails.icmp6Ns = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ns; - return true; -} - -legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy( - V1_1::IWifiChip::TxPowerScenario hidl_scenario) { - switch (hidl_scenario) { - // This is the only supported scenario for V1_1 - case V1_1::IWifiChip::TxPowerScenario::VOICE_CALL: - return legacy_hal::WIFI_POWER_SCENARIO_VOICE_CALL; - }; - CHECK(false); -} - -legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy_1_2( - V1_2::IWifiChip::TxPowerScenario hidl_scenario) { - switch (hidl_scenario) { - // This is the only supported scenario for V1_1 - case V1_2::IWifiChip::TxPowerScenario::VOICE_CALL: - return legacy_hal::WIFI_POWER_SCENARIO_VOICE_CALL; - // Those are the supported scenarios for V1_2 - case V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF: - return legacy_hal::WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF; - case V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_ON: - return legacy_hal::WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON; - case V1_2::IWifiChip::TxPowerScenario::ON_BODY_CELL_OFF: - return legacy_hal::WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF; - case V1_2::IWifiChip::TxPowerScenario::ON_BODY_CELL_ON: - return legacy_hal::WIFI_POWER_SCENARIO_ON_BODY_CELL_ON; - }; - CHECK(false); -} - -legacy_hal::wifi_latency_mode convertHidlLatencyModeToLegacy( - V1_3::IWifiChip::LatencyMode hidl_latency_mode) { - switch (hidl_latency_mode) { - case V1_3::IWifiChip::LatencyMode::NORMAL: - return legacy_hal::WIFI_LATENCY_MODE_NORMAL; - case V1_3::IWifiChip::LatencyMode::LOW: - return legacy_hal::WIFI_LATENCY_MODE_LOW; - } - CHECK(false); -} - -bool convertLegacyWifiMacInfoToHidl( - const legacy_hal::WifiMacInfo& legacy_mac_info, - V1_4::IWifiChipEventCallback::RadioModeInfo* hidl_radio_mode_info) { - if (!hidl_radio_mode_info) { - return false; - } - *hidl_radio_mode_info = {}; - - hidl_radio_mode_info->radioId = legacy_mac_info.wlan_mac_id; - // Convert from bitmask of bands in the legacy HAL to enum value in - // the HIDL interface. - if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_6_0_BAND && - legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND && - legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_2_4_BAND) { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_24GHZ_5GHZ_6GHZ; - } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_6_0_BAND && - legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND) { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_5GHZ_6GHZ; - } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_6_0_BAND) { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_6GHZ; - } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_2_4_BAND && - legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND) { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_24GHZ_5GHZ; - } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_2_4_BAND) { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_24GHZ; - } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND) { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_5GHZ; - } else { - hidl_radio_mode_info->bandInfo = V1_4::WifiBand::BAND_UNSPECIFIED; - } - std::vector iface_info_vec; - for (const auto& legacy_iface_info : legacy_mac_info.iface_infos) { - V1_2::IWifiChipEventCallback::IfaceInfo iface_info; - iface_info.name = legacy_iface_info.name; - iface_info.channel = legacy_iface_info.channel; - iface_info_vec.push_back(iface_info); - } - hidl_radio_mode_info->ifaceInfos = iface_info_vec; - return true; -} - -uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand hidl_band) { - switch (hidl_band) { - case V1_5::WifiBand::BAND_24GHZ: - return legacy_hal::WLAN_MAC_2_4_BAND; - case V1_5::WifiBand::BAND_5GHZ: - case V1_5::WifiBand::BAND_5GHZ_DFS: - case V1_5::WifiBand::BAND_5GHZ_WITH_DFS: - return legacy_hal::WLAN_MAC_5_0_BAND; - case V1_5::WifiBand::BAND_24GHZ_5GHZ: - case V1_5::WifiBand::BAND_24GHZ_5GHZ_WITH_DFS: - return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND); - case V1_5::WifiBand::BAND_6GHZ: - return legacy_hal::WLAN_MAC_6_0_BAND; - case V1_5::WifiBand::BAND_5GHZ_6GHZ: - return (legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_6_0_BAND); - case V1_5::WifiBand::BAND_24GHZ_5GHZ_6GHZ: - case V1_5::WifiBand::BAND_24GHZ_5GHZ_WITH_DFS_6GHZ: - return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | - legacy_hal::WLAN_MAC_6_0_BAND); - case V1_5::WifiBand::BAND_60GHZ: - return legacy_hal::WLAN_MAC_60_0_BAND; - default: - return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | - legacy_hal::WLAN_MAC_6_0_BAND | legacy_hal::WLAN_MAC_60_0_BAND); - } -} - -V1_5::WifiBand convertLegacyMacBandToHidlWifiBand(uint32_t band) { - switch (band) { - case legacy_hal::WLAN_MAC_2_4_BAND: - return V1_5::WifiBand::BAND_24GHZ; - case legacy_hal::WLAN_MAC_5_0_BAND: - return V1_5::WifiBand::BAND_5GHZ; - case legacy_hal::WLAN_MAC_6_0_BAND: - return V1_5::WifiBand::BAND_6GHZ; - case legacy_hal::WLAN_MAC_60_0_BAND: - return V1_5::WifiBand::BAND_60GHZ; - default: - return V1_5::WifiBand::BAND_UNSPECIFIED; - } -} - -uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask) { - uint32_t legacy_iface_mask = 0; - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_STA) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_STA); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_SOFTAP) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_SOFTAP); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_P2P_CLIENT) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_P2P_CLIENT); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_P2P_GO) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_P2P_GO); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_NAN) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_NAN); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_TDLS) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_TDLS); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_MESH) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_MESH); - } - if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_IBSS) { - legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_IBSS); - } - return legacy_iface_mask; -} - -uint32_t convertLegacyWifiInterfaceModeToHidl(uint32_t legacy_iface_mask) { - uint32_t hidl_iface_mask = 0; - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_STA)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_STA; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_SOFTAP)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_SOFTAP; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_P2P_CLIENT)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_P2P_CLIENT; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_P2P_GO)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_P2P_GO; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_NAN)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_NAN; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_TDLS)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_TDLS; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_MESH)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_MESH; - } - if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_IBSS)) { - hidl_iface_mask |= V1_5::WifiIfaceMode::IFACE_MODE_IBSS; - } - return hidl_iface_mask; -} - -uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask) { - uint32_t legacy_filter_mask = 0; - if (hidl_filter_mask & V1_5::IWifiChip::UsableChannelFilter::CELLULAR_COEXISTENCE) { - legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CELLULAR_COEXISTENCE; - } - if (hidl_filter_mask & V1_5::IWifiChip::UsableChannelFilter::CONCURRENCY) { - legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY; - } - if (hidl_filter_mask & V1_6::IWifiChip::UsableChannelFilter::NAN_INSTANT_MODE) { - legacy_filter_mask |= WIFI_USABLE_CHANNEL_FILTER_NAN_INSTANT_MODE; - } - return legacy_filter_mask; -} - -bool convertLegacyWifiUsableChannelToHidl( - const legacy_hal::wifi_usable_channel& legacy_usable_channel, - V1_6::WifiUsableChannel* hidl_usable_channel) { - if (!hidl_usable_channel) { - return false; - } - *hidl_usable_channel = {}; - hidl_usable_channel->channel = legacy_usable_channel.freq; - hidl_usable_channel->channelBandwidth = - convertLegacyWifiChannelWidthToHidl(legacy_usable_channel.width); - hidl_usable_channel->ifaceModeMask = - convertLegacyWifiInterfaceModeToHidl(legacy_usable_channel.iface_mode_mask); - - return true; -} - -bool convertLegacyWifiUsableChannelsToHidl( - const std::vector& legacy_usable_channels, - std::vector* hidl_usable_channels) { - if (!hidl_usable_channels) { - return false; - } - *hidl_usable_channels = {}; - for (const auto& legacy_usable_channel : legacy_usable_channels) { - V1_6::WifiUsableChannel hidl_usable_channel; - if (!convertLegacyWifiUsableChannelToHidl(legacy_usable_channel, &hidl_usable_channel)) { - return false; - } - hidl_usable_channels->push_back(hidl_usable_channel); - } - return true; -} - -bool convertLegacyWifiMacInfosToHidl( - const std::vector& legacy_mac_infos, - std::vector* hidl_radio_mode_infos) { - if (!hidl_radio_mode_infos) { - return false; - } - *hidl_radio_mode_infos = {}; - - for (const auto& legacy_mac_info : legacy_mac_infos) { - V1_4::IWifiChipEventCallback::RadioModeInfo hidl_radio_mode_info; - if (!convertLegacyWifiMacInfoToHidl(legacy_mac_info, &hidl_radio_mode_info)) { - return false; - } - hidl_radio_mode_infos->push_back(hidl_radio_mode_info); - } - return true; -} - -bool convertLegacyFeaturesToHidlStaCapabilities(uint64_t legacy_feature_set, - uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps) { - if (!hidl_caps) { - return false; - } - *hidl_caps = {}; - using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask; - for (const auto feature : {legacy_hal::WIFI_LOGGER_PACKET_FATE_SUPPORTED}) { - if (feature & legacy_logger_feature_set) { - *hidl_caps |= convertLegacyLoggerFeatureToHidlStaIfaceCapability(feature); - } - } - for (const auto feature : - {WIFI_FEATURE_GSCAN, WIFI_FEATURE_LINK_LAYER_STATS, WIFI_FEATURE_RSSI_MONITOR, - WIFI_FEATURE_CONTROL_ROAMING, WIFI_FEATURE_IE_WHITELIST, WIFI_FEATURE_SCAN_RAND, - WIFI_FEATURE_INFRA_5G, WIFI_FEATURE_HOTSPOT, WIFI_FEATURE_PNO, WIFI_FEATURE_TDLS, - WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE}) { - if (feature & legacy_feature_set) { - *hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature); - } - } - // There is no flag for this one in the legacy feature set. Adding it to the - // set because all the current devices support it. - *hidl_caps |= HidlStaIfaceCaps::APF; - return true; -} - -bool convertLegacyApfCapabilitiesToHidl(const legacy_hal::PacketFilterCapabilities& legacy_caps, - StaApfPacketFilterCapabilities* hidl_caps) { - if (!hidl_caps) { - return false; - } - *hidl_caps = {}; - hidl_caps->version = legacy_caps.version; - hidl_caps->maxLength = legacy_caps.max_len; - return true; -} - -uint8_t convertHidlGscanReportEventFlagToLegacy( - StaBackgroundScanBucketEventReportSchemeMask hidl_flag) { - using HidlFlag = StaBackgroundScanBucketEventReportSchemeMask; - switch (hidl_flag) { - case HidlFlag::EACH_SCAN: - return REPORT_EVENTS_EACH_SCAN; - case HidlFlag::FULL_RESULTS: - return REPORT_EVENTS_FULL_RESULTS; - case HidlFlag::NO_BATCH: - return REPORT_EVENTS_NO_BATCH; - }; - CHECK(false); -} - -StaScanDataFlagMask convertLegacyGscanDataFlagToHidl(uint8_t legacy_flag) { - switch (legacy_flag) { - case legacy_hal::WIFI_SCAN_FLAG_INTERRUPTED: - return StaScanDataFlagMask::INTERRUPTED; - }; - CHECK(false) << "Unknown legacy flag: " << legacy_flag; - // To silence the compiler warning about reaching the end of non-void - // function. - return {}; -} - -bool convertLegacyGscanCapabilitiesToHidl(const legacy_hal::wifi_gscan_capabilities& legacy_caps, - StaBackgroundScanCapabilities* hidl_caps) { - if (!hidl_caps) { - return false; - } - *hidl_caps = {}; - hidl_caps->maxCacheSize = legacy_caps.max_scan_cache_size; - hidl_caps->maxBuckets = legacy_caps.max_scan_buckets; - hidl_caps->maxApCachePerScan = legacy_caps.max_ap_cache_per_scan; - hidl_caps->maxReportingThreshold = legacy_caps.max_scan_reporting_threshold; - return true; -} - -legacy_hal::wifi_band convertHidlWifiBandToLegacy(V1_0::WifiBand band) { - switch (band) { - case V1_0::WifiBand::BAND_UNSPECIFIED: - return legacy_hal::WIFI_BAND_UNSPECIFIED; - case V1_0::WifiBand::BAND_24GHZ: - return legacy_hal::WIFI_BAND_BG; - case V1_0::WifiBand::BAND_5GHZ: - return legacy_hal::WIFI_BAND_A; - case V1_0::WifiBand::BAND_5GHZ_DFS: - return legacy_hal::WIFI_BAND_A_DFS; - case V1_0::WifiBand::BAND_5GHZ_WITH_DFS: - return legacy_hal::WIFI_BAND_A_WITH_DFS; - case V1_0::WifiBand::BAND_24GHZ_5GHZ: - return legacy_hal::WIFI_BAND_ABG; - case V1_0::WifiBand::BAND_24GHZ_5GHZ_WITH_DFS: - return legacy_hal::WIFI_BAND_ABG_WITH_DFS; - }; - CHECK(false); -} - -bool convertHidlGscanParamsToLegacy(const StaBackgroundScanParameters& hidl_scan_params, - legacy_hal::wifi_scan_cmd_params* legacy_scan_params) { - if (!legacy_scan_params) { - return false; - } - *legacy_scan_params = {}; - legacy_scan_params->base_period = hidl_scan_params.basePeriodInMs; - legacy_scan_params->max_ap_per_scan = hidl_scan_params.maxApPerScan; - legacy_scan_params->report_threshold_percent = hidl_scan_params.reportThresholdPercent; - legacy_scan_params->report_threshold_num_scans = hidl_scan_params.reportThresholdNumScans; - if (hidl_scan_params.buckets.size() > MAX_BUCKETS) { - return false; - } - legacy_scan_params->num_buckets = hidl_scan_params.buckets.size(); - for (uint32_t bucket_idx = 0; bucket_idx < hidl_scan_params.buckets.size(); bucket_idx++) { - const StaBackgroundScanBucketParameters& hidl_bucket_spec = - hidl_scan_params.buckets[bucket_idx]; - legacy_hal::wifi_scan_bucket_spec& legacy_bucket_spec = - legacy_scan_params->buckets[bucket_idx]; - if (hidl_bucket_spec.bucketIdx >= MAX_BUCKETS) { - return false; - } - legacy_bucket_spec.bucket = hidl_bucket_spec.bucketIdx; - legacy_bucket_spec.band = convertHidlWifiBandToLegacy(hidl_bucket_spec.band); - legacy_bucket_spec.period = hidl_bucket_spec.periodInMs; - legacy_bucket_spec.max_period = hidl_bucket_spec.exponentialMaxPeriodInMs; - legacy_bucket_spec.base = hidl_bucket_spec.exponentialBase; - legacy_bucket_spec.step_count = hidl_bucket_spec.exponentialStepCount; - legacy_bucket_spec.report_events = 0; - using HidlFlag = StaBackgroundScanBucketEventReportSchemeMask; - for (const auto flag : {HidlFlag::EACH_SCAN, HidlFlag::FULL_RESULTS, HidlFlag::NO_BATCH}) { - if (hidl_bucket_spec.eventReportScheme & - static_cast::type>(flag)) { - legacy_bucket_spec.report_events |= convertHidlGscanReportEventFlagToLegacy(flag); - } - } - if (hidl_bucket_spec.frequencies.size() > MAX_CHANNELS) { - return false; - } - legacy_bucket_spec.num_channels = hidl_bucket_spec.frequencies.size(); - for (uint32_t freq_idx = 0; freq_idx < hidl_bucket_spec.frequencies.size(); freq_idx++) { - legacy_bucket_spec.channels[freq_idx].channel = hidl_bucket_spec.frequencies[freq_idx]; - } - } - return true; -} - -bool convertLegacyIeToHidl(const legacy_hal::wifi_information_element& legacy_ie, - WifiInformationElement* hidl_ie) { - if (!hidl_ie) { - return false; - } - *hidl_ie = {}; - hidl_ie->id = legacy_ie.id; - hidl_ie->data = std::vector(legacy_ie.data, legacy_ie.data + legacy_ie.len); - return true; -} - -bool convertLegacyIeBlobToHidl(const uint8_t* ie_blob, uint32_t ie_blob_len, - std::vector* hidl_ies) { - if (!ie_blob || !hidl_ies) { - return false; - } - *hidl_ies = {}; - const uint8_t* ies_begin = ie_blob; - const uint8_t* ies_end = ie_blob + ie_blob_len; - const uint8_t* next_ie = ies_begin; - using wifi_ie = legacy_hal::wifi_information_element; - constexpr size_t kIeHeaderLen = sizeof(wifi_ie); - // Each IE should atleast have the header (i.e |id| & |len| fields). - while (next_ie + kIeHeaderLen <= ies_end) { - const wifi_ie& legacy_ie = (*reinterpret_cast(next_ie)); - uint32_t curr_ie_len = kIeHeaderLen + legacy_ie.len; - if (next_ie + curr_ie_len > ies_end) { - LOG(ERROR) << "Error parsing IE blob. Next IE: " << (void*)next_ie - << ", Curr IE len: " << curr_ie_len << ", IEs End: " << (void*)ies_end; - break; - } - WifiInformationElement hidl_ie; - if (!convertLegacyIeToHidl(legacy_ie, &hidl_ie)) { - LOG(ERROR) << "Error converting IE. Id: " << legacy_ie.id << ", len: " << legacy_ie.len; - break; - } - hidl_ies->push_back(std::move(hidl_ie)); - next_ie += curr_ie_len; - } - // Check if the blob has been fully consumed. - if (next_ie != ies_end) { - LOG(ERROR) << "Failed to fully parse IE blob. Next IE: " << (void*)next_ie - << ", IEs End: " << (void*)ies_end; - } - return true; -} - -bool convertLegacyGscanResultToHidl(const legacy_hal::wifi_scan_result& legacy_scan_result, - bool has_ie_data, StaScanResult* hidl_scan_result) { - if (!hidl_scan_result) { - return false; - } - *hidl_scan_result = {}; - hidl_scan_result->timeStampInUs = legacy_scan_result.ts; - hidl_scan_result->ssid = std::vector( - legacy_scan_result.ssid, - legacy_scan_result.ssid + - strnlen(legacy_scan_result.ssid, sizeof(legacy_scan_result.ssid) - 1)); - memcpy(hidl_scan_result->bssid.data(), legacy_scan_result.bssid, - hidl_scan_result->bssid.size()); - hidl_scan_result->frequency = legacy_scan_result.channel; - hidl_scan_result->rssi = legacy_scan_result.rssi; - hidl_scan_result->beaconPeriodInMs = legacy_scan_result.beacon_period; - hidl_scan_result->capability = legacy_scan_result.capability; - if (has_ie_data) { - std::vector ies; - if (!convertLegacyIeBlobToHidl(reinterpret_cast(legacy_scan_result.ie_data), - legacy_scan_result.ie_length, &ies)) { - return false; - } - hidl_scan_result->informationElements = std::move(ies); - } - return true; -} - -bool convertLegacyCachedGscanResultsToHidl( - const legacy_hal::wifi_cached_scan_results& legacy_cached_scan_result, - StaScanData* hidl_scan_data) { - if (!hidl_scan_data) { - return false; - } - *hidl_scan_data = {}; - hidl_scan_data->flags = 0; - for (const auto flag : {legacy_hal::WIFI_SCAN_FLAG_INTERRUPTED}) { - if (legacy_cached_scan_result.flags & flag) { - hidl_scan_data->flags |= static_cast::type>( - convertLegacyGscanDataFlagToHidl(flag)); - } - } - hidl_scan_data->bucketsScanned = legacy_cached_scan_result.buckets_scanned; - - CHECK(legacy_cached_scan_result.num_results >= 0 && - legacy_cached_scan_result.num_results <= MAX_AP_CACHE_PER_SCAN); - std::vector hidl_scan_results; - for (int32_t result_idx = 0; result_idx < legacy_cached_scan_result.num_results; result_idx++) { - StaScanResult hidl_scan_result; - if (!convertLegacyGscanResultToHidl(legacy_cached_scan_result.results[result_idx], false, - &hidl_scan_result)) { - return false; - } - hidl_scan_results.push_back(hidl_scan_result); - } - hidl_scan_data->results = std::move(hidl_scan_results); - return true; -} - -bool convertLegacyVectorOfCachedGscanResultsToHidl( - const std::vector& legacy_cached_scan_results, - std::vector* hidl_scan_datas) { - if (!hidl_scan_datas) { - return false; - } - *hidl_scan_datas = {}; - for (const auto& legacy_cached_scan_result : legacy_cached_scan_results) { - StaScanData hidl_scan_data; - if (!convertLegacyCachedGscanResultsToHidl(legacy_cached_scan_result, &hidl_scan_data)) { - return false; - } - hidl_scan_datas->push_back(hidl_scan_data); - } - return true; -} - -WifiDebugTxPacketFate convertLegacyDebugTxPacketFateToHidl(legacy_hal::wifi_tx_packet_fate fate) { - switch (fate) { - case legacy_hal::TX_PKT_FATE_ACKED: - return WifiDebugTxPacketFate::ACKED; - case legacy_hal::TX_PKT_FATE_SENT: - return WifiDebugTxPacketFate::SENT; - case legacy_hal::TX_PKT_FATE_FW_QUEUED: - return WifiDebugTxPacketFate::FW_QUEUED; - case legacy_hal::TX_PKT_FATE_FW_DROP_INVALID: - return WifiDebugTxPacketFate::FW_DROP_INVALID; - case legacy_hal::TX_PKT_FATE_FW_DROP_NOBUFS: - return WifiDebugTxPacketFate::FW_DROP_NOBUFS; - case legacy_hal::TX_PKT_FATE_FW_DROP_OTHER: - return WifiDebugTxPacketFate::FW_DROP_OTHER; - case legacy_hal::TX_PKT_FATE_DRV_QUEUED: - return WifiDebugTxPacketFate::DRV_QUEUED; - case legacy_hal::TX_PKT_FATE_DRV_DROP_INVALID: - return WifiDebugTxPacketFate::DRV_DROP_INVALID; - case legacy_hal::TX_PKT_FATE_DRV_DROP_NOBUFS: - return WifiDebugTxPacketFate::DRV_DROP_NOBUFS; - case legacy_hal::TX_PKT_FATE_DRV_DROP_OTHER: - return WifiDebugTxPacketFate::DRV_DROP_OTHER; - }; - CHECK(false) << "Unknown legacy fate type: " << fate; -} - -WifiDebugRxPacketFate convertLegacyDebugRxPacketFateToHidl(legacy_hal::wifi_rx_packet_fate fate) { - switch (fate) { - case legacy_hal::RX_PKT_FATE_SUCCESS: - return WifiDebugRxPacketFate::SUCCESS; - case legacy_hal::RX_PKT_FATE_FW_QUEUED: - return WifiDebugRxPacketFate::FW_QUEUED; - case legacy_hal::RX_PKT_FATE_FW_DROP_FILTER: - return WifiDebugRxPacketFate::FW_DROP_FILTER; - case legacy_hal::RX_PKT_FATE_FW_DROP_INVALID: - return WifiDebugRxPacketFate::FW_DROP_INVALID; - case legacy_hal::RX_PKT_FATE_FW_DROP_NOBUFS: - return WifiDebugRxPacketFate::FW_DROP_NOBUFS; - case legacy_hal::RX_PKT_FATE_FW_DROP_OTHER: - return WifiDebugRxPacketFate::FW_DROP_OTHER; - case legacy_hal::RX_PKT_FATE_DRV_QUEUED: - return WifiDebugRxPacketFate::DRV_QUEUED; - case legacy_hal::RX_PKT_FATE_DRV_DROP_FILTER: - return WifiDebugRxPacketFate::DRV_DROP_FILTER; - case legacy_hal::RX_PKT_FATE_DRV_DROP_INVALID: - return WifiDebugRxPacketFate::DRV_DROP_INVALID; - case legacy_hal::RX_PKT_FATE_DRV_DROP_NOBUFS: - return WifiDebugRxPacketFate::DRV_DROP_NOBUFS; - case legacy_hal::RX_PKT_FATE_DRV_DROP_OTHER: - return WifiDebugRxPacketFate::DRV_DROP_OTHER; - }; - CHECK(false) << "Unknown legacy fate type: " << fate; -} - -WifiDebugPacketFateFrameType convertLegacyDebugPacketFateFrameTypeToHidl( - legacy_hal::frame_type type) { - switch (type) { - case legacy_hal::FRAME_TYPE_UNKNOWN: - return WifiDebugPacketFateFrameType::UNKNOWN; - case legacy_hal::FRAME_TYPE_ETHERNET_II: - return WifiDebugPacketFateFrameType::ETHERNET_II; - case legacy_hal::FRAME_TYPE_80211_MGMT: - return WifiDebugPacketFateFrameType::MGMT_80211; - }; - CHECK(false) << "Unknown legacy frame type: " << type; -} - -bool convertLegacyDebugPacketFateFrameToHidl(const legacy_hal::frame_info& legacy_frame, - WifiDebugPacketFateFrameInfo* hidl_frame) { - if (!hidl_frame) { - return false; - } - *hidl_frame = {}; - hidl_frame->frameType = convertLegacyDebugPacketFateFrameTypeToHidl(legacy_frame.payload_type); - hidl_frame->frameLen = legacy_frame.frame_len; - hidl_frame->driverTimestampUsec = legacy_frame.driver_timestamp_usec; - hidl_frame->firmwareTimestampUsec = legacy_frame.firmware_timestamp_usec; - const uint8_t* frame_begin = - reinterpret_cast(legacy_frame.frame_content.ethernet_ii_bytes); - hidl_frame->frameContent = - std::vector(frame_begin, frame_begin + legacy_frame.frame_len); - return true; -} - -bool convertLegacyDebugTxPacketFateToHidl(const legacy_hal::wifi_tx_report& legacy_fate, - WifiDebugTxPacketFateReport* hidl_fate) { - if (!hidl_fate) { - return false; - } - *hidl_fate = {}; - hidl_fate->fate = convertLegacyDebugTxPacketFateToHidl(legacy_fate.fate); - return convertLegacyDebugPacketFateFrameToHidl(legacy_fate.frame_inf, &hidl_fate->frameInfo); -} - -bool convertLegacyVectorOfDebugTxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates) { - if (!hidl_fates) { - return false; - } - *hidl_fates = {}; - for (const auto& legacy_fate : legacy_fates) { - WifiDebugTxPacketFateReport hidl_fate; - if (!convertLegacyDebugTxPacketFateToHidl(legacy_fate, &hidl_fate)) { - return false; - } - hidl_fates->push_back(hidl_fate); - } - return true; -} - -bool convertLegacyDebugRxPacketFateToHidl(const legacy_hal::wifi_rx_report& legacy_fate, - WifiDebugRxPacketFateReport* hidl_fate) { - if (!hidl_fate) { - return false; - } - *hidl_fate = {}; - hidl_fate->fate = convertLegacyDebugRxPacketFateToHidl(legacy_fate.fate); - return convertLegacyDebugPacketFateFrameToHidl(legacy_fate.frame_inf, &hidl_fate->frameInfo); -} - -bool convertLegacyVectorOfDebugRxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates) { - if (!hidl_fates) { - return false; - } - *hidl_fates = {}; - for (const auto& legacy_fate : legacy_fates) { - WifiDebugRxPacketFateReport hidl_fate; - if (!convertLegacyDebugRxPacketFateToHidl(legacy_fate, &hidl_fate)) { - return false; - } - hidl_fates->push_back(hidl_fate); - } - return true; -} - -bool convertLegacyLinkLayerRadioStatsToHidl( - const legacy_hal::LinkLayerRadioStats& legacy_radio_stat, - V1_6::StaLinkLayerRadioStats* hidl_radio_stat) { - if (!hidl_radio_stat) { - return false; - } - *hidl_radio_stat = {}; - - hidl_radio_stat->radioId = legacy_radio_stat.stats.radio; - hidl_radio_stat->V1_0.onTimeInMs = legacy_radio_stat.stats.on_time; - hidl_radio_stat->V1_0.txTimeInMs = legacy_radio_stat.stats.tx_time; - hidl_radio_stat->V1_0.rxTimeInMs = legacy_radio_stat.stats.rx_time; - hidl_radio_stat->V1_0.onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan; - hidl_radio_stat->V1_0.txTimeInMsPerLevel = legacy_radio_stat.tx_time_per_levels; - hidl_radio_stat->onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd; - hidl_radio_stat->onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan; - hidl_radio_stat->onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan; - hidl_radio_stat->onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan; - hidl_radio_stat->onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20; - - std::vector hidl_channel_stats; - - for (const auto& channel_stat : legacy_radio_stat.channel_stats) { - V1_6::WifiChannelStats hidl_channel_stat; - hidl_channel_stat.onTimeInMs = channel_stat.on_time; - hidl_channel_stat.ccaBusyTimeInMs = channel_stat.cca_busy_time; - /* - * TODO once b/119142899 is fixed, - * replace below code with convertLegacyWifiChannelInfoToHidl() - */ - hidl_channel_stat.channel.width = WifiChannelWidthInMhz::WIDTH_20; - hidl_channel_stat.channel.centerFreq = channel_stat.channel.center_freq; - hidl_channel_stat.channel.centerFreq0 = channel_stat.channel.center_freq0; - hidl_channel_stat.channel.centerFreq1 = channel_stat.channel.center_freq1; - hidl_channel_stats.push_back(hidl_channel_stat); - } - - hidl_radio_stat->channelStats = hidl_channel_stats; - - return true; -} - -bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats, - V1_6::StaLinkLayerStats* hidl_stats) { - if (!hidl_stats) { - return false; - } - *hidl_stats = {}; - // iface legacy_stats conversion. - hidl_stats->iface.V1_0.beaconRx = legacy_stats.iface.beacon_rx; - hidl_stats->iface.V1_0.avgRssiMgmt = legacy_stats.iface.rssi_mgmt; - hidl_stats->iface.V1_0.wmeBePktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu; - hidl_stats->iface.V1_0.wmeBePktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu; - hidl_stats->iface.V1_0.wmeBePktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost; - hidl_stats->iface.V1_0.wmeBePktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries; - hidl_stats->iface.wmeBeContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min; - hidl_stats->iface.wmeBeContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max; - hidl_stats->iface.wmeBeContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg; - hidl_stats->iface.wmeBeContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples; - hidl_stats->iface.V1_0.wmeBkPktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu; - hidl_stats->iface.V1_0.wmeBkPktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu; - hidl_stats->iface.V1_0.wmeBkPktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost; - hidl_stats->iface.V1_0.wmeBkPktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries; - hidl_stats->iface.wmeBkContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min; - hidl_stats->iface.wmeBkContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max; - hidl_stats->iface.wmeBkContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg; - hidl_stats->iface.wmeBkContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples; - hidl_stats->iface.V1_0.wmeViPktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu; - hidl_stats->iface.V1_0.wmeViPktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu; - hidl_stats->iface.V1_0.wmeViPktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost; - hidl_stats->iface.V1_0.wmeViPktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries; - hidl_stats->iface.wmeViContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min; - hidl_stats->iface.wmeViContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max; - hidl_stats->iface.wmeViContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg; - hidl_stats->iface.wmeViContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples; - hidl_stats->iface.V1_0.wmeVoPktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu; - hidl_stats->iface.V1_0.wmeVoPktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu; - hidl_stats->iface.V1_0.wmeVoPktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost; - hidl_stats->iface.V1_0.wmeVoPktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries; - hidl_stats->iface.wmeVoContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min; - hidl_stats->iface.wmeVoContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max; - hidl_stats->iface.wmeVoContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg; - hidl_stats->iface.wmeVoContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples; - hidl_stats->iface.timeSliceDutyCycleInPercent = - legacy_stats.iface.info.time_slicing_duty_cycle_percent; - // peer info legacy_stats conversion. - std::vector hidl_peers_info_stats; - for (const auto& legacy_peer_info_stats : legacy_stats.peers) { - V1_6::StaPeerInfo hidl_peer_info_stats; - if (!convertLegacyPeerInfoStatsToHidl(legacy_peer_info_stats, &hidl_peer_info_stats)) { - return false; - } - hidl_peers_info_stats.push_back(hidl_peer_info_stats); - } - hidl_stats->iface.peers = hidl_peers_info_stats; - // radio legacy_stats conversion. - std::vector hidl_radios_stats; - for (const auto& legacy_radio_stats : legacy_stats.radios) { - V1_6::StaLinkLayerRadioStats hidl_radio_stats; - if (!convertLegacyLinkLayerRadioStatsToHidl(legacy_radio_stats, &hidl_radio_stats)) { - return false; - } - hidl_radios_stats.push_back(hidl_radio_stats); - } - hidl_stats->radios = hidl_radios_stats; - // Timestamp in the HAL wrapper here since it's not provided in the legacy - // HAL API. - hidl_stats->timeStampInMs = uptimeMillis(); - return true; -} - -bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, - V1_6::StaPeerInfo* hidl_peer_info_stats) { - if (!hidl_peer_info_stats) { - return false; - } - *hidl_peer_info_stats = {}; - hidl_peer_info_stats->staCount = legacy_peer_info_stats.peer_info.bssload.sta_count; - hidl_peer_info_stats->chanUtil = legacy_peer_info_stats.peer_info.bssload.chan_util; - - std::vector hidlRateStats; - for (const auto& legacy_rate_stats : legacy_peer_info_stats.rate_stats) { - V1_6::StaRateStat rateStat; - if (!convertLegacyWifiRateInfoToHidl(legacy_rate_stats.rate, &rateStat.rateInfo)) { - return false; - } - rateStat.txMpdu = legacy_rate_stats.tx_mpdu; - rateStat.rxMpdu = legacy_rate_stats.rx_mpdu; - rateStat.mpduLost = legacy_rate_stats.mpdu_lost; - rateStat.retries = legacy_rate_stats.retries; - hidlRateStats.push_back(rateStat); - } - hidl_peer_info_stats->rateStats = hidlRateStats; - return true; -} - -bool convertLegacyRoamingCapabilitiesToHidl( - const legacy_hal::wifi_roaming_capabilities& legacy_caps, - StaRoamingCapabilities* hidl_caps) { - if (!hidl_caps) { - return false; - } - *hidl_caps = {}; - hidl_caps->maxBlacklistSize = legacy_caps.max_blacklist_size; - hidl_caps->maxWhitelistSize = legacy_caps.max_whitelist_size; - return true; -} - -bool convertHidlRoamingConfigToLegacy(const StaRoamingConfig& hidl_config, - legacy_hal::wifi_roaming_config* legacy_config) { - if (!legacy_config) { - return false; - } - *legacy_config = {}; - if (hidl_config.bssidBlacklist.size() > MAX_BLACKLIST_BSSID || - hidl_config.ssidWhitelist.size() > MAX_WHITELIST_SSID) { - return false; - } - legacy_config->num_blacklist_bssid = hidl_config.bssidBlacklist.size(); - uint32_t i = 0; - for (const auto& bssid : hidl_config.bssidBlacklist) { - CHECK(bssid.size() == sizeof(legacy_hal::mac_addr)); - memcpy(legacy_config->blacklist_bssid[i++], bssid.data(), bssid.size()); - } - legacy_config->num_whitelist_ssid = hidl_config.ssidWhitelist.size(); - i = 0; - for (const auto& ssid : hidl_config.ssidWhitelist) { - CHECK(ssid.size() <= sizeof(legacy_hal::ssid_t::ssid_str)); - legacy_config->whitelist_ssid[i].length = ssid.size(); - memcpy(legacy_config->whitelist_ssid[i].ssid_str, ssid.data(), ssid.size()); - i++; - } - return true; -} - -legacy_hal::fw_roaming_state_t convertHidlRoamingStateToLegacy(StaRoamingState state) { - switch (state) { - case StaRoamingState::ENABLED: - return legacy_hal::ROAMING_ENABLE; - case StaRoamingState::DISABLED: - return legacy_hal::ROAMING_DISABLE; - }; - CHECK(false); -} - -legacy_hal::NanMatchAlg convertHidlNanMatchAlgToLegacy(NanMatchAlg type) { - switch (type) { - case NanMatchAlg::MATCH_ONCE: - return legacy_hal::NAN_MATCH_ALG_MATCH_ONCE; - case NanMatchAlg::MATCH_CONTINUOUS: - return legacy_hal::NAN_MATCH_ALG_MATCH_CONTINUOUS; - case NanMatchAlg::MATCH_NEVER: - return legacy_hal::NAN_MATCH_ALG_MATCH_NEVER; - } - CHECK(false); -} - -legacy_hal::NanPublishType convertHidlNanPublishTypeToLegacy(NanPublishType type) { - switch (type) { - case NanPublishType::UNSOLICITED: - return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED; - case NanPublishType::SOLICITED: - return legacy_hal::NAN_PUBLISH_TYPE_SOLICITED; - case NanPublishType::UNSOLICITED_SOLICITED: - return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED; - } - CHECK(false); -} - -legacy_hal::NanTxType convertHidlNanTxTypeToLegacy(NanTxType type) { - switch (type) { - case NanTxType::BROADCAST: - return legacy_hal::NAN_TX_TYPE_BROADCAST; - case NanTxType::UNICAST: - return legacy_hal::NAN_TX_TYPE_UNICAST; - } - CHECK(false); -} - -legacy_hal::NanSubscribeType convertHidlNanSubscribeTypeToLegacy(NanSubscribeType type) { - switch (type) { - case NanSubscribeType::PASSIVE: - return legacy_hal::NAN_SUBSCRIBE_TYPE_PASSIVE; - case NanSubscribeType::ACTIVE: - return legacy_hal::NAN_SUBSCRIBE_TYPE_ACTIVE; - } - CHECK(false); -} - -legacy_hal::NanSRFType convertHidlNanSrfTypeToLegacy(NanSrfType type) { - switch (type) { - case NanSrfType::BLOOM_FILTER: - return legacy_hal::NAN_SRF_ATTR_BLOOM_FILTER; - case NanSrfType::PARTIAL_MAC_ADDR: - return legacy_hal::NAN_SRF_ATTR_PARTIAL_MAC_ADDR; - } - CHECK(false); -} - -legacy_hal::NanDataPathChannelCfg convertHidlNanDataPathChannelCfgToLegacy( - NanDataPathChannelCfg type) { - switch (type) { - case NanDataPathChannelCfg::CHANNEL_NOT_REQUESTED: - return legacy_hal::NAN_DP_CHANNEL_NOT_REQUESTED; - case NanDataPathChannelCfg::REQUEST_CHANNEL_SETUP: - return legacy_hal::NAN_DP_REQUEST_CHANNEL_SETUP; - case NanDataPathChannelCfg::FORCE_CHANNEL_SETUP: - return legacy_hal::NAN_DP_FORCE_CHANNEL_SETUP; - } - CHECK(false); -} - -NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type) { - switch (type) { - case legacy_hal::NAN_STATUS_SUCCESS: - return NanStatusType::SUCCESS; - case legacy_hal::NAN_STATUS_INTERNAL_FAILURE: - return NanStatusType::INTERNAL_FAILURE; - case legacy_hal::NAN_STATUS_PROTOCOL_FAILURE: - return NanStatusType::PROTOCOL_FAILURE; - case legacy_hal::NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID: - return NanStatusType::INVALID_SESSION_ID; - case legacy_hal::NAN_STATUS_NO_RESOURCE_AVAILABLE: - return NanStatusType::NO_RESOURCES_AVAILABLE; - case legacy_hal::NAN_STATUS_INVALID_PARAM: - return NanStatusType::INVALID_ARGS; - case legacy_hal::NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID: - return NanStatusType::INVALID_PEER_ID; - case legacy_hal::NAN_STATUS_INVALID_NDP_ID: - return NanStatusType::INVALID_NDP_ID; - case legacy_hal::NAN_STATUS_NAN_NOT_ALLOWED: - return NanStatusType::NAN_NOT_ALLOWED; - case legacy_hal::NAN_STATUS_NO_OTA_ACK: - return NanStatusType::NO_OTA_ACK; - case legacy_hal::NAN_STATUS_ALREADY_ENABLED: - return NanStatusType::ALREADY_ENABLED; - case legacy_hal::NAN_STATUS_FOLLOWUP_QUEUE_FULL: - return NanStatusType::FOLLOWUP_TX_QUEUE_FULL; - case legacy_hal::NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED: - return NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED; - } - CHECK(false); -} - -void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len, - WifiNanStatus* wifiNanStatus) { - wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(type); - wifiNanStatus->description = safeConvertChar(str, max_len); -} - -bool convertHidlNanEnableRequestToLegacy(const V1_4::NanEnableRequest& hidl_request, - legacy_hal::NanEnableRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: null legacy_request"; - return false; - } - *legacy_request = {}; - - legacy_request->config_2dot4g_support = 1; - legacy_request->support_2dot4g_val = - hidl_request.operateInBand[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_support_5g = 1; - legacy_request->support_5g_val = - hidl_request.operateInBand[(size_t)NanBandIndex::NAN_BAND_5GHZ]; - legacy_request->config_hop_count_limit = 1; - legacy_request->hop_count_limit_val = hidl_request.hopCountMax; - legacy_request->master_pref = hidl_request.configParams.masterPref; - legacy_request->discovery_indication_cfg = 0; - legacy_request->discovery_indication_cfg |= - hidl_request.configParams.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; - legacy_request->discovery_indication_cfg |= - hidl_request.configParams.disableStartedClusterIndication ? 0x2 : 0x0; - legacy_request->discovery_indication_cfg |= - hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0; - legacy_request->config_sid_beacon = 1; - if (hidl_request.configParams.numberOfPublishServiceIdsInBeacon > 127) { - LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: " - "numberOfPublishServiceIdsInBeacon > 127"; - return false; - } - legacy_request->sid_beacon_val = - (hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | - (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1); - legacy_request->config_subscribe_sid_beacon = 1; - if (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon > 127) { - LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: " - "numberOfSubscribeServiceIdsInBeacon > 127"; - return false; - } - legacy_request->subscribe_sid_beacon_val = - (hidl_request.configParams.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | - (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon << 1); - legacy_request->config_rssi_window_size = 1; - legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize; - legacy_request->config_disc_mac_addr_randomization = 1; - legacy_request->disc_mac_addr_rand_interval_sec = - hidl_request.configParams.macAddressRandomizationIntervalSec; - legacy_request->config_2dot4g_rssi_close = 1; - if (hidl_request.configParams.bandSpecificConfig.size() != 3) { - LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: " - "bandSpecificConfig.size() != 3"; - return false; - } - legacy_request->rssi_close_2dot4g_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .rssiClose; - legacy_request->config_2dot4g_rssi_middle = 1; - legacy_request->rssi_middle_2dot4g_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .rssiMiddle; - legacy_request->config_2dot4g_rssi_proximity = 1; - legacy_request->rssi_proximity_2dot4g_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .rssiCloseProximity; - legacy_request->config_scan_params = 1; - legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .dwellTimeMs; - legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .scanPeriodSec; - legacy_request->config_dw.config_2dot4g_dw_band = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .validDiscoveryWindowIntervalVal; - legacy_request->config_dw.dw_2dot4g_interval_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .discoveryWindowIntervalVal; - legacy_request->config_5g_rssi_close = 1; - legacy_request->rssi_close_5g_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiClose; - legacy_request->config_5g_rssi_middle = 1; - legacy_request->rssi_middle_5g_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiMiddle; - legacy_request->config_5g_rssi_close_proximity = 1; - legacy_request->rssi_close_proximity_5g_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiCloseProximity; - legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .dwellTimeMs; - legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .scanPeriodSec; - legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .dwellTimeMs; - legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .scanPeriodSec; - legacy_request->config_dw.config_5g_dw_band = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .validDiscoveryWindowIntervalVal; - legacy_request->config_dw.dw_5g_interval_val = - hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .discoveryWindowIntervalVal; - if (hidl_request.debugConfigs.validClusterIdVals) { - legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdBottomRangeVal; - legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdTopRangeVal; - } else { // need 'else' since not configurable in legacy HAL - legacy_request->cluster_low = 0x0000; - legacy_request->cluster_high = 0xFFFF; - } - legacy_request->config_intf_addr = hidl_request.debugConfigs.validIntfAddrVal; - memcpy(legacy_request->intf_addr_val, hidl_request.debugConfigs.intfAddrVal.data(), 6); - legacy_request->config_oui = hidl_request.debugConfigs.validOuiVal; - legacy_request->oui_val = hidl_request.debugConfigs.ouiVal; - legacy_request->config_random_factor_force = - hidl_request.debugConfigs.validRandomFactorForceVal; - legacy_request->random_factor_force_val = hidl_request.debugConfigs.randomFactorForceVal; - legacy_request->config_hop_count_force = hidl_request.debugConfigs.validHopCountForceVal; - legacy_request->hop_count_force_val = hidl_request.debugConfigs.hopCountForceVal; - legacy_request->config_24g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal; - legacy_request->channel_24g_val = - hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_5g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal; - legacy_request->channel_5g_val = - hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; - legacy_request->config_2dot4g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal; - legacy_request->beacon_2dot4g_val = - hidl_request.debugConfigs.useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_5g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal; - legacy_request->beacon_5g_val = - hidl_request.debugConfigs.useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; - legacy_request->config_2dot4g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal; - legacy_request->sdf_2dot4g_val = - hidl_request.debugConfigs.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_5g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal; - legacy_request->sdf_5g_val = - hidl_request.debugConfigs.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; - - /* TODO: b/145609058 - * Missing updates needed to legacy_hal::NanEnableRequest and conversion to - * it for 6GHz band */ - - return true; -} - -bool convertHidlNanEnableRequest_1_6ToLegacy(const V1_4::NanEnableRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanEnableRequest_1_6ToLegacy: null legacy_request"; - return false; - } - - *legacy_request = {}; - if (!convertHidlNanEnableRequestToLegacy(hidl_request1, legacy_request)) { - return false; - } - - legacy_request->config_discovery_beacon_int = 1; - legacy_request->discovery_beacon_interval = hidl_request2.V1_5.V1_2.discoveryBeaconIntervalMs; - legacy_request->config_nss = 1; - legacy_request->nss = hidl_request2.V1_5.V1_2.numberOfSpatialStreamsInDiscovery; - legacy_request->config_dw_early_termination = 1; - legacy_request->enable_dw_termination = - hidl_request2.V1_5.V1_2.enableDiscoveryWindowEarlyTermination; - legacy_request->config_enable_ranging = 1; - legacy_request->enable_ranging = hidl_request2.V1_5.V1_2.enableRanging; - - legacy_request->config_enable_instant_mode = 1; - legacy_request->enable_instant_mode = hidl_request2.V1_5.enableInstantCommunicationMode; - legacy_request->config_instant_mode_channel = 1; - legacy_request->instant_mode_channel = hidl_request2.instantModeChannel; - - return true; -} - -bool convertHidlNanConfigRequest_1_6ToLegacy(const V1_4::NanConfigRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanConfigRequest_1_6ToLegacy: null legacy_request"; - return false; - } - - *legacy_request = {}; - if (!convertHidlNanConfigRequestToLegacy(hidl_request1, legacy_request)) { - return false; - } - - legacy_request->config_discovery_beacon_int = 1; - legacy_request->discovery_beacon_interval = hidl_request2.V1_5.V1_2.discoveryBeaconIntervalMs; - legacy_request->config_nss = 1; - legacy_request->nss = hidl_request2.V1_5.V1_2.numberOfSpatialStreamsInDiscovery; - legacy_request->config_dw_early_termination = 1; - legacy_request->enable_dw_termination = - hidl_request2.V1_5.V1_2.enableDiscoveryWindowEarlyTermination; - legacy_request->config_enable_ranging = 1; - legacy_request->enable_ranging = hidl_request2.V1_5.V1_2.enableRanging; - - legacy_request->config_enable_instant_mode = 1; - legacy_request->enable_instant_mode = hidl_request2.V1_5.enableInstantCommunicationMode; - legacy_request->config_instant_mode_channel = 1; - legacy_request->instant_mode_channel = hidl_request2.instantModeChannel; - - return true; -} - -bool convertHidlNanPublishRequestToLegacy(const V1_6::NanPublishRequest& hidl_request, - legacy_hal::NanPublishRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: null legacy_request"; - return false; - } - *legacy_request = {}; - - legacy_request->publish_id = hidl_request.baseConfigs.sessionId; - legacy_request->ttl = hidl_request.baseConfigs.ttlSec; - legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod; - legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount; - legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size(); - if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: service_name_len " - "too large"; - return false; - } - memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(), - legacy_request->service_name_len); - legacy_request->publish_match_indicator = - convertHidlNanMatchAlgToLegacy(hidl_request.baseConfigs.discoveryMatchIndicator); - legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size(); - if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " - "service_specific_info_len too large"; - return false; - } - memcpy(legacy_request->service_specific_info, - hidl_request.baseConfigs.serviceSpecificInfo.data(), - legacy_request->service_specific_info_len); - legacy_request->sdea_service_specific_info_len = - hidl_request.baseConfigs.extendedServiceSpecificInfo.size(); - if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " - "sdea_service_specific_info_len too large"; - return false; - } - memcpy(legacy_request->sdea_service_specific_info, - hidl_request.baseConfigs.extendedServiceSpecificInfo.data(), - legacy_request->sdea_service_specific_info_len); - legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size(); - if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " - "rx_match_filter_len too large"; - return false; - } - memcpy(legacy_request->rx_match_filter, hidl_request.baseConfigs.rxMatchFilter.data(), - legacy_request->rx_match_filter_len); - legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size(); - if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " - "tx_match_filter_len too large"; - return false; - } - memcpy(legacy_request->tx_match_filter, hidl_request.baseConfigs.txMatchFilter.data(), - legacy_request->tx_match_filter_len); - legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold; - legacy_request->recv_indication_cfg = 0; - legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0; - legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; - legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; - legacy_request->recv_indication_cfg |= 0x8; - legacy_request->cipher_type = (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; - - legacy_request->scid_len = hidl_request.baseConfigs.securityConfig.scid.size(); - if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: scid_len too large"; - return false; - } - memcpy(legacy_request->scid, hidl_request.baseConfigs.securityConfig.scid.data(), - legacy_request->scid_len); - - if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = - hidl_request.baseConfigs.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: invalid pmk_len"; - return false; - } - memcpy(legacy_request->key_info.body.pmk_info.pmk, - hidl_request.baseConfigs.securityConfig.pmk.data(), - legacy_request->key_info.body.pmk_info.pmk_len); - } - if (hidl_request.baseConfigs.securityConfig.securityType == - NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; - legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.baseConfigs.securityConfig.passphrase.size(); - if (legacy_request->key_info.body.passphrase_info.passphrase_len < - NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " - "passphrase_len too small"; - return false; - } - if (legacy_request->key_info.body.passphrase_info.passphrase_len > - NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " - "passphrase_len too large"; - return false; - } - memcpy(legacy_request->key_info.body.passphrase_info.passphrase, - hidl_request.baseConfigs.securityConfig.passphrase.data(), - legacy_request->key_info.body.passphrase_info.passphrase_len); - } - legacy_request->sdea_params.security_cfg = - (hidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - - legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired - ? legacy_hal::NAN_RANGING_ENABLE - : legacy_hal::NAN_RANGING_DISABLE; - legacy_request->ranging_cfg.ranging_interval_msec = - hidl_request.baseConfigs.rangingIntervalMsec; - legacy_request->ranging_cfg.config_ranging_indications = - hidl_request.baseConfigs.configRangingIndications; - legacy_request->ranging_cfg.distance_ingress_mm = - hidl_request.baseConfigs.distanceIngressCm * 10; - legacy_request->ranging_cfg.distance_egress_mm = hidl_request.baseConfigs.distanceEgressCm * 10; - legacy_request->ranging_auto_response = hidl_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->publish_type = convertHidlNanPublishTypeToLegacy(hidl_request.publishType); - legacy_request->tx_type = convertHidlNanTxTypeToLegacy(hidl_request.txType); - legacy_request->service_responder_policy = hidl_request.autoAcceptDataPathRequests - ? legacy_hal::NAN_SERVICE_ACCEPT_POLICY_ALL - : legacy_hal::NAN_SERVICE_ACCEPT_POLICY_NONE; - - return true; -} - -bool convertHidlNanSubscribeRequestToLegacy(const V1_0::NanSubscribeRequest& hidl_request, - legacy_hal::NanSubscribeRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: legacy_request is null"; - return false; - } - *legacy_request = {}; - - legacy_request->subscribe_id = hidl_request.baseConfigs.sessionId; - legacy_request->ttl = hidl_request.baseConfigs.ttlSec; - legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod; - legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount; - legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size(); - if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "service_name_len too large"; - return false; - } - memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(), - legacy_request->service_name_len); - legacy_request->subscribe_match_indicator = - convertHidlNanMatchAlgToLegacy(hidl_request.baseConfigs.discoveryMatchIndicator); - legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size(); - if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "service_specific_info_len too large"; - return false; - } - memcpy(legacy_request->service_specific_info, - hidl_request.baseConfigs.serviceSpecificInfo.data(), - legacy_request->service_specific_info_len); - legacy_request->sdea_service_specific_info_len = - hidl_request.baseConfigs.extendedServiceSpecificInfo.size(); - if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "sdea_service_specific_info_len too large"; - return false; - } - memcpy(legacy_request->sdea_service_specific_info, - hidl_request.baseConfigs.extendedServiceSpecificInfo.data(), - legacy_request->sdea_service_specific_info_len); - legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size(); - if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "rx_match_filter_len too large"; - return false; - } - memcpy(legacy_request->rx_match_filter, hidl_request.baseConfigs.rxMatchFilter.data(), - legacy_request->rx_match_filter_len); - legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size(); - if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "tx_match_filter_len too large"; - return false; - } - memcpy(legacy_request->tx_match_filter, hidl_request.baseConfigs.txMatchFilter.data(), - legacy_request->tx_match_filter_len); - legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold; - legacy_request->recv_indication_cfg = 0; - legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0; - legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; - legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; - legacy_request->cipher_type = (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; - if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = - hidl_request.baseConfigs.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: invalid pmk_len"; - return false; - } - memcpy(legacy_request->key_info.body.pmk_info.pmk, - hidl_request.baseConfigs.securityConfig.pmk.data(), - legacy_request->key_info.body.pmk_info.pmk_len); - } - if (hidl_request.baseConfigs.securityConfig.securityType == - NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; - legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.baseConfigs.securityConfig.passphrase.size(); - if (legacy_request->key_info.body.passphrase_info.passphrase_len < - NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "passphrase_len too small"; - return false; - } - if (legacy_request->key_info.body.passphrase_info.passphrase_len > - NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "passphrase_len too large"; - return false; - } - memcpy(legacy_request->key_info.body.passphrase_info.passphrase, - hidl_request.baseConfigs.securityConfig.passphrase.data(), - legacy_request->key_info.body.passphrase_info.passphrase_len); - } - legacy_request->sdea_params.security_cfg = - (hidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired - ? legacy_hal::NAN_RANGING_ENABLE - : legacy_hal::NAN_RANGING_DISABLE; - legacy_request->ranging_cfg.ranging_interval_msec = - hidl_request.baseConfigs.rangingIntervalMsec; - legacy_request->ranging_cfg.config_ranging_indications = - hidl_request.baseConfigs.configRangingIndications; - legacy_request->ranging_cfg.distance_ingress_mm = - hidl_request.baseConfigs.distanceIngressCm * 10; - legacy_request->ranging_cfg.distance_egress_mm = hidl_request.baseConfigs.distanceEgressCm * 10; - legacy_request->ranging_auto_response = hidl_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->subscribe_type = - convertHidlNanSubscribeTypeToLegacy(hidl_request.subscribeType); - legacy_request->serviceResponseFilter = convertHidlNanSrfTypeToLegacy(hidl_request.srfType); - legacy_request->serviceResponseInclude = hidl_request.srfRespondIfInAddressSet - ? legacy_hal::NAN_SRF_INCLUDE_RESPOND - : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND; - legacy_request->useServiceResponseFilter = - hidl_request.shouldUseSrf ? legacy_hal::NAN_USE_SRF : legacy_hal::NAN_DO_NOT_USE_SRF; - legacy_request->ssiRequiredForMatchIndication = - hidl_request.isSsiRequiredForMatch ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND - : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND; - legacy_request->num_intf_addr_present = hidl_request.intfAddr.size(); - if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) { - LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " - "num_intf_addr_present - too many"; - return false; - } - for (int i = 0; i < legacy_request->num_intf_addr_present; i++) { - memcpy(legacy_request->intf_addr[i], hidl_request.intfAddr[i].data(), 6); - } - - return true; -} - -bool convertHidlNanTransmitFollowupRequestToLegacy( - const NanTransmitFollowupRequest& hidl_request, - legacy_hal::NanTransmitFollowupRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: " - "legacy_request is null"; - return false; - } - *legacy_request = {}; - - legacy_request->publish_subscribe_id = hidl_request.discoverySessionId; - legacy_request->requestor_instance_id = hidl_request.peerId; - memcpy(legacy_request->addr, hidl_request.addr.data(), 6); - legacy_request->priority = hidl_request.isHighPriority ? legacy_hal::NAN_TX_PRIORITY_HIGH - : legacy_hal::NAN_TX_PRIORITY_NORMAL; - legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow - ? legacy_hal::NAN_TRANSMIT_IN_DW - : legacy_hal::NAN_TRANSMIT_IN_FAW; - legacy_request->service_specific_info_len = hidl_request.serviceSpecificInfo.size(); - if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { - LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: " - "service_specific_info_len too large"; - return false; - } - memcpy(legacy_request->service_specific_info, hidl_request.serviceSpecificInfo.data(), - legacy_request->service_specific_info_len); - legacy_request->sdea_service_specific_info_len = - hidl_request.extendedServiceSpecificInfo.size(); - if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { - LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: " - "sdea_service_specific_info_len too large"; - return false; - } - memcpy(legacy_request->sdea_service_specific_info, - hidl_request.extendedServiceSpecificInfo.data(), - legacy_request->sdea_service_specific_info_len); - legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0; - - return true; -} - -bool convertHidlNanConfigRequestToLegacy(const V1_4::NanConfigRequest& hidl_request, - legacy_hal::NanConfigRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: legacy_request is null"; - return false; - } - *legacy_request = {}; - - // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown - // defaults - legacy_request->master_pref = hidl_request.masterPref; - legacy_request->discovery_indication_cfg = 0; - legacy_request->discovery_indication_cfg |= - hidl_request.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; - legacy_request->discovery_indication_cfg |= - hidl_request.disableStartedClusterIndication ? 0x2 : 0x0; - legacy_request->discovery_indication_cfg |= - hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0; - legacy_request->config_sid_beacon = 1; - if (hidl_request.numberOfPublishServiceIdsInBeacon > 127) { - LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: " - "numberOfPublishServiceIdsInBeacon > 127"; - return false; - } - legacy_request->sid_beacon = (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | - (hidl_request.numberOfPublishServiceIdsInBeacon << 1); - legacy_request->config_subscribe_sid_beacon = 1; - if (hidl_request.numberOfSubscribeServiceIdsInBeacon > 127) { - LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: " - "numberOfSubscribeServiceIdsInBeacon > 127"; - return false; - } - legacy_request->subscribe_sid_beacon_val = - (hidl_request.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | - (hidl_request.numberOfSubscribeServiceIdsInBeacon << 1); - legacy_request->config_rssi_window_size = 1; - legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize; - legacy_request->config_disc_mac_addr_randomization = 1; - legacy_request->disc_mac_addr_rand_interval_sec = - hidl_request.macAddressRandomizationIntervalSec; - /* TODO : missing - legacy_request->config_2dot4g_rssi_close = 1; - legacy_request->rssi_close_2dot4g_val = - hidl_request.bandSpecificConfig[ - (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose; - legacy_request->config_2dot4g_rssi_middle = 1; - legacy_request->rssi_middle_2dot4g_val = - hidl_request.bandSpecificConfig[ - (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle; - legacy_request->config_2dot4g_rssi_proximity = 1; - legacy_request->rssi_proximity_2dot4g_val = - hidl_request.bandSpecificConfig[ - (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity; - */ - legacy_request->config_scan_params = 1; - legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs; - legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec; - legacy_request->config_dw.config_2dot4g_dw_band = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .validDiscoveryWindowIntervalVal; - legacy_request->config_dw.dw_2dot4g_interval_val = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .discoveryWindowIntervalVal; - /* TODO: missing - legacy_request->config_5g_rssi_close = 1; - legacy_request->rssi_close_5g_val = - hidl_request.bandSpecificConfig[ - (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose; - legacy_request->config_5g_rssi_middle = 1; - legacy_request->rssi_middle_5g_val = - hidl_request.bandSpecificConfig[ - (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle; - */ - legacy_request->config_5g_rssi_close_proximity = 1; - legacy_request->rssi_close_proximity_5g_val = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity; - legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs; - legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec; - legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs; - legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec; - legacy_request->config_dw.config_5g_dw_band = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .validDiscoveryWindowIntervalVal; - legacy_request->config_dw.dw_5g_interval_val = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .discoveryWindowIntervalVal; - /* TODO: b/145609058 - * Missing updates needed to legacy_hal::NanConfigRequest and conversion to - * it for 6GHz band */ - - return true; -} - -bool convertHidlNanDataPathInitiatorRequestToLegacy( - const V1_0::NanInitiateDataPathRequest& hidl_request, - legacy_hal::NanDataPathInitiatorRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "legacy_request is null"; - return false; - } - *legacy_request = {}; - - legacy_request->requestor_instance_id = hidl_request.peerId; - memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6); - legacy_request->channel_request_type = - convertHidlNanDataPathChannelCfgToLegacy(hidl_request.channelRequestType); - legacy_request->channel = hidl_request.channel; - if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "ifaceName too long"; - return false; - } - strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); - legacy_request->ndp_cfg.security_cfg = - (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); - if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "ndp_app_info_len too large"; - return false; - } - memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), - legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "invalid pmk_len"; - return false; - } - memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), - legacy_request->key_info.body.pmk_info.pmk_len); - } - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; - legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.securityConfig.passphrase.size(); - if (legacy_request->key_info.body.passphrase_info.passphrase_len < - NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "passphrase_len too small"; - return false; - } - if (legacy_request->key_info.body.passphrase_info.passphrase_len > - NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "passphrase_len too large"; - return false; - } - memcpy(legacy_request->key_info.body.passphrase_info.passphrase, - hidl_request.securityConfig.passphrase.data(), - legacy_request->key_info.body.passphrase_info.passphrase_len); - } - legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); - if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " - "service_name_len too large"; - return false; - } - memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), - legacy_request->service_name_len); - - return true; -} - -bool convertHidlNanDataPathInitiatorRequest_1_6ToLegacy( - const V1_6::NanInitiateDataPathRequest& hidl_request, - legacy_hal::NanDataPathInitiatorRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "legacy_request is null"; - return false; - } - *legacy_request = {}; - - legacy_request->requestor_instance_id = hidl_request.peerId; - memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6); - legacy_request->channel_request_type = - convertHidlNanDataPathChannelCfgToLegacy(hidl_request.channelRequestType); - legacy_request->channel = hidl_request.channel; - if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "ifaceName too long"; - return false; - } - strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); - legacy_request->ndp_cfg.security_cfg = - (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); - if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "ndp_app_info_len too large"; - return false; - } - memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), - legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "invalid pmk_len"; - return false; - } - memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), - legacy_request->key_info.body.pmk_info.pmk_len); - } - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; - legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.securityConfig.passphrase.size(); - if (legacy_request->key_info.body.passphrase_info.passphrase_len < - NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "passphrase_len too small"; - return false; - } - if (legacy_request->key_info.body.passphrase_info.passphrase_len > - NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "passphrase_len too large"; - return false; - } - memcpy(legacy_request->key_info.body.passphrase_info.passphrase, - hidl_request.securityConfig.passphrase.data(), - legacy_request->key_info.body.passphrase_info.passphrase_len); - } - legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); - if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " - "service_name_len too large"; - return false; - } - memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), - legacy_request->service_name_len); - legacy_request->scid_len = hidl_request.securityConfig.scid.size(); - if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: scid_len too large"; - return false; - } - memcpy(legacy_request->scid, hidl_request.securityConfig.scid.data(), legacy_request->scid_len); - - return true; -} - -bool convertHidlNanDataPathIndicationResponseToLegacy( - const V1_0::NanRespondToDataPathIndicationRequest& hidl_request, - legacy_hal::NanDataPathIndicationResponse* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "legacy_request is null"; - return false; - } - *legacy_request = {}; - - legacy_request->rsp_code = hidl_request.acceptRequest ? legacy_hal::NAN_DP_REQUEST_ACCEPT - : legacy_hal::NAN_DP_REQUEST_REJECT; - legacy_request->ndp_instance_id = hidl_request.ndpInstanceId; - if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "ifaceName too long"; - return false; - } - strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); - legacy_request->ndp_cfg.security_cfg = - (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); - if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "ndp_app_info_len too large"; - return false; - } - memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), - legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "invalid pmk_len"; - return false; - } - memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), - legacy_request->key_info.body.pmk_info.pmk_len); - } - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; - legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.securityConfig.passphrase.size(); - if (legacy_request->key_info.body.passphrase_info.passphrase_len < - NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "passphrase_len too small"; - return false; - } - if (legacy_request->key_info.body.passphrase_info.passphrase_len > - NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "passphrase_len too large"; - return false; - } - memcpy(legacy_request->key_info.body.passphrase_info.passphrase, - hidl_request.securityConfig.passphrase.data(), - legacy_request->key_info.body.passphrase_info.passphrase_len); - } - legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); - if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " - "service_name_len too large"; - return false; - } - memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), - legacy_request->service_name_len); - - return true; -} - -bool convertHidlNanDataPathIndicationResponse_1_6ToLegacy( - const V1_6::NanRespondToDataPathIndicationRequest& hidl_request, - legacy_hal::NanDataPathIndicationResponse* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "legacy_request is null"; - return false; - } - *legacy_request = {}; - - legacy_request->rsp_code = hidl_request.acceptRequest ? legacy_hal::NAN_DP_REQUEST_ACCEPT - : legacy_hal::NAN_DP_REQUEST_REJECT; - legacy_request->ndp_instance_id = hidl_request.ndpInstanceId; - if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "ifaceName too long"; - return false; - } - strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); - legacy_request->ndp_cfg.security_cfg = - (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); - if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "ndp_app_info_len too large"; - return false; - } - memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), - legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "invalid pmk_len"; - return false; - } - memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), - legacy_request->key_info.body.pmk_info.pmk_len); - } - if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; - legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.securityConfig.passphrase.size(); - if (legacy_request->key_info.body.passphrase_info.passphrase_len < - NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "passphrase_len too small"; - return false; - } - if (legacy_request->key_info.body.passphrase_info.passphrase_len > - NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "passphrase_len too large"; - return false; - } - memcpy(legacy_request->key_info.body.passphrase_info.passphrase, - hidl_request.securityConfig.passphrase.data(), - legacy_request->key_info.body.passphrase_info.passphrase_len); - } - legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); - if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " - "service_name_len too large"; - return false; - } - memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), - legacy_request->service_name_len); - legacy_request->scid_len = hidl_request.securityConfig.scid.size(); - if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { - LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: scid_len too large"; - return false; - } - memcpy(legacy_request->scid, hidl_request.securityConfig.scid.data(), legacy_request->scid_len); - - return true; -} - -bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& legacy_response, - WifiNanStatus* wifiNanStatus) { - if (!wifiNanStatus) { - LOG(ERROR) << "convertLegacyNanResponseHeaderToHidl: wifiNanStatus is null"; - return false; - } - *wifiNanStatus = {}; - - convertToWifiNanStatus(legacy_response.status, legacy_response.nan_error, - sizeof(legacy_response.nan_error), wifiNanStatus); - return true; -} - -bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilities& legacy_response, - V1_6::NanCapabilities* hidl_response) { - if (!hidl_response) { - LOG(ERROR) << "convertLegacyNanCapabilitiesResponseToHidl: " - "hidl_response is null"; - return false; - } - *hidl_response = {}; - - hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters; - hidl_response->maxPublishes = legacy_response.max_publishes; - hidl_response->maxSubscribes = legacy_response.max_subscribes; - hidl_response->maxServiceNameLen = legacy_response.max_service_name_len; - hidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len; - hidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len; - hidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len; - hidl_response->maxExtendedServiceSpecificInfoLen = - legacy_response.max_sdea_service_specific_info_len; - hidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces; - hidl_response->maxNdpSessions = legacy_response.max_ndp_sessions; - hidl_response->maxAppInfoLen = legacy_response.max_app_info_len; - hidl_response->maxQueuedTransmitFollowupMsgs = - legacy_response.max_queued_transmit_followup_msgs; - hidl_response->maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address; - hidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported; - hidl_response->instantCommunicationModeSupportFlag = legacy_response.is_instant_mode_supported; - - return true; -} - -bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, - V1_6::NanMatchInd* hidl_ind) { - if (!hidl_ind) { - LOG(ERROR) << "convertLegacyNanMatchIndToHidl: hidl_ind is null"; - return false; - } - *hidl_ind = {}; - - hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; - hidl_ind->peerId = legacy_ind.requestor_instance_id; - hidl_ind->addr = hidl_array(legacy_ind.addr); - hidl_ind->serviceSpecificInfo = std::vector( - legacy_ind.service_specific_info, - legacy_ind.service_specific_info + legacy_ind.service_specific_info_len); - hidl_ind->extendedServiceSpecificInfo = std::vector( - legacy_ind.sdea_service_specific_info, - legacy_ind.sdea_service_specific_info + legacy_ind.sdea_service_specific_info_len); - hidl_ind->matchFilter = - std::vector(legacy_ind.sdf_match_filter, - legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len); - hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1; - hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1; - hidl_ind->rssiValue = legacy_ind.rssi_value; - hidl_ind->peerCipherType = (V1_6::NanCipherSuiteType)legacy_ind.peer_cipher_type; - hidl_ind->peerRequiresSecurityEnabledInNdp = - legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; - hidl_ind->peerRequiresRanging = - legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE; - hidl_ind->rangingMeasurementInMm = legacy_ind.range_info.range_measurement_mm; - hidl_ind->rangingIndicationType = legacy_ind.range_info.ranging_event_type; - hidl_ind->scid = std::vector(legacy_ind.scid, legacy_ind.scid + legacy_ind.scid_len); - return true; -} - -bool convertLegacyNanFollowupIndToHidl(const legacy_hal::NanFollowupInd& legacy_ind, - NanFollowupReceivedInd* hidl_ind) { - if (!hidl_ind) { - LOG(ERROR) << "convertLegacyNanFollowupIndToHidl: hidl_ind is null"; - return false; - } - *hidl_ind = {}; - - hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; - hidl_ind->peerId = legacy_ind.requestor_instance_id; - hidl_ind->addr = hidl_array(legacy_ind.addr); - hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1; - hidl_ind->serviceSpecificInfo = std::vector( - legacy_ind.service_specific_info, - legacy_ind.service_specific_info + legacy_ind.service_specific_info_len); - hidl_ind->extendedServiceSpecificInfo = std::vector( - legacy_ind.sdea_service_specific_info, - legacy_ind.sdea_service_specific_info + legacy_ind.sdea_service_specific_info_len); - - return true; -} - -bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, - NanDataPathRequestInd* hidl_ind) { - if (!hidl_ind) { - LOG(ERROR) << "convertLegacyNanDataPathRequestIndToHidl: hidl_ind is null"; - return false; - } - *hidl_ind = {}; - - hidl_ind->discoverySessionId = legacy_ind.service_instance_id; - hidl_ind->peerDiscMacAddr = hidl_array(legacy_ind.peer_disc_mac_addr); - hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id; - hidl_ind->securityRequired = - legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; - hidl_ind->appInfo = std::vector( - legacy_ind.app_info.ndp_app_info, - legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len); - - return true; -} - -bool convertLegacyNdpChannelInfoToHidl(const legacy_hal::NanChannelInfo& legacy_struct, - V1_6::NanDataPathChannelInfo* hidl_struct) { - if (!hidl_struct) { - LOG(ERROR) << "convertLegacyNdpChannelInfoToHidl: hidl_struct is null"; - return false; - } - *hidl_struct = {}; - - hidl_struct->channelFreq = legacy_struct.channel; - hidl_struct->channelBandwidth = convertLegacyWifiChannelWidthToHidl( - (legacy_hal::wifi_channel_width)legacy_struct.bandwidth); - hidl_struct->numSpatialStreams = legacy_struct.nss; - - return true; -} - -bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, - V1_6::NanDataPathConfirmInd* hidl_ind) { - if (!hidl_ind) { - LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null"; - return false; - } - *hidl_ind = {}; - - hidl_ind->V1_0.ndpInstanceId = legacy_ind.ndp_instance_id; - hidl_ind->V1_0.dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT; - hidl_ind->V1_0.peerNdiMacAddr = hidl_array(legacy_ind.peer_ndi_mac_addr); - hidl_ind->V1_0.appInfo = std::vector( - legacy_ind.app_info.ndp_app_info, - legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len); - hidl_ind->V1_0.status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code); - hidl_ind->V1_0.status.description = ""; // TODO: b/34059183 - - std::vector channelInfo; - for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { - V1_6::NanDataPathChannelInfo hidl_struct; - if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { - return false; - } - channelInfo.push_back(hidl_struct); - } - hidl_ind->channelInfo = channelInfo; - - return true; -} - -bool convertLegacyNanDataPathScheduleUpdateIndToHidl( - const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, - V1_6::NanDataPathScheduleUpdateInd* hidl_ind) { - if (!hidl_ind) { - LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToHidl: " - "hidl_ind is null"; - return false; - } - *hidl_ind = {}; - - hidl_ind->peerDiscoveryAddress = hidl_array(legacy_ind.peer_mac_addr); - std::vector channelInfo; - for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { - V1_6::NanDataPathChannelInfo hidl_struct; - if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { - return false; - } - channelInfo.push_back(hidl_struct); - } - hidl_ind->channelInfo = channelInfo; - std::vector ndpInstanceIds; - for (unsigned int i = 0; i < legacy_ind.num_ndp_instances; ++i) { - ndpInstanceIds.push_back(legacy_ind.ndp_instance_id[i]); - } - hidl_ind->ndpInstanceIds = ndpInstanceIds; - - return true; -} - -legacy_hal::wifi_rtt_type convertHidlRttTypeToLegacy(RttType type) { - switch (type) { - case RttType::ONE_SIDED: - return legacy_hal::RTT_TYPE_1_SIDED; - case RttType::TWO_SIDED: - return legacy_hal::RTT_TYPE_2_SIDED; - }; - CHECK(false); -} - -RttType convertLegacyRttTypeToHidl(legacy_hal::wifi_rtt_type type) { - switch (type) { - case legacy_hal::RTT_TYPE_1_SIDED: - return RttType::ONE_SIDED; - case legacy_hal::RTT_TYPE_2_SIDED: - return RttType::TWO_SIDED; - }; - CHECK(false) << "Unknown legacy type: " << type; -} - -legacy_hal::rtt_peer_type convertHidlRttPeerTypeToLegacy(RttPeerType type) { - switch (type) { - case RttPeerType::AP: - return legacy_hal::RTT_PEER_AP; - case RttPeerType::STA: - return legacy_hal::RTT_PEER_STA; - case RttPeerType::P2P_GO: - return legacy_hal::RTT_PEER_P2P_GO; - case RttPeerType::P2P_CLIENT: - return legacy_hal::RTT_PEER_P2P_CLIENT; - case RttPeerType::NAN: - return legacy_hal::RTT_PEER_NAN; - }; - CHECK(false); -} - -legacy_hal::wifi_channel_width convertHidlWifiChannelWidthToLegacy(WifiChannelWidthInMhz type) { - switch (type) { - case WifiChannelWidthInMhz::WIDTH_20: - return legacy_hal::WIFI_CHAN_WIDTH_20; - case WifiChannelWidthInMhz::WIDTH_40: - return legacy_hal::WIFI_CHAN_WIDTH_40; - case WifiChannelWidthInMhz::WIDTH_80: - return legacy_hal::WIFI_CHAN_WIDTH_80; - case WifiChannelWidthInMhz::WIDTH_160: - return legacy_hal::WIFI_CHAN_WIDTH_160; - case WifiChannelWidthInMhz::WIDTH_80P80: - return legacy_hal::WIFI_CHAN_WIDTH_80P80; - case WifiChannelWidthInMhz::WIDTH_5: - return legacy_hal::WIFI_CHAN_WIDTH_5; - case WifiChannelWidthInMhz::WIDTH_10: - return legacy_hal::WIFI_CHAN_WIDTH_10; - case V1_6::WifiChannelWidthInMhz::WIDTH_320: - return legacy_hal::WIFI_CHAN_WIDTH_320; - case WifiChannelWidthInMhz::WIDTH_INVALID: - return legacy_hal::WIFI_CHAN_WIDTH_INVALID; - }; - CHECK(false); -} - -V1_6::WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl( - legacy_hal::wifi_channel_width type) { - switch (type) { - case legacy_hal::WIFI_CHAN_WIDTH_20: - return WifiChannelWidthInMhz::WIDTH_20; - case legacy_hal::WIFI_CHAN_WIDTH_40: - return WifiChannelWidthInMhz::WIDTH_40; - case legacy_hal::WIFI_CHAN_WIDTH_80: - return WifiChannelWidthInMhz::WIDTH_80; - case legacy_hal::WIFI_CHAN_WIDTH_160: - return WifiChannelWidthInMhz::WIDTH_160; - case legacy_hal::WIFI_CHAN_WIDTH_80P80: - return WifiChannelWidthInMhz::WIDTH_80P80; - case legacy_hal::WIFI_CHAN_WIDTH_5: - return WifiChannelWidthInMhz::WIDTH_5; - case legacy_hal::WIFI_CHAN_WIDTH_10: - return WifiChannelWidthInMhz::WIDTH_10; - case legacy_hal::WIFI_CHAN_WIDTH_320: - return V1_6::WifiChannelWidthInMhz::WIDTH_320; - default: - return WifiChannelWidthInMhz::WIDTH_INVALID; - }; -} - -legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(V1_6::RttPreamble type) { - switch (type) { - case V1_6::RttPreamble::LEGACY: - return legacy_hal::WIFI_RTT_PREAMBLE_LEGACY; - case V1_6::RttPreamble::HT: - return legacy_hal::WIFI_RTT_PREAMBLE_HT; - case V1_6::RttPreamble::VHT: - return legacy_hal::WIFI_RTT_PREAMBLE_VHT; - case V1_6::RttPreamble::HE: - return legacy_hal::WIFI_RTT_PREAMBLE_HE; - case V1_6::RttPreamble::EHT: - return legacy_hal::WIFI_RTT_PREAMBLE_EHT; - }; - CHECK(false); -} - -V1_6::RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) { - switch (type) { - case legacy_hal::WIFI_RTT_PREAMBLE_LEGACY: - return V1_6::RttPreamble::LEGACY; - case legacy_hal::WIFI_RTT_PREAMBLE_HT: - return V1_6::RttPreamble::HT; - case legacy_hal::WIFI_RTT_PREAMBLE_VHT: - return V1_6::RttPreamble::VHT; - case legacy_hal::WIFI_RTT_PREAMBLE_HE: - return V1_6::RttPreamble::HE; - case legacy_hal::WIFI_RTT_PREAMBLE_EHT: - return V1_6::RttPreamble::EHT; - }; - CHECK(false) << "Unknown legacy type: " << type; -} - -legacy_hal::wifi_rtt_bw convertHidlRttBwToLegacy(RttBw type) { - switch (type) { - case RttBw::BW_5MHZ: - return legacy_hal::WIFI_RTT_BW_5; - case RttBw::BW_10MHZ: - return legacy_hal::WIFI_RTT_BW_10; - case RttBw::BW_20MHZ: - return legacy_hal::WIFI_RTT_BW_20; - case RttBw::BW_40MHZ: - return legacy_hal::WIFI_RTT_BW_40; - case RttBw::BW_80MHZ: - return legacy_hal::WIFI_RTT_BW_80; - case RttBw::BW_160MHZ: - return legacy_hal::WIFI_RTT_BW_160; - case RttBw::BW_320MHZ: - return legacy_hal::WIFI_RTT_BW_320; - }; - CHECK(false); -} - -RttBw convertLegacyRttBwToHidl(legacy_hal::wifi_rtt_bw type) { - switch (type) { - case legacy_hal::WIFI_RTT_BW_5: - return RttBw::BW_5MHZ; - case legacy_hal::WIFI_RTT_BW_10: - return RttBw::BW_10MHZ; - case legacy_hal::WIFI_RTT_BW_20: - return RttBw::BW_20MHZ; - case legacy_hal::WIFI_RTT_BW_40: - return RttBw::BW_40MHZ; - case legacy_hal::WIFI_RTT_BW_80: - return RttBw::BW_80MHZ; - case legacy_hal::WIFI_RTT_BW_160: - return RttBw::BW_160MHZ; - case legacy_hal::WIFI_RTT_BW_320: - return RttBw::BW_320MHZ; - }; - CHECK(false) << "Unknown legacy type: " << type; -} - -legacy_hal::wifi_motion_pattern convertHidlRttMotionPatternToLegacy(RttMotionPattern type) { - switch (type) { - case RttMotionPattern::NOT_EXPECTED: - return legacy_hal::WIFI_MOTION_NOT_EXPECTED; - case RttMotionPattern::EXPECTED: - return legacy_hal::WIFI_MOTION_EXPECTED; - case RttMotionPattern::UNKNOWN: - return legacy_hal::WIFI_MOTION_UNKNOWN; - }; - CHECK(false); -} - -V1_6::WifiRatePreamble convertLegacyWifiRatePreambleToHidl(uint8_t preamble) { - switch (preamble) { - case 0: - return V1_6::WifiRatePreamble::OFDM; - case 1: - return V1_6::WifiRatePreamble::CCK; - case 2: - return V1_6::WifiRatePreamble::HT; - case 3: - return V1_6::WifiRatePreamble::VHT; - case 4: - return V1_6::WifiRatePreamble::HE; - case 5: - return V1_6::WifiRatePreamble::EHT; - default: - return V1_6::WifiRatePreamble::RESERVED; - }; - CHECK(false) << "Unknown legacy preamble: " << preamble; -} - -WifiRateNss convertLegacyWifiRateNssToHidl(uint8_t nss) { - switch (nss) { - case 0: - return WifiRateNss::NSS_1x1; - case 1: - return WifiRateNss::NSS_2x2; - case 2: - return WifiRateNss::NSS_3x3; - case 3: - return WifiRateNss::NSS_4x4; - }; - CHECK(false) << "Unknown legacy nss: " << nss; - return {}; -} - -RttStatus convertLegacyRttStatusToHidl(legacy_hal::wifi_rtt_status status) { - switch (status) { - case legacy_hal::RTT_STATUS_SUCCESS: - return RttStatus::SUCCESS; - case legacy_hal::RTT_STATUS_FAILURE: - return RttStatus::FAILURE; - case legacy_hal::RTT_STATUS_FAIL_NO_RSP: - return RttStatus::FAIL_NO_RSP; - case legacy_hal::RTT_STATUS_FAIL_REJECTED: - return RttStatus::FAIL_REJECTED; - case legacy_hal::RTT_STATUS_FAIL_NOT_SCHEDULED_YET: - return RttStatus::FAIL_NOT_SCHEDULED_YET; - case legacy_hal::RTT_STATUS_FAIL_TM_TIMEOUT: - return RttStatus::FAIL_TM_TIMEOUT; - case legacy_hal::RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL: - return RttStatus::FAIL_AP_ON_DIFF_CHANNEL; - case legacy_hal::RTT_STATUS_FAIL_NO_CAPABILITY: - return RttStatus::FAIL_NO_CAPABILITY; - case legacy_hal::RTT_STATUS_ABORTED: - return RttStatus::ABORTED; - case legacy_hal::RTT_STATUS_FAIL_INVALID_TS: - return RttStatus::FAIL_INVALID_TS; - case legacy_hal::RTT_STATUS_FAIL_PROTOCOL: - return RttStatus::FAIL_PROTOCOL; - case legacy_hal::RTT_STATUS_FAIL_SCHEDULE: - return RttStatus::FAIL_SCHEDULE; - case legacy_hal::RTT_STATUS_FAIL_BUSY_TRY_LATER: - return RttStatus::FAIL_BUSY_TRY_LATER; - case legacy_hal::RTT_STATUS_INVALID_REQ: - return RttStatus::INVALID_REQ; - case legacy_hal::RTT_STATUS_NO_WIFI: - return RttStatus::NO_WIFI; - case legacy_hal::RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE: - return RttStatus::FAIL_FTM_PARAM_OVERRIDE; - case legacy_hal::RTT_STATUS_NAN_RANGING_PROTOCOL_FAILURE: - return RttStatus::FAILURE; // TODO: add HIDL enumeration - case legacy_hal::RTT_STATUS_NAN_RANGING_CONCURRENCY_NOT_SUPPORTED: - return RttStatus::FAILURE; // TODO: add HIDL enumeration - }; - CHECK(false) << "Unknown legacy status: " << status; -} - -bool convertHidlWifiChannelInfoToLegacy(const WifiChannelInfo& hidl_info, - legacy_hal::wifi_channel_info* legacy_info) { - if (!legacy_info) { - return false; - } - *legacy_info = {}; - legacy_info->width = convertHidlWifiChannelWidthToLegacy(hidl_info.width); - legacy_info->center_freq = hidl_info.centerFreq; - legacy_info->center_freq0 = hidl_info.centerFreq0; - legacy_info->center_freq1 = hidl_info.centerFreq1; - return true; -} - -bool convertLegacyWifiChannelInfoToHidl(const legacy_hal::wifi_channel_info& legacy_info, - WifiChannelInfo* hidl_info) { - if (!hidl_info) { - return false; - } - *hidl_info = {}; - hidl_info->width = convertLegacyWifiChannelWidthToHidl(legacy_info.width); - hidl_info->centerFreq = legacy_info.center_freq; - hidl_info->centerFreq0 = legacy_info.center_freq0; - hidl_info->centerFreq1 = legacy_info.center_freq1; - return true; -} - -bool convertHidlRttConfigToLegacy(const V1_6::RttConfig& hidl_config, - legacy_hal::wifi_rtt_config* legacy_config) { - if (!legacy_config) { - return false; - } - *legacy_config = {}; - CHECK(hidl_config.addr.size() == sizeof(legacy_config->addr)); - memcpy(legacy_config->addr, hidl_config.addr.data(), hidl_config.addr.size()); - legacy_config->type = convertHidlRttTypeToLegacy(hidl_config.type); - legacy_config->peer = convertHidlRttPeerTypeToLegacy(hidl_config.peer); - if (!convertHidlWifiChannelInfoToLegacy(hidl_config.channel, &legacy_config->channel)) { - return false; - } - legacy_config->burst_period = hidl_config.burstPeriod; - legacy_config->num_burst = hidl_config.numBurst; - legacy_config->num_frames_per_burst = hidl_config.numFramesPerBurst; - legacy_config->num_retries_per_rtt_frame = hidl_config.numRetriesPerRttFrame; - legacy_config->num_retries_per_ftmr = hidl_config.numRetriesPerFtmr; - legacy_config->LCI_request = hidl_config.mustRequestLci; - legacy_config->LCR_request = hidl_config.mustRequestLcr; - legacy_config->burst_duration = hidl_config.burstDuration; - legacy_config->preamble = convertHidlRttPreambleToLegacy(hidl_config.preamble); - legacy_config->bw = convertHidlRttBwToLegacy(hidl_config.bw); - return true; -} - -bool convertHidlVectorOfRttConfigToLegacy( - const std::vector& hidl_configs, - std::vector* legacy_configs) { - if (!legacy_configs) { - return false; - } - *legacy_configs = {}; - for (const auto& hidl_config : hidl_configs) { - legacy_hal::wifi_rtt_config legacy_config; - if (!convertHidlRttConfigToLegacy(hidl_config, &legacy_config)) { - return false; - } - legacy_configs->push_back(legacy_config); - } - return true; -} - -bool convertHidlRttLciInformationToLegacy(const RttLciInformation& hidl_info, - legacy_hal::wifi_lci_information* legacy_info) { - if (!legacy_info) { - return false; - } - *legacy_info = {}; - legacy_info->latitude = hidl_info.latitude; - legacy_info->longitude = hidl_info.longitude; - legacy_info->altitude = hidl_info.altitude; - legacy_info->latitude_unc = hidl_info.latitudeUnc; - legacy_info->longitude_unc = hidl_info.longitudeUnc; - legacy_info->altitude_unc = hidl_info.altitudeUnc; - legacy_info->motion_pattern = convertHidlRttMotionPatternToLegacy(hidl_info.motionPattern); - legacy_info->floor = hidl_info.floor; - legacy_info->height_above_floor = hidl_info.heightAboveFloor; - legacy_info->height_unc = hidl_info.heightUnc; - return true; -} - -bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info, - legacy_hal::wifi_lcr_information* legacy_info) { - if (!legacy_info) { - return false; - } - *legacy_info = {}; - CHECK(hidl_info.countryCode.size() == sizeof(legacy_info->country_code)); - memcpy(legacy_info->country_code, hidl_info.countryCode.data(), hidl_info.countryCode.size()); - if (hidl_info.civicInfo.size() > sizeof(legacy_info->civic_info)) { - return false; - } - legacy_info->length = hidl_info.civicInfo.size(); - memcpy(legacy_info->civic_info, hidl_info.civicInfo.c_str(), hidl_info.civicInfo.size()); - return true; -} - -bool convertHidlRttResponderToLegacy(const V1_6::RttResponder& hidl_responder, - legacy_hal::wifi_rtt_responder* legacy_responder) { - if (!legacy_responder) { - return false; - } - *legacy_responder = {}; - if (!convertHidlWifiChannelInfoToLegacy(hidl_responder.channel, &legacy_responder->channel)) { - return false; - } - legacy_responder->preamble = convertHidlRttPreambleToLegacy(hidl_responder.preamble); - return true; -} - -bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder, - V1_6::RttResponder* hidl_responder) { - if (!hidl_responder) { - return false; - } - *hidl_responder = {}; - if (!convertLegacyWifiChannelInfoToHidl(legacy_responder.channel, &hidl_responder->channel)) { - return false; - } - hidl_responder->preamble = convertLegacyRttPreambleToHidl(legacy_responder.preamble); - return true; -} - -bool convertLegacyRttCapabilitiesToHidl( - const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - V1_6::RttCapabilities* hidl_capabilities) { - if (!hidl_capabilities) { - return false; - } - *hidl_capabilities = {}; - hidl_capabilities->rttOneSidedSupported = legacy_capabilities.rtt_one_sided_supported; - hidl_capabilities->rttFtmSupported = legacy_capabilities.rtt_ftm_supported; - hidl_capabilities->lciSupported = legacy_capabilities.lci_support; - hidl_capabilities->lcrSupported = legacy_capabilities.lcr_support; - hidl_capabilities->responderSupported = legacy_capabilities.responder_supported; - hidl_capabilities->preambleSupport = 0; - for (const auto flag : {legacy_hal::WIFI_RTT_PREAMBLE_LEGACY, legacy_hal::WIFI_RTT_PREAMBLE_HT, - legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE, - legacy_hal::WIFI_RTT_PREAMBLE_EHT}) { - if (legacy_capabilities.preamble_support & flag) { - hidl_capabilities->preambleSupport |= - static_cast::type>( - convertLegacyRttPreambleToHidl(flag)); - } - } - hidl_capabilities->bwSupport = 0; - for (const auto flag : - {legacy_hal::WIFI_RTT_BW_5, legacy_hal::WIFI_RTT_BW_10, legacy_hal::WIFI_RTT_BW_20, - legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160, - legacy_hal::WIFI_RTT_BW_320}) { - if (legacy_capabilities.bw_support & flag) { - hidl_capabilities->bwSupport |= - static_cast::type>(convertLegacyRttBwToHidl(flag)); - } - } - hidl_capabilities->mcVersion = legacy_capabilities.mc_version; - return true; -} - -bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, - V1_6::WifiRateInfo* hidl_rate) { - if (!hidl_rate) { - return false; - } - *hidl_rate = {}; - hidl_rate->preamble = convertLegacyWifiRatePreambleToHidl(legacy_rate.preamble); - hidl_rate->nss = convertLegacyWifiRateNssToHidl(legacy_rate.nss); - hidl_rate->bw = convertLegacyWifiChannelWidthToHidl( - static_cast(legacy_rate.bw)); - hidl_rate->rateMcsIdx = legacy_rate.rateMcsIdx; - hidl_rate->bitRateInKbps = legacy_rate.bitrate; - return true; -} - -bool convertLegacyRttResultToHidl(const legacy_hal::wifi_rtt_result& legacy_result, - V1_6::RttResult* hidl_result) { - if (!hidl_result) { - return false; - } - *hidl_result = {}; - CHECK(sizeof(legacy_result.addr) == hidl_result->addr.size()); - memcpy(hidl_result->addr.data(), legacy_result.addr, sizeof(legacy_result.addr)); - hidl_result->burstNum = legacy_result.burst_num; - hidl_result->measurementNumber = legacy_result.measurement_number; - hidl_result->successNumber = legacy_result.success_number; - hidl_result->numberPerBurstPeer = legacy_result.number_per_burst_peer; - hidl_result->status = convertLegacyRttStatusToHidl(legacy_result.status); - hidl_result->retryAfterDuration = legacy_result.retry_after_duration; - hidl_result->type = convertLegacyRttTypeToHidl(legacy_result.type); - hidl_result->rssi = legacy_result.rssi; - hidl_result->rssiSpread = legacy_result.rssi_spread; - if (!convertLegacyWifiRateInfoToHidl(legacy_result.tx_rate, &hidl_result->txRate)) { - return false; - } - if (!convertLegacyWifiRateInfoToHidl(legacy_result.rx_rate, &hidl_result->rxRate)) { - return false; - } - hidl_result->rtt = legacy_result.rtt; - hidl_result->rttSd = legacy_result.rtt_sd; - hidl_result->rttSpread = legacy_result.rtt_spread; - hidl_result->distanceInMm = legacy_result.distance_mm; - hidl_result->distanceSdInMm = legacy_result.distance_sd_mm; - hidl_result->distanceSpreadInMm = legacy_result.distance_spread_mm; - hidl_result->timeStampInUs = legacy_result.ts; - hidl_result->burstDurationInMs = legacy_result.burst_duration; - hidl_result->negotiatedBurstNum = legacy_result.negotiated_burst_num; - if (legacy_result.LCI && !convertLegacyIeToHidl(*legacy_result.LCI, &hidl_result->lci)) { - return false; - } - if (legacy_result.LCR && !convertLegacyIeToHidl(*legacy_result.LCR, &hidl_result->lcr)) { - return false; - } - return true; -} - -bool convertLegacyVectorOfRttResultToHidl( - const std::vector& legacy_results, - std::vector* hidl_results) { - if (!hidl_results) { - return false; - } - *hidl_results = {}; - for (const auto legacy_result : legacy_results) { - V1_6::RttResult hidl_result; - if (!convertLegacyRttResultToHidl(*legacy_result, &hidl_result)) { - return false; - } - hidl_results->push_back(hidl_result); - } - return true; -} - -legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy(IfaceType hidl_interface_type) { - switch (hidl_interface_type) { - case IfaceType::STA: - return legacy_hal::WIFI_INTERFACE_TYPE_STA; - case IfaceType::AP: - return legacy_hal::WIFI_INTERFACE_TYPE_AP; - case IfaceType::P2P: - return legacy_hal::WIFI_INTERFACE_TYPE_P2P; - case IfaceType::NAN: - return legacy_hal::WIFI_INTERFACE_TYPE_NAN; - } - CHECK(false); -} - -legacy_hal::wifi_multi_sta_use_case convertHidlMultiStaUseCaseToLegacy( - V1_5::IWifiChip::MultiStaUseCase use_case) { - switch (use_case) { - case V1_5::IWifiChip::MultiStaUseCase::DUAL_STA_TRANSIENT_PREFER_PRIMARY: - return legacy_hal::WIFI_DUAL_STA_TRANSIENT_PREFER_PRIMARY; - case V1_5::IWifiChip::MultiStaUseCase::DUAL_STA_NON_TRANSIENT_UNBIASED: - return legacy_hal::WIFI_DUAL_STA_NON_TRANSIENT_UNBIASED; - } - CHECK(false); -} - -bool convertHidlCoexUnsafeChannelToLegacy( - const V1_5::IWifiChip::CoexUnsafeChannel& hidl_unsafe_channel, - legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel) { - if (!legacy_unsafe_channel) { - return false; - } - *legacy_unsafe_channel = {}; - switch (hidl_unsafe_channel.band) { - case V1_5::WifiBand::BAND_24GHZ: - legacy_unsafe_channel->band = legacy_hal::WLAN_MAC_2_4_BAND; - break; - case V1_5::WifiBand::BAND_5GHZ: - legacy_unsafe_channel->band = legacy_hal::WLAN_MAC_5_0_BAND; - break; - default: - return false; - }; - legacy_unsafe_channel->channel = hidl_unsafe_channel.channel; - legacy_unsafe_channel->power_cap_dbm = hidl_unsafe_channel.powerCapDbm; - return true; -} - -bool convertHidlVectorOfCoexUnsafeChannelToLegacy( - const std::vector& hidl_unsafe_channels, - std::vector* legacy_unsafe_channels) { - if (!legacy_unsafe_channels) { - return false; - } - *legacy_unsafe_channels = {}; - for (const auto& hidl_unsafe_channel : hidl_unsafe_channels) { - legacy_hal::wifi_coex_unsafe_channel legacy_unsafe_channel; - if (!hidl_struct_util::convertHidlCoexUnsafeChannelToLegacy(hidl_unsafe_channel, - &legacy_unsafe_channel)) { - return false; - } - legacy_unsafe_channels->push_back(legacy_unsafe_channel); - } - return true; -} - -V1_6::WifiAntennaMode convertLegacyAntennaConfigurationToHidl(uint32_t antenna_cfg) { - switch (antenna_cfg) { - case legacy_hal::WIFI_ANTENNA_1X1: - return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_1X1; - case legacy_hal::WIFI_ANTENNA_2X2: - return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_2X2; - case legacy_hal::WIFI_ANTENNA_3X3: - return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_3X3; - case legacy_hal::WIFI_ANTENNA_4X4: - return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_4X4; - default: - return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_UNSPECIFIED; - } -} - -bool convertLegacyWifiRadioConfigurationToHidl( - legacy_hal::wifi_radio_configuration* radio_configuration, - V1_6::WifiRadioConfiguration* hidl_radio_configuration) { - if (!hidl_radio_configuration) { - return false; - } - *hidl_radio_configuration = {}; - hidl_radio_configuration->bandInfo = - hidl_struct_util::convertLegacyMacBandToHidlWifiBand(radio_configuration->band); - if (hidl_radio_configuration->bandInfo == V1_5::WifiBand::BAND_UNSPECIFIED) { - LOG(ERROR) << "Unspecified band"; - return false; - } - hidl_radio_configuration->antennaMode = - hidl_struct_util::convertLegacyAntennaConfigurationToHidl( - radio_configuration->antenna_cfg); - return true; -} - -bool convertLegacyRadioCombinationsMatrixToHidl( - legacy_hal::wifi_radio_combination_matrix* legacy_matrix, - WifiRadioCombinationMatrix* hidl_matrix) { - if (!hidl_matrix || !legacy_matrix) { - return false; - } - *hidl_matrix = {}; - - int num_combinations = legacy_matrix->num_radio_combinations; - std::vector radio_combinations_vec; - if (!num_combinations) { - LOG(ERROR) << "zero radio combinations"; - return false; - } - wifi_radio_combination* l_radio_combinations_ptr = legacy_matrix->radio_combinations; - for (int i = 0; i < num_combinations; i++) { - int num_configurations = l_radio_combinations_ptr->num_radio_configurations; - WifiRadioCombination radioCombination; - std::vector radio_configurations_vec; - if (!num_configurations) { - LOG(ERROR) << "zero radio configurations"; - return false; - } - for (int j = 0; j < num_configurations; j++) { - WifiRadioConfiguration radioConfiguration; - wifi_radio_configuration* l_radio_configurations_ptr = - &l_radio_combinations_ptr->radio_configurations[j]; - if (!hidl_struct_util::convertLegacyWifiRadioConfigurationToHidl( - l_radio_configurations_ptr, &radioConfiguration)) { - LOG(ERROR) << "Error converting wifi radio configuration"; - return false; - } - radio_configurations_vec.push_back(radioConfiguration); - } - radioCombination.radioConfigurations = radio_configurations_vec; - radio_combinations_vec.push_back(radioCombination); - l_radio_combinations_ptr = - (wifi_radio_combination*)((u8*)l_radio_combinations_ptr + - sizeof(wifi_radio_combination) + - (sizeof(wifi_radio_configuration) * num_configurations)); - } - hidl_matrix->radioCombinations = radio_combinations_vec; - return true; -} - -} // namespace hidl_struct_util -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h deleted file mode 100644 index 2d4a5f13f4..0000000000 --- a/wifi/1.6/default/hidl_struct_util.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef HIDL_STRUCT_UTIL_H_ -#define HIDL_STRUCT_UTIL_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "wifi_legacy_hal.h" - -/** - * This file contains a bunch of functions to convert structs from the legacy - * HAL to HIDL and vice versa. - * TODO(b/32093047): Add unit tests for these conversion methods in the VTS test - * suite. - */ -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -namespace hidl_struct_util { -using namespace android::hardware::wifi::V1_0; - -// Chip conversion methods. -bool convertLegacyFeaturesToHidlChipCapabilities(uint64_t legacy_feature_set, - uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps); -bool convertLegacyDebugRingBufferStatusToHidl( - const legacy_hal::wifi_ring_buffer_status& legacy_status, - WifiDebugRingBufferStatus* hidl_status); -bool convertLegacyVectorOfDebugRingBufferStatusToHidl( - const std::vector& legacy_status_vec, - std::vector* hidl_status_vec); -bool convertLegacyWakeReasonStatsToHidl(const legacy_hal::WakeReasonStats& legacy_stats, - WifiDebugHostWakeReasonStats* hidl_stats); -legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy( - V1_1::IWifiChip::TxPowerScenario hidl_scenario); -legacy_hal::wifi_latency_mode convertHidlLatencyModeToLegacy( - V1_3::IWifiChip::LatencyMode hidl_latency_mode); -legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy_1_2( - V1_2::IWifiChip::TxPowerScenario hidl_scenario); -bool convertLegacyWifiMacInfosToHidl( - const std::vector& legacy_mac_infos, - std::vector* hidl_radio_mode_infos); -legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy(IfaceType hidl_interface_type); -legacy_hal::wifi_multi_sta_use_case convertHidlMultiStaUseCaseToLegacy( - V1_5::IWifiChip::MultiStaUseCase use_case); -bool convertHidlCoexUnsafeChannelToLegacy( - const V1_5::IWifiChip::CoexUnsafeChannel& hidl_unsafe_channel, - legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel); -bool convertHidlVectorOfCoexUnsafeChannelToLegacy( - const std::vector& hidl_unsafe_channels, - std::vector* legacy_unsafe_channels); -bool convertLegacyRadioCombinationsMatrixToHidl( - legacy_hal::wifi_radio_combination_matrix* legacy_matrix, - V1_6::WifiRadioCombinationMatrix* hidl_matrix); -V1_5::WifiBand convertLegacyMacBandToHidlWifiBand(uint32_t band); -V1_6::WifiAntennaMode convertLegacyAntennaConfigurationToHidl(uint32_t antenna_cfg); - -// STA iface conversion methods. -bool convertLegacyFeaturesToHidlStaCapabilities(uint64_t legacy_feature_set, - uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps); -bool convertLegacyApfCapabilitiesToHidl(const legacy_hal::PacketFilterCapabilities& legacy_caps, - StaApfPacketFilterCapabilities* hidl_caps); -bool convertLegacyGscanCapabilitiesToHidl(const legacy_hal::wifi_gscan_capabilities& legacy_caps, - StaBackgroundScanCapabilities* hidl_caps); -legacy_hal::wifi_band convertHidlWifiBandToLegacy(V1_0::WifiBand band); -bool convertHidlGscanParamsToLegacy(const StaBackgroundScanParameters& hidl_scan_params, - legacy_hal::wifi_scan_cmd_params* legacy_scan_params); -// |has_ie_data| indicates whether or not the wifi_scan_result includes 802.11 -// Information Elements (IEs) -bool convertLegacyGscanResultToHidl(const legacy_hal::wifi_scan_result& legacy_scan_result, - bool has_ie_data, StaScanResult* hidl_scan_result); -// |cached_results| is assumed to not include IEs. -bool convertLegacyVectorOfCachedGscanResultsToHidl( - const std::vector& legacy_cached_scan_results, - std::vector* hidl_scan_datas); -bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats, - V1_6::StaLinkLayerStats* hidl_stats); -bool convertLegacyRoamingCapabilitiesToHidl( - const legacy_hal::wifi_roaming_capabilities& legacy_caps, - StaRoamingCapabilities* hidl_caps); -bool convertHidlRoamingConfigToLegacy(const StaRoamingConfig& hidl_config, - legacy_hal::wifi_roaming_config* legacy_config); -legacy_hal::fw_roaming_state_t convertHidlRoamingStateToLegacy(StaRoamingState state); -bool convertLegacyVectorOfDebugTxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates); -bool convertLegacyVectorOfDebugRxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates); - -// NAN iface conversion methods. -void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len, - WifiNanStatus* wifiNanStatus); -bool convertHidlNanEnableRequestToLegacy(const V1_4::NanEnableRequest& hidl_request, - legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequestToLegacy(const V1_4::NanConfigRequest& hidl_request, - legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanEnableRequest_1_6ToLegacy( - const V1_4::NanEnableRequest& hidl_request1, - const V1_6::NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequest_1_6ToLegacy( - const V1_4::NanConfigRequest& hidl_request1, - const V1_6::NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanPublishRequestToLegacy(const V1_6::NanPublishRequest& hidl_request, - legacy_hal::NanPublishRequest* legacy_request); -bool convertHidlNanSubscribeRequestToLegacy(const V1_0::NanSubscribeRequest& hidl_request, - legacy_hal::NanSubscribeRequest* legacy_request); -bool convertHidlNanTransmitFollowupRequestToLegacy( - const NanTransmitFollowupRequest& hidl_request, - legacy_hal::NanTransmitFollowupRequest* legacy_request); -bool convertHidlNanDataPathInitiatorRequestToLegacy( - const V1_0::NanInitiateDataPathRequest& hidl_request, - legacy_hal::NanDataPathInitiatorRequest* legacy_request); -bool convertHidlNanDataPathIndicationResponseToLegacy( - const V1_0::NanRespondToDataPathIndicationRequest& hidl_response, - legacy_hal::NanDataPathIndicationResponse* legacy_response); -bool convertHidlNanDataPathInitiatorRequest_1_6ToLegacy( - const V1_6::NanInitiateDataPathRequest& hidl_request, - legacy_hal::NanDataPathInitiatorRequest* legacy_request); -bool convertHidlNanDataPathIndicationResponse_1_6ToLegacy( - const V1_6::NanRespondToDataPathIndicationRequest& hidl_response, - legacy_hal::NanDataPathIndicationResponse* legacy_response); - -bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& legacy_response, - WifiNanStatus* wifiNanStatus); -bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilities& legacy_response, - V1_6::NanCapabilities* hidl_response); -bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, - V1_6::NanMatchInd* hidl_ind); -bool convertLegacyNanFollowupIndToHidl(const legacy_hal::NanFollowupInd& legacy_ind, - NanFollowupReceivedInd* hidl_ind); -bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, - NanDataPathRequestInd* hidl_ind); -bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, - V1_6::NanDataPathConfirmInd* hidl_ind); -bool convertLegacyNanDataPathScheduleUpdateIndToHidl( - const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, - V1_6::NanDataPathScheduleUpdateInd* hidl_ind); - -// RTT controller conversion methods. -bool convertHidlVectorOfRttConfigToLegacy(const std::vector& hidl_configs, - std::vector* legacy_configs); -bool convertHidlRttLciInformationToLegacy(const RttLciInformation& hidl_info, - legacy_hal::wifi_lci_information* legacy_info); -bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info, - legacy_hal::wifi_lcr_information* legacy_info); -bool convertHidlRttResponderToLegacy(const V1_6::RttResponder& hidl_responder, - legacy_hal::wifi_rtt_responder* legacy_responder); -bool convertHidlWifiChannelInfoToLegacy(const V1_6::WifiChannelInfo& hidl_info, - legacy_hal::wifi_channel_info* legacy_info); -bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder, - V1_6::RttResponder* hidl_responder); -bool convertLegacyRttCapabilitiesToHidl( - const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - V1_6::RttCapabilities* hidl_capabilities); -bool convertLegacyVectorOfRttResultToHidl( - const std::vector& legacy_results, - std::vector* hidl_results); -uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand band); -uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask); -uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask); -bool convertLegacyWifiUsableChannelsToHidl( - const std::vector& legacy_usable_channels, - std::vector* hidl_usable_channels); -bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, - V1_6::StaPeerInfo* hidl_peer_info_stats); -bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, - V1_6::WifiRateInfo* hidl_rate); -} // namespace hidl_struct_util -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // HIDL_STRUCT_UTIL_H_ diff --git a/wifi/1.6/default/service.cpp b/wifi/1.6/default/service.cpp deleted file mode 100644 index c874d8b199..0000000000 --- a/wifi/1.6/default/service.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include - -#include "wifi.h" -#include "wifi_feature_flags.h" -#include "wifi_legacy_hal.h" -#include "wifi_legacy_hal_factory.h" -#include "wifi_mode_controller.h" - -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; -using android::hardware::LazyServiceRegistrar; -using android::hardware::wifi::V1_6::implementation::feature_flags::WifiFeatureFlags; -using android::hardware::wifi::V1_6::implementation::legacy_hal::WifiLegacyHal; -using android::hardware::wifi::V1_6::implementation::legacy_hal::WifiLegacyHalFactory; -using android::hardware::wifi::V1_6::implementation::mode_controller::WifiModeController; - -#ifdef LAZY_SERVICE -const bool kLazyService = true; -#else -const bool kLazyService = false; -#endif - -int main(int /*argc*/, char** argv) { - signal(SIGPIPE, SIG_IGN); - android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM)); - LOG(INFO) << "Wifi Hal is booting up..."; - - configureRpcThreadpool(1, true /* callerWillJoin */); - - const auto iface_tool = std::make_shared(); - const auto legacy_hal_factory = std::make_shared(iface_tool); - - // Setup hwbinder service - android::sp service = - new android::hardware::wifi::V1_6::implementation::Wifi( - iface_tool, legacy_hal_factory, std::make_shared(), - std::make_shared()); - if (kLazyService) { - auto registrar = LazyServiceRegistrar::getInstance(); - CHECK_EQ(registrar.registerService(service), android::NO_ERROR) - << "Failed to register wifi HAL"; - } else { - CHECK_EQ(service->registerAsService(), android::NO_ERROR) << "Failed to register wifi HAL"; - } - - joinRpcThreadpool(); - - LOG(INFO) << "Wifi Hal is terminating..."; - return 0; -} diff --git a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp deleted file mode 100644 index 0dd0aa15bb..0000000000 --- a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Copyright (C) 2017, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#undef NAN -#include "hidl_struct_util.h" - -using testing::Test; - -namespace { -constexpr uint32_t kMacId1 = 1; -constexpr uint32_t kMacId2 = 2; -constexpr uint32_t kIfaceChannel1 = 3; -constexpr uint32_t kIfaceChannel2 = 5; -constexpr char kIfaceName1[] = "wlan0"; -constexpr char kIfaceName2[] = "wlan1"; -} // namespace -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; -using ::android::hardware::wifi::V1_6::WifiChannelWidthInMhz; - -class HidlStructUtilTest : public Test {}; - -TEST_F(HidlStructUtilTest, CanConvertLegacyWifiMacInfosToHidlWithOneMac) { - std::vector legacy_mac_infos; - legacy_hal::WifiMacInfo legacy_mac_info1 = { - .wlan_mac_id = kMacId1, - .mac_band = legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_2_4_BAND}; - legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, .channel = kIfaceChannel1}; - legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, .channel = kIfaceChannel2}; - legacy_mac_info1.iface_infos.push_back(legacy_iface_info1); - legacy_mac_info1.iface_infos.push_back(legacy_iface_info2); - legacy_mac_infos.push_back(legacy_mac_info1); - - std::vector hidl_radio_mode_infos; - ASSERT_TRUE(hidl_struct_util::convertLegacyWifiMacInfosToHidl(legacy_mac_infos, - &hidl_radio_mode_infos)); - - ASSERT_EQ(1u, hidl_radio_mode_infos.size()); - auto hidl_radio_mode_info1 = hidl_radio_mode_infos[0]; - EXPECT_EQ(legacy_mac_info1.wlan_mac_id, hidl_radio_mode_info1.radioId); - EXPECT_EQ(V1_4::WifiBand::BAND_24GHZ_5GHZ, hidl_radio_mode_info1.bandInfo); - ASSERT_EQ(2u, hidl_radio_mode_info1.ifaceInfos.size()); - auto hidl_iface_info1 = hidl_radio_mode_info1.ifaceInfos[0]; - EXPECT_EQ(legacy_iface_info1.name, hidl_iface_info1.name); - EXPECT_EQ(static_cast(legacy_iface_info1.channel), hidl_iface_info1.channel); - auto hidl_iface_info2 = hidl_radio_mode_info1.ifaceInfos[1]; - EXPECT_EQ(legacy_iface_info2.name, hidl_iface_info2.name); - EXPECT_EQ(static_cast(legacy_iface_info2.channel), hidl_iface_info2.channel); -} - -TEST_F(HidlStructUtilTest, CanConvertLegacyWifiMacInfosToHidlWithTwoMac) { - std::vector legacy_mac_infos; - legacy_hal::WifiMacInfo legacy_mac_info1 = {.wlan_mac_id = kMacId1, - .mac_band = legacy_hal::WLAN_MAC_5_0_BAND}; - legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, .channel = kIfaceChannel1}; - legacy_hal::WifiMacInfo legacy_mac_info2 = {.wlan_mac_id = kMacId2, - .mac_band = legacy_hal::WLAN_MAC_2_4_BAND}; - legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, .channel = kIfaceChannel2}; - legacy_mac_info1.iface_infos.push_back(legacy_iface_info1); - legacy_mac_infos.push_back(legacy_mac_info1); - legacy_mac_info2.iface_infos.push_back(legacy_iface_info2); - legacy_mac_infos.push_back(legacy_mac_info2); - - std::vector hidl_radio_mode_infos; - ASSERT_TRUE(hidl_struct_util::convertLegacyWifiMacInfosToHidl(legacy_mac_infos, - &hidl_radio_mode_infos)); - - ASSERT_EQ(2u, hidl_radio_mode_infos.size()); - - // Find mac info 1. - const auto hidl_radio_mode_info1 = - std::find_if(hidl_radio_mode_infos.begin(), hidl_radio_mode_infos.end(), - [&legacy_mac_info1](const V1_4::IWifiChipEventCallback::RadioModeInfo& x) { - return x.radioId == legacy_mac_info1.wlan_mac_id; - }); - ASSERT_NE(hidl_radio_mode_infos.end(), hidl_radio_mode_info1); - EXPECT_EQ(V1_4::WifiBand::BAND_5GHZ, hidl_radio_mode_info1->bandInfo); - ASSERT_EQ(1u, hidl_radio_mode_info1->ifaceInfos.size()); - auto hidl_iface_info1 = hidl_radio_mode_info1->ifaceInfos[0]; - EXPECT_EQ(legacy_iface_info1.name, hidl_iface_info1.name); - EXPECT_EQ(static_cast(legacy_iface_info1.channel), hidl_iface_info1.channel); - - // Find mac info 2. - const auto hidl_radio_mode_info2 = - std::find_if(hidl_radio_mode_infos.begin(), hidl_radio_mode_infos.end(), - [&legacy_mac_info2](const V1_4::IWifiChipEventCallback::RadioModeInfo& x) { - return x.radioId == legacy_mac_info2.wlan_mac_id; - }); - ASSERT_NE(hidl_radio_mode_infos.end(), hidl_radio_mode_info2); - EXPECT_EQ(V1_4::WifiBand::BAND_24GHZ, hidl_radio_mode_info2->bandInfo); - ASSERT_EQ(1u, hidl_radio_mode_info2->ifaceInfos.size()); - auto hidl_iface_info2 = hidl_radio_mode_info2->ifaceInfos[0]; - EXPECT_EQ(legacy_iface_info2.name, hidl_iface_info2.name); - EXPECT_EQ(static_cast(legacy_iface_info2.channel), hidl_iface_info2.channel); -} - -TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { - legacy_hal::LinkLayerStats legacy_stats{}; - legacy_stats.radios.push_back(legacy_hal::LinkLayerRadioStats{}); - legacy_stats.radios.push_back(legacy_hal::LinkLayerRadioStats{}); - legacy_stats.peers.push_back(legacy_hal::WifiPeerInfo{}); - legacy_stats.peers.push_back(legacy_hal::WifiPeerInfo{}); - legacy_stats.iface.beacon_rx = rand(); - legacy_stats.iface.rssi_mgmt = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples = rand(); - - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples = rand(); - - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples = rand(); - - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples = rand(); - - legacy_stats.iface.info.time_slicing_duty_cycle_percent = rand(); - legacy_stats.iface.num_peers = 1; - - for (auto& radio : legacy_stats.radios) { - radio.stats.radio = rand(); - radio.stats.on_time = rand(); - radio.stats.tx_time = rand(); - radio.stats.rx_time = rand(); - radio.stats.on_time_scan = rand(); - radio.stats.on_time_nbd = rand(); - radio.stats.on_time_gscan = rand(); - radio.stats.on_time_roam_scan = rand(); - radio.stats.on_time_pno_scan = rand(); - radio.stats.on_time_hs20 = rand(); - for (int i = 0; i < 4; i++) { - radio.tx_time_per_levels.push_back(rand()); - } - - legacy_hal::wifi_channel_stat channel_stat1 = { - .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 2437, 2437, 0}, - .on_time = 0x1111, - .cca_busy_time = 0x55, - }; - legacy_hal::wifi_channel_stat channel_stat2 = { - .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 5180, 5180, 0}, - .on_time = 0x2222, - .cca_busy_time = 0x66, - }; - radio.channel_stats.push_back(channel_stat1); - radio.channel_stats.push_back(channel_stat2); - } - - for (auto& peer : legacy_stats.peers) { - peer.peer_info.bssload.sta_count = rand(); - peer.peer_info.bssload.chan_util = rand(); - wifi_rate_stat rate_stat1 = { - .rate = {3, 1, 2, 5, 0, 0}, - .tx_mpdu = 0, - .rx_mpdu = 1, - .mpdu_lost = 2, - .retries = 3, - .retries_short = 4, - .retries_long = 5, - }; - wifi_rate_stat rate_stat2 = { - .rate = {2, 2, 1, 6, 0, 1}, - .tx_mpdu = 6, - .rx_mpdu = 7, - .mpdu_lost = 8, - .retries = 9, - .retries_short = 10, - .retries_long = 11, - }; - peer.rate_stats.push_back(rate_stat1); - peer.rate_stats.push_back(rate_stat2); - } - - V1_6::StaLinkLayerStats converted{}; - hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &converted); - EXPECT_EQ(legacy_stats.iface.beacon_rx, converted.iface.V1_0.beaconRx); - EXPECT_EQ(legacy_stats.iface.rssi_mgmt, converted.iface.V1_0.avgRssiMgmt); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu, - converted.iface.V1_0.wmeBePktStats.rxMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu, - converted.iface.V1_0.wmeBePktStats.txMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost, - converted.iface.V1_0.wmeBePktStats.lostMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries, - converted.iface.V1_0.wmeBePktStats.retries); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min, - converted.iface.wmeBeContentionTimeStats.contentionTimeMinInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max, - converted.iface.wmeBeContentionTimeStats.contentionTimeMaxInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg, - converted.iface.wmeBeContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples, - converted.iface.wmeBeContentionTimeStats.contentionNumSamples); - - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu, - converted.iface.V1_0.wmeBkPktStats.rxMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu, - converted.iface.V1_0.wmeBkPktStats.txMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost, - converted.iface.V1_0.wmeBkPktStats.lostMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries, - converted.iface.V1_0.wmeBkPktStats.retries); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min, - converted.iface.wmeBkContentionTimeStats.contentionTimeMinInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max, - converted.iface.wmeBkContentionTimeStats.contentionTimeMaxInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg, - converted.iface.wmeBkContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples, - converted.iface.wmeBkContentionTimeStats.contentionNumSamples); - - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu, - converted.iface.V1_0.wmeViPktStats.rxMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu, - converted.iface.V1_0.wmeViPktStats.txMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost, - converted.iface.V1_0.wmeViPktStats.lostMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries, - converted.iface.V1_0.wmeViPktStats.retries); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min, - converted.iface.wmeViContentionTimeStats.contentionTimeMinInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max, - converted.iface.wmeViContentionTimeStats.contentionTimeMaxInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg, - converted.iface.wmeViContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples, - converted.iface.wmeViContentionTimeStats.contentionNumSamples); - - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu, - converted.iface.V1_0.wmeVoPktStats.rxMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu, - converted.iface.V1_0.wmeVoPktStats.txMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost, - converted.iface.V1_0.wmeVoPktStats.lostMpdu); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries, - converted.iface.V1_0.wmeVoPktStats.retries); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min, - converted.iface.wmeVoContentionTimeStats.contentionTimeMinInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max, - converted.iface.wmeVoContentionTimeStats.contentionTimeMaxInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg, - converted.iface.wmeVoContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples, - converted.iface.wmeVoContentionTimeStats.contentionNumSamples); - - EXPECT_EQ(legacy_stats.iface.info.time_slicing_duty_cycle_percent, - converted.iface.timeSliceDutyCycleInPercent); - - EXPECT_EQ(legacy_stats.radios.size(), converted.radios.size()); - for (size_t i = 0; i < legacy_stats.radios.size(); i++) { - EXPECT_EQ(legacy_stats.radios[i].stats.radio, converted.radios[i].radioId); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time, converted.radios[i].V1_0.onTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, converted.radios[i].V1_0.txTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, converted.radios[i].V1_0.rxTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time_scan, - converted.radios[i].V1_0.onTimeInMsForScan); - EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels.size(), - converted.radios[i].V1_0.txTimeInMsPerLevel.size()); - for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size(); j++) { - EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels[j], - converted.radios[i].V1_0.txTimeInMsPerLevel[j]); - } - EXPECT_EQ(legacy_stats.radios[i].stats.on_time_nbd, - converted.radios[i].onTimeInMsForNanScan); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time_gscan, - converted.radios[i].onTimeInMsForBgScan); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time_roam_scan, - converted.radios[i].onTimeInMsForRoamScan); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time_pno_scan, - converted.radios[i].onTimeInMsForPnoScan); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time_hs20, - converted.radios[i].onTimeInMsForHs20Scan); - EXPECT_EQ(legacy_stats.radios[i].channel_stats.size(), - converted.radios[i].channelStats.size()); - for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size(); k++) { - auto& legacy_channel_st = legacy_stats.radios[i].channel_stats[k]; - EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20, - converted.radios[i].channelStats[k].channel.width); - EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq), - converted.radios[i].channelStats[k].channel.centerFreq); - EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq0), - converted.radios[i].channelStats[k].channel.centerFreq0); - EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq1), - converted.radios[i].channelStats[k].channel.centerFreq1); - EXPECT_EQ(legacy_channel_st.cca_busy_time, - converted.radios[i].channelStats[k].ccaBusyTimeInMs); - EXPECT_EQ(legacy_channel_st.on_time, converted.radios[i].channelStats[k].onTimeInMs); - } - } - - EXPECT_EQ(legacy_stats.peers.size(), converted.iface.peers.size()); - for (size_t i = 0; i < legacy_stats.peers.size(); i++) { - EXPECT_EQ(legacy_stats.peers[i].peer_info.bssload.sta_count, - converted.iface.peers[i].staCount); - EXPECT_EQ(legacy_stats.peers[i].peer_info.bssload.chan_util, - converted.iface.peers[i].chanUtil); - for (size_t j = 0; j < legacy_stats.peers[i].rate_stats.size(); j++) { - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.preamble, - (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.preamble); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.nss, - (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.nss); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.bw, - (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.bw); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.rateMcsIdx, - converted.iface.peers[i].rateStats[j].rateInfo.rateMcsIdx); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].tx_mpdu, - converted.iface.peers[i].rateStats[j].txMpdu); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rx_mpdu, - converted.iface.peers[i].rateStats[j].rxMpdu); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].mpdu_lost, - converted.iface.peers[i].rateStats[j].mpduLost); - EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].retries, - converted.iface.peers[i].rateStats[j].retries); - } - } -} - -TEST_F(HidlStructUtilTest, CanConvertLegacyFeaturesToHidl) { - using HidlChipCaps = V1_3::IWifiChip::ChipCapabilityMask; - - uint32_t hidle_caps; - - uint32_t legacy_feature_set = WIFI_FEATURE_D2D_RTT | WIFI_FEATURE_SET_LATENCY_MODE; - uint32_t legacy_logger_feature_set = legacy_hal::WIFI_LOGGER_DRIVER_DUMP_SUPPORTED; - - ASSERT_TRUE(hidl_struct_util::convertLegacyFeaturesToHidlChipCapabilities( - legacy_feature_set, legacy_logger_feature_set, &hidle_caps)); - - EXPECT_EQ(HidlChipCaps::DEBUG_RING_BUFFER_VENDOR_DATA | - HidlChipCaps::DEBUG_HOST_WAKE_REASON_STATS | - HidlChipCaps::DEBUG_ERROR_ALERTS | HidlChipCaps::D2D_RTT | - HidlChipCaps::SET_LATENCY_MODE | HidlChipCaps::DEBUG_MEMORY_DRIVER_DUMP, - hidle_caps); -} - -void insertRadioCombination(legacy_hal::wifi_radio_combination* dst_radio_combination_ptr, - int num_radio_configurations, - legacy_hal::wifi_radio_configuration* radio_configuration) { - dst_radio_combination_ptr->num_radio_configurations = num_radio_configurations; - memcpy(dst_radio_combination_ptr->radio_configurations, radio_configuration, - num_radio_configurations * sizeof(legacy_hal::wifi_radio_configuration)); -} - -void verifyRadioCombination(WifiRadioCombination* radioCombination, size_t num_radio_configurations, - legacy_hal::wifi_radio_configuration* radio_configuration) { - EXPECT_EQ(num_radio_configurations, radioCombination->radioConfigurations.size()); - for (size_t i = 0; i < num_radio_configurations; i++) { - EXPECT_EQ(hidl_struct_util::convertLegacyMacBandToHidlWifiBand(radio_configuration->band), - radioCombination->radioConfigurations[i].bandInfo); - EXPECT_EQ(hidl_struct_util::convertLegacyAntennaConfigurationToHidl( - radio_configuration->antenna_cfg), - radioCombination->radioConfigurations[i].antennaMode); - radio_configuration++; - } -} - -TEST_F(HidlStructUtilTest, canConvertLegacyRadioCombinationsMatrixToHidl) { - legacy_hal::wifi_radio_configuration radio_configurations_array1[] = { - {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1}, - }; - legacy_hal::wifi_radio_configuration radio_configurations_array2[] = { - {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2}, - {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_3X3}, - }; - legacy_hal::wifi_radio_configuration radio_configurations_array3[] = { - {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2}, - {.band = legacy_hal::WLAN_MAC_6_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1}, - {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_4X4}, - }; - - int num_radio_configs = 0; - int num_combinations = 0; - std::array buffer; - buffer.fill(0); - legacy_hal::wifi_radio_combination_matrix* legacy_matrix = - reinterpret_cast(buffer.data()); - legacy_hal::wifi_radio_combination* radio_combinations; - - // Prepare a legacy wifi_radio_combination_matrix - legacy_matrix->num_radio_combinations = 3; - // Insert first combination - radio_combinations = - (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations); - insertRadioCombination( - radio_combinations, - sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]), - radio_configurations_array1); - num_combinations++; - num_radio_configs += - sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]); - - // Insert second combination - radio_combinations = - (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations + - (num_combinations * - sizeof(legacy_hal::wifi_radio_combination)) + - (num_radio_configs * - sizeof(wifi_radio_configuration))); - insertRadioCombination( - radio_combinations, - sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]), - radio_configurations_array2); - num_combinations++; - num_radio_configs += - sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]); - - // Insert third combination - radio_combinations = - (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations + - (num_combinations * - sizeof(legacy_hal::wifi_radio_combination)) + - (num_radio_configs * - sizeof(wifi_radio_configuration))); - insertRadioCombination( - radio_combinations, - sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]), - radio_configurations_array3); - - V1_6::WifiRadioCombinationMatrix converted_matrix{}; - hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix, &converted_matrix); - - // Verify the conversion - EXPECT_EQ(legacy_matrix->num_radio_combinations, converted_matrix.radioCombinations.size()); - verifyRadioCombination( - &converted_matrix.radioCombinations[0], - sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]), - radio_configurations_array1); - verifyRadioCombination( - &converted_matrix.radioCombinations[1], - sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]), - radio_configurations_array2); - verifyRadioCombination( - &converted_matrix.radioCombinations[2], - sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]), - radio_configurations_array3); -} -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp deleted file mode 100644 index 8a5ddcd998..0000000000 --- a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2019, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include - -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 -#include "wifi_nan_iface.h" - -#include "mock_interface_tool.h" -#include "mock_wifi_feature_flags.h" -#include "mock_wifi_iface_util.h" -#include "mock_wifi_legacy_hal.h" - -using testing::NiceMock; -using testing::Return; -using testing::Test; - -namespace { -constexpr char kIfaceName[] = "mockWlan0"; -} // namespace - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { - -using android::hardware::wifi::V1_2::NanDataPathConfirmInd; - -bool CaptureIfaceEventHandlers(const std::string& /* iface_name*/, - iface_util::IfaceEventHandlers in_iface_event_handlers, - iface_util::IfaceEventHandlers* out_iface_event_handlers) { - *out_iface_event_handlers = in_iface_event_handlers; - return true; -} - -class MockNanIfaceEventCallback : public V1_5::IWifiNanIfaceEventCallback { - public: - MockNanIfaceEventCallback() = default; - - MOCK_METHOD3(notifyCapabilitiesResponse, - Return(uint16_t, const WifiNanStatus&, - const android::hardware::wifi::V1_0::NanCapabilities&)); - MOCK_METHOD2(notifyEnableResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyConfigResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyDisableResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD3(notifyStartPublishResponse, Return(uint16_t, const WifiNanStatus&, uint8_t)); - MOCK_METHOD2(notifyStopPublishResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD3(notifyStartSubscribeResponse, - Return(uint16_t, const WifiNanStatus&, uint8_t)); - MOCK_METHOD2(notifyStopSubscribeResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyTransmitFollowupResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyCreateDataInterfaceResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyDeleteDataInterfaceResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD3(notifyInitiateDataPathResponse, - Return(uint16_t, const WifiNanStatus&, uint32_t)); - MOCK_METHOD2(notifyRespondToDataPathIndicationResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyTerminateDataPathResponse, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD1(eventClusterEvent, Return(const NanClusterEventInd&)); - MOCK_METHOD1(eventDisabled, Return(const WifiNanStatus&)); - MOCK_METHOD2(eventPublishTerminated, Return(uint8_t, const WifiNanStatus&)); - MOCK_METHOD2(eventSubscribeTerminated, Return(uint8_t, const WifiNanStatus&)); - MOCK_METHOD1(eventMatch, Return(const V1_0::NanMatchInd&)); - MOCK_METHOD1(eventMatch_1_6, Return(const NanMatchInd&)); - MOCK_METHOD2(eventMatchExpired, Return(uint8_t, uint32_t)); - MOCK_METHOD1(eventFollowupReceived, Return(const NanFollowupReceivedInd&)); - MOCK_METHOD2(eventTransmitFollowup, Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD1(eventDataPathRequest, Return(const NanDataPathRequestInd&)); - MOCK_METHOD1(eventDataPathConfirm, - Return(const android::hardware::wifi::V1_0::NanDataPathConfirmInd&)); - MOCK_METHOD1(eventDataPathTerminated, Return(uint32_t)); - MOCK_METHOD1(eventDataPathConfirm_1_2, - Return(const android::hardware::wifi::V1_2::NanDataPathConfirmInd&)); - MOCK_METHOD1(eventDataPathConfirm_1_6, Return(const NanDataPathConfirmInd&)); - MOCK_METHOD1(eventDataPathScheduleUpdate, - Return(const android::hardware::wifi::V1_2::NanDataPathScheduleUpdateInd&)); - MOCK_METHOD1(eventDataPathScheduleUpdate_1_6, - Return(const NanDataPathScheduleUpdateInd&)); - MOCK_METHOD3(notifyCapabilitiesResponse_1_5, - Return(uint16_t, const WifiNanStatus&, const V1_5::NanCapabilities&)); -}; - -class WifiNanIfaceTest : public Test { - protected: - legacy_hal::wifi_hal_fn fake_func_table_; - std::shared_ptr> iface_tool_{ - new NiceMock}; - std::shared_ptr> legacy_hal_{ - new NiceMock(iface_tool_, fake_func_table_, true)}; - std::shared_ptr> iface_util_{ - new NiceMock(iface_tool_, legacy_hal_)}; -}; - -TEST_F(WifiNanIfaceTest, IfacEventHandlers_OnStateToggleOffOn) { - iface_util::IfaceEventHandlers captured_iface_event_handlers = {}; - EXPECT_CALL(*legacy_hal_, nanRegisterCallbackHandlers(testing::_, testing::_)) - .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); - EXPECT_CALL(*iface_util_, registerIfaceEventHandlers(testing::_, testing::_)) - .WillOnce(testing::Invoke(bind(CaptureIfaceEventHandlers, std::placeholders::_1, - std::placeholders::_2, &captured_iface_event_handlers))); - sp nan_iface = new WifiNanIface(kIfaceName, false, legacy_hal_, iface_util_); - - // Register a mock nan event callback. - sp> mock_event_callback{ - new NiceMock}; - nan_iface->registerEventCallback(mock_event_callback, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); - // Ensure that the eventDisabled() function in mock callback will be - // invoked. - WifiNanStatus expected_nan_status = {NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; - EXPECT_CALL(*mock_event_callback, eventDisabled(expected_nan_status)).Times(1); - - // Trigger the iface state toggle callback. - captured_iface_event_handlers.on_state_toggle_off_on(kIfaceName); -} -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.6/default/wifi.h b/wifi/1.6/default/wifi.h deleted file mode 100644 index 435358e797..0000000000 --- a/wifi/1.6/default/wifi.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef WIFI_H_ -#define WIFI_H_ - -// HACK: NAN is a macro defined in math.h, which can be included in various -// headers. This wifi HAL uses an enum called NAN, which does not compile when -// the macro is defined. Undefine NAN to work around it. -#undef NAN -#include - -#include -#include -#include - -#include "hidl_callback_util.h" -#include "wifi_chip.h" -#include "wifi_feature_flags.h" -#include "wifi_legacy_hal.h" -#include "wifi_legacy_hal_factory.h" -#include "wifi_mode_controller.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { - -/** - * Root HIDL interface object used to control the Wifi HAL. - */ -class Wifi : public V1_6::IWifi { - public: - Wifi(const std::shared_ptr iface_tool, - const std::shared_ptr legacy_hal_factory, - const std::shared_ptr mode_controller, - const std::shared_ptr feature_flags); - - bool isValid(); - - // HIDL methods exposed. - Return registerEventCallback(const sp& event_callback, - registerEventCallback_cb hidl_status_cb) override; - Return registerEventCallback_1_5(const sp& event_callback, - registerEventCallback_1_5_cb hidl_status_cb) override; - Return isStarted() override; - Return start(start_cb hidl_status_cb) override; - Return stop(stop_cb hidl_status_cb) override; - Return getChipIds(getChipIds_cb hidl_status_cb) override; - Return getChip(ChipId chip_id, getChip_cb hidl_status_cb) override; - Return debug(const hidl_handle& handle, const hidl_vec& options) override; - - private: - enum class RunState { STOPPED, STARTED, STOPPING }; - - // Corresponding worker functions for the HIDL methods. - WifiStatus registerEventCallbackInternal( - const sp& event_callback __unused); - WifiStatus registerEventCallbackInternal_1_5( - const sp& event_callback); - WifiStatus startInternal(); - WifiStatus stopInternal(std::unique_lock* lock); - std::pair> getChipIdsInternal(); - std::pair> getChipInternal(ChipId chip_id); - - WifiStatus initializeModeControllerAndLegacyHal(); - WifiStatus stopLegacyHalAndDeinitializeModeController( - std::unique_lock* lock); - ChipId getChipIdFromWifiChip(sp& chip); - - // Instance is created in this root level |IWifi| HIDL interface object - // and shared with all the child HIDL interface objects. - std::shared_ptr iface_tool_; - std::shared_ptr legacy_hal_factory_; - std::shared_ptr mode_controller_; - std::vector> legacy_hals_; - std::shared_ptr feature_flags_; - RunState run_state_; - std::vector> chips_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_; - - DISALLOW_COPY_AND_ASSIGN(Wifi); -}; - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_H_ diff --git a/wifi/1.6/default/wifi_ap_iface.h b/wifi/1.6/default/wifi_ap_iface.h deleted file mode 100644 index d1c06424df..0000000000 --- a/wifi/1.6/default/wifi_ap_iface.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef WIFI_AP_IFACE_H_ -#define WIFI_AP_IFACE_H_ - -#include -#include - -#include "wifi_iface_util.h" -#include "wifi_legacy_hal.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; - -/** - * HIDL interface object used to control a AP Iface instance. - */ -class WifiApIface : public V1_5::IWifiApIface { - public: - WifiApIface(const std::string& ifname, const std::vector& instances, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util); - // Refer to |WifiChip::invalidate()|. - void invalidate(); - bool isValid(); - std::string getName(); - void removeInstance(std::string instance); - - // HIDL methods exposed. - Return getName(getName_cb hidl_status_cb) override; - Return getType(getType_cb hidl_status_cb) override; - Return setCountryCode(const hidl_array& code, - setCountryCode_cb hidl_status_cb) override; - Return getValidFrequenciesForBand(V1_0::WifiBand band, - getValidFrequenciesForBand_cb hidl_status_cb) override; - Return setMacAddress(const hidl_array& mac, - setMacAddress_cb hidl_status_cb) override; - Return getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) override; - Return resetToFactoryMacAddress(resetToFactoryMacAddress_cb hidl_status_cb) override; - - Return getBridgedInstances(getBridgedInstances_cb hidl_status_cb) override; - - private: - // Corresponding worker functions for the HIDL methods. - std::pair getNameInternal(); - std::pair getTypeInternal(); - WifiStatus setCountryCodeInternal(const std::array& code); - std::pair> getValidFrequenciesForBandInternal( - V1_0::WifiBand band); - WifiStatus setMacAddressInternal(const std::array& mac); - std::pair> getFactoryMacAddressInternal( - const std::string& ifaceName); - WifiStatus resetToFactoryMacAddressInternal(); - std::pair> getBridgedInstancesInternal(); - - std::string ifname_; - std::vector instances_; - std::weak_ptr legacy_hal_; - std::weak_ptr iface_util_; - bool is_valid_; - - DISALLOW_COPY_AND_ASSIGN(WifiApIface); -}; - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_AP_IFACE_H_ diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h deleted file mode 100644 index e8ddaa6f9e..0000000000 --- a/wifi/1.6/default/wifi_chip.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef WIFI_CHIP_H_ -#define WIFI_CHIP_H_ - -// HACK: NAN is a macro defined in math.h, which can be included in various -// headers. This wifi HAL uses an enum called NAN, which does not compile when -// the macro is defined. Undefine NAN to work around it. -#undef NAN - -#include -#include -#include - -#include -#include -#include -#include - -#include "hidl_callback_util.h" -#include "ringbuffer.h" -#include "wifi_ap_iface.h" -#include "wifi_feature_flags.h" -#include "wifi_legacy_hal.h" -#include "wifi_mode_controller.h" -#include "wifi_nan_iface.h" -#include "wifi_p2p_iface.h" -#include "wifi_rtt_controller.h" -#include "wifi_sta_iface.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; -using V1_5::WifiBand; - -/** - * HIDL interface object used to control a Wifi HAL chip instance. - * Since there is only a single chip instance used today, there is no - * identifying handle information stored here. - */ -class WifiChip : public V1_6::IWifiChip { - public: - WifiChip(ChipId chip_id, bool is_primary, - const std::weak_ptr legacy_hal, - const std::weak_ptr mode_controller, - const std::shared_ptr iface_util, - const std::weak_ptr feature_flags, - const std::function& subsystemCallbackHandler); - // HIDL does not provide a built-in mechanism to let the server invalidate - // a HIDL interface object after creation. If any client process holds onto - // a reference to the object in their context, any method calls on that - // reference will continue to be directed to the server. - // - // However Wifi HAL needs to control the lifetime of these objects. So, add - // a public |invalidate| method to |WifiChip| and it's child objects. This - // will be used to mark an object invalid when either: - // a) Wifi HAL is stopped, or - // b) Wifi Chip is reconfigured. - // - // All HIDL method implementations should check if the object is still - // marked valid before processing them. - void invalidate(); - bool isValid(); - std::set> getEventCallbacks(); - - // HIDL methods exposed. - Return getId(getId_cb hidl_status_cb) override; - // Deprecated support for this callback - Return registerEventCallback(const sp& event_callback, - registerEventCallback_cb hidl_status_cb) override; - Return getCapabilities(getCapabilities_cb hidl_status_cb) override; - Return getAvailableModes(getAvailableModes_cb hidl_status_cb) override; - Return configureChip(ChipModeId mode_id, configureChip_cb hidl_status_cb) override; - Return getMode(getMode_cb hidl_status_cb) override; - Return requestChipDebugInfo(requestChipDebugInfo_cb hidl_status_cb) override; - Return requestDriverDebugDump(requestDriverDebugDump_cb hidl_status_cb) override; - Return requestFirmwareDebugDump(requestFirmwareDebugDump_cb hidl_status_cb) override; - Return createApIface(createApIface_cb hidl_status_cb) override; - Return createBridgedApIface(createBridgedApIface_cb hidl_status_cb) override; - Return getApIfaceNames(getApIfaceNames_cb hidl_status_cb) override; - Return getApIface(const hidl_string& ifname, getApIface_cb hidl_status_cb) override; - Return removeApIface(const hidl_string& ifname, removeApIface_cb hidl_status_cb) override; - Return removeIfaceInstanceFromBridgedApIface( - const hidl_string& brIfaceName, const hidl_string& ifaceInstanceName, - removeIfaceInstanceFromBridgedApIface_cb hidl_status_cb) override; - Return createNanIface(createNanIface_cb hidl_status_cb) override; - Return getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) override; - Return getNanIface(const hidl_string& ifname, getNanIface_cb hidl_status_cb) override; - Return removeNanIface(const hidl_string& ifname, - removeNanIface_cb hidl_status_cb) override; - Return createP2pIface(createP2pIface_cb hidl_status_cb) override; - Return getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) override; - Return getP2pIface(const hidl_string& ifname, getP2pIface_cb hidl_status_cb) override; - Return removeP2pIface(const hidl_string& ifname, - removeP2pIface_cb hidl_status_cb) override; - Return createStaIface(createStaIface_cb hidl_status_cb) override; - Return getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) override; - Return getStaIface(const hidl_string& ifname, getStaIface_cb hidl_status_cb) override; - Return removeStaIface(const hidl_string& ifname, - removeStaIface_cb hidl_status_cb) override; - Return createRttController(const sp& bound_iface, - createRttController_cb hidl_status_cb) override; - Return getDebugRingBuffersStatus(getDebugRingBuffersStatus_cb hidl_status_cb) override; - Return startLoggingToDebugRingBuffer( - const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, - startLoggingToDebugRingBuffer_cb hidl_status_cb) override; - Return forceDumpToDebugRingBuffer(const hidl_string& ring_name, - forceDumpToDebugRingBuffer_cb hidl_status_cb) override; - Return flushRingBufferToFile(flushRingBufferToFile_cb hidl_status_cb) override; - Return stopLoggingToDebugRingBuffer( - stopLoggingToDebugRingBuffer_cb hidl_status_cb) override; - Return getDebugHostWakeReasonStats( - getDebugHostWakeReasonStats_cb hidl_status_cb) override; - Return enableDebugErrorAlerts(bool enable, - enableDebugErrorAlerts_cb hidl_status_cb) override; - Return selectTxPowerScenario(V1_1::IWifiChip::TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) override; - Return resetTxPowerScenario(resetTxPowerScenario_cb hidl_status_cb) override; - Return setLatencyMode(LatencyMode mode, setLatencyMode_cb hidl_status_cb) override; - Return registerEventCallback_1_2(const sp& event_callback, - registerEventCallback_1_2_cb hidl_status_cb) override; - Return selectTxPowerScenario_1_2(TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) override; - Return getCapabilities_1_3(getCapabilities_cb hidl_status_cb) override; - Return getCapabilities_1_5(getCapabilities_1_5_cb hidl_status_cb) override; - Return debug(const hidl_handle& handle, const hidl_vec& options) override; - Return createRttController_1_4(const sp& bound_iface, - createRttController_1_4_cb hidl_status_cb) override; - Return registerEventCallback_1_4(const sp& event_callback, - registerEventCallback_1_4_cb hidl_status_cb) override; - Return setMultiStaPrimaryConnection( - const hidl_string& ifname, setMultiStaPrimaryConnection_cb hidl_status_cb) override; - Return setMultiStaUseCase(MultiStaUseCase use_case, - setMultiStaUseCase_cb hidl_status_cb) override; - Return setCoexUnsafeChannels(const hidl_vec& unsafe_channels, - hidl_bitfield restrictions, - setCoexUnsafeChannels_cb hidl_status_cb) override; - Return setCountryCode(const hidl_array& code, - setCountryCode_cb _hidl_cb) override; - Return getUsableChannels(WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, - getUsableChannels_cb _hidl_cb) override; - Return triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) override; - Return createRttController_1_6(const sp& bound_iface, - createRttController_1_6_cb hidl_status_cb) override; - Return getUsableChannels_1_6(WifiBand band, - hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, - getUsableChannels_1_6_cb _hidl_cb) override; - Return getSupportedRadioCombinationsMatrix( - getSupportedRadioCombinationsMatrix_cb hidl_status_cb) override; - Return getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) override; - - private: - void invalidateAndRemoveAllIfaces(); - // When a STA iface is removed any dependent NAN-ifaces/RTT-controllers are - // invalidated & removed. - void invalidateAndRemoveDependencies(const std::string& removed_iface_name); - - // Corresponding worker functions for the HIDL methods. - std::pair getIdInternal(); - // Deprecated support for this callback - WifiStatus registerEventCallbackInternal( - const sp& event_callback); - std::pair getCapabilitiesInternal(); - std::pair> getAvailableModesInternal(); - WifiStatus configureChipInternal(std::unique_lock* lock, - ChipModeId mode_id); - std::pair getModeInternal(); - std::pair requestChipDebugInfoInternal(); - std::pair> requestDriverDebugDumpInternal(); - std::pair> requestFirmwareDebugDumpInternal(); - sp newWifiApIface(std::string& ifname); - WifiStatus createVirtualApInterface(const std::string& apVirtIf); - std::pair> createApIfaceInternal(); - std::pair> createBridgedApIfaceInternal(); - std::pair> getApIfaceNamesInternal(); - std::pair> getApIfaceInternal(const std::string& ifname); - WifiStatus removeApIfaceInternal(const std::string& ifname); - WifiStatus removeIfaceInstanceFromBridgedApIfaceInternal(const std::string& brIfaceName, - const std::string& ifInstanceName); - std::pair> createNanIfaceInternal(); - std::pair> getNanIfaceNamesInternal(); - std::pair> getNanIfaceInternal(const std::string& ifname); - WifiStatus removeNanIfaceInternal(const std::string& ifname); - std::pair> createP2pIfaceInternal(); - std::pair> getP2pIfaceNamesInternal(); - std::pair> getP2pIfaceInternal(const std::string& ifname); - WifiStatus removeP2pIfaceInternal(const std::string& ifname); - std::pair> createStaIfaceInternal(); - std::pair> getStaIfaceNamesInternal(); - std::pair> getStaIfaceInternal(const std::string& ifname); - WifiStatus removeStaIfaceInternal(const std::string& ifname); - std::pair> createRttControllerInternal( - const sp& bound_iface); - std::pair> - getDebugRingBuffersStatusInternal(); - WifiStatus startLoggingToDebugRingBufferInternal(const hidl_string& ring_name, - WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, - uint32_t min_data_size_in_bytes); - WifiStatus forceDumpToDebugRingBufferInternal(const hidl_string& ring_name); - WifiStatus flushRingBufferToFileInternal(); - WifiStatus stopLoggingToDebugRingBufferInternal(); - std::pair getDebugHostWakeReasonStatsInternal(); - WifiStatus enableDebugErrorAlertsInternal(bool enable); - WifiStatus selectTxPowerScenarioInternal(V1_1::IWifiChip::TxPowerScenario scenario); - WifiStatus resetTxPowerScenarioInternal(); - WifiStatus setLatencyModeInternal(LatencyMode mode); - WifiStatus registerEventCallbackInternal_1_2( - const sp& event_callback); - WifiStatus selectTxPowerScenarioInternal_1_2(TxPowerScenario scenario); - std::pair getCapabilitiesInternal_1_3(); - std::pair getCapabilitiesInternal_1_5(); - std::pair> createRttControllerInternal_1_4( - const sp& bound_iface); - WifiStatus registerEventCallbackInternal_1_4( - const sp& event_callback); - WifiStatus setMultiStaPrimaryConnectionInternal(const std::string& ifname); - WifiStatus setMultiStaUseCaseInternal(MultiStaUseCase use_case); - WifiStatus setCoexUnsafeChannelsInternal(std::vector unsafe_channels, - uint32_t restrictions); - WifiStatus setCountryCodeInternal(const std::array& code); - std::pair> getUsableChannelsInternal( - WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); - WifiStatus handleChipConfiguration(std::unique_lock* lock, - ChipModeId mode_id); - WifiStatus registerDebugRingBufferCallback(); - WifiStatus registerRadioModeChangeCallback(); - std::vector - getCurrentModeConcurrencyCombinations(); - std::map getCurrentConcurrencyCombination(); - std::vector> expandConcurrencyCombinations( - const V1_6::IWifiChip::ChipConcurrencyCombination& combination); - bool canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes( - const std::map& expanded_combo, - IfaceConcurrencyType requested_type); - bool canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType requested_type); - bool canExpandedConcurrencyComboSupportConcurrencyCombo( - const std::map& expanded_combo, - const std::map& req_combo); - bool canCurrentModeSupportConcurrencyCombo( - const std::map& req_combo); - bool canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type); - bool isValidModeId(ChipModeId mode_id); - bool isStaApConcurrencyAllowedInCurrentMode(); - bool isDualStaConcurrencyAllowedInCurrentMode(); - uint32_t startIdxOfApIface(); - std::string getFirstActiveWlanIfaceName(); - std::string allocateApOrStaIfaceName(IfaceType type, uint32_t start_idx); - std::string allocateApIfaceName(); - std::vector allocateBridgedApInstanceNames(); - std::string allocateStaIfaceName(); - bool writeRingbufferFilesInternal(); - std::string getWlanIfaceNameWithType(IfaceType type, unsigned idx); - void invalidateAndClearBridgedApAll(); - void deleteApIface(const std::string& if_name); - bool findUsingNameFromBridgedApInstances(const std::string& name); - WifiStatus triggerSubsystemRestartInternal(); - std::pair> createRttControllerInternal_1_6( - const sp& bound_iface); - std::pair> getUsableChannelsInternal_1_6( - WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); - std::pair getSupportedRadioCombinationsMatrixInternal(); - std::pair> getAvailableModesInternal_1_6(); - - ChipId chip_id_; - std::weak_ptr legacy_hal_; - std::weak_ptr mode_controller_; - std::shared_ptr iface_util_; - std::vector> ap_ifaces_; - std::vector> nan_ifaces_; - std::vector> p2p_ifaces_; - std::vector> sta_ifaces_; - std::vector> rtt_controllers_; - std::map ringbuffer_map_; - bool is_valid_; - // Members pertaining to chip configuration. - uint32_t current_mode_id_; - std::mutex lock_t; - std::vector modes_; - // The legacy ring buffer callback API has only a global callback - // registration mechanism. Use this to check if we have already - // registered a callback. - bool debug_ring_buffer_cb_registered_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_; - - const std::function subsystemCallbackHandler_; - std::map> br_ifaces_ap_instances_; - DISALLOW_COPY_AND_ASSIGN(WifiChip); -}; - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_CHIP_H_ diff --git a/wifi/1.6/default/wifi_nan_iface.cpp b/wifi/1.6/default/wifi_nan_iface.cpp deleted file mode 100644 index ac2ebc940e..0000000000 --- a/wifi/1.6/default/wifi_nan_iface.cpp +++ /dev/null @@ -1,1016 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_nan_iface.h" -#include "wifi_status_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; - -WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util) - : ifname_(ifname), - is_dedicated_iface_(is_dedicated_iface), - legacy_hal_(legacy_hal), - iface_util_(iface_util), - is_valid_(true) { - if (is_dedicated_iface_) { - // If using a dedicated iface, set the iface up first. - if (!iface_util_.lock()->setUpState(ifname_, true)) { - // Fatal failure, invalidate the iface object. - invalidate(); - return; - } - } - // Register all the callbacks here. these should be valid for the lifetime - // of the object. Whenever the mode changes legacy HAL will remove - // all of these callbacks. - legacy_hal::NanCallbackHandlers callback_handlers; - android::wp weak_ptr_this(this); - - // Callback for response. - callback_handlers.on_notify_response = [weak_ptr_this](legacy_hal::transaction_id id, - const legacy_hal::NanResponseMsg& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus wifiNanStatus; - if (!hidl_struct_util::convertLegacyNanResponseHeaderToHidl(msg, &wifiNanStatus)) { - LOG(ERROR) << "Failed to convert nan response header"; - return; - } - - switch (msg.response_type) { - case legacy_hal::NAN_RESPONSE_ENABLED: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyEnableResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_DISABLED: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyDisableResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_PUBLISH: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyStartPublishResponse(id, wifiNanStatus, - msg.body.publish_response.publish_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyStopPublishResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyTransmitFollowupResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_SUBSCRIBE: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyStartSubscribeResponse( - id, wifiNanStatus, - msg.body.subscribe_response.subscribe_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyStopSubscribeResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_CONFIG: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyConfigResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_GET_CAPABILITIES: { - V1_6::NanCapabilities hidl_struct; - if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl( - msg.body.nan_capabilities, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { - if (!callback->notifyCapabilitiesResponse_1_6(id, wifiNanStatus, hidl_struct) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_INTERFACE_CREATE: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyCreateDataInterfaceResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_INTERFACE_DELETE: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyDeleteDataInterfaceResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_INITIATOR_RESPONSE: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyInitiateDataPathResponse( - id, wifiNanStatus, - msg.body.data_request_response.ndp_instance_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_RESPONDER_RESPONSE: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_END: { - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyTerminateDataPathResponse(id, wifiNanStatus).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: - /* fall through */ - case legacy_hal::NAN_RESPONSE_TCA: - /* fall through */ - case legacy_hal::NAN_RESPONSE_STATS: - /* fall through */ - case legacy_hal::NAN_RESPONSE_ERROR: - /* fall through */ - default: - LOG(ERROR) << "Unknown or unhandled response type: " << msg.response_type; - return; - } - }; - - callback_handlers.on_event_disc_eng_event = - [weak_ptr_this](const legacy_hal::NanDiscEngEventInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanClusterEventInd hidl_struct; - // event types defined identically - hence can be cast - hidl_struct.eventType = (NanClusterEventType)msg.event_type; - hidl_struct.addr = msg.data.mac_addr.addr; - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventClusterEvent(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_disabled = [weak_ptr_this](const legacy_hal::NanDisabledInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason), - &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventDisabled(status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_publish_terminated = - [weak_ptr_this](const legacy_hal::NanPublishTerminatedInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, - sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_subscribe_terminated = - [weak_ptr_this](const legacy_hal::NanSubscribeTerminatedInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, - sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_match = [weak_ptr_this](const legacy_hal::NanMatchInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - V1_6::NanMatchInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanMatchIndToHidl(msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { - if (!callback->eventMatch_1_6(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_match_expired = [weak_ptr_this]( - const legacy_hal::NanMatchExpiredInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventMatchExpired(msg.publish_subscribe_id, msg.requestor_instance_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_followup = [weak_ptr_this](const legacy_hal::NanFollowupInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanFollowupReceivedInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanFollowupIndToHidl(msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventFollowupReceived(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_transmit_follow_up = - [weak_ptr_this](const legacy_hal::NanTransmitFollowupInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, - sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventTransmitFollowup(msg.id, status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_data_path_request = - [weak_ptr_this](const legacy_hal::NanDataPathRequestInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanDataPathRequestInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanDataPathRequestIndToHidl(msg, - &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventDataPathRequest(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_data_path_confirm = - [weak_ptr_this](const legacy_hal::NanDataPathConfirmInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - V1_6::NanDataPathConfirmInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(msg, - &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { - if (!callback->eventDataPathConfirm_1_6(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_data_path_end = - [weak_ptr_this](const legacy_hal::NanDataPathEndInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - for (int i = 0; i < msg.num_ndp_instances; ++i) { - if (!callback->eventDataPathTerminated(msg.ndp_instance_id[i]).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - } - }; - - callback_handlers.on_event_beacon_sdf_payload = - [weak_ptr_this](const legacy_hal::NanBeaconSdfPayloadInd& /* msg */) { - LOG(ERROR) << "on_event_beacon_sdf_payload - should not be called"; - }; - - callback_handlers.on_event_range_request = - [weak_ptr_this](const legacy_hal::NanRangeRequestInd& /* msg */) { - LOG(ERROR) << "on_event_range_request - should not be called"; - }; - - callback_handlers.on_event_range_report = - [weak_ptr_this](const legacy_hal::NanRangeReportInd& /* msg */) { - LOG(ERROR) << "on_event_range_report - should not be called"; - }; - - callback_handlers.on_event_schedule_update = - [weak_ptr_this](const legacy_hal::NanDataPathScheduleUpdateInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - V1_6::NanDataPathScheduleUpdateInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanDataPathScheduleUpdateIndToHidl( - msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { - if (!callback->eventDataPathScheduleUpdate_1_6(hidl_struct).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) { - LOG(ERROR) << "Failed to register nan callbacks. Invalidating object"; - invalidate(); - } - - // Register for iface state toggle events. - iface_util::IfaceEventHandlers event_handlers = {}; - event_handlers.on_state_toggle_off_on = [weak_ptr_this](const std::string& /* iface_name */) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - // Tell framework that NAN has been disabled. - WifiNanStatus status = {NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventDisabled(status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - iface_util_.lock()->registerIfaceEventHandlers(ifname_, event_handlers); -} - -void WifiNanIface::invalidate() { - if (!isValid()) { - return; - } - // send commands to HAL to actually disable and destroy interfaces - legacy_hal_.lock()->nanDisableRequest(ifname_, 0xFFFF); - legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFE, "aware_data0"); - legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFD, "aware_data1"); - iface_util_.lock()->unregisterIfaceEventHandlers(ifname_); - legacy_hal_.reset(); - event_cb_handler_.invalidate(); - event_cb_handler_1_2_.invalidate(); - event_cb_handler_1_5_.invalidate(); - is_valid_ = false; - if (is_dedicated_iface_) { - // If using a dedicated iface, set the iface down. - iface_util_.lock()->setUpState(ifname_, false); - } -} - -bool WifiNanIface::isValid() { - return is_valid_; -} - -std::string WifiNanIface::getName() { - return ifname_; -} - -std::set> WifiNanIface::getEventCallbacks() { - return event_cb_handler_.getCallbacks(); -} - -std::set> WifiNanIface::getEventCallbacks_1_2() { - return event_cb_handler_1_2_.getCallbacks(); -} - -std::set> WifiNanIface::getEventCallbacks_1_5() { - return event_cb_handler_1_5_.getCallbacks(); -} - -std::set> WifiNanIface::getEventCallbacks_1_6() { - return event_cb_handler_1_6_.getCallbacks(); -} - -Return WifiNanIface::getName(getName_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getNameInternal, hidl_status_cb); -} - -Return WifiNanIface::getType(getType_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getTypeInternal, hidl_status_cb); -} - -Return WifiNanIface::registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallbackInternal, hidl_status_cb, callback); -} - -Return WifiNanIface::getCapabilitiesRequest(uint16_t cmd_id, - getCapabilitiesRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getCapabilitiesRequestInternal, hidl_status_cb, cmd_id); -} - -Return WifiNanIface::enableRequest(uint16_t cmd_id, const V1_0::NanEnableRequest& msg, - enableRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequestInternal, hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::configRequest(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, - configRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequestInternal, hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::disableRequest(uint16_t cmd_id, disableRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::disableRequestInternal, hidl_status_cb, cmd_id); -} - -Return WifiNanIface::startPublishRequest(uint16_t cmd_id, const V1_0::NanPublishRequest& msg, - startPublishRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::startPublishRequestInternal, hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::stopPublishRequest(uint16_t cmd_id, uint8_t sessionId, - stopPublishRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::stopPublishRequestInternal, hidl_status_cb, cmd_id, - sessionId); -} - -Return WifiNanIface::startSubscribeRequest(uint16_t cmd_id, - const V1_0::NanSubscribeRequest& msg, - startSubscribeRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::startSubscribeRequestInternal, hidl_status_cb, cmd_id, - msg); -} - -Return WifiNanIface::stopSubscribeRequest(uint16_t cmd_id, uint8_t sessionId, - stopSubscribeRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::stopSubscribeRequestInternal, hidl_status_cb, cmd_id, - sessionId); -} - -Return WifiNanIface::transmitFollowupRequest(uint16_t cmd_id, - const NanTransmitFollowupRequest& msg, - transmitFollowupRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::transmitFollowupRequestInternal, hidl_status_cb, cmd_id, - msg); -} - -Return WifiNanIface::createDataInterfaceRequest( - uint16_t cmd_id, const hidl_string& iface_name, - createDataInterfaceRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::createDataInterfaceRequestInternal, hidl_status_cb, - cmd_id, iface_name); -} - -Return WifiNanIface::deleteDataInterfaceRequest( - uint16_t cmd_id, const hidl_string& iface_name, - deleteDataInterfaceRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::deleteDataInterfaceRequestInternal, hidl_status_cb, - cmd_id, iface_name); -} - -Return WifiNanIface::initiateDataPathRequest(uint16_t cmd_id, - const V1_0::NanInitiateDataPathRequest& msg, - initiateDataPathRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::initiateDataPathRequestInternal, hidl_status_cb, cmd_id, - msg); -} - -Return WifiNanIface::respondToDataPathIndicationRequest( - uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg, - respondToDataPathIndicationRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::respondToDataPathIndicationRequestInternal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId, - terminateDataPathRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::terminateDataPathRequestInternal, hidl_status_cb, cmd_id, - ndpInstanceId); -} - -Return WifiNanIface::registerEventCallback_1_2( - const sp& callback, - registerEventCallback_1_2_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallback_1_2Internal, hidl_status_cb, - callback); -} - -Return WifiNanIface::enableRequest_1_2(uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_2_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_2Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::configRequest_1_2(uint16_t cmd_id, const V1_0::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_2_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_2Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::enableRequest_1_4(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_4Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::configRequest_1_4(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_4Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::registerEventCallback_1_5( - const sp& callback, - registerEventCallback_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallback_1_5Internal, hidl_status_cb, - callback); -} - -Return WifiNanIface::enableRequest_1_5(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2, - enableRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_5Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::configRequest_1_5(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2, - configRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_5Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::getCapabilitiesRequest_1_5( - uint16_t cmd_id, getCapabilitiesRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getCapabilitiesRequest_1_5Internal, hidl_status_cb, - cmd_id); -} - -Return WifiNanIface::enableRequest_1_6(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2, - enableRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_6Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::configRequest_1_6(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2, - configRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_6Internal, hidl_status_cb, cmd_id, msg1, - msg2); -} - -Return WifiNanIface::initiateDataPathRequest_1_6(uint16_t cmd_id, - const V1_6::NanInitiateDataPathRequest& msg, - initiateDataPathRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::initiateDataPathRequest_1_6Internal, hidl_status_cb, - cmd_id, msg); -} - -Return WifiNanIface::respondToDataPathIndicationRequest_1_6( - uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg, - respondToDataPathIndicationRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::respondToDataPathIndicationRequest_1_6Internal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::startPublishRequest_1_6(uint16_t cmd_id, - const V1_6::NanPublishRequest& msg, - startPublishRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::startPublishRequest_1_6Internal, hidl_status_cb, cmd_id, - msg); -} - -std::pair WifiNanIface::getNameInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; -} - -std::pair WifiNanIface::getTypeInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN}; -} - -Return WifiNanIface::registerEventCallback_1_6( - const sp& callback, - registerEventCallback_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallback_1_6Internal, hidl_status_cb, - callback); -} - -WifiStatus WifiNanIface::registerEventCallbackInternal( - const sp& callback) { - if (!event_cb_handler_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t /* cmd_id */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::enableRequestInternal(uint16_t /* cmd_id */, - const V1_0::NanEnableRequest& /* msg */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequestInternal(uint16_t /* cmd_id */, - const V1_0::NanConfigRequest& /* msg */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->nanDisableRequest(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t /* cmd_id */, - const V1_0::NanPublishRequest& /* msg */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId) { - legacy_hal::NanPublishCancelRequest legacy_msg; - legacy_msg.publish_id = sessionId; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanPublishCancelRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::startSubscribeRequestInternal(uint16_t cmd_id, - const V1_0::NanSubscribeRequest& msg) { - legacy_hal::NanSubscribeRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanSubscribeRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId) { - legacy_hal::NanSubscribeCancelRequest legacy_msg; - legacy_msg.subscribe_id = sessionId; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanSubscribeCancelRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::transmitFollowupRequestInternal(uint16_t cmd_id, - const NanTransmitFollowupRequest& msg) { - legacy_hal::NanTransmitFollowupRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanTransmitFollowupRequestToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanTransmitFollowupRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::createDataInterfaceRequestInternal(uint16_t cmd_id, - const std::string& iface_name) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataInterfaceCreate(ifname_, cmd_id, iface_name); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal(uint16_t cmd_id, - const std::string& iface_name) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, cmd_id, iface_name); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::initiateDataPathRequestInternal( - uint16_t cmd_id, const V1_0::NanInitiateDataPathRequest& msg) { - legacy_hal::NanDataPathInitiatorRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataRequestInitiator(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal( - uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg) { - legacy_hal::NanDataPathIndicationResponse legacy_msg; - if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataIndicationResponse(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::terminateDataPathRequestInternal(uint16_t cmd_id, uint32_t ndpInstanceId) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataEnd(ifname_, cmd_id, ndpInstanceId); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::registerEventCallback_1_2Internal( - const sp& callback) { - sp callback_1_0 = callback; - if (!event_cb_handler_.addCallback(callback_1_0)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - if (!event_cb_handler_1_2_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiNanIface::enableRequest_1_2Internal( - uint16_t /* cmd_id */, const V1_0::NanEnableRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequest_1_2Internal( - uint16_t /* cmd_id */, const V1_0::NanConfigRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::enableRequest_1_4Internal( - uint16_t /* cmd_id */, const V1_4::NanEnableRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequest_1_4Internal( - uint16_t /* cmd_id */, const V1_4::NanConfigRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::registerEventCallback_1_5Internal( - const sp& callback) { - sp callback_1_0 = callback; - if (!event_cb_handler_.addCallback(callback_1_0)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - sp callback_1_2 = callback; - if (!event_cb_handler_1_2_.addCallback(callback_1_2)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - if (!event_cb_handler_1_5_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiNanIface::getCapabilitiesRequest_1_5Internal(uint16_t cmd_id) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->nanGetCapabilities(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::enableRequest_1_5Internal( - uint16_t /* cmd_id */, const V1_4::NanEnableRequest& /* msg1 */, - const V1_5::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequest_1_5Internal( - uint16_t /* cmd_id */, const V1_4::NanConfigRequest& /* msg1 */, - const V1_5::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::enableRequest_1_6Internal(uint16_t cmd_id, - const V1_4::NanEnableRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2) { - legacy_hal::NanEnableRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanEnableRequest_1_6ToLegacy(msg1, msg2, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanEnableRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::configRequest_1_6Internal(uint16_t cmd_id, - const V1_4::NanConfigRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2) { - legacy_hal::NanConfigRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanConfigRequest_1_6ToLegacy(msg1, msg2, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanConfigRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::initiateDataPathRequest_1_6Internal( - uint16_t cmd_id, const V1_6::NanInitiateDataPathRequest& msg) { - legacy_hal::NanDataPathInitiatorRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequest_1_6ToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataRequestInitiator(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::respondToDataPathIndicationRequest_1_6Internal( - uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg) { - legacy_hal::NanDataPathIndicationResponse legacy_msg; - if (!hidl_struct_util::convertHidlNanDataPathIndicationResponse_1_6ToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataIndicationResponse(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::startPublishRequest_1_6Internal(uint16_t cmd_id, - const V1_6::NanPublishRequest& msg) { - legacy_hal::NanPublishRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanPublishRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::registerEventCallback_1_6Internal( - const sp& callback) { - sp callback_1_0 = callback; - if (!event_cb_handler_.addCallback(callback_1_0)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - sp callback_1_2 = callback; - if (!event_cb_handler_1_2_.addCallback(callback_1_2)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - sp callback_1_5 = callback; - if (!event_cb_handler_1_5_.addCallback(callback_1_5)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - if (!event_cb_handler_1_6_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.6/default/wifi_nan_iface.h b/wifi/1.6/default/wifi_nan_iface.h deleted file mode 100644 index 15bf57298c..0000000000 --- a/wifi/1.6/default/wifi_nan_iface.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef WIFI_NAN_IFACE_H_ -#define WIFI_NAN_IFACE_H_ - -#include -#include -#include - -#include "hidl_callback_util.h" -#include "wifi_iface_util.h" -#include "wifi_legacy_hal.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; -using namespace android::hardware::wifi::V1_2; -using namespace android::hardware::wifi::V1_4; -using namespace android::hardware::wifi::V1_6; - -/** - * HIDL interface object used to control a NAN Iface instance. - */ -class WifiNanIface : public V1_6::IWifiNanIface { - public: - WifiNanIface(const std::string& ifname, bool is_dedicated_iface, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util); - // Refer to |WifiChip::invalidate()|. - void invalidate(); - bool isValid(); - std::string getName(); - - // HIDL methods exposed. - Return getName(getName_cb hidl_status_cb) override; - Return getType(getType_cb hidl_status_cb) override; - Return registerEventCallback(const sp& callback, - registerEventCallback_cb hidl_status_cb) override; - Return getCapabilitiesRequest(uint16_t cmd_id, - getCapabilitiesRequest_cb hidl_status_cb) override; - Return enableRequest(uint16_t cmd_id, const V1_0::NanEnableRequest& msg, - enableRequest_cb hidl_status_cb) override; - Return configRequest(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, - configRequest_cb hidl_status_cb) override; - Return disableRequest(uint16_t cmd_id, disableRequest_cb hidl_status_cb) override; - Return startPublishRequest(uint16_t cmd_id, const V1_0::NanPublishRequest& msg, - startPublishRequest_cb hidl_status_cb) override; - Return stopPublishRequest(uint16_t cmd_id, uint8_t sessionId, - stopPublishRequest_cb hidl_status_cb) override; - Return startSubscribeRequest(uint16_t cmd_id, const V1_0::NanSubscribeRequest& msg, - startSubscribeRequest_cb hidl_status_cb) override; - Return stopSubscribeRequest(uint16_t cmd_id, uint8_t sessionId, - stopSubscribeRequest_cb hidl_status_cb) override; - Return transmitFollowupRequest(uint16_t cmd_id, const NanTransmitFollowupRequest& msg, - transmitFollowupRequest_cb hidl_status_cb) override; - Return createDataInterfaceRequest(uint16_t cmd_id, const hidl_string& iface_name, - createDataInterfaceRequest_cb hidl_status_cb) override; - Return deleteDataInterfaceRequest(uint16_t cmd_id, const hidl_string& iface_name, - deleteDataInterfaceRequest_cb hidl_status_cb) override; - Return initiateDataPathRequest(uint16_t cmd_id, - const V1_0::NanInitiateDataPathRequest& msg, - initiateDataPathRequest_cb hidl_status_cb) override; - Return respondToDataPathIndicationRequest( - uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg, - respondToDataPathIndicationRequest_cb hidl_status_cb) override; - Return terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId, - terminateDataPathRequest_cb hidl_status_cb) override; - - Return registerEventCallback_1_2(const sp& callback, - registerEventCallback_1_2_cb hidl_status_cb) override; - Return enableRequest_1_2(uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_2_cb hidl_status_cb) override; - Return configRequest_1_2(uint16_t cmd_id, const V1_0::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_2_cb hidl_status_cb) override; - Return enableRequest_1_4(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_4_cb hidl_status_cb) override; - Return configRequest_1_4(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_4_cb hidl_status_cb) override; - Return registerEventCallback_1_5(const sp& callback, - registerEventCallback_1_5_cb hidl_status_cb) override; - Return enableRequest_1_5(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2, - enableRequest_1_5_cb hidl_status_cb) override; - Return configRequest_1_5(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2, - configRequest_1_5_cb hidl_status_cb) override; - Return getCapabilitiesRequest_1_5(uint16_t cmd_id, - getCapabilitiesRequest_cb hidl_status_cb) override; - Return registerEventCallback_1_6(const sp& callback, - registerEventCallback_1_6_cb hidl_status_cb) override; - Return initiateDataPathRequest_1_6( - uint16_t cmd_id, const V1_6::NanInitiateDataPathRequest& msg, - initiateDataPathRequest_1_6_cb hidl_status_cb) override; - Return respondToDataPathIndicationRequest_1_6( - uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg, - respondToDataPathIndicationRequest_1_6_cb hidl_status_cb) override; - Return enableRequest_1_6(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2, - enableRequest_1_6_cb hidl_status_cb) override; - Return configRequest_1_6(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2, - configRequest_1_6_cb hidl_status_cb) override; - Return startPublishRequest_1_6(uint16_t cmd_id, const V1_6::NanPublishRequest& msg, - startPublishRequest_cb hidl_status_cb) override; - - private: - // Corresponding worker functions for the HIDL methods. - std::pair getNameInternal(); - std::pair getTypeInternal(); - WifiStatus registerEventCallbackInternal(const sp& callback); - WifiStatus getCapabilitiesRequestInternal(uint16_t cmd_id); - WifiStatus enableRequestInternal(uint16_t cmd_id, const V1_0::NanEnableRequest& msg); - WifiStatus configRequestInternal(uint16_t cmd_id, const V1_0::NanConfigRequest& msg); - WifiStatus disableRequestInternal(uint16_t cmd_id); - WifiStatus startPublishRequestInternal(uint16_t cmd_id, const V1_0::NanPublishRequest& msg); - WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId); - WifiStatus startSubscribeRequestInternal(uint16_t cmd_id, const V1_0::NanSubscribeRequest& msg); - WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId); - WifiStatus transmitFollowupRequestInternal(uint16_t cmd_id, - const NanTransmitFollowupRequest& msg); - WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id, const std::string& iface_name); - WifiStatus deleteDataInterfaceRequestInternal(uint16_t cmd_id, const std::string& iface_name); - WifiStatus initiateDataPathRequestInternal(uint16_t cmd_id, - const V1_0::NanInitiateDataPathRequest& msg); - WifiStatus respondToDataPathIndicationRequestInternal( - uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg); - WifiStatus terminateDataPathRequestInternal(uint16_t cmd_id, uint32_t ndpInstanceId); - - WifiStatus registerEventCallback_1_2Internal( - const sp& callback); - WifiStatus enableRequest_1_2Internal(uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_2Internal(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus enableRequest_1_4Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_4Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus registerEventCallback_1_5Internal( - const sp& callback); - WifiStatus enableRequest_1_5Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_5Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, - const V1_5::NanConfigRequestSupplemental& msg2); - WifiStatus getCapabilitiesRequest_1_5Internal(uint16_t cmd_id); - WifiStatus registerEventCallback_1_6Internal( - const sp& callback); - - WifiStatus enableRequest_1_6Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_6::NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_6Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, - const V1_6::NanConfigRequestSupplemental& msg2); - WifiStatus startPublishRequest_1_6Internal(uint16_t cmd_id, const V1_6::NanPublishRequest& msg); - WifiStatus initiateDataPathRequest_1_6Internal(uint16_t cmd_id, - const V1_6::NanInitiateDataPathRequest& msg); - WifiStatus respondToDataPathIndicationRequest_1_6Internal( - uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg); - - // all 1_0 and descendant callbacks - std::set> getEventCallbacks(); - // all 1_2 and descendant callbacks - std::set> getEventCallbacks_1_2(); - // all 1_5 and descendant callbacks - std::set> getEventCallbacks_1_5(); - // all 1_6 and descendant callbacks - std::set> getEventCallbacks_1_6(); - - std::string ifname_; - bool is_dedicated_iface_; - std::weak_ptr legacy_hal_; - std::weak_ptr iface_util_; - bool is_valid_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_1_2_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_1_5_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_1_6_; - - DISALLOW_COPY_AND_ASSIGN(WifiNanIface); -}; - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_NAN_IFACE_H_ diff --git a/wifi/1.6/default/wifi_rtt_controller.cpp b/wifi/1.6/default/wifi_rtt_controller.cpp deleted file mode 100644 index aa9ee2f520..0000000000 --- a/wifi/1.6/default/wifi_rtt_controller.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_rtt_controller.h" -#include "wifi_status_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; - -WifiRttController::WifiRttController(const std::string& iface_name, - const sp& bound_iface, - const std::weak_ptr legacy_hal) - : ifname_(iface_name), bound_iface_(bound_iface), legacy_hal_(legacy_hal), is_valid_(true) {} - -void WifiRttController::invalidate() { - legacy_hal_.reset(); - event_callbacks_.clear(); - is_valid_ = false; -} - -bool WifiRttController::isValid() { - return is_valid_; -} - -std::vector> WifiRttController::getEventCallbacks() { - return event_callbacks_; -} - -std::string WifiRttController::getIfaceName() { - return ifname_; -} - -Return WifiRttController::getBoundIface(getBoundIface_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getBoundIfaceInternal, hidl_status_cb); -} - -Return WifiRttController::registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::registerEventCallbackInternal, hidl_status_cb, - callback); -} - -Return WifiRttController::rangeRequest(uint32_t cmd_id, - const hidl_vec& rtt_configs, - rangeRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeRequestInternal, hidl_status_cb, cmd_id, - rtt_configs); -} - -Return WifiRttController::rangeCancel(uint32_t cmd_id, - const hidl_vec>& addrs, - rangeCancel_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeCancelInternal, hidl_status_cb, cmd_id, addrs); -} - -Return WifiRttController::getCapabilities(getCapabilities_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getCapabilitiesInternal, hidl_status_cb); -} - -Return WifiRttController::setLci(uint32_t cmd_id, const RttLciInformation& lci, - setLci_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::setLciInternal, hidl_status_cb, cmd_id, lci); -} - -Return WifiRttController::setLcr(uint32_t cmd_id, const RttLcrInformation& lcr, - setLcr_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::setLcrInternal, hidl_status_cb, cmd_id, lcr); -} - -Return WifiRttController::getResponderInfo(getResponderInfo_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getResponderInfoInternal, hidl_status_cb); -} - -Return WifiRttController::enableResponder(uint32_t cmd_id, - const V1_0::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_0::RttResponder& info, - enableResponder_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::enableResponderInternal, hidl_status_cb, cmd_id, - channel_hint, max_duration_seconds, info); -} - -Return WifiRttController::disableResponder(uint32_t cmd_id, - disableResponder_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::disableResponderInternal, hidl_status_cb, cmd_id); -} - -Return WifiRttController::registerEventCallback_1_4( - const sp& callback, - registerEventCallback_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::registerEventCallbackInternal_1_4, hidl_status_cb, - callback); -} - -Return WifiRttController::rangeRequest_1_4(uint32_t cmd_id, - const hidl_vec& rtt_configs, - rangeRequest_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeRequestInternal_1_4, hidl_status_cb, cmd_id, - rtt_configs); -} - -Return WifiRttController::getCapabilities_1_4(getCapabilities_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getCapabilitiesInternal_1_4, hidl_status_cb); -} - -Return WifiRttController::getResponderInfo_1_4(getResponderInfo_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getResponderInfoInternal_1_4, hidl_status_cb); -} - -Return WifiRttController::enableResponder_1_4(uint32_t cmd_id, - const V1_0::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_4::RttResponder& info, - enableResponder_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::enableResponderInternal_1_4, hidl_status_cb, cmd_id, - channel_hint, max_duration_seconds, info); -} - -Return WifiRttController::registerEventCallback_1_6( - const sp& callback, - registerEventCallback_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::registerEventCallbackInternal_1_6, hidl_status_cb, - callback); -} - -Return WifiRttController::rangeRequest_1_6(uint32_t cmd_id, - const hidl_vec& rtt_configs, - rangeRequest_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeRequestInternal_1_6, hidl_status_cb, cmd_id, - rtt_configs); -} - -Return WifiRttController::getCapabilities_1_6(getCapabilities_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getCapabilitiesInternal_1_6, hidl_status_cb); -} - -Return WifiRttController::getResponderInfo_1_6(getResponderInfo_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getResponderInfoInternal_1_6, hidl_status_cb); -} - -Return WifiRttController::enableResponder_1_6(uint32_t cmd_id, - const V1_6::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_6::RttResponder& info, - enableResponder_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::enableResponderInternal_1_6, hidl_status_cb, cmd_id, - channel_hint, max_duration_seconds, info); -} - -std::pair> WifiRttController::getBoundIfaceInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_}; -} - -WifiStatus WifiRttController::registerEventCallbackInternal( - const sp& /* callback */) { - // Deprecated support for this api - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiRttController::rangeRequestInternal( - uint32_t /* cmd_id */, const std::vector& /* rtt_configs */) { - // Deprecated support for this api - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiRttController::rangeCancelInternal( - uint32_t cmd_id, const std::vector>& addrs) { - std::vector> legacy_addrs; - for (const auto& addr : addrs) { - legacy_addrs.push_back(addr); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->cancelRttRangeRequest(ifname_, cmd_id, legacy_addrs); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair WifiRttController::getCapabilitiesInternal() { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiRttController::setLciInternal(uint32_t cmd_id, const RttLciInformation& lci) { - legacy_hal::wifi_lci_information legacy_lci; - if (!hidl_struct_util::convertHidlRttLciInformationToLegacy(lci, &legacy_lci)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->setRttLci(ifname_, cmd_id, legacy_lci); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiRttController::setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr) { - legacy_hal::wifi_lcr_information legacy_lcr; - if (!hidl_struct_util::convertHidlRttLcrInformationToLegacy(lcr, &legacy_lcr)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->setRttLcr(ifname_, cmd_id, legacy_lcr); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair WifiRttController::getResponderInfoInternal() { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiRttController::enableResponderInternal( - uint32_t /* cmd_id */, const V1_0::WifiChannelInfo& /* channel_hint */, - uint32_t /* max_duration_seconds */, const V1_0::RttResponder& /* info */) { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)}; -} - -WifiStatus WifiRttController::disableResponderInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->disableRttResponder(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiRttController::registerEventCallbackInternal_1_4( - const sp& /* callback */) { - // Deprecated support for this api - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiRttController::rangeRequestInternal_1_4( - uint32_t /* cmd_id */, const std::vector& /* rtt_configs */) { - // Deprecated support for this api - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -std::pair WifiRttController::getCapabilitiesInternal_1_4() { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -std::pair WifiRttController::getResponderInfoInternal_1_4() { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiRttController::enableResponderInternal_1_4( - uint32_t /* cmd_id */, const V1_0::WifiChannelInfo& /* channel_hint */, - uint32_t /* max_duration_seconds */, const V1_4::RttResponder& /* info */) { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)}; -} - -WifiStatus WifiRttController::registerEventCallbackInternal_1_6( - const sp& callback) { - // TODO(b/31632518): remove the callback when the client is destroyed - event_callbacks_.emplace_back(callback); - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiRttController::rangeRequestInternal_1_6( - uint32_t cmd_id, const std::vector& rtt_configs) { - std::vector legacy_configs; - if (!hidl_struct_util::convertHidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - android::wp weak_ptr_this(this); - const auto& on_results_callback = - [weak_ptr_this](legacy_hal::wifi_request_id id, - const std::vector& results) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - std::vector hidl_results; - if (!hidl_struct_util::convertLegacyVectorOfRttResultToHidl(results, - &hidl_results)) { - LOG(ERROR) << "Failed to convert rtt results to HIDL structs"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onResults_1_6(id, hidl_results).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest( - ifname_, cmd_id, legacy_configs, on_results_callback); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair WifiRttController::getCapabilitiesInternal_1_6() { - legacy_hal::wifi_error legacy_status; - legacy_hal::wifi_rtt_capabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - V1_6::RttCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyRttCapabilitiesToHidl(legacy_caps, &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -std::pair WifiRttController::getResponderInfoInternal_1_6() { - legacy_hal::wifi_error legacy_status; - legacy_hal::wifi_rtt_responder legacy_responder; - std::tie(legacy_status, legacy_responder) = legacy_hal_.lock()->getRttResponderInfo(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - V1_6::RttResponder hidl_responder; - if (!hidl_struct_util::convertLegacyRttResponderToHidl(legacy_responder, &hidl_responder)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_responder}; -} - -WifiStatus WifiRttController::enableResponderInternal_1_6(uint32_t cmd_id, - const V1_6::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_6::RttResponder& info) { - legacy_hal::wifi_channel_info legacy_channel_info; - if (!hidl_struct_util::convertHidlWifiChannelInfoToLegacy(channel_hint, &legacy_channel_info)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_rtt_responder legacy_responder; - if (!hidl_struct_util::convertHidlRttResponderToLegacy(info, &legacy_responder)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableRttResponder( - ifname_, cmd_id, legacy_channel_info, max_duration_seconds, legacy_responder); - return createWifiStatusFromLegacyError(legacy_status); -} -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.6/default/wifi_rtt_controller.h b/wifi/1.6/default/wifi_rtt_controller.h deleted file mode 100644 index fd5f68b6a8..0000000000 --- a/wifi/1.6/default/wifi_rtt_controller.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef WIFI_RTT_CONTROLLER_H_ -#define WIFI_RTT_CONTROLLER_H_ - -#include -#include -#include -#include - -#include "wifi_legacy_hal.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { - -/** - * HIDL interface object used to control all RTT operations. - */ -class WifiRttController : public V1_6::IWifiRttController { - public: - WifiRttController(const std::string& iface_name, const sp& bound_iface, - const std::weak_ptr legacy_hal); - // Refer to |WifiChip::invalidate()|. - void invalidate(); - bool isValid(); - std::vector> getEventCallbacks(); - std::string getIfaceName(); - - // HIDL methods exposed. - Return getBoundIface(getBoundIface_cb hidl_status_cb) override; - Return registerEventCallback(const sp& callback, - registerEventCallback_cb hidl_status_cb) override; - Return rangeRequest(uint32_t cmd_id, const hidl_vec& rtt_configs, - rangeRequest_cb hidl_status_cb) override; - Return rangeCancel(uint32_t cmd_id, const hidl_vec>& addrs, - rangeCancel_cb hidl_status_cb) override; - Return getCapabilities(getCapabilities_cb hidl_status_cb) override; - Return setLci(uint32_t cmd_id, const RttLciInformation& lci, - setLci_cb hidl_status_cb) override; - Return setLcr(uint32_t cmd_id, const RttLcrInformation& lcr, - setLcr_cb hidl_status_cb) override; - Return getResponderInfo(getResponderInfo_cb hidl_status_cb) override; - Return enableResponder(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_0::RttResponder& info, - enableResponder_cb hidl_status_cb) override; - Return disableResponder(uint32_t cmd_id, disableResponder_cb hidl_status_cb) override; - Return registerEventCallback_1_4( - const sp& callback, - registerEventCallback_1_4_cb hidl_status_cb) override; - Return rangeRequest_1_4(uint32_t cmd_id, const hidl_vec& rtt_configs, - rangeRequest_1_4_cb hidl_status_cb) override; - Return getCapabilities_1_4(getCapabilities_1_4_cb hidl_status_cb) override; - Return getResponderInfo_1_4(getResponderInfo_1_4_cb hidl_status_cb) override; - Return enableResponder_1_4(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_4::RttResponder& info, - enableResponder_1_4_cb hidl_status_cb) override; - Return registerEventCallback_1_6( - const sp& callback, - registerEventCallback_1_6_cb hidl_status_cb) override; - Return rangeRequest_1_6(uint32_t cmd_id, const hidl_vec& rtt_configs, - rangeRequest_1_6_cb hidl_status_cb) override; - Return getCapabilities_1_6(getCapabilities_1_6_cb hidl_status_cb) override; - Return getResponderInfo_1_6(getResponderInfo_1_6_cb hidl_status_cb) override; - Return enableResponder_1_6(uint32_t cmd_id, const V1_6::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_6::RttResponder& info, - enableResponder_1_6_cb hidl_status_cb) override; - - private: - // Corresponding worker functions for the HIDL methods. - std::pair> getBoundIfaceInternal(); - WifiStatus registerEventCallbackInternal( - const sp& callback); - WifiStatus rangeRequestInternal(uint32_t cmd_id, - const std::vector& rtt_configs); - WifiStatus rangeCancelInternal(uint32_t cmd_id, - const std::vector>& addrs); - std::pair getCapabilitiesInternal(); - WifiStatus setLciInternal(uint32_t cmd_id, const RttLciInformation& lci); - WifiStatus setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr); - std::pair getResponderInfoInternal(); - WifiStatus enableResponderInternal(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_0::RttResponder& info); - WifiStatus disableResponderInternal(uint32_t cmd_id); - WifiStatus registerEventCallbackInternal_1_4( - const sp& callback); - WifiStatus rangeRequestInternal_1_4(uint32_t cmd_id, - const std::vector& rtt_configs); - std::pair getCapabilitiesInternal_1_4(); - std::pair getResponderInfoInternal_1_4(); - WifiStatus enableResponderInternal_1_4(uint32_t cmd_id, - const V1_0::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_4::RttResponder& info); - WifiStatus registerEventCallbackInternal_1_6( - const sp& callback); - WifiStatus rangeRequestInternal_1_6(uint32_t cmd_id, - const std::vector& rtt_configs); - std::pair getCapabilitiesInternal_1_6(); - std::pair getResponderInfoInternal_1_6(); - WifiStatus enableResponderInternal_1_6(uint32_t cmd_id, - const V1_6::WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_6::RttResponder& info); - - std::string ifname_; - sp bound_iface_; - std::weak_ptr legacy_hal_; - std::vector> event_callbacks_; - bool is_valid_; - - DISALLOW_COPY_AND_ASSIGN(WifiRttController); -}; - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_RTT_CONTROLLER_H_ diff --git a/wifi/1.6/default/wifi_sta_iface.cpp b/wifi/1.6/default/wifi_sta_iface.cpp deleted file mode 100644 index dd11839c97..0000000000 --- a/wifi/1.6/default/wifi_sta_iface.cpp +++ /dev/null @@ -1,592 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_sta_iface.h" -#include "wifi_status_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; - -WifiStaIface::WifiStaIface(const std::string& ifname, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util) - : ifname_(ifname), legacy_hal_(legacy_hal), iface_util_(iface_util), is_valid_(true) { - // Turn on DFS channel usage for STA iface. - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setDfsFlag(ifname_, true); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to set DFS flag; DFS channels may be unavailable."; - } -} - -void WifiStaIface::invalidate() { - legacy_hal_.reset(); - event_cb_handler_.invalidate(); - is_valid_ = false; -} - -bool WifiStaIface::isValid() { - return is_valid_; -} - -std::string WifiStaIface::getName() { - return ifname_; -} - -std::set> WifiStaIface::getEventCallbacks() { - return event_cb_handler_.getCallbacks(); -} - -Return WifiStaIface::getName(getName_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getNameInternal, hidl_status_cb); -} - -Return WifiStaIface::getType(getType_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getTypeInternal, hidl_status_cb); -} - -Return WifiStaIface::registerEventCallback(const sp& callback, - registerEventCallback_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::registerEventCallbackInternal, hidl_status_cb, callback); -} - -Return WifiStaIface::getCapabilities(getCapabilities_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getCapabilitiesInternal, hidl_status_cb); -} - -Return WifiStaIface::getApfPacketFilterCapabilities( - getApfPacketFilterCapabilities_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getApfPacketFilterCapabilitiesInternal, hidl_status_cb); -} - -Return WifiStaIface::installApfPacketFilter(uint32_t cmd_id, const hidl_vec& program, - installApfPacketFilter_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::installApfPacketFilterInternal, hidl_status_cb, cmd_id, - program); -} - -Return WifiStaIface::readApfPacketFilterData(readApfPacketFilterData_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::readApfPacketFilterDataInternal, hidl_status_cb); -} - -Return WifiStaIface::getBackgroundScanCapabilities( - getBackgroundScanCapabilities_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getBackgroundScanCapabilitiesInternal, hidl_status_cb); -} - -Return WifiStaIface::getValidFrequenciesForBand( - V1_0::WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getValidFrequenciesForBandInternal, hidl_status_cb, band); -} - -Return WifiStaIface::startBackgroundScan(uint32_t cmd_id, - const StaBackgroundScanParameters& params, - startBackgroundScan_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startBackgroundScanInternal, hidl_status_cb, cmd_id, - params); -} - -Return WifiStaIface::stopBackgroundScan(uint32_t cmd_id, - stopBackgroundScan_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::stopBackgroundScanInternal, hidl_status_cb, cmd_id); -} - -Return WifiStaIface::enableLinkLayerStatsCollection( - bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::enableLinkLayerStatsCollectionInternal, hidl_status_cb, - debug); -} - -Return WifiStaIface::disableLinkLayerStatsCollection( - disableLinkLayerStatsCollection_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::disableLinkLayerStatsCollectionInternal, hidl_status_cb); -} - -Return WifiStaIface::getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal, hidl_status_cb); -} - -Return WifiStaIface::getLinkLayerStats_1_3(getLinkLayerStats_1_3_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal_1_3, hidl_status_cb); -} - -Return WifiStaIface::getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal_1_5, hidl_status_cb); -} - -Return WifiStaIface::getLinkLayerStats_1_6(getLinkLayerStats_1_6_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal_1_6, hidl_status_cb); -} - -Return WifiStaIface::startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, - startRssiMonitoring_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startRssiMonitoringInternal, hidl_status_cb, cmd_id, - max_rssi, min_rssi); -} - -Return WifiStaIface::stopRssiMonitoring(uint32_t cmd_id, - stopRssiMonitoring_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::stopRssiMonitoringInternal, hidl_status_cb, cmd_id); -} - -Return WifiStaIface::getRoamingCapabilities(getRoamingCapabilities_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getRoamingCapabilitiesInternal, hidl_status_cb); -} - -Return WifiStaIface::configureRoaming(const StaRoamingConfig& config, - configureRoaming_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::configureRoamingInternal, hidl_status_cb, config); -} - -Return WifiStaIface::setRoamingState(StaRoamingState state, - setRoamingState_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setRoamingStateInternal, hidl_status_cb, state); -} - -Return WifiStaIface::enableNdOffload(bool enable, enableNdOffload_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::enableNdOffloadInternal, hidl_status_cb, enable); -} - -Return WifiStaIface::startSendingKeepAlivePackets( - uint32_t cmd_id, const hidl_vec& ip_packet_data, uint16_t ether_type, - const hidl_array& src_address, const hidl_array& dst_address, - uint32_t period_in_ms, startSendingKeepAlivePackets_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startSendingKeepAlivePacketsInternal, hidl_status_cb, - cmd_id, ip_packet_data, ether_type, src_address, dst_address, - period_in_ms); -} - -Return WifiStaIface::stopSendingKeepAlivePackets( - uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::stopSendingKeepAlivePacketsInternal, hidl_status_cb, - cmd_id); -} - -Return WifiStaIface::setScanningMacOui(const hidl_array& oui, - setScanningMacOui_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setScanningMacOuiInternal, hidl_status_cb, oui); -} - -Return WifiStaIface::startDebugPacketFateMonitoring( - startDebugPacketFateMonitoring_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startDebugPacketFateMonitoringInternal, hidl_status_cb); -} - -Return WifiStaIface::getDebugTxPacketFates(getDebugTxPacketFates_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getDebugTxPacketFatesInternal, hidl_status_cb); -} - -Return WifiStaIface::getDebugRxPacketFates(getDebugRxPacketFates_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getDebugRxPacketFatesInternal, hidl_status_cb); -} - -Return WifiStaIface::setMacAddress(const hidl_array& mac, - setMacAddress_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setMacAddressInternal, hidl_status_cb, mac); -} - -Return WifiStaIface::getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getFactoryMacAddressInternal, hidl_status_cb); -} - -Return WifiStaIface::setScanMode(bool enable, setScanMode_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setScanModeInternal, hidl_status_cb, enable); -} - -std::pair WifiStaIface::getNameInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; -} - -std::pair WifiStaIface::getTypeInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::STA}; -} - -WifiStatus WifiStaIface::registerEventCallbackInternal( - const sp& callback) { - if (!event_cb_handler_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -std::pair WifiStaIface::getCapabilitiesInternal() { - legacy_hal::wifi_error legacy_status; - uint64_t legacy_feature_set; - std::tie(legacy_status, legacy_feature_set) = - legacy_hal_.lock()->getSupportedFeatureSet(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), 0}; - } - uint32_t legacy_logger_feature_set; - std::tie(legacy_status, legacy_logger_feature_set) = - legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - // some devices don't support querying logger feature set - legacy_logger_feature_set = 0; - } - uint32_t hidl_caps; - if (!hidl_struct_util::convertLegacyFeaturesToHidlStaCapabilities( - legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), 0}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -std::pair -WifiStaIface::getApfPacketFilterCapabilitiesInternal() { - legacy_hal::wifi_error legacy_status; - legacy_hal::PacketFilterCapabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getPacketFilterCapabilities(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - StaApfPacketFilterCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyApfCapabilitiesToHidl(legacy_caps, &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -WifiStatus WifiStaIface::installApfPacketFilterInternal(uint32_t /* cmd_id */, - const std::vector& program) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setPacketFilter(ifname_, program); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair> WifiStaIface::readApfPacketFilterDataInternal() { - const std::pair> legacy_status_and_data = - legacy_hal_.lock()->readApfPacketFilterData(ifname_); - return {createWifiStatusFromLegacyError(legacy_status_and_data.first), - std::move(legacy_status_and_data.second)}; -} - -std::pair -WifiStaIface::getBackgroundScanCapabilitiesInternal() { - legacy_hal::wifi_error legacy_status; - legacy_hal::wifi_gscan_capabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getGscanCapabilities(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - StaBackgroundScanCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyGscanCapabilitiesToHidl(legacy_caps, &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -std::pair> -WifiStaIface::getValidFrequenciesForBandInternal(V1_0::WifiBand band) { - static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch"); - legacy_hal::wifi_error legacy_status; - std::vector valid_frequencies; - std::tie(legacy_status, valid_frequencies) = legacy_hal_.lock()->getValidFrequenciesForBand( - ifname_, hidl_struct_util::convertHidlWifiBandToLegacy(band)); - return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies}; -} - -WifiStatus WifiStaIface::startBackgroundScanInternal(uint32_t cmd_id, - const StaBackgroundScanParameters& params) { - legacy_hal::wifi_scan_cmd_params legacy_params; - if (!hidl_struct_util::convertHidlGscanParamsToLegacy(params, &legacy_params)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - android::wp weak_ptr_this(this); - const auto& on_failure_callback = [weak_ptr_this](legacy_hal::wifi_request_id id) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onBackgroundScanFailure(id).isOk()) { - LOG(ERROR) << "Failed to invoke onBackgroundScanFailure callback"; - } - } - }; - const auto& on_results_callback = - [weak_ptr_this](legacy_hal::wifi_request_id id, - const std::vector& results) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - std::vector hidl_scan_datas; - if (!hidl_struct_util::convertLegacyVectorOfCachedGscanResultsToHidl( - results, &hidl_scan_datas)) { - LOG(ERROR) << "Failed to convert scan results to HIDL structs"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onBackgroundScanResults(id, hidl_scan_datas).isOk()) { - LOG(ERROR) << "Failed to invoke onBackgroundScanResults callback"; - } - } - }; - const auto& on_full_result_callback = [weak_ptr_this]( - legacy_hal::wifi_request_id id, - const legacy_hal::wifi_scan_result* result, - uint32_t buckets_scanned) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - StaScanResult hidl_scan_result; - if (!hidl_struct_util::convertLegacyGscanResultToHidl(*result, true, &hidl_scan_result)) { - LOG(ERROR) << "Failed to convert full scan results to HIDL structs"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onBackgroundFullScanResult(id, buckets_scanned, hidl_scan_result) - .isOk()) { - LOG(ERROR) << "Failed to invoke onBackgroundFullScanResult callback"; - } - } - }; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->startGscan(ifname_, cmd_id, legacy_params, on_failure_callback, - on_results_callback, on_full_result_callback); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::stopBackgroundScanInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stopGscan(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::enableLinkLayerStatsCollectionInternal(bool debug) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableLinkLayerStats(ifname_, debug); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::disableLinkLayerStatsCollectionInternal() { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->disableLinkLayerStats(ifname_); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair WifiStaIface::getLinkLayerStatsInternal() { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -std::pair WifiStaIface::getLinkLayerStatsInternal_1_3() { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -std::pair WifiStaIface::getLinkLayerStatsInternal_1_5() { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -std::pair WifiStaIface::getLinkLayerStatsInternal_1_6() { - legacy_hal::wifi_error legacy_status; - legacy_hal::LinkLayerStats legacy_stats; - std::tie(legacy_status, legacy_stats) = legacy_hal_.lock()->getLinkLayerStats(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - V1_6::StaLinkLayerStats hidl_stats; - if (!hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &hidl_stats)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_stats}; -} - -WifiStatus WifiStaIface::startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, - int32_t min_rssi) { - android::wp weak_ptr_this(this); - const auto& on_threshold_breached_callback = [weak_ptr_this](legacy_hal::wifi_request_id id, - std::array bssid, - int8_t rssi) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onRssiThresholdBreached(id, bssid, rssi).isOk()) { - LOG(ERROR) << "Failed to invoke onRssiThresholdBreached callback"; - } - } - }; - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRssiMonitoring( - ifname_, cmd_id, max_rssi, min_rssi, on_threshold_breached_callback); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::stopRssiMonitoringInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stopRssiMonitoring(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair WifiStaIface::getRoamingCapabilitiesInternal() { - legacy_hal::wifi_error legacy_status; - legacy_hal::wifi_roaming_capabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRoamingCapabilities(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - StaRoamingCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyRoamingCapabilitiesToHidl(legacy_caps, &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -WifiStatus WifiStaIface::configureRoamingInternal(const StaRoamingConfig& config) { - legacy_hal::wifi_roaming_config legacy_config; - if (!hidl_struct_util::convertHidlRoamingConfigToLegacy(config, &legacy_config)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->configureRoaming(ifname_, legacy_config); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::setRoamingStateInternal(StaRoamingState state) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableFirmwareRoaming( - ifname_, hidl_struct_util::convertHidlRoamingStateToLegacy(state)); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::enableNdOffloadInternal(bool enable) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->configureNdOffload(ifname_, enable); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::startSendingKeepAlivePacketsInternal( - uint32_t cmd_id, const std::vector& ip_packet_data, uint16_t ether_type, - const std::array& src_address, const std::array& dst_address, - uint32_t period_in_ms) { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startSendingOffloadedPacket( - ifname_, cmd_id, ether_type, ip_packet_data, src_address, dst_address, period_in_ms); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::stopSendingKeepAlivePacketsInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->stopSendingOffloadedPacket(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiStaIface::setScanningMacOuiInternal(const std::array& /* oui */) { - // deprecated. - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiStaIface::startDebugPacketFateMonitoringInternal() { - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startPktFateMonitoring(ifname_); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair> -WifiStaIface::getDebugTxPacketFatesInternal() { - legacy_hal::wifi_error legacy_status; - std::vector legacy_fates; - std::tie(legacy_status, legacy_fates) = legacy_hal_.lock()->getTxPktFates(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - std::vector hidl_fates; - if (!hidl_struct_util::convertLegacyVectorOfDebugTxPacketFateToHidl(legacy_fates, - &hidl_fates)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_fates}; -} - -std::pair> -WifiStaIface::getDebugRxPacketFatesInternal() { - legacy_hal::wifi_error legacy_status; - std::vector legacy_fates; - std::tie(legacy_status, legacy_fates) = legacy_hal_.lock()->getRxPktFates(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - std::vector hidl_fates; - if (!hidl_struct_util::convertLegacyVectorOfDebugRxPacketFateToHidl(legacy_fates, - &hidl_fates)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_fates}; -} - -WifiStatus WifiStaIface::setMacAddressInternal(const std::array& mac) { - bool status = iface_util_.lock()->setMacAddress(ifname_, mac); - if (!status) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -std::pair> WifiStaIface::getFactoryMacAddressInternal() { - std::array mac = iface_util_.lock()->getFactoryMacAddress(ifname_); - if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && mac[4] == 0 && mac[5] == 0) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), mac}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), mac}; -} - -WifiStatus WifiStaIface::setScanModeInternal(bool enable) { - // OEM's need to implement this on their devices if needed. - LOG(WARNING) << "setScanModeInternal(" << enable << ") not supported"; - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.6/default/wifi_sta_iface.h b/wifi/1.6/default/wifi_sta_iface.h deleted file mode 100644 index c01c50b612..0000000000 --- a/wifi/1.6/default/wifi_sta_iface.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#ifndef WIFI_STA_IFACE_H_ -#define WIFI_STA_IFACE_H_ - -#include -#include -#include - -#include "hidl_callback_util.h" -#include "wifi_iface_util.h" -#include "wifi_legacy_hal.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; - -/** - * HIDL interface object used to control a STA Iface instance. - */ -class WifiStaIface : public V1_6::IWifiStaIface { - public: - WifiStaIface(const std::string& ifname, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util); - // Refer to |WifiChip::invalidate()|. - void invalidate(); - bool isValid(); - std::set> getEventCallbacks(); - std::string getName(); - - // HIDL methods exposed. - Return getName(getName_cb hidl_status_cb) override; - Return getType(getType_cb hidl_status_cb) override; - Return registerEventCallback(const sp& callback, - registerEventCallback_cb hidl_status_cb) override; - Return getCapabilities(getCapabilities_cb hidl_status_cb) override; - Return getApfPacketFilterCapabilities( - getApfPacketFilterCapabilities_cb hidl_status_cb) override; - Return installApfPacketFilter(uint32_t cmd_id, const hidl_vec& program, - installApfPacketFilter_cb hidl_status_cb) override; - Return readApfPacketFilterData(readApfPacketFilterData_cb hidl_status_cb) override; - Return getBackgroundScanCapabilities( - getBackgroundScanCapabilities_cb hidl_status_cb) override; - Return getValidFrequenciesForBand(V1_0::WifiBand band, - getValidFrequenciesForBand_cb hidl_status_cb) override; - Return startBackgroundScan(uint32_t cmd_id, const StaBackgroundScanParameters& params, - startBackgroundScan_cb hidl_status_cb) override; - Return stopBackgroundScan(uint32_t cmd_id, stopBackgroundScan_cb hidl_status_cb) override; - Return enableLinkLayerStatsCollection( - bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) override; - Return disableLinkLayerStatsCollection( - disableLinkLayerStatsCollection_cb hidl_status_cb) override; - Return getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) override; - Return getLinkLayerStats_1_3(getLinkLayerStats_1_3_cb hidl_status_cb) override; - Return getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_status_cb) override; - Return getLinkLayerStats_1_6(getLinkLayerStats_1_6_cb hidl_status_cb) override; - Return startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, - startRssiMonitoring_cb hidl_status_cb) override; - Return stopRssiMonitoring(uint32_t cmd_id, stopRssiMonitoring_cb hidl_status_cb) override; - Return getRoamingCapabilities(getRoamingCapabilities_cb hidl_status_cb) override; - Return configureRoaming(const StaRoamingConfig& config, - configureRoaming_cb hidl_status_cb) override; - Return setRoamingState(StaRoamingState state, setRoamingState_cb hidl_status_cb) override; - Return enableNdOffload(bool enable, enableNdOffload_cb hidl_status_cb) override; - Return startSendingKeepAlivePackets( - uint32_t cmd_id, const hidl_vec& ip_packet_data, uint16_t ether_type, - const hidl_array& src_address, const hidl_array& dst_address, - uint32_t period_in_ms, startSendingKeepAlivePackets_cb hidl_status_cb) override; - Return stopSendingKeepAlivePackets( - uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) override; - Return setScanningMacOui(const hidl_array& oui, - setScanningMacOui_cb hidl_status_cb) override; - Return startDebugPacketFateMonitoring( - startDebugPacketFateMonitoring_cb hidl_status_cb) override; - Return getDebugTxPacketFates(getDebugTxPacketFates_cb hidl_status_cb) override; - Return getDebugRxPacketFates(getDebugRxPacketFates_cb hidl_status_cb) override; - Return setMacAddress(const hidl_array& mac, - setMacAddress_cb hidl_status_cb) override; - Return getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) override; - Return setScanMode(bool enable, setScanMode_cb hidl_status_cb) override; - - private: - // Corresponding worker functions for the HIDL methods. - std::pair getNameInternal(); - std::pair getTypeInternal(); - WifiStatus registerEventCallbackInternal(const sp& callback); - std::pair getCapabilitiesInternal(); - std::pair getApfPacketFilterCapabilitiesInternal(); - WifiStatus installApfPacketFilterInternal(uint32_t cmd_id, const std::vector& program); - std::pair> readApfPacketFilterDataInternal(); - std::pair getBackgroundScanCapabilitiesInternal(); - std::pair> getValidFrequenciesForBandInternal( - V1_0::WifiBand band); - WifiStatus startBackgroundScanInternal(uint32_t cmd_id, - const StaBackgroundScanParameters& params); - WifiStatus stopBackgroundScanInternal(uint32_t cmd_id); - WifiStatus enableLinkLayerStatsCollectionInternal(bool debug); - WifiStatus disableLinkLayerStatsCollectionInternal(); - std::pair getLinkLayerStatsInternal(); - std::pair getLinkLayerStatsInternal_1_3(); - std::pair getLinkLayerStatsInternal_1_5(); - std::pair getLinkLayerStatsInternal_1_6(); - WifiStatus startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi); - WifiStatus stopRssiMonitoringInternal(uint32_t cmd_id); - std::pair getRoamingCapabilitiesInternal(); - WifiStatus configureRoamingInternal(const StaRoamingConfig& config); - WifiStatus setRoamingStateInternal(StaRoamingState state); - WifiStatus enableNdOffloadInternal(bool enable); - WifiStatus startSendingKeepAlivePacketsInternal(uint32_t cmd_id, - const std::vector& ip_packet_data, - uint16_t ether_type, - const std::array& src_address, - const std::array& dst_address, - uint32_t period_in_ms); - WifiStatus stopSendingKeepAlivePacketsInternal(uint32_t cmd_id); - WifiStatus setScanningMacOuiInternal(const std::array& oui); - WifiStatus startDebugPacketFateMonitoringInternal(); - std::pair> getDebugTxPacketFatesInternal(); - std::pair> getDebugRxPacketFatesInternal(); - WifiStatus setMacAddressInternal(const std::array& mac); - std::pair> getFactoryMacAddressInternal(); - WifiStatus setScanModeInternal(bool enable); - - std::string ifname_; - std::weak_ptr legacy_hal_; - std::weak_ptr iface_util_; - bool is_valid_; - hidl_callback_util::HidlCallbackHandler event_cb_handler_; - - DISALLOW_COPY_AND_ASSIGN(WifiStaIface); -}; - -} // namespace implementation -} // namespace V1_6 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_STA_IFACE_H_ diff --git a/wifi/aidl/Android.bp b/wifi/aidl/Android.bp index c0ca667b41..7bc8ae7739 100644 --- a/wifi/aidl/Android.bp +++ b/wifi/aidl/Android.bp @@ -37,8 +37,18 @@ aidl_interface { ], min_sdk_version: "30", lint: { + // Disable linter to avoid error about fixed size arrays. + // Interface will only be accessed on devices >= U. enabled: false, }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + frozen: true, + } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/.hash b/wifi/aidl/aidl_api/android.hardware.wifi/1/.hash new file mode 100644 index 0000000000..be9627a638 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/.hash @@ -0,0 +1 @@ +aa2d34a8d196759e8f89109768ebe16039e47518 diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AfcChannelAllowance.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AfcChannelAllowance.aidl new file mode 100644 index 0000000000..4d3cd6eb58 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AfcChannelAllowance.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable AfcChannelAllowance { + android.hardware.wifi.AvailableAfcFrequencyInfo[] availableAfcFrequencyInfos; + android.hardware.wifi.AvailableAfcChannelInfo[] availableAfcChannelInfos; + long availabilityExpireTimeMs; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AvailableAfcChannelInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AvailableAfcChannelInfo.aidl new file mode 100644 index 0000000000..d2386401ba --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AvailableAfcChannelInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable AvailableAfcChannelInfo { + int globalOperatingClass; + int channelCfi; + int maxEirpDbm; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl new file mode 100644 index 0000000000..cbea5affb9 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable AvailableAfcFrequencyInfo { + int startFrequencyMhz; + int endFrequencyMhz; + int maxPsd; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifi.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifi.aidl new file mode 100644 index 0000000000..cc995fce3f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifi.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifi { + @PropagateAllowBlocking android.hardware.wifi.IWifiChip getChip(int chipId); + int[] getChipIds(); + boolean isStarted(); + void registerEventCallback(in android.hardware.wifi.IWifiEventCallback callback); + void start(); + void stop(); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiApIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiApIface.aidl new file mode 100644 index 0000000000..e71dde40fd --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiApIface.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiApIface { + String getName(); + String[] getBridgedInstances(); + byte[6] getFactoryMacAddress(); + void setCountryCode(in byte[2] code); + void resetToFactoryMacAddress(); + void setMacAddress(in byte[6] mac); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiChip.aidl new file mode 100644 index 0000000000..4ea2081ace --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiChip.aidl @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiChip { + void configureChip(in int modeId); + @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApIface(); + @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createBridgedApIface(); + @PropagateAllowBlocking android.hardware.wifi.IWifiNanIface createNanIface(); + @PropagateAllowBlocking android.hardware.wifi.IWifiP2pIface createP2pIface(); + @PropagateAllowBlocking android.hardware.wifi.IWifiRttController createRttController(in android.hardware.wifi.IWifiStaIface boundIface); + @PropagateAllowBlocking android.hardware.wifi.IWifiStaIface createStaIface(); + void enableDebugErrorAlerts(in boolean enable); + void flushRingBufferToFile(); + void forceDumpToDebugRingBuffer(in String ringName); + @PropagateAllowBlocking android.hardware.wifi.IWifiApIface getApIface(in String ifname); + String[] getApIfaceNames(); + android.hardware.wifi.IWifiChip.ChipMode[] getAvailableModes(); + int getFeatureSet(); + android.hardware.wifi.WifiDebugHostWakeReasonStats getDebugHostWakeReasonStats(); + android.hardware.wifi.WifiDebugRingBufferStatus[] getDebugRingBuffersStatus(); + int getId(); + int getMode(); + @PropagateAllowBlocking android.hardware.wifi.IWifiNanIface getNanIface(in String ifname); + String[] getNanIfaceNames(); + @PropagateAllowBlocking android.hardware.wifi.IWifiP2pIface getP2pIface(in String ifname); + String[] getP2pIfaceNames(); + @PropagateAllowBlocking android.hardware.wifi.IWifiStaIface getStaIface(in String ifname); + String[] getStaIfaceNames(); + android.hardware.wifi.WifiRadioCombination[] getSupportedRadioCombinations(); + android.hardware.wifi.WifiChipCapabilities getWifiChipCapabilities(); + android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in int ifaceModeMask, in int filterMask); + void setAfcChannelAllowance(in android.hardware.wifi.AfcChannelAllowance afcChannelAllowance); + void registerEventCallback(in android.hardware.wifi.IWifiChipEventCallback callback); + void removeApIface(in String ifname); + void removeIfaceInstanceFromBridgedApIface(in String brIfaceName, in String ifaceInstanceName); + void removeNanIface(in String ifname); + void removeP2pIface(in String ifname); + void removeStaIface(in String ifname); + android.hardware.wifi.IWifiChip.ChipDebugInfo requestChipDebugInfo(); + byte[] requestDriverDebugDump(); + byte[] requestFirmwareDebugDump(); + void resetTxPowerScenario(); + void selectTxPowerScenario(in android.hardware.wifi.IWifiChip.TxPowerScenario scenario); + void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in int restrictions); + void setCountryCode(in byte[2] code); + void setLatencyMode(in android.hardware.wifi.IWifiChip.LatencyMode mode); + void setMultiStaPrimaryConnection(in String ifName); + void setMultiStaUseCase(in android.hardware.wifi.IWifiChip.MultiStaUseCase useCase); + void startLoggingToDebugRingBuffer(in String ringName, in android.hardware.wifi.WifiDebugRingBufferVerboseLevel verboseLevel, in int maxIntervalInSec, in int minDataSizeInBytes); + void stopLoggingToDebugRingBuffer(); + void triggerSubsystemRestart(); + void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag); + void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode); + const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF; + @Backing(type="int") @VintfStability + enum FeatureSetMask { + SET_TX_POWER_LIMIT = (1 << 0) /* 1 */, + D2D_RTT = (1 << 1) /* 2 */, + D2AP_RTT = (1 << 2) /* 4 */, + USE_BODY_HEAD_SAR = (1 << 3) /* 8 */, + SET_LATENCY_MODE = (1 << 4) /* 16 */, + P2P_RAND_MAC = (1 << 5) /* 32 */, + WIGIG = (1 << 6) /* 64 */, + SET_AFC_CHANNEL_ALLOWANCE = (1 << 7) /* 128 */, + T2LM_NEGOTIATION = (1 << 8) /* 256 */, + } + @VintfStability + parcelable ChipConcurrencyCombinationLimit { + android.hardware.wifi.IfaceConcurrencyType[] types; + int maxIfaces; + } + @VintfStability + parcelable ChipConcurrencyCombination { + android.hardware.wifi.IWifiChip.ChipConcurrencyCombinationLimit[] limits; + } + @VintfStability + parcelable ChipDebugInfo { + String driverDescription; + String firmwareDescription; + } + @VintfStability + parcelable ChipIfaceCombinationLimit { + android.hardware.wifi.IfaceType[] types; + int maxIfaces; + } + @VintfStability + parcelable ChipIfaceCombination { + android.hardware.wifi.IWifiChip.ChipIfaceCombinationLimit[] limits; + } + @VintfStability + parcelable ChipMode { + int id; + android.hardware.wifi.IWifiChip.ChipConcurrencyCombination[] availableCombinations; + } + @Backing(type="int") @VintfStability + enum CoexRestriction { + WIFI_DIRECT = (1 << 0) /* 1 */, + SOFTAP = (1 << 1) /* 2 */, + WIFI_AWARE = (1 << 2) /* 4 */, + } + @VintfStability + parcelable CoexUnsafeChannel { + android.hardware.wifi.WifiBand band; + int channel; + int powerCapDbm; + } + @Backing(type="int") @VintfStability + enum LatencyMode { + NORMAL = 0, + LOW = 1, + } + @Backing(type="byte") @VintfStability + enum MultiStaUseCase { + DUAL_STA_TRANSIENT_PREFER_PRIMARY = 0, + DUAL_STA_NON_TRANSIENT_UNBIASED = 1, + } + @Backing(type="int") @VintfStability + enum TxPowerScenario { + VOICE_CALL = 0, + ON_HEAD_CELL_OFF = 1, + ON_HEAD_CELL_ON = 2, + ON_BODY_CELL_OFF = 3, + ON_BODY_CELL_ON = 4, + } + @Backing(type="int") @VintfStability + enum UsableChannelFilter { + CELLULAR_COEXISTENCE = (1 << 0) /* 1 */, + CONCURRENCY = (1 << 1) /* 2 */, + NAN_INSTANT_MODE = (1 << 2) /* 4 */, + } + @Backing(type="int") @VintfStability + enum ChannelCategoryMask { + INDOOR_CHANNEL = (1 << 0) /* 1 */, + DFS_CHANNEL = (1 << 1) /* 2 */, + } + @Backing(type="int") @VintfStability + enum ChipMloMode { + DEFAULT = 0, + LOW_LATENCY = 1, + HIGH_THROUGHPUT = 2, + LOW_POWER = 3, + } +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiChipEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiChipEventCallback.aidl new file mode 100644 index 0000000000..3fd8533c44 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiChipEventCallback.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiChipEventCallback { + oneway void onChipReconfigureFailure(in android.hardware.wifi.WifiStatusCode status); + oneway void onChipReconfigured(in int modeId); + oneway void onDebugErrorAlert(in int errorCode, in byte[] debugData); + oneway void onDebugRingBufferDataAvailable(in android.hardware.wifi.WifiDebugRingBufferStatus status, in byte[] data); + oneway void onIfaceAdded(in android.hardware.wifi.IfaceType type, in String name); + oneway void onIfaceRemoved(in android.hardware.wifi.IfaceType type, in String name); + oneway void onRadioModeChange(in android.hardware.wifi.IWifiChipEventCallback.RadioModeInfo[] radioModeInfos); + @VintfStability + parcelable IfaceInfo { + String name; + int channel; + } + @VintfStability + parcelable RadioModeInfo { + int radioId; + android.hardware.wifi.WifiBand bandInfo; + android.hardware.wifi.IWifiChipEventCallback.IfaceInfo[] ifaceInfos; + } +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiEventCallback.aidl new file mode 100644 index 0000000000..00e5cb6e09 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiEventCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiEventCallback { + oneway void onFailure(in android.hardware.wifi.WifiStatusCode status); + oneway void onStart(); + oneway void onStop(); + oneway void onSubsystemRestart(in android.hardware.wifi.WifiStatusCode status); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiNanIface.aidl new file mode 100644 index 0000000000..0e2f90fbc0 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiNanIface.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiNanIface { + String getName(); + void configRequest(in char cmdId, in android.hardware.wifi.NanConfigRequest msg1, in android.hardware.wifi.NanConfigRequestSupplemental msg2); + void createDataInterfaceRequest(in char cmdId, in String ifaceName); + void deleteDataInterfaceRequest(in char cmdId, in String ifaceName); + void disableRequest(in char cmdId); + void enableRequest(in char cmdId, in android.hardware.wifi.NanEnableRequest msg1, in android.hardware.wifi.NanConfigRequestSupplemental msg2); + void getCapabilitiesRequest(in char cmdId); + void initiateDataPathRequest(in char cmdId, in android.hardware.wifi.NanInitiateDataPathRequest msg); + void registerEventCallback(in android.hardware.wifi.IWifiNanIfaceEventCallback callback); + void respondToDataPathIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToDataPathIndicationRequest msg); + void startPublishRequest(in char cmdId, in android.hardware.wifi.NanPublishRequest msg); + void startSubscribeRequest(in char cmdId, in android.hardware.wifi.NanSubscribeRequest msg); + void stopPublishRequest(in char cmdId, in byte sessionId); + void stopSubscribeRequest(in char cmdId, in byte sessionId); + void terminateDataPathRequest(in char cmdId, in int ndpInstanceId); + void suspendRequest(in char cmdId, in byte sessionId); + void resumeRequest(in char cmdId, in byte sessionId); + void transmitFollowupRequest(in char cmdId, in android.hardware.wifi.NanTransmitFollowupRequest msg); + void initiatePairingRequest(in char cmdId, in android.hardware.wifi.NanPairingRequest msg); + void respondToPairingIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToPairingIndicationRequest msg); + void initiateBootstrappingRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingRequest msg); + void respondToBootstrappingIndicationRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingResponse msg); + void terminatePairingRequest(in char cmdId, in int pairingInstanceId); + const int MIN_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 8; + const int MAX_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 63; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl new file mode 100644 index 0000000000..8c443309ee --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiNanIfaceEventCallback { + oneway void eventClusterEvent(in android.hardware.wifi.NanClusterEventInd event); + oneway void eventDataPathConfirm(in android.hardware.wifi.NanDataPathConfirmInd event); + oneway void eventDataPathRequest(in android.hardware.wifi.NanDataPathRequestInd event); + oneway void eventDataPathScheduleUpdate(in android.hardware.wifi.NanDataPathScheduleUpdateInd event); + oneway void eventDataPathTerminated(in int ndpInstanceId); + oneway void eventDisabled(in android.hardware.wifi.NanStatus status); + oneway void eventFollowupReceived(in android.hardware.wifi.NanFollowupReceivedInd event); + oneway void eventMatch(in android.hardware.wifi.NanMatchInd event); + oneway void eventMatchExpired(in byte discoverySessionId, in int peerId); + oneway void eventPublishTerminated(in byte sessionId, in android.hardware.wifi.NanStatus status); + oneway void eventSubscribeTerminated(in byte sessionId, in android.hardware.wifi.NanStatus status); + oneway void eventTransmitFollowup(in char id, in android.hardware.wifi.NanStatus status); + oneway void eventSuspensionModeChanged(in android.hardware.wifi.NanSuspensionModeChangeInd event); + oneway void notifyCapabilitiesResponse(in char id, in android.hardware.wifi.NanStatus status, in android.hardware.wifi.NanCapabilities capabilities); + oneway void notifyConfigResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyCreateDataInterfaceResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyDeleteDataInterfaceResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyDisableResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyEnableResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyInitiateDataPathResponse(in char id, in android.hardware.wifi.NanStatus status, in int ndpInstanceId); + oneway void notifyRespondToDataPathIndicationResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyStartPublishResponse(in char id, in android.hardware.wifi.NanStatus status, in byte sessionId); + oneway void notifyStartSubscribeResponse(in char id, in android.hardware.wifi.NanStatus status, in byte sessionId); + oneway void notifyStopPublishResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyStopSubscribeResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyTerminateDataPathResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifySuspendResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyResumeResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyTransmitFollowupResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void eventPairingRequest(in android.hardware.wifi.NanPairingRequestInd event); + oneway void eventPairingConfirm(in android.hardware.wifi.NanPairingConfirmInd event); + oneway void notifyInitiatePairingResponse(in char id, in android.hardware.wifi.NanStatus status, in int pairingInstanceId); + oneway void notifyRespondToPairingIndicationResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void eventBootstrappingRequest(in android.hardware.wifi.NanBootstrappingRequestInd event); + oneway void eventBootstrappingConfirm(in android.hardware.wifi.NanBootstrappingConfirmInd event); + 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); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiP2pIface.aidl similarity index 94% rename from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl rename to wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiP2pIface.aidl index ea86c4fa79..5e9948e0b7 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiRadioCombinationMatrix.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiP2pIface.aidl @@ -33,6 +33,6 @@ package android.hardware.wifi; @VintfStability -parcelable WifiRadioCombinationMatrix { - android.hardware.wifi.WifiRadioCombination[] radioCombinations; +interface IWifiP2pIface { + String getName(); } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiRttController.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiRttController.aidl new file mode 100644 index 0000000000..730a055eeb --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiRttController.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiRttController { + void disableResponder(in int cmdId); + void enableResponder(in int cmdId, in android.hardware.wifi.WifiChannelInfo channelHint, in int maxDurationInSeconds, in android.hardware.wifi.RttResponder info); + android.hardware.wifi.IWifiStaIface getBoundIface(); + android.hardware.wifi.RttCapabilities getCapabilities(); + android.hardware.wifi.RttResponder getResponderInfo(); + void rangeCancel(in int cmdId, in android.hardware.wifi.MacAddress[] addrs); + void rangeRequest(in int cmdId, in android.hardware.wifi.RttConfig[] rttConfigs); + void registerEventCallback(in android.hardware.wifi.IWifiRttControllerEventCallback callback); + void setLci(in int cmdId, in android.hardware.wifi.RttLciInformation lci); + void setLcr(in int cmdId, in android.hardware.wifi.RttLcrInformation lcr); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiRttControllerEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiRttControllerEventCallback.aidl new file mode 100644 index 0000000000..a6a33fc049 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiRttControllerEventCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiRttControllerEventCallback { + oneway void onResults(in int cmdId, in android.hardware.wifi.RttResult[] results); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiStaIface.aidl new file mode 100644 index 0000000000..923deff01f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiStaIface.aidl @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiStaIface { + String getName(); + void configureRoaming(in android.hardware.wifi.StaRoamingConfig config); + void disableLinkLayerStatsCollection(); + void enableLinkLayerStatsCollection(in boolean debug); + void enableNdOffload(in boolean enable); + android.hardware.wifi.StaApfPacketFilterCapabilities getApfPacketFilterCapabilities(); + android.hardware.wifi.StaBackgroundScanCapabilities getBackgroundScanCapabilities(); + int getFeatureSet(); + android.hardware.wifi.WifiDebugRxPacketFateReport[] getDebugRxPacketFates(); + android.hardware.wifi.WifiDebugTxPacketFateReport[] getDebugTxPacketFates(); + byte[6] getFactoryMacAddress(); + android.hardware.wifi.StaLinkLayerStats getLinkLayerStats(); + android.hardware.wifi.StaRoamingCapabilities getRoamingCapabilities(); + void installApfPacketFilter(in byte[] program); + byte[] readApfPacketFilterData(); + void registerEventCallback(in android.hardware.wifi.IWifiStaIfaceEventCallback callback); + void setMacAddress(in byte[6] mac); + void setRoamingState(in android.hardware.wifi.StaRoamingState state); + void setScanMode(in boolean enable); + void startBackgroundScan(in int cmdId, in android.hardware.wifi.StaBackgroundScanParameters params); + void startDebugPacketFateMonitoring(); + void startRssiMonitoring(in int cmdId, in int maxRssi, in int minRssi); + void startSendingKeepAlivePackets(in int cmdId, in byte[] ipPacketData, in char etherType, in byte[6] srcAddress, in byte[6] dstAddress, in int periodInMs); + void stopBackgroundScan(in int cmdId); + void stopRssiMonitoring(in int cmdId); + void stopSendingKeepAlivePackets(in int cmdId); + void setDtimMultiplier(in int multiplier); + @Backing(type="int") @VintfStability + enum FeatureSetMask { + APF = (1 << 0) /* 1 */, + BACKGROUND_SCAN = (1 << 1) /* 2 */, + LINK_LAYER_STATS = (1 << 2) /* 4 */, + RSSI_MONITOR = (1 << 3) /* 8 */, + CONTROL_ROAMING = (1 << 4) /* 16 */, + PROBE_IE_ALLOWLIST = (1 << 5) /* 32 */, + SCAN_RAND = (1 << 6) /* 64 */, + STA_5G = (1 << 7) /* 128 */, + HOTSPOT = (1 << 8) /* 256 */, + PNO = (1 << 9) /* 512 */, + TDLS = (1 << 10) /* 1024 */, + TDLS_OFFCHANNEL = (1 << 11) /* 2048 */, + ND_OFFLOAD = (1 << 12) /* 4096 */, + KEEP_ALIVE = (1 << 13) /* 8192 */, + } +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl new file mode 100644 index 0000000000..48b85b0fcf --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +interface IWifiStaIfaceEventCallback { + oneway void onBackgroundFullScanResult(in int cmdId, in int bucketsScanned, in android.hardware.wifi.StaScanResult result); + oneway void onBackgroundScanFailure(in int cmdId); + oneway void onBackgroundScanResults(in int cmdId, in android.hardware.wifi.StaScanData[] scanDatas); + oneway void onRssiThresholdBreached(in int cmdId, in byte[6] currBssid, in int currRssi); +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IfaceConcurrencyType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IfaceConcurrencyType.aidl new file mode 100644 index 0000000000..d584423f5a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IfaceConcurrencyType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum IfaceConcurrencyType { + STA, + AP, + AP_BRIDGED, + P2P, + NAN_IFACE, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IfaceType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IfaceType.aidl new file mode 100644 index 0000000000..67022dfdff --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/IfaceType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum IfaceType { + STA, + AP, + P2P, + NAN_IFACE, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/MacAddress.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/MacAddress.aidl new file mode 100644 index 0000000000..c4a06136ec --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/MacAddress.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable MacAddress { + byte[6] data; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBandIndex.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBandIndex.aidl new file mode 100644 index 0000000000..3f1ea5e444 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBandIndex.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanBandIndex { + NAN_BAND_24GHZ = 0, + NAN_BAND_5GHZ, + NAN_BAND_6GHZ = 2, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBandSpecificConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBandSpecificConfig.aidl new file mode 100644 index 0000000000..57540b3835 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBandSpecificConfig.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBandSpecificConfig { + byte rssiClose; + byte rssiMiddle; + byte rssiCloseProximity; + char dwellTimeMs; + char scanPeriodSec; + boolean validDiscoveryWindowIntervalVal; + byte discoveryWindowIntervalVal; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingConfirmInd.aidl new file mode 100644 index 0000000000..5ab8dcd213 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingConfirmInd.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingConfirmInd { + int bootstrappingInstanceId; + android.hardware.wifi.NanBootstrappingResponseCode responseCode; + android.hardware.wifi.NanStatus reasonCode; + int comeBackDelay; + byte[] cookie; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingMethod.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingMethod.aidl new file mode 100644 index 0000000000..6ff62b2f52 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingMethod.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanBootstrappingMethod { + BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0) /* 1 */, + BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1) /* 2 */, + BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2) /* 4 */, + BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3) /* 8 */, + BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4) /* 16 */, + BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5) /* 32 */, + BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6) /* 64 */, + BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7) /* 128 */, + BOOTSTRAPPING_NFC_READER_MASK = (1 << 8) /* 256 */, + BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14) /* 16384 */, + BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15) /* 32768 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingRequest.aidl new file mode 100644 index 0000000000..dd0a5ede2f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingRequest { + int peerId; + byte[6] peerDiscMacAddr; + android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod; + byte[] cookie; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingRequestInd.aidl new file mode 100644 index 0000000000..a4398e9310 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingRequestInd.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingRequestInd { + byte discoverySessionId; + int peerId; + byte[6] peerDiscMacAddr; + int bootstrappingInstanceId; + android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingResponse.aidl new file mode 100644 index 0000000000..6dd9b2603a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingResponse { + int bootstrappingInstanceId; + boolean acceptRequest; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingResponseCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingResponseCode.aidl new file mode 100644 index 0000000000..a3e9e4d2ae --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanBootstrappingResponseCode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanBootstrappingResponseCode { + NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0, + NAN_BOOTSTRAPPING_REQUEST_REJECT, + NAN_BOOTSTRAPPING_REQUEST_COMEBACK, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanCapabilities.aidl new file mode 100644 index 0000000000..a30893a0c2 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanCapabilities.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanCapabilities { + int maxConcurrentClusters; + int maxPublishes; + int maxSubscribes; + int maxServiceNameLen; + int maxMatchFilterLen; + int maxTotalMatchFilterLen; + int maxServiceSpecificInfoLen; + int maxExtendedServiceSpecificInfoLen; + int maxNdiInterfaces; + int maxNdpSessions; + int maxAppInfoLen; + int maxQueuedTransmitFollowupMsgs; + int maxSubscribeInterfaceAddresses; + int supportedCipherSuites; + boolean instantCommunicationModeSupportFlag; + boolean supports6g; + boolean supportsHe; + boolean supportsPairing; + boolean supportsSetClusterId; + boolean supportsSuspension; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanCipherSuiteType.aidl new file mode 100644 index 0000000000..6f3158e670 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanCipherSuiteType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanCipherSuiteType { + NONE = 0, + SHARED_KEY_128_MASK = (1 << 0) /* 1 */, + SHARED_KEY_256_MASK = (1 << 1) /* 2 */, + PUBLIC_KEY_2WDH_128_MASK = (1 << 2) /* 4 */, + PUBLIC_KEY_2WDH_256_MASK = (1 << 3) /* 8 */, + PUBLIC_KEY_PASN_128_MASK = (1 << 6) /* 64 */, + PUBLIC_KEY_PASN_256_MASK = (1 << 7) /* 128 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanClusterEventInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanClusterEventInd.aidl new file mode 100644 index 0000000000..7a3ff8151a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanClusterEventInd.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanClusterEventInd { + android.hardware.wifi.NanClusterEventType eventType; + byte[6] addr; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanClusterEventType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanClusterEventType.aidl new file mode 100644 index 0000000000..6c20543d86 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanClusterEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanClusterEventType { + DISCOVERY_MAC_ADDRESS_CHANGED = 0, + STARTED_CLUSTER, + JOINED_CLUSTER, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanConfigRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanConfigRequest.aidl new file mode 100644 index 0000000000..5ead6515d0 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanConfigRequest.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanConfigRequest { + byte masterPref; + boolean disableDiscoveryAddressChangeIndication; + boolean disableStartedClusterIndication; + boolean disableJoinedClusterIndication; + boolean includePublishServiceIdsInBeacon; + byte numberOfPublishServiceIdsInBeacon; + boolean includeSubscribeServiceIdsInBeacon; + byte numberOfSubscribeServiceIdsInBeacon; + char rssiWindowSize; + int macAddressRandomizationIntervalSec; + android.hardware.wifi.NanBandSpecificConfig[3] bandSpecificConfig; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanConfigRequestSupplemental.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanConfigRequestSupplemental.aidl new file mode 100644 index 0000000000..99f2af771e --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanConfigRequestSupplemental.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanConfigRequestSupplemental { + int discoveryBeaconIntervalMs; + int numberOfSpatialStreamsInDiscovery; + boolean enableDiscoveryWindowEarlyTermination; + boolean enableRanging; + boolean enableInstantCommunicationMode; + int instantModeChannel; + int clusterId; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathChannelCfg.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathChannelCfg.aidl new file mode 100644 index 0000000000..4233c32863 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathChannelCfg.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanDataPathChannelCfg { + CHANNEL_NOT_REQUESTED = 0, + REQUEST_CHANNEL_SETUP, + FORCE_CHANNEL_SETUP, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathChannelInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathChannelInfo.aidl new file mode 100644 index 0000000000..d111db784c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathChannelInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDataPathChannelInfo { + int channelFreq; + android.hardware.wifi.WifiChannelWidthInMhz channelBandwidth; + int numSpatialStreams; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathConfirmInd.aidl new file mode 100644 index 0000000000..2e1e2caece --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathConfirmInd.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDataPathConfirmInd { + int ndpInstanceId; + boolean dataPathSetupSuccess; + byte[6] peerNdiMacAddr; + byte[] appInfo; + android.hardware.wifi.NanStatus status; + android.hardware.wifi.NanDataPathChannelInfo[] channelInfo; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathRequestInd.aidl new file mode 100644 index 0000000000..74d5b73aba --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathRequestInd.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDataPathRequestInd { + byte discoverySessionId; + byte[6] peerDiscMacAddr; + int ndpInstanceId; + boolean securityRequired; + byte[] appInfo; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathScheduleUpdateInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathScheduleUpdateInd.aidl new file mode 100644 index 0000000000..5fabf5539c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathScheduleUpdateInd.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDataPathScheduleUpdateInd { + byte[6] peerDiscoveryAddress; + android.hardware.wifi.NanDataPathChannelInfo[] channelInfo; + int[] ndpInstanceIds; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathSecurityConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathSecurityConfig.aidl new file mode 100644 index 0000000000..635dbce788 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathSecurityConfig.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDataPathSecurityConfig { + android.hardware.wifi.NanDataPathSecurityType securityType; + android.hardware.wifi.NanCipherSuiteType cipherType; + byte[32] pmk; + byte[] passphrase; + byte[16] scid; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathSecurityType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathSecurityType.aidl new file mode 100644 index 0000000000..cb7904d180 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDataPathSecurityType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanDataPathSecurityType { + OPEN, + PMK, + PASSPHRASE, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDebugConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDebugConfig.aidl new file mode 100644 index 0000000000..b84d891221 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDebugConfig.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDebugConfig { + boolean validClusterIdVals; + char clusterIdBottomRangeVal; + char clusterIdTopRangeVal; + boolean validIntfAddrVal; + byte[6] intfAddrVal; + boolean validOuiVal; + int ouiVal; + boolean validRandomFactorForceVal; + byte randomFactorForceVal; + boolean validHopCountForceVal; + byte hopCountForceVal; + boolean validDiscoveryChannelVal; + int[3] discoveryChannelMhzVal; + boolean validUseBeaconsInBandVal; + boolean[3] useBeaconsInBandVal; + boolean validUseSdfInBandVal; + boolean[3] useSdfInBandVal; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDiscoveryCommonConfig.aidl new file mode 100644 index 0000000000..96d940ae31 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanDiscoveryCommonConfig.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanDiscoveryCommonConfig { + byte sessionId; + char ttlSec; + char discoveryWindowPeriod; + byte discoveryCount; + byte[] serviceName; + android.hardware.wifi.NanMatchAlg discoveryMatchIndicator; + byte[] serviceSpecificInfo; + byte[] extendedServiceSpecificInfo; + byte[] rxMatchFilter; + byte[] txMatchFilter; + boolean useRssiThreshold; + boolean disableDiscoveryTerminationIndication; + boolean disableMatchExpirationIndication; + boolean disableFollowupReceivedIndication; + android.hardware.wifi.NanDataPathSecurityConfig securityConfig; + boolean rangingRequired; + int rangingIntervalMs; + int configRangingIndications; + char distanceIngressCm; + char distanceEgressCm; + boolean enableSessionSuspendability; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanEnableRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanEnableRequest.aidl new file mode 100644 index 0000000000..eaa009cfd1 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanEnableRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanEnableRequest { + boolean[3] operateInBand; + byte hopCountMax; + android.hardware.wifi.NanConfigRequest configParams; + android.hardware.wifi.NanDebugConfig debugConfigs; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanFollowupReceivedInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanFollowupReceivedInd.aidl new file mode 100644 index 0000000000..743ad9d227 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanFollowupReceivedInd.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanFollowupReceivedInd { + byte discoverySessionId; + int peerId; + byte[6] addr; + boolean receivedInFaw; + byte[] serviceSpecificInfo; + byte[] extendedServiceSpecificInfo; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanIdentityResolutionAttribute.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanIdentityResolutionAttribute.aidl new file mode 100644 index 0000000000..843107ea40 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanIdentityResolutionAttribute.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanIdentityResolutionAttribute { + byte[8] nonce; + byte[8] tag; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanInitiateDataPathRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanInitiateDataPathRequest.aidl new file mode 100644 index 0000000000..740a140780 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanInitiateDataPathRequest.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanInitiateDataPathRequest { + int peerId; + byte[6] peerDiscMacAddr; + android.hardware.wifi.NanDataPathChannelCfg channelRequestType; + int channel; + String ifaceName; + android.hardware.wifi.NanDataPathSecurityConfig securityConfig; + byte[] appInfo; + byte[] serviceNameOutOfBand; + byte discoverySessionId; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanMatchAlg.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanMatchAlg.aidl new file mode 100644 index 0000000000..93ac26b25f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanMatchAlg.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanMatchAlg { + MATCH_ONCE = 0, + MATCH_CONTINUOUS, + MATCH_NEVER, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanMatchInd.aidl new file mode 100644 index 0000000000..317489f223 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanMatchInd.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanMatchInd { + byte discoverySessionId; + int peerId; + byte[6] addr; + byte[] serviceSpecificInfo; + byte[] extendedServiceSpecificInfo; + byte[] matchFilter; + boolean matchOccurredInBeaconFlag; + boolean outOfResourceFlag; + byte rssiValue; + android.hardware.wifi.NanCipherSuiteType peerCipherType; + boolean peerRequiresSecurityEnabledInNdp; + boolean peerRequiresRanging; + int rangingMeasurementInMm; + int rangingIndicationType; + byte[] scid; + android.hardware.wifi.NanPairingConfig peerPairingConfig; + android.hardware.wifi.NanIdentityResolutionAttribute peerNira; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingAkm.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingAkm.aidl new file mode 100644 index 0000000000..05bbaee0d5 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingAkm.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPairingAkm { + SAE = 0, + PASN = 1, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingConfig.aidl new file mode 100644 index 0000000000..1c04a96d6c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingConfig.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingConfig { + boolean enablePairingSetup; + boolean enablePairingCache; + boolean enablePairingVerification; + int supportedBootstrappingMethods; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingConfirmInd.aidl new file mode 100644 index 0000000000..8ecf22aa01 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingConfirmInd.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingConfirmInd { + int pairingInstanceId; + boolean pairingSuccess; + android.hardware.wifi.NanStatus status; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + android.hardware.wifi.NpkSecurityAssociation npksa; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequest.aidl new file mode 100644 index 0000000000..2a644ae63b --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequest.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingRequest { + int peerId; + byte[6] peerDiscMacAddr; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + byte[16] pairingIdentityKey; + android.hardware.wifi.NanPairingSecurityConfig securityConfig; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequestInd.aidl new file mode 100644 index 0000000000..66762b93e6 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequestInd.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingRequestInd { + byte discoverySessionId; + int peerId; + byte[6] peerDiscMacAddr; + int pairingInstanceId; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + android.hardware.wifi.NanIdentityResolutionAttribute peerNira; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequestType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequestType.aidl new file mode 100644 index 0000000000..3488340bf4 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingRequestType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPairingRequestType { + NAN_PAIRING_SETUP = 0, + NAN_PAIRING_VERIFICATION, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingSecurityConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingSecurityConfig.aidl new file mode 100644 index 0000000000..1a6a13c550 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingSecurityConfig.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingSecurityConfig { + android.hardware.wifi.NanPairingSecurityType securityType; + byte[32] pmk; + byte[] passphrase; + android.hardware.wifi.NanPairingAkm akm; + android.hardware.wifi.NanCipherSuiteType cipherType; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingSecurityType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingSecurityType.aidl new file mode 100644 index 0000000000..9f6c774021 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPairingSecurityType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPairingSecurityType { + OPPORTUNISTIC, + PMK, + PASSPHRASE, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPublishRequest.aidl new file mode 100644 index 0000000000..c49f5f9012 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPublishRequest.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPublishRequest { + android.hardware.wifi.NanDiscoveryCommonConfig baseConfigs; + android.hardware.wifi.NanPublishType publishType; + android.hardware.wifi.NanTxType txType; + boolean autoAcceptDataPathRequests; + android.hardware.wifi.NanPairingConfig pairingConfig; + byte[16] identityKey; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPublishType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPublishType.aidl new file mode 100644 index 0000000000..30dffb29d1 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanPublishType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPublishType { + UNSOLICITED = 0, + SOLICITED, + UNSOLICITED_SOLICITED, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRangingIndication.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRangingIndication.aidl new file mode 100644 index 0000000000..cf72dcea23 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRangingIndication.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanRangingIndication { + CONTINUOUS_INDICATION_MASK = (1 << 0) /* 1 */, + INGRESS_MET_MASK = (1 << 1) /* 2 */, + EGRESS_MET_MASK = (1 << 2) /* 4 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl new file mode 100644 index 0000000000..0f873b5ea8 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanRespondToDataPathIndicationRequest { + boolean acceptRequest; + int ndpInstanceId; + String ifaceName; + android.hardware.wifi.NanDataPathSecurityConfig securityConfig; + byte[] appInfo; + byte[] serviceNameOutOfBand; + byte discoverySessionId; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl new file mode 100644 index 0000000000..a58890c542 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanRespondToPairingIndicationRequest { + boolean acceptRequest; + int pairingInstanceId; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + byte[16] pairingIdentityKey; + android.hardware.wifi.NanPairingSecurityConfig securityConfig; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSrfType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSrfType.aidl new file mode 100644 index 0000000000..82409fd5aa --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSrfType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanSrfType { + BLOOM_FILTER = 0, + PARTIAL_MAC_ADDR, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanStatus.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanStatus.aidl new file mode 100644 index 0000000000..834558ae72 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanStatus.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanStatus { + android.hardware.wifi.NanStatusCode status; + String description; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanStatusCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanStatusCode.aidl new file mode 100644 index 0000000000..ec12eb0c4c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanStatusCode.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanStatusCode { + SUCCESS = 0, + INTERNAL_FAILURE = 1, + PROTOCOL_FAILURE = 2, + INVALID_SESSION_ID = 3, + NO_RESOURCES_AVAILABLE = 4, + INVALID_ARGS = 5, + INVALID_PEER_ID = 6, + INVALID_NDP_ID = 7, + NAN_NOT_ALLOWED = 8, + NO_OTA_ACK = 9, + ALREADY_ENABLED = 10, + FOLLOWUP_TX_QUEUE_FULL = 11, + UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12, + INVALID_PAIRING_ID = 13, + INVALID_BOOTSTRAPPING_ID = 14, + REDUNDANT_REQUEST = 15, + NOT_SUPPORTED = 16, + NO_CONNECTION = 17, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSubscribeRequest.aidl new file mode 100644 index 0000000000..96be096d74 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSubscribeRequest.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanSubscribeRequest { + android.hardware.wifi.NanDiscoveryCommonConfig baseConfigs; + android.hardware.wifi.NanSubscribeType subscribeType; + android.hardware.wifi.NanSrfType srfType; + boolean srfRespondIfInAddressSet; + boolean shouldUseSrf; + boolean isSsiRequiredForMatch; + android.hardware.wifi.MacAddress[] intfAddr; + android.hardware.wifi.NanPairingConfig pairingConfig; + byte[16] identityKey; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSubscribeType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSubscribeType.aidl new file mode 100644 index 0000000000..4f06df956d --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSubscribeType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanSubscribeType { + PASSIVE = 0, + ACTIVE, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSuspensionModeChangeInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSuspensionModeChangeInd.aidl new file mode 100644 index 0000000000..557fc796d9 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanSuspensionModeChangeInd.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanSuspensionModeChangeInd { + boolean isSuspended; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanTransmitFollowupRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanTransmitFollowupRequest.aidl new file mode 100644 index 0000000000..20c94d9558 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanTransmitFollowupRequest.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanTransmitFollowupRequest { + byte discoverySessionId; + int peerId; + byte[6] addr; + boolean isHighPriority; + boolean shouldUseDiscoveryWindow; + byte[] serviceSpecificInfo; + byte[] extendedServiceSpecificInfo; + boolean disableFollowupResultIndication; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanTxType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanTxType.aidl new file mode 100644 index 0000000000..798d3a29e6 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NanTxType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanTxType { + BROADCAST = 0, + UNICAST, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NpkSecurityAssociation.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NpkSecurityAssociation.aidl new file mode 100644 index 0000000000..508e92009d --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/NpkSecurityAssociation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NpkSecurityAssociation { + byte[16] peerNanIdentityKey; + byte[16] localNanIdentityKey; + byte[32] npk; + android.hardware.wifi.NanPairingAkm akm; + android.hardware.wifi.NanCipherSuiteType cipherType; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttBw.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttBw.aidl new file mode 100644 index 0000000000..7cc700250e --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttBw.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum RttBw { + BW_UNSPECIFIED = 0x0, + BW_5MHZ = 0x01, + BW_10MHZ = 0x02, + BW_20MHZ = 0x04, + BW_40MHZ = 0x08, + BW_80MHZ = 0x10, + BW_160MHZ = 0x20, + BW_320MHZ = 0x40, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttCapabilities.aidl new file mode 100644 index 0000000000..cf64687c50 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttCapabilities.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable RttCapabilities { + boolean rttOneSidedSupported; + boolean rttFtmSupported; + boolean lciSupported; + boolean lcrSupported; + boolean responderSupported; + android.hardware.wifi.RttPreamble preambleSupport; + android.hardware.wifi.RttBw bwSupport; + byte mcVersion; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttConfig.aidl new file mode 100644 index 0000000000..ccdf2cee68 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttConfig.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable RttConfig { + byte[6] addr; + android.hardware.wifi.RttType type; + android.hardware.wifi.RttPeerType peer; + android.hardware.wifi.WifiChannelInfo channel; + int burstPeriod; + int numBurst; + int numFramesPerBurst; + int numRetriesPerRttFrame; + int numRetriesPerFtmr; + boolean mustRequestLci; + boolean mustRequestLcr; + int burstDuration; + android.hardware.wifi.RttPreamble preamble; + android.hardware.wifi.RttBw bw; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttLciInformation.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttLciInformation.aidl new file mode 100644 index 0000000000..0fcf151fd1 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttLciInformation.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable RttLciInformation { + long latitude; + long longitude; + int altitude; + byte latitudeUnc; + byte longitudeUnc; + byte altitudeUnc; + android.hardware.wifi.RttMotionPattern motionPattern; + int floor; + int heightAboveFloor; + int heightUnc; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttLcrInformation.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttLcrInformation.aidl new file mode 100644 index 0000000000..c756ddab0d --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttLcrInformation.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable RttLcrInformation { + byte[2] countryCode; + String civicInfo; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttMotionPattern.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttMotionPattern.aidl new file mode 100644 index 0000000000..7c8e3692b1 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttMotionPattern.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum RttMotionPattern { + NOT_EXPECTED = 0, + EXPECTED = 1, + UNKNOWN = 2, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttPeerType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttPeerType.aidl new file mode 100644 index 0000000000..23fa7f67cb --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttPeerType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum RttPeerType { + AP = 1, + STA = 2, + P2P_GO = 3, + P2P_CLIENT = 4, + NAN_TYPE = 5, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttPreamble.aidl new file mode 100644 index 0000000000..de26f28f81 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttPreamble.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum RttPreamble { + LEGACY = 0x1, + HT = 0x2, + VHT = 0x4, + HE = 0x8, + EHT = 0x10, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttResponder.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttResponder.aidl new file mode 100644 index 0000000000..41463b5292 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttResponder.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable RttResponder { + android.hardware.wifi.WifiChannelInfo channel; + android.hardware.wifi.RttPreamble preamble; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttResult.aidl new file mode 100644 index 0000000000..8375dcb148 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttResult.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable RttResult { + byte[6] addr; + int burstNum; + int measurementNumber; + int successNumber; + byte numberPerBurstPeer; + android.hardware.wifi.RttStatus status; + byte retryAfterDuration; + android.hardware.wifi.RttType type; + int rssi; + int rssiSpread; + android.hardware.wifi.WifiRateInfo txRate; + android.hardware.wifi.WifiRateInfo rxRate; + long rtt; + long rttSd; + long rttSpread; + int distanceInMm; + int distanceSdInMm; + int distanceSpreadInMm; + long timeStampInUs; + int burstDurationInMs; + int negotiatedBurstNum; + android.hardware.wifi.WifiInformationElement lci; + android.hardware.wifi.WifiInformationElement lcr; + int channelFreqMHz; + android.hardware.wifi.RttBw packetBw; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttStatus.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttStatus.aidl new file mode 100644 index 0000000000..2817497a7a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttStatus.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum RttStatus { + SUCCESS = 0, + FAILURE = 1, + FAIL_NO_RSP = 2, + FAIL_REJECTED = 3, + FAIL_NOT_SCHEDULED_YET = 4, + FAIL_TM_TIMEOUT = 5, + FAIL_AP_ON_DIFF_CHANNEL = 6, + FAIL_NO_CAPABILITY = 7, + ABORTED = 8, + FAIL_INVALID_TS = 9, + FAIL_PROTOCOL = 10, + FAIL_SCHEDULE = 11, + FAIL_BUSY_TRY_LATER = 12, + INVALID_REQ = 13, + NO_WIFI = 14, + FAIL_FTM_PARAM_OVERRIDE = 15, + NAN_RANGING_PROTOCOL_FAILURE = 16, + NAN_RANGING_CONCURRENCY_NOT_SUPPORTED = 17, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttType.aidl new file mode 100644 index 0000000000..2b6087a6bc --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/RttType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum RttType { + ONE_SIDED = 1, + TWO_SIDED = 2, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/Ssid.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/Ssid.aidl new file mode 100644 index 0000000000..98b523f37e --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/Ssid.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable Ssid { + byte[32] data; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaApfPacketFilterCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaApfPacketFilterCapabilities.aidl new file mode 100644 index 0000000000..3b4d785a42 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaApfPacketFilterCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaApfPacketFilterCapabilities { + int version; + int maxLength; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl new file mode 100644 index 0000000000..249d87622a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum StaBackgroundScanBucketEventReportSchemeMask { + EACH_SCAN = (1 << 0) /* 1 */, + FULL_RESULTS = (1 << 1) /* 2 */, + NO_BATCH = (1 << 2) /* 4 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl new file mode 100644 index 0000000000..4e9671a370 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaBackgroundScanBucketParameters { + int bucketIdx; + android.hardware.wifi.WifiBand band; + int[] frequencies; + int periodInMs; + int eventReportScheme; + int exponentialMaxPeriodInMs; + int exponentialBase; + int exponentialStepCount; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanCapabilities.aidl new file mode 100644 index 0000000000..758dd97485 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaBackgroundScanCapabilities { + int maxCacheSize; + int maxBuckets; + int maxApCachePerScan; + int maxReportingThreshold; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanLimits.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanLimits.aidl new file mode 100644 index 0000000000..05d0277d1c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanLimits.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum StaBackgroundScanLimits { + MAX_CHANNELS = 16, + MAX_BUCKETS = 16, + MAX_AP_CACHE_PER_SCAN = 32, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanParameters.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanParameters.aidl new file mode 100644 index 0000000000..077356685d --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaBackgroundScanParameters.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaBackgroundScanParameters { + int basePeriodInMs; + int maxApPerScan; + int reportThresholdPercent; + int reportThresholdNumScans; + android.hardware.wifi.StaBackgroundScanBucketParameters[] buckets; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfaceContentionTimeStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfaceContentionTimeStats.aidl new file mode 100644 index 0000000000..4dee6de3fd --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfaceContentionTimeStats.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerIfaceContentionTimeStats { + int contentionTimeMinInUsec; + int contentionTimeMaxInUsec; + int contentionTimeAvgInUsec; + int contentionNumSamples; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfacePacketStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfacePacketStats.aidl new file mode 100644 index 0000000000..eddf52ee25 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfacePacketStats.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerIfacePacketStats { + long rxMpdu; + long txMpdu; + long lostMpdu; + long retries; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfaceStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfaceStats.aidl new file mode 100644 index 0000000000..a4192076d2 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerIfaceStats.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerIfaceStats { + android.hardware.wifi.StaLinkLayerLinkStats[] links; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerLinkStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerLinkStats.aidl new file mode 100644 index 0000000000..cd21c256fe --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerLinkStats.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerLinkStats { + int linkId; + int radioId; + int frequencyMhz; + int beaconRx; + int avgRssiMgmt; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeBePktStats; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeBkPktStats; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeViPktStats; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeVoPktStats; + byte timeSliceDutyCycleInPercent; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; + android.hardware.wifi.StaPeerInfo[] peers; + android.hardware.wifi.StaLinkLayerLinkStats.StaLinkState state; + @Backing(type="int") @VintfStability + enum StaLinkState { + UNKNOWN = 0, + NOT_IN_USE = (1 << 0) /* 1 */, + IN_USE = (1 << 1) /* 2 */, + } +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerRadioStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerRadioStats.aidl new file mode 100644 index 0000000000..84d24c9974 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerRadioStats.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerRadioStats { + int onTimeInMs; + int txTimeInMs; + int[] txTimeInMsPerLevel; + int rxTimeInMs; + int onTimeInMsForScan; + int onTimeInMsForNanScan; + int onTimeInMsForBgScan; + int onTimeInMsForRoamScan; + int onTimeInMsForPnoScan; + int onTimeInMsForHs20Scan; + android.hardware.wifi.WifiChannelStats[] channelStats; + int radioId; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerStats.aidl new file mode 100644 index 0000000000..9c05346998 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaLinkLayerStats.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerStats { + android.hardware.wifi.StaLinkLayerIfaceStats iface; + android.hardware.wifi.StaLinkLayerRadioStats[] radios; + long timeStampInMs; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaPeerInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaPeerInfo.aidl new file mode 100644 index 0000000000..93a901fb2a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaPeerInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaPeerInfo { + char staCount; + char chanUtil; + android.hardware.wifi.StaRateStat[] rateStats; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRateStat.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRateStat.aidl new file mode 100644 index 0000000000..43b69fc900 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRateStat.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaRateStat { + android.hardware.wifi.WifiRateInfo rateInfo; + int txMpdu; + int rxMpdu; + int mpduLost; + int retries; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingCapabilities.aidl new file mode 100644 index 0000000000..9eed877d6f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaRoamingCapabilities { + int maxBlocklistSize; + int maxAllowlistSize; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingConfig.aidl new file mode 100644 index 0000000000..2b37cee12a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingConfig.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaRoamingConfig { + android.hardware.wifi.MacAddress[] bssidBlocklist; + android.hardware.wifi.Ssid[] ssidAllowlist; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingState.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingState.aidl new file mode 100644 index 0000000000..1f3d91f290 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaRoamingState.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="byte") @VintfStability +enum StaRoamingState { + DISABLED = 0, + ENABLED = 1, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanData.aidl new file mode 100644 index 0000000000..7c75232e51 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaScanData { + int flags; + int bucketsScanned; + android.hardware.wifi.StaScanResult[] results; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanDataFlagMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanDataFlagMask.aidl new file mode 100644 index 0000000000..0ca4b4b41c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanDataFlagMask.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum StaScanDataFlagMask { + INTERRUPTED = (1 << 0) /* 1 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanResult.aidl new file mode 100644 index 0000000000..9a8d29720c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/StaScanResult.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaScanResult { + long timeStampInUs; + byte[] ssid; + byte[6] bssid; + int rssi; + int frequency; + char beaconPeriodInMs; + char capability; + android.hardware.wifi.WifiInformationElement[] informationElements; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiAntennaMode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiAntennaMode.aidl new file mode 100644 index 0000000000..b47b7f502a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiAntennaMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiAntennaMode { + WIFI_ANTENNA_MODE_UNSPECIFIED = 0, + WIFI_ANTENNA_MODE_1X1 = 1, + WIFI_ANTENNA_MODE_2X2 = 2, + WIFI_ANTENNA_MODE_3X3 = 3, + WIFI_ANTENNA_MODE_4X4 = 4, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiBand.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiBand.aidl new file mode 100644 index 0000000000..e9a87ee458 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiBand.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiBand { + BAND_UNSPECIFIED = 0, + BAND_24GHZ = 1, + BAND_5GHZ = 2, + BAND_5GHZ_DFS = 4, + BAND_5GHZ_WITH_DFS = 6, + BAND_24GHZ_5GHZ = 3, + BAND_24GHZ_5GHZ_WITH_DFS = 7, + BAND_6GHZ = 8, + BAND_5GHZ_6GHZ = 10, + BAND_24GHZ_5GHZ_6GHZ = 11, + BAND_24GHZ_5GHZ_WITH_DFS_6GHZ = 15, + BAND_60GHZ = 16, + BAND_24GHZ_5GHZ_6GHZ_60GHZ = 27, + BAND_24GHZ_5GHZ_WITH_DFS_6GHZ_60GHZ = 31, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelInfo.aidl new file mode 100644 index 0000000000..297c923dbe --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiChannelInfo { + android.hardware.wifi.WifiChannelWidthInMhz width; + int centerFreq; + int centerFreq0; + int centerFreq1; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelStats.aidl new file mode 100644 index 0000000000..c6e7acc937 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelStats.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiChannelStats { + android.hardware.wifi.WifiChannelInfo channel; + int onTimeInMs; + int ccaBusyTimeInMs; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelWidthInMhz.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelWidthInMhz.aidl new file mode 100644 index 0000000000..e6ea642db6 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChannelWidthInMhz.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiChannelWidthInMhz { + WIDTH_INVALID = (-1) /* -1 */, + WIDTH_20 = 0, + WIDTH_40 = 1, + WIDTH_80 = 2, + WIDTH_160 = 3, + WIDTH_80P80 = 4, + WIDTH_5 = 5, + WIDTH_10 = 6, + WIDTH_320 = 7, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChipCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChipCapabilities.aidl new file mode 100644 index 0000000000..b5034ea387 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiChipCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiChipCapabilities { + int maxMloAssociationLinkCount; + int maxMloStrLinkCount; + int maxConcurrentTdlsSessionCount; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxIcmpPacketDetails.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxIcmpPacketDetails.aidl new file mode 100644 index 0000000000..8415e09ad8 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxIcmpPacketDetails.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugHostWakeReasonRxIcmpPacketDetails { + int icmpPkt; + int icmp6Pkt; + int icmp6Ra; + int icmp6Na; + int icmp6Ns; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxMulticastPacketDetails.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxMulticastPacketDetails.aidl new file mode 100644 index 0000000000..30301d3e45 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxMulticastPacketDetails.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugHostWakeReasonRxMulticastPacketDetails { + int ipv4RxMulticastAddrCnt; + int ipv6RxMulticastAddrCnt; + int otherRxMulticastAddrCnt; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxPacketDetails.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxPacketDetails.aidl new file mode 100644 index 0000000000..81183225dc --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonRxPacketDetails.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugHostWakeReasonRxPacketDetails { + int rxUnicastCnt; + int rxMulticastCnt; + int rxBroadcastCnt; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonStats.aidl new file mode 100644 index 0000000000..1766476919 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugHostWakeReasonStats.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugHostWakeReasonStats { + int totalCmdEventWakeCnt; + int[] cmdEventWakeCntPerType; + int totalDriverFwLocalWakeCnt; + int[] driverFwLocalWakeCntPerType; + int totalRxPacketWakeCnt; + android.hardware.wifi.WifiDebugHostWakeReasonRxPacketDetails rxPktWakeDetails; + android.hardware.wifi.WifiDebugHostWakeReasonRxMulticastPacketDetails rxMulticastPkWakeDetails; + android.hardware.wifi.WifiDebugHostWakeReasonRxIcmpPacketDetails rxIcmpPkWakeDetails; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugPacketFateFrameInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugPacketFateFrameInfo.aidl new file mode 100644 index 0000000000..2ff6cfcbeb --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugPacketFateFrameInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugPacketFateFrameInfo { + android.hardware.wifi.WifiDebugPacketFateFrameType frameType; + long frameLen; + long driverTimestampUsec; + long firmwareTimestampUsec; + byte[] frameContent; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl new file mode 100644 index 0000000000..6db96efc0f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiDebugPacketFateFrameType { + UNKNOWN, + ETHERNET_II, + MGMT_80211, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferFlags.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferFlags.aidl new file mode 100644 index 0000000000..9ababc373d --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferFlags.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiDebugRingBufferFlags { + HAS_BINARY_ENTRIES = (1 << 0) /* 1 */, + HAS_ASCII_ENTRIES = (1 << 1) /* 2 */, + HAS_PER_PACKET_ENTRIES = (1 << 2) /* 4 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferStatus.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferStatus.aidl new file mode 100644 index 0000000000..e4249d9a88 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugRingBufferStatus { + String ringName; + int flags; + int ringId; + int sizeInBytes; + int freeSizeInBytes; + int verboseLevel; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferVerboseLevel.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferVerboseLevel.aidl new file mode 100644 index 0000000000..e614f3fba0 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRingBufferVerboseLevel.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiDebugRingBufferVerboseLevel { + NONE = 0, + DEFAULT = 1, + VERBOSE = 2, + EXCESSIVE = 3, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRxPacketFate.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRxPacketFate.aidl new file mode 100644 index 0000000000..f638c4f7df --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRxPacketFate.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiDebugRxPacketFate { + SUCCESS, + FW_QUEUED, + FW_DROP_FILTER, + FW_DROP_INVALID, + FW_DROP_NOBUFS, + FW_DROP_OTHER, + DRV_QUEUED, + DRV_DROP_FILTER, + DRV_DROP_INVALID, + DRV_DROP_NOBUFS, + DRV_DROP_OTHER, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRxPacketFateReport.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRxPacketFateReport.aidl new file mode 100644 index 0000000000..bfe0c0aee6 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugRxPacketFateReport.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugRxPacketFateReport { + android.hardware.wifi.WifiDebugRxPacketFate fate; + android.hardware.wifi.WifiDebugPacketFateFrameInfo frameInfo; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugTxPacketFate.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugTxPacketFate.aidl new file mode 100644 index 0000000000..778ca5dee2 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugTxPacketFate.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiDebugTxPacketFate { + ACKED, + SENT, + FW_QUEUED, + FW_DROP_INVALID, + FW_DROP_NOBUFS, + FW_DROP_OTHER, + DRV_QUEUED, + DRV_DROP_INVALID, + DRV_DROP_NOBUFS, + DRV_DROP_OTHER, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugTxPacketFateReport.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugTxPacketFateReport.aidl new file mode 100644 index 0000000000..aee5c31103 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiDebugTxPacketFateReport.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiDebugTxPacketFateReport { + android.hardware.wifi.WifiDebugTxPacketFate fate; + android.hardware.wifi.WifiDebugPacketFateFrameInfo frameInfo; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiIfaceMode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiIfaceMode.aidl new file mode 100644 index 0000000000..557cef4c77 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiIfaceMode.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiIfaceMode { + IFACE_MODE_STA = (1 << 0) /* 1 */, + IFACE_MODE_SOFTAP = (1 << 1) /* 2 */, + IFACE_MODE_IBSS = (1 << 2) /* 4 */, + IFACE_MODE_P2P_CLIENT = (1 << 3) /* 8 */, + IFACE_MODE_P2P_GO = (1 << 4) /* 16 */, + IFACE_MODE_NAN = (1 << 5) /* 32 */, + IFACE_MODE_MESH = (1 << 6) /* 64 */, + IFACE_MODE_TDLS = (1 << 7) /* 128 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiInformationElement.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiInformationElement.aidl new file mode 100644 index 0000000000..27ba0db19c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiInformationElement.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiInformationElement { + byte id; + byte[] data; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRadioCombination.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRadioCombination.aidl new file mode 100644 index 0000000000..f060db87f3 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRadioCombination.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiRadioCombination { + android.hardware.wifi.WifiRadioConfiguration[] radioConfigurations; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRadioConfiguration.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRadioConfiguration.aidl new file mode 100644 index 0000000000..5169351525 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRadioConfiguration.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiRadioConfiguration { + android.hardware.wifi.WifiBand bandInfo; + android.hardware.wifi.WifiAntennaMode antennaMode; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRateInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRateInfo.aidl new file mode 100644 index 0000000000..c4aca637bf --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRateInfo.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiRateInfo { + android.hardware.wifi.WifiRatePreamble preamble; + android.hardware.wifi.WifiRateNss nss; + android.hardware.wifi.WifiChannelWidthInMhz bw; + byte rateMcsIdx; + int bitRateInKbps; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRateNss.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRateNss.aidl new file mode 100644 index 0000000000..0ad6f04847 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRateNss.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiRateNss { + NSS_1x1 = 0, + NSS_2x2 = 1, + NSS_3x3 = 2, + NSS_4x4 = 3, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRatePreamble.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRatePreamble.aidl new file mode 100644 index 0000000000..04b63583ea --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiRatePreamble.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiRatePreamble { + OFDM = 0, + CCK = 1, + HT = 2, + VHT = 3, + RESERVED = 4, + HE = 5, + EHT = 6, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiStatusCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiStatusCode.aidl new file mode 100644 index 0000000000..9a15fa1cae --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiStatusCode.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum WifiStatusCode { + SUCCESS, + ERROR_WIFI_CHIP_INVALID, + ERROR_WIFI_IFACE_INVALID, + ERROR_WIFI_RTT_CONTROLLER_INVALID, + ERROR_NOT_SUPPORTED, + ERROR_NOT_AVAILABLE, + ERROR_NOT_STARTED, + ERROR_INVALID_ARGS, + ERROR_BUSY, + ERROR_UNKNOWN, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiUsableChannel.aidl new file mode 100644 index 0000000000..774b2423ff --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/1/android/hardware/wifi/WifiUsableChannel.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiUsableChannel { + int channel; + android.hardware.wifi.WifiChannelWidthInMhz channelBandwidth; + int ifaceModeMask; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AfcChannelAllowance.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AfcChannelAllowance.aidl new file mode 100644 index 0000000000..4d3cd6eb58 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AfcChannelAllowance.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable AfcChannelAllowance { + android.hardware.wifi.AvailableAfcFrequencyInfo[] availableAfcFrequencyInfos; + android.hardware.wifi.AvailableAfcChannelInfo[] availableAfcChannelInfos; + long availabilityExpireTimeMs; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AvailableAfcChannelInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AvailableAfcChannelInfo.aidl new file mode 100644 index 0000000000..d2386401ba --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AvailableAfcChannelInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable AvailableAfcChannelInfo { + int globalOperatingClass; + int channelCfi; + int maxEirpDbm; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl new file mode 100644 index 0000000000..cbea5affb9 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable AvailableAfcFrequencyInfo { + int startFrequencyMhz; + int endFrequencyMhz; + int maxPsd; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiApIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiApIface.aidl index a102b9779d..e71dde40fd 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiApIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiApIface.aidl @@ -38,7 +38,6 @@ interface IWifiApIface { String[] getBridgedInstances(); byte[6] getFactoryMacAddress(); void setCountryCode(in byte[2] code); - int[] getValidFrequenciesForBand(in android.hardware.wifi.WifiBand band); void resetToFactoryMacAddress(); void setMacAddress(in byte[6] mac); } 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 647891f7cb..4ea2081ace 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl @@ -47,7 +47,7 @@ interface IWifiChip { @PropagateAllowBlocking android.hardware.wifi.IWifiApIface getApIface(in String ifname); String[] getApIfaceNames(); android.hardware.wifi.IWifiChip.ChipMode[] getAvailableModes(); - android.hardware.wifi.IWifiChip.ChipCapabilityMask getCapabilities(); + int getFeatureSet(); android.hardware.wifi.WifiDebugHostWakeReasonStats getDebugHostWakeReasonStats(); android.hardware.wifi.WifiDebugRingBufferStatus[] getDebugRingBuffersStatus(); int getId(); @@ -58,8 +58,10 @@ interface IWifiChip { String[] getP2pIfaceNames(); @PropagateAllowBlocking android.hardware.wifi.IWifiStaIface getStaIface(in String ifname); String[] getStaIfaceNames(); - android.hardware.wifi.WifiRadioCombinationMatrix getSupportedRadioCombinationsMatrix(); - android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in android.hardware.wifi.WifiIfaceMode ifaceModeMask, in android.hardware.wifi.IWifiChip.UsableChannelFilter filterMask); + android.hardware.wifi.WifiRadioCombination[] getSupportedRadioCombinations(); + android.hardware.wifi.WifiChipCapabilities getWifiChipCapabilities(); + android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in int ifaceModeMask, in int filterMask); + void setAfcChannelAllowance(in android.hardware.wifi.AfcChannelAllowance afcChannelAllowance); void registerEventCallback(in android.hardware.wifi.IWifiChipEventCallback callback); void removeApIface(in String ifname); void removeIfaceInstanceFromBridgedApIface(in String brIfaceName, in String ifaceInstanceName); @@ -71,7 +73,7 @@ interface IWifiChip { byte[] requestFirmwareDebugDump(); void resetTxPowerScenario(); void selectTxPowerScenario(in android.hardware.wifi.IWifiChip.TxPowerScenario scenario); - void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in android.hardware.wifi.IWifiChip.CoexRestriction restrictions); + void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in int restrictions); void setCountryCode(in byte[2] code); void setLatencyMode(in android.hardware.wifi.IWifiChip.LatencyMode mode); void setMultiStaPrimaryConnection(in String ifName); @@ -79,24 +81,20 @@ interface IWifiChip { void startLoggingToDebugRingBuffer(in String ringName, in android.hardware.wifi.WifiDebugRingBufferVerboseLevel verboseLevel, in int maxIntervalInSec, in int minDataSizeInBytes); void stopLoggingToDebugRingBuffer(); void triggerSubsystemRestart(); - const int NO_POWER_CAP_CONSTANT = 2147483647; + void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag); + void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode); + const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF; @Backing(type="int") @VintfStability - enum ChipCapabilityMask { - DEBUG_MEMORY_FIRMWARE_DUMP = 1, - DEBUG_MEMORY_DRIVER_DUMP = 2, - DEBUG_RING_BUFFER_CONNECT_EVENT = 4, - DEBUG_RING_BUFFER_POWER_EVENT = 8, - DEBUG_RING_BUFFER_WAKELOCK_EVENT = 16, - DEBUG_RING_BUFFER_VENDOR_DATA = 32, - DEBUG_HOST_WAKE_REASON_STATS = 64, - DEBUG_ERROR_ALERTS = 128, - SET_TX_POWER_LIMIT = 256, - D2D_RTT = 512, - D2AP_RTT = 1024, - USE_BODY_HEAD_SAR = 2048, - SET_LATENCY_MODE = 4096, - P2P_RAND_MAC = 8192, - WIGIG = 16384, + enum FeatureSetMask { + SET_TX_POWER_LIMIT = (1 << 0) /* 1 */, + D2D_RTT = (1 << 1) /* 2 */, + D2AP_RTT = (1 << 2) /* 4 */, + USE_BODY_HEAD_SAR = (1 << 3) /* 8 */, + SET_LATENCY_MODE = (1 << 4) /* 16 */, + P2P_RAND_MAC = (1 << 5) /* 32 */, + WIGIG = (1 << 6) /* 64 */, + SET_AFC_CHANNEL_ALLOWANCE = (1 << 7) /* 128 */, + T2LM_NEGOTIATION = (1 << 8) /* 256 */, } @VintfStability parcelable ChipConcurrencyCombinationLimit { @@ -128,9 +126,9 @@ interface IWifiChip { } @Backing(type="int") @VintfStability enum CoexRestriction { - WIFI_DIRECT = 1, - SOFTAP = 2, - WIFI_AWARE = 4, + WIFI_DIRECT = (1 << 0) /* 1 */, + SOFTAP = (1 << 1) /* 2 */, + WIFI_AWARE = (1 << 2) /* 4 */, } @VintfStability parcelable CoexUnsafeChannel { @@ -158,8 +156,20 @@ interface IWifiChip { } @Backing(type="int") @VintfStability enum UsableChannelFilter { - CELLULAR_COEXISTENCE = 1, - CONCURRENCY = 2, - NAN_INSTANT_MODE = 4, + CELLULAR_COEXISTENCE = (1 << 0) /* 1 */, + CONCURRENCY = (1 << 1) /* 2 */, + NAN_INSTANT_MODE = (1 << 2) /* 4 */, + } + @Backing(type="int") @VintfStability + enum ChannelCategoryMask { + INDOOR_CHANNEL = (1 << 0) /* 1 */, + DFS_CHANNEL = (1 << 1) /* 2 */, + } + @Backing(type="int") @VintfStability + enum ChipMloMode { + DEFAULT = 0, + LOW_LATENCY = 1, + HIGH_THROUGHPUT = 2, + LOW_POWER = 3, } } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl index 070ca240cb..0e2f90fbc0 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl @@ -49,7 +49,14 @@ interface IWifiNanIface { void stopPublishRequest(in char cmdId, in byte sessionId); void stopSubscribeRequest(in char cmdId, in byte sessionId); void terminateDataPathRequest(in char cmdId, in int ndpInstanceId); + void suspendRequest(in char cmdId, in byte sessionId); + void resumeRequest(in char cmdId, in byte sessionId); void transmitFollowupRequest(in char cmdId, in android.hardware.wifi.NanTransmitFollowupRequest msg); + void initiatePairingRequest(in char cmdId, in android.hardware.wifi.NanPairingRequest msg); + void respondToPairingIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToPairingIndicationRequest msg); + void initiateBootstrappingRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingRequest msg); + void respondToBootstrappingIndicationRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingResponse msg); + void terminatePairingRequest(in char cmdId, in int pairingInstanceId); const int MIN_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 8; const int MAX_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 63; } 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 591cd8c205..8c443309ee 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 @@ -46,6 +46,7 @@ interface IWifiNanIfaceEventCallback { oneway void eventPublishTerminated(in byte sessionId, in android.hardware.wifi.NanStatus status); oneway void eventSubscribeTerminated(in byte sessionId, in android.hardware.wifi.NanStatus status); oneway void eventTransmitFollowup(in char id, in android.hardware.wifi.NanStatus status); + oneway void eventSuspensionModeChanged(in android.hardware.wifi.NanSuspensionModeChangeInd event); oneway void notifyCapabilitiesResponse(in char id, in android.hardware.wifi.NanStatus status, in android.hardware.wifi.NanCapabilities capabilities); oneway void notifyConfigResponse(in char id, in android.hardware.wifi.NanStatus status); oneway void notifyCreateDataInterfaceResponse(in char id, in android.hardware.wifi.NanStatus status); @@ -59,5 +60,16 @@ interface IWifiNanIfaceEventCallback { oneway void notifyStopPublishResponse(in char id, in android.hardware.wifi.NanStatus status); oneway void notifyStopSubscribeResponse(in char id, in android.hardware.wifi.NanStatus status); oneway void notifyTerminateDataPathResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifySuspendResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void notifyResumeResponse(in char id, in android.hardware.wifi.NanStatus status); oneway void notifyTransmitFollowupResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void eventPairingRequest(in android.hardware.wifi.NanPairingRequestInd event); + oneway void eventPairingConfirm(in android.hardware.wifi.NanPairingConfirmInd event); + oneway void notifyInitiatePairingResponse(in char id, in android.hardware.wifi.NanStatus status, in int pairingInstanceId); + oneway void notifyRespondToPairingIndicationResponse(in char id, in android.hardware.wifi.NanStatus status); + oneway void eventBootstrappingRequest(in android.hardware.wifi.NanBootstrappingRequestInd event); + oneway void eventBootstrappingConfirm(in android.hardware.wifi.NanBootstrappingConfirmInd event); + 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); } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl index 2f0dfa18fa..923deff01f 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl @@ -41,13 +41,12 @@ interface IWifiStaIface { void enableNdOffload(in boolean enable); android.hardware.wifi.StaApfPacketFilterCapabilities getApfPacketFilterCapabilities(); android.hardware.wifi.StaBackgroundScanCapabilities getBackgroundScanCapabilities(); - android.hardware.wifi.IWifiStaIface.StaIfaceCapabilityMask getCapabilities(); + int getFeatureSet(); android.hardware.wifi.WifiDebugRxPacketFateReport[] getDebugRxPacketFates(); android.hardware.wifi.WifiDebugTxPacketFateReport[] getDebugTxPacketFates(); byte[6] getFactoryMacAddress(); android.hardware.wifi.StaLinkLayerStats getLinkLayerStats(); android.hardware.wifi.StaRoamingCapabilities getRoamingCapabilities(); - int[] getValidFrequenciesForBand(in android.hardware.wifi.WifiBand band); void installApfPacketFilter(in byte[] program); byte[] readApfPacketFilterData(); void registerEventCallback(in android.hardware.wifi.IWifiStaIfaceEventCallback callback); @@ -61,22 +60,22 @@ interface IWifiStaIface { void stopBackgroundScan(in int cmdId); void stopRssiMonitoring(in int cmdId); void stopSendingKeepAlivePackets(in int cmdId); + void setDtimMultiplier(in int multiplier); @Backing(type="int") @VintfStability - enum StaIfaceCapabilityMask { - APF = 1, - BACKGROUND_SCAN = 2, - LINK_LAYER_STATS = 4, - RSSI_MONITOR = 8, - CONTROL_ROAMING = 16, - PROBE_IE_ALLOWLIST = 32, - SCAN_RAND = 64, - STA_5G = 128, - HOTSPOT = 256, - PNO = 512, - TDLS = 1024, - TDLS_OFFCHANNEL = 2048, - ND_OFFLOAD = 4096, - KEEP_ALIVE = 8192, - DEBUG_PACKET_FATE = 16384, + enum FeatureSetMask { + APF = (1 << 0) /* 1 */, + BACKGROUND_SCAN = (1 << 1) /* 2 */, + LINK_LAYER_STATS = (1 << 2) /* 4 */, + RSSI_MONITOR = (1 << 3) /* 8 */, + CONTROL_ROAMING = (1 << 4) /* 16 */, + PROBE_IE_ALLOWLIST = (1 << 5) /* 32 */, + SCAN_RAND = (1 << 6) /* 64 */, + STA_5G = (1 << 7) /* 128 */, + HOTSPOT = (1 << 8) /* 256 */, + PNO = (1 << 9) /* 512 */, + TDLS = (1 << 10) /* 1024 */, + TDLS_OFFCHANNEL = (1 << 11) /* 2048 */, + ND_OFFLOAD = (1 << 12) /* 4096 */, + KEEP_ALIVE = (1 << 13) /* 8192 */, } } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl index 0a3ad1ac8b..d584423f5a 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceConcurrencyType.aidl @@ -34,9 +34,9 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum IfaceConcurrencyType { - STA = 0, - AP = 1, - AP_BRIDGED = 2, - P2P = 3, - NAN_IFACE = 4, + STA, + AP, + AP_BRIDGED, + P2P, + NAN_IFACE, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl index dbdc4390f3..67022dfdff 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IfaceType.aidl @@ -34,8 +34,8 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum IfaceType { - STA = 0, - AP = 1, - P2P = 2, - NAN_IFACE = 3, + STA, + AP, + P2P, + NAN_IFACE, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl index ca6c910579..3f1ea5e444 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBandIndex.aidl @@ -35,6 +35,6 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanBandIndex { NAN_BAND_24GHZ = 0, - NAN_BAND_5GHZ = 1, + NAN_BAND_5GHZ, NAN_BAND_6GHZ = 2, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl new file mode 100644 index 0000000000..5ab8dcd213 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingConfirmInd { + int bootstrappingInstanceId; + android.hardware.wifi.NanBootstrappingResponseCode responseCode; + android.hardware.wifi.NanStatus reasonCode; + int comeBackDelay; + byte[] cookie; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl new file mode 100644 index 0000000000..6ff62b2f52 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanBootstrappingMethod { + BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0) /* 1 */, + BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1) /* 2 */, + BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2) /* 4 */, + BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3) /* 8 */, + BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4) /* 16 */, + BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5) /* 32 */, + BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6) /* 64 */, + BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7) /* 128 */, + BOOTSTRAPPING_NFC_READER_MASK = (1 << 8) /* 256 */, + BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14) /* 16384 */, + BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15) /* 32768 */, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl new file mode 100644 index 0000000000..dd0a5ede2f --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingRequest { + int peerId; + byte[6] peerDiscMacAddr; + android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod; + byte[] cookie; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequestInd.aidl new file mode 100644 index 0000000000..a4398e9310 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequestInd.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingRequestInd { + byte discoverySessionId; + int peerId; + byte[6] peerDiscMacAddr; + int bootstrappingInstanceId; + android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl new file mode 100644 index 0000000000..6dd9b2603a --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanBootstrappingResponse { + int bootstrappingInstanceId; + boolean acceptRequest; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponseCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponseCode.aidl new file mode 100644 index 0000000000..a3e9e4d2ae --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponseCode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanBootstrappingResponseCode { + NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0, + NAN_BOOTSTRAPPING_REQUEST_REJECT, + NAN_BOOTSTRAPPING_REQUEST_COMEBACK, +} 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 c44654e4a3..a30893a0c2 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl @@ -47,6 +47,11 @@ parcelable NanCapabilities { int maxAppInfoLen; int maxQueuedTransmitFollowupMsgs; int maxSubscribeInterfaceAddresses; - android.hardware.wifi.NanCipherSuiteType supportedCipherSuites; + int supportedCipherSuites; boolean instantCommunicationModeSupportFlag; + boolean supports6g; + boolean supportsHe; + boolean supportsPairing; + boolean supportsSetClusterId; + boolean supportsSuspension; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl index 44509563b8..6f3158e670 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl @@ -35,8 +35,10 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanCipherSuiteType { NONE = 0, - SHARED_KEY_128_MASK = 1, - SHARED_KEY_256_MASK = 2, - PUBLIC_KEY_128_MASK = 4, - PUBLIC_KEY_256_MASK = 8, + SHARED_KEY_128_MASK = (1 << 0) /* 1 */, + SHARED_KEY_256_MASK = (1 << 1) /* 2 */, + PUBLIC_KEY_2WDH_128_MASK = (1 << 2) /* 4 */, + PUBLIC_KEY_2WDH_256_MASK = (1 << 3) /* 8 */, + PUBLIC_KEY_PASN_128_MASK = (1 << 6) /* 64 */, + PUBLIC_KEY_PASN_256_MASK = (1 << 7) /* 128 */, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl index 1dfa45f6c8..6c20543d86 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanClusterEventType.aidl @@ -35,6 +35,6 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanClusterEventType { DISCOVERY_MAC_ADDRESS_CHANGED = 0, - STARTED_CLUSTER = 1, - JOINED_CLUSTER = 2, + STARTED_CLUSTER, + JOINED_CLUSTER, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl index 682699e7f4..99f2af771e 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl @@ -40,4 +40,5 @@ parcelable NanConfigRequestSupplemental { boolean enableRanging; boolean enableInstantCommunicationMode; int instantModeChannel; + int clusterId; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl index ce752882af..4233c32863 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathChannelCfg.aidl @@ -35,6 +35,6 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanDataPathChannelCfg { CHANNEL_NOT_REQUESTED = 0, - REQUEST_CHANNEL_SETUP = 1, - FORCE_CHANNEL_SETUP = 2, + REQUEST_CHANNEL_SETUP, + FORCE_CHANNEL_SETUP, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl index 64288ca5b3..cb7904d180 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityType.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanDataPathSecurityType { - OPEN = 0, - PMK = 1, - PASSPHRASE = 2, + OPEN, + PMK, + PASSPHRASE, } 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 761cdbb643..96d940ae31 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDiscoveryCommonConfig.aidl @@ -51,7 +51,8 @@ parcelable NanDiscoveryCommonConfig { android.hardware.wifi.NanDataPathSecurityConfig securityConfig; boolean rangingRequired; int rangingIntervalMs; - android.hardware.wifi.NanRangingIndication configRangingIndications; + int configRangingIndications; char distanceIngressCm; char distanceEgressCm; + boolean enableSessionSuspendability; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanIdentityResolutionAttribute.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanIdentityResolutionAttribute.aidl new file mode 100644 index 0000000000..843107ea40 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanIdentityResolutionAttribute.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanIdentityResolutionAttribute { + byte[8] nonce; + byte[8] tag; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanInitiateDataPathRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanInitiateDataPathRequest.aidl index 697e29a7c8..740a140780 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanInitiateDataPathRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanInitiateDataPathRequest.aidl @@ -42,4 +42,5 @@ parcelable NanInitiateDataPathRequest { android.hardware.wifi.NanDataPathSecurityConfig securityConfig; byte[] appInfo; byte[] serviceNameOutOfBand; + byte discoverySessionId; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl index dab33ad19f..93ac26b25f 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchAlg.aidl @@ -35,6 +35,6 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanMatchAlg { MATCH_ONCE = 0, - MATCH_CONTINUOUS = 1, - MATCH_NEVER = 2, + MATCH_CONTINUOUS, + MATCH_NEVER, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl index ae430c4df7..317489f223 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl @@ -47,6 +47,8 @@ parcelable NanMatchInd { boolean peerRequiresSecurityEnabledInNdp; boolean peerRequiresRanging; int rangingMeasurementInMm; - android.hardware.wifi.NanRangingIndication rangingIndicationType; + int rangingIndicationType; byte[] scid; + android.hardware.wifi.NanPairingConfig peerPairingConfig; + android.hardware.wifi.NanIdentityResolutionAttribute peerNira; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingAkm.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingAkm.aidl new file mode 100644 index 0000000000..05bbaee0d5 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingAkm.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPairingAkm { + SAE = 0, + PASN = 1, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfig.aidl new file mode 100644 index 0000000000..1c04a96d6c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfig.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingConfig { + boolean enablePairingSetup; + boolean enablePairingCache; + boolean enablePairingVerification; + int supportedBootstrappingMethods; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl new file mode 100644 index 0000000000..8ecf22aa01 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingConfirmInd { + int pairingInstanceId; + boolean pairingSuccess; + android.hardware.wifi.NanStatus status; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + android.hardware.wifi.NpkSecurityAssociation npksa; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl new file mode 100644 index 0000000000..2a644ae63b --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingRequest { + int peerId; + byte[6] peerDiscMacAddr; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + byte[16] pairingIdentityKey; + android.hardware.wifi.NanPairingSecurityConfig securityConfig; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl new file mode 100644 index 0000000000..66762b93e6 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingRequestInd { + byte discoverySessionId; + int peerId; + byte[6] peerDiscMacAddr; + int pairingInstanceId; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + android.hardware.wifi.NanIdentityResolutionAttribute peerNira; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl new file mode 100644 index 0000000000..3488340bf4 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPairingRequestType { + NAN_PAIRING_SETUP = 0, + NAN_PAIRING_VERIFICATION, +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl new file mode 100644 index 0000000000..1a6a13c550 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanPairingSecurityConfig { + android.hardware.wifi.NanPairingSecurityType securityType; + byte[32] pmk; + byte[] passphrase; + android.hardware.wifi.NanPairingAkm akm; + android.hardware.wifi.NanCipherSuiteType cipherType; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl new file mode 100644 index 0000000000..9f6c774021 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@Backing(type="int") @VintfStability +enum NanPairingSecurityType { + OPPORTUNISTIC, + PMK, + PASSPHRASE, +} 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 d8d6b1bd61..c49f5f9012 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 @@ -38,4 +38,6 @@ parcelable NanPublishRequest { android.hardware.wifi.NanPublishType publishType; android.hardware.wifi.NanTxType txType; boolean autoAcceptDataPathRequests; + android.hardware.wifi.NanPairingConfig pairingConfig; + byte[16] identityKey; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl index fc9b7a0512..30dffb29d1 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishType.aidl @@ -35,6 +35,6 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanPublishType { UNSOLICITED = 0, - SOLICITED = 1, - UNSOLICITED_SOLICITED = 2, + SOLICITED, + UNSOLICITED_SOLICITED, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl index d03dffc815..cf72dcea23 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanRangingIndication { - CONTINUOUS_INDICATION_MASK = 1, - INGRESS_MET_MASK = 2, - EGRESS_MET_MASK = 4, + CONTINUOUS_INDICATION_MASK = (1 << 0) /* 1 */, + INGRESS_MET_MASK = (1 << 1) /* 2 */, + EGRESS_MET_MASK = (1 << 2) /* 4 */, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl index 5542ff62ba..0f873b5ea8 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl @@ -40,4 +40,5 @@ parcelable NanRespondToDataPathIndicationRequest { android.hardware.wifi.NanDataPathSecurityConfig securityConfig; byte[] appInfo; byte[] serviceNameOutOfBand; + byte discoverySessionId; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl new file mode 100644 index 0000000000..a58890c542 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanRespondToPairingIndicationRequest { + boolean acceptRequest; + int pairingInstanceId; + android.hardware.wifi.NanPairingRequestType requestType; + boolean enablePairingCache; + byte[16] pairingIdentityKey; + android.hardware.wifi.NanPairingSecurityConfig securityConfig; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl index 3c0583cbee..82409fd5aa 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSrfType.aidl @@ -35,5 +35,5 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanSrfType { BLOOM_FILTER = 0, - PARTIAL_MAC_ADDR = 1, + PARTIAL_MAC_ADDR, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl index 9eaf518a2f..ec12eb0c4c 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanStatusCode.aidl @@ -47,4 +47,9 @@ enum NanStatusCode { ALREADY_ENABLED = 10, FOLLOWUP_TX_QUEUE_FULL = 11, UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12, + INVALID_PAIRING_ID = 13, + INVALID_BOOTSTRAPPING_ID = 14, + REDUNDANT_REQUEST = 15, + NOT_SUPPORTED = 16, + NO_CONNECTION = 17, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl index bf176a5a05..96be096d74 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl @@ -41,4 +41,6 @@ parcelable NanSubscribeRequest { boolean shouldUseSrf; boolean isSsiRequiredForMatch; android.hardware.wifi.MacAddress[] intfAddr; + android.hardware.wifi.NanPairingConfig pairingConfig; + byte[16] identityKey; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl index 325e40be6f..4f06df956d 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeType.aidl @@ -35,5 +35,5 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanSubscribeType { PASSIVE = 0, - ACTIVE = 1, + ACTIVE, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSuspensionModeChangeInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSuspensionModeChangeInd.aidl new file mode 100644 index 0000000000..557fc796d9 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSuspensionModeChangeInd.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NanSuspensionModeChangeInd { + boolean isSuspended; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl index 6f7696f07d..798d3a29e6 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanTxType.aidl @@ -35,5 +35,5 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum NanTxType { BROADCAST = 0, - UNICAST = 1, + UNICAST, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl new file mode 100644 index 0000000000..508e92009d --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable NpkSecurityAssociation { + byte[16] peerNanIdentityKey; + byte[16] localNanIdentityKey; + byte[32] npk; + android.hardware.wifi.NanPairingAkm akm; + android.hardware.wifi.NanCipherSuiteType cipherType; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl index bd7efff345..7cc700250e 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttBw.aidl @@ -34,11 +34,12 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum RttBw { - BW_5MHZ = 1, - BW_10MHZ = 2, - BW_20MHZ = 4, - BW_40MHZ = 8, - BW_80MHZ = 16, - BW_160MHZ = 32, - BW_320MHZ = 64, + BW_UNSPECIFIED = 0x0, + BW_5MHZ = 0x01, + BW_10MHZ = 0x02, + BW_20MHZ = 0x04, + BW_40MHZ = 0x08, + BW_80MHZ = 0x10, + BW_160MHZ = 0x20, + BW_320MHZ = 0x40, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl index 02e6479cdc..de26f28f81 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl @@ -34,9 +34,9 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum RttPreamble { - LEGACY = 1, - HT = 2, - VHT = 4, - HE = 8, - EHT = 16, + LEGACY = 0x1, + HT = 0x2, + VHT = 0x4, + HE = 0x8, + EHT = 0x10, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl index 743e0bd182..8375dcb148 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl @@ -57,4 +57,6 @@ parcelable RttResult { int negotiatedBurstNum; android.hardware.wifi.WifiInformationElement lci; android.hardware.wifi.WifiInformationElement lcr; + int channelFreqMHz; + android.hardware.wifi.RttBw packetBw; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl index 1041dd7407..249d87622a 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum StaBackgroundScanBucketEventReportSchemeMask { - EACH_SCAN = 1, - FULL_RESULTS = 2, - NO_BATCH = 4, + EACH_SCAN = (1 << 0) /* 1 */, + FULL_RESULTS = (1 << 1) /* 2 */, + NO_BATCH = (1 << 2) /* 4 */, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl index b49d406921..4e9671a370 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl @@ -38,7 +38,7 @@ parcelable StaBackgroundScanBucketParameters { android.hardware.wifi.WifiBand band; int[] frequencies; int periodInMs; - android.hardware.wifi.StaBackgroundScanBucketEventReportSchemeMask eventReportScheme; + int eventReportScheme; int exponentialMaxPeriodInMs; int exponentialBase; int exponentialStepCount; diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerIfaceStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerIfaceStats.aidl index cf68fc6bf4..a4192076d2 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerIfaceStats.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerIfaceStats.aidl @@ -34,16 +34,5 @@ package android.hardware.wifi; @VintfStability parcelable StaLinkLayerIfaceStats { - int beaconRx; - int avgRssiMgmt; - android.hardware.wifi.StaLinkLayerIfacePacketStats wmeBePktStats; - android.hardware.wifi.StaLinkLayerIfacePacketStats wmeBkPktStats; - android.hardware.wifi.StaLinkLayerIfacePacketStats wmeViPktStats; - android.hardware.wifi.StaLinkLayerIfacePacketStats wmeVoPktStats; - byte timeSliceDutyCycleInPercent; - android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; - android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; - android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; - android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; - android.hardware.wifi.StaPeerInfo[] peers; + android.hardware.wifi.StaLinkLayerLinkStats[] links; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerLinkStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerLinkStats.aidl new file mode 100644 index 0000000000..cd21c256fe --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaLinkLayerLinkStats.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable StaLinkLayerLinkStats { + int linkId; + int radioId; + int frequencyMhz; + int beaconRx; + int avgRssiMgmt; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeBePktStats; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeBkPktStats; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeViPktStats; + android.hardware.wifi.StaLinkLayerIfacePacketStats wmeVoPktStats; + byte timeSliceDutyCycleInPercent; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; + android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; + android.hardware.wifi.StaPeerInfo[] peers; + android.hardware.wifi.StaLinkLayerLinkStats.StaLinkState state; + @Backing(type="int") @VintfStability + enum StaLinkState { + UNKNOWN = 0, + NOT_IN_USE = (1 << 0) /* 1 */, + IN_USE = (1 << 1) /* 2 */, + } +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl index 590376098b..7c75232e51 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @VintfStability parcelable StaScanData { - android.hardware.wifi.StaScanDataFlagMask flags; + int flags; int bucketsScanned; android.hardware.wifi.StaScanResult[] results; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl index dc8f2f1bd4..0ca4b4b41c 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl @@ -34,5 +34,5 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum StaScanDataFlagMask { - INTERRUPTED = 1, + INTERRUPTED = (1 << 0) /* 1 */, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl index 8c4504442f..e6ea642db6 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiChannelWidthInMhz { - WIDTH_INVALID = -1, + WIDTH_INVALID = (-1) /* -1 */, WIDTH_20 = 0, WIDTH_40 = 1, WIDTH_80 = 2, diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChipCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChipCapabilities.aidl new file mode 100644 index 0000000000..b5034ea387 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChipCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable WifiChipCapabilities { + int maxMloAssociationLinkCount; + int maxMloStrLinkCount; + int maxConcurrentTdlsSessionCount; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl index ee26f2ef11..6db96efc0f 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugPacketFateFrameType.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiDebugPacketFateFrameType { - UNKNOWN = 0, - ETHERNET_II = 1, - MGMT_80211 = 2, + UNKNOWN, + ETHERNET_II, + MGMT_80211, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl index f210e826a3..9ababc373d 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl @@ -34,7 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiDebugRingBufferFlags { - HAS_BINARY_ENTRIES = 1, - HAS_ASCII_ENTRIES = 2, - HAS_PER_PACKET_ENTRIES = 4, + HAS_BINARY_ENTRIES = (1 << 0) /* 1 */, + HAS_ASCII_ENTRIES = (1 << 1) /* 2 */, + HAS_PER_PACKET_ENTRIES = (1 << 2) /* 4 */, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl index 75abb4e538..f638c4f7df 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRxPacketFate.aidl @@ -34,15 +34,15 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiDebugRxPacketFate { - SUCCESS = 0, - FW_QUEUED = 1, - FW_DROP_FILTER = 2, - FW_DROP_INVALID = 3, - FW_DROP_NOBUFS = 4, - FW_DROP_OTHER = 5, - DRV_QUEUED = 6, - DRV_DROP_FILTER = 7, - DRV_DROP_INVALID = 8, - DRV_DROP_NOBUFS = 9, - DRV_DROP_OTHER = 10, + SUCCESS, + FW_QUEUED, + FW_DROP_FILTER, + FW_DROP_INVALID, + FW_DROP_NOBUFS, + FW_DROP_OTHER, + DRV_QUEUED, + DRV_DROP_FILTER, + DRV_DROP_INVALID, + DRV_DROP_NOBUFS, + DRV_DROP_OTHER, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl index e360c2c505..778ca5dee2 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugTxPacketFate.aidl @@ -34,14 +34,14 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiDebugTxPacketFate { - ACKED = 0, - SENT = 1, - FW_QUEUED = 2, - FW_DROP_INVALID = 3, - FW_DROP_NOBUFS = 4, - FW_DROP_OTHER = 5, - DRV_QUEUED = 6, - DRV_DROP_INVALID = 7, - DRV_DROP_NOBUFS = 8, - DRV_DROP_OTHER = 9, + ACKED, + SENT, + FW_QUEUED, + FW_DROP_INVALID, + FW_DROP_NOBUFS, + FW_DROP_OTHER, + DRV_QUEUED, + DRV_DROP_INVALID, + DRV_DROP_NOBUFS, + DRV_DROP_OTHER, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl index e2fe57af3f..557cef4c77 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl @@ -34,12 +34,12 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiIfaceMode { - IFACE_MODE_STA = 1, - IFACE_MODE_SOFTAP = 2, - IFACE_MODE_IBSS = 4, - IFACE_MODE_P2P_CLIENT = 8, - IFACE_MODE_P2P_GO = 16, - IFACE_MODE_NAN = 32, - IFACE_MODE_MESH = 64, - IFACE_MODE_TDLS = 128, + IFACE_MODE_STA = (1 << 0) /* 1 */, + IFACE_MODE_SOFTAP = (1 << 1) /* 2 */, + IFACE_MODE_IBSS = (1 << 2) /* 4 */, + IFACE_MODE_P2P_CLIENT = (1 << 3) /* 8 */, + IFACE_MODE_P2P_GO = (1 << 4) /* 16 */, + IFACE_MODE_NAN = (1 << 5) /* 32 */, + IFACE_MODE_MESH = (1 << 6) /* 64 */, + IFACE_MODE_TDLS = (1 << 7) /* 128 */, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl index f27661c93d..9a15fa1cae 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiStatusCode.aidl @@ -34,14 +34,14 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum WifiStatusCode { - SUCCESS = 0, - ERROR_WIFI_CHIP_INVALID = 1, - ERROR_WIFI_IFACE_INVALID = 2, - ERROR_WIFI_RTT_CONTROLLER_INVALID = 3, - ERROR_NOT_SUPPORTED = 4, - ERROR_NOT_AVAILABLE = 5, - ERROR_NOT_STARTED = 6, - ERROR_INVALID_ARGS = 7, - ERROR_BUSY = 8, - ERROR_UNKNOWN = 9, + SUCCESS, + ERROR_WIFI_CHIP_INVALID, + ERROR_WIFI_IFACE_INVALID, + ERROR_WIFI_RTT_CONTROLLER_INVALID, + ERROR_NOT_SUPPORTED, + ERROR_NOT_AVAILABLE, + ERROR_NOT_STARTED, + ERROR_INVALID_ARGS, + ERROR_BUSY, + ERROR_UNKNOWN, } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl index 94e3a8ae0b..774b2423ff 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl @@ -36,5 +36,5 @@ package android.hardware.wifi; parcelable WifiUsableChannel { int channel; android.hardware.wifi.WifiChannelWidthInMhz channelBandwidth; - android.hardware.wifi.WifiIfaceMode ifaceModeMask; + int ifaceModeMask; } diff --git a/wifi/aidl/android/hardware/wifi/AfcChannelAllowance.aidl b/wifi/aidl/android/hardware/wifi/AfcChannelAllowance.aidl new file mode 100644 index 0000000000..289383c2e3 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/AfcChannelAllowance.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.AvailableAfcChannelInfo; +import android.hardware.wifi.AvailableAfcFrequencyInfo; + +/** + * Defines the maximum permissible power spectral density to support 6Ghz with standard power for + * AFC. The maximum power can be either defined based on frequencies or channel number. + * + * Note, based on AFC server support, either availableAfcFrequencyInfos or availableAfcChannelInfos + * may be empty. If one of them is empty while the other is not, use the non-empty one and ignore + * the empty one. If both are empty then it means 6Ghz standard power should not be supported at + * all. + * + * If availableAfcFrequencyInfos is non-empty, set the max permissible power according to the maxPsd + * per frequency range, and disallow emmision on 6Ghz frequencies not included in the structure. + * + * If availableAfcChannelInfos is non-empty, set the max permissible power according to the + * maxEirpDbm per channel, and disallow emmision on 6Ghz channels not included in the structure. + */ +@VintfStability +parcelable AfcChannelAllowance { + /** + * AFC max permissible information queried from AFC server based on frequency. + */ + AvailableAfcFrequencyInfo[] availableAfcFrequencyInfos; + /** + * AFC max permissible information queried from AFC server on channel number. + */ + AvailableAfcChannelInfo[] availableAfcChannelInfos; + /** + * The time in UTC at which this information expires, as the difference, measured in + * milliseconds between the expiration time and midnight, January 1, 1970 UTC. + */ + long availabilityExpireTimeMs; +} diff --git a/wifi/aidl/android/hardware/wifi/AvailableAfcChannelInfo.aidl b/wifi/aidl/android/hardware/wifi/AvailableAfcChannelInfo.aidl new file mode 100644 index 0000000000..398cd12ff9 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/AvailableAfcChannelInfo.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Defines the maximum EIRP per channel for supporting 6Ghz standard power for AFC. The format of + * the data structure is derived from the Wi-Fi Alliance AFC System to AFC Device Interface + * Specification: AvailableChannelInfo object. + */ +@VintfStability +parcelable AvailableAfcChannelInfo { + /** + * The global operating class used to define the channel center frequency indices + * and operating bandwidth. + */ + int globalOperatingClass; + + /** + * The channel center frequency index. + */ + int channelCfi; + + /** + * The maximum permissible EIRP in units of dBm available for the channel + * specified by channelCfi. In addition, in any portion of the channel, the conducted PSD plus + * the maximum antenna gain cannot exceed the maxEirp divided by the channel width defined by + * the globalOperatingClass. + */ + int maxEirpDbm; +} diff --git a/wifi/aidl/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl b/wifi/aidl/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl new file mode 100644 index 0000000000..5de360cc21 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/AvailableAfcFrequencyInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Defines the maximum permissible power spectral density on a range of + * frequencies to support 6Ghz with standard power for AFC. + * The format of the data follows spec from the Wi-Fi Alliance AFC System to + * AFC Device Interface Specification: AvailableFrequencyInfo object. + */ +@VintfStability +parcelable AvailableAfcFrequencyInfo { + /** + * Defines the lowest frequency included in this 6Ghz frequency range. + */ + int startFrequencyMhz; + /** + * Defines the highest frequency included in this 6Ghz frequency range. + */ + int endFrequencyMhz; + /** + * The maximum permissible EIRP available in any one MHz bin within the + * frequency range specified. The limit is expressed as a power spectral + * density with units of dBm per MHz. + */ + int maxPsd; +} diff --git a/wifi/aidl/android/hardware/wifi/IWifiApIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiApIface.aidl index 71ea385a3e..b14a8005b5 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiApIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiApIface.aidl @@ -67,20 +67,6 @@ interface IWifiApIface { */ void setCountryCode(in byte[2] code); - /** - * Used to query the list of valid frequencies (depending on country code set) - * for the provided band. - * - * @param band Band for which the frequency list is being generated. - * @return Vector of valid frequencies for the provided band. - * @throws ServiceSpecificException with one of the following values: - * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, - * |WifiStatusCode.ERROR_NOT_SUPPORTED|, - * |WifiStatusCode.ERROR_NOT_AVAILABLE|, - * |WifiStatusCode.ERROR_UNKNOWN| - */ - int[] getValidFrequenciesForBand(in WifiBand band); - /** * Reset all of the AP interfaces' MAC address to the factory MAC address. * diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl index fe9a6f399b..c1caa7e6c6 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi; +import android.hardware.wifi.AfcChannelAllowance; import android.hardware.wifi.IWifiApIface; import android.hardware.wifi.IWifiChipEventCallback; import android.hardware.wifi.IWifiNanIface; @@ -25,11 +26,12 @@ import android.hardware.wifi.IWifiStaIface; import android.hardware.wifi.IfaceConcurrencyType; import android.hardware.wifi.IfaceType; import android.hardware.wifi.WifiBand; +import android.hardware.wifi.WifiChipCapabilities; import android.hardware.wifi.WifiDebugHostWakeReasonStats; import android.hardware.wifi.WifiDebugRingBufferStatus; import android.hardware.wifi.WifiDebugRingBufferVerboseLevel; import android.hardware.wifi.WifiIfaceMode; -import android.hardware.wifi.WifiRadioCombinationMatrix; +import android.hardware.wifi.WifiRadioCombination; import android.hardware.wifi.WifiUsableChannel; /** @@ -42,68 +44,44 @@ interface IWifiChip { */ @VintfStability @Backing(type="int") - enum ChipCapabilityMask { - /** - * Memory dump of Firmware. - */ - DEBUG_MEMORY_FIRMWARE_DUMP = 1 << 0, - /** - * Memory dump of Driver. - */ - DEBUG_MEMORY_DRIVER_DUMP = 1 << 1, - /** - * Connectivity events reported via debug ring buffer. - */ - DEBUG_RING_BUFFER_CONNECT_EVENT = 1 << 2, - /** - * Power events reported via debug ring buffer. - */ - DEBUG_RING_BUFFER_POWER_EVENT = 1 << 3, - /** - * Wakelock events reported via debug ring buffer. - */ - DEBUG_RING_BUFFER_WAKELOCK_EVENT = 1 << 4, - /** - * Vendor data reported via debug ring buffer. - * This mostly contains firmware event logs. - */ - DEBUG_RING_BUFFER_VENDOR_DATA = 1 << 5, - /** - * Host wake reasons stats collection. - */ - DEBUG_HOST_WAKE_REASON_STATS = 1 << 6, - /** - * Error alerts. - */ - DEBUG_ERROR_ALERTS = 1 << 7, + enum FeatureSetMask { /** * Set/Reset Tx Power limits. */ - SET_TX_POWER_LIMIT = 1 << 8, + SET_TX_POWER_LIMIT = 1 << 0, /** * Device to Device RTT. */ - D2D_RTT = 1 << 9, + D2D_RTT = 1 << 1, /** * Device to AP RTT. */ - D2AP_RTT = 1 << 10, + D2AP_RTT = 1 << 2, /** * Set/Reset Tx Power limits. */ - USE_BODY_HEAD_SAR = 1 << 11, + USE_BODY_HEAD_SAR = 1 << 3, /** * Set Latency Mode. */ - SET_LATENCY_MODE = 1 << 12, + SET_LATENCY_MODE = 1 << 4, /** * Support P2P MAC randomization. */ - P2P_RAND_MAC = 1 << 13, + P2P_RAND_MAC = 1 << 5, /** * Chip can operate in the 60GHz band (WiGig chip). */ - WIGIG = 1 << 14, + WIGIG = 1 << 6, + /** + * Chip supports setting allowed channels along with PSD in 6GHz band + * for AFC purposes. + */ + SET_AFC_CHANNEL_ALLOWANCE = 1 << 7, + /** + * Chip supports Tid-To-Link mapping negotiation. + */ + T2LM_NEGOTIATION = 1 << 8, } /** @@ -533,7 +511,6 @@ interface IWifiChip { * API to enable/disable alert notifications from the chip. * These alerts must be used to notify the framework of any fatal error events * that the chip encounters via |IWifiChipEventCallback.onDebugErrorAlert| method. - * Must fail if |ChipCapabilityMask.DEBUG_ERROR_ALERTS| is not set. * * @param enable true to enable, false to disable. * @throws ServiceSpecificException with one of the following values: @@ -605,15 +582,15 @@ interface IWifiChip { ChipMode[] getAvailableModes(); /** - * Get the capabilities supported by this chip. + * Get the features supported by this chip. * - * @return Bitset of |ChipCapabilityMask| values. + * @return Bitset of |FeatureSetMask| values. * @throws ServiceSpecificException with one of the following values: * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| */ - ChipCapabilityMask getCapabilities(); + int getFeatureSet(); /** * API to retrieve the wifi wake up reason stats for debugging. @@ -760,8 +737,7 @@ interface IWifiChip { * Retrieve the list of all the possible radio combinations supported by this * chip. * - * @return A list of all the possible radio combinations represented by - * |WifiRadioCombinationMatrix|. + * @return A list of all the possible radio combinations. * For example, in case of a chip which has two radios, where one radio is * capable of 2.4GHz 2X2 only and another radio which is capable of either * 5GHz or 6GHz 2X2, the number of possible radio combinations in this case @@ -782,7 +758,19 @@ interface IWifiChip { * |WifiStatusCode.FAILURE_UNKNOWN| * */ - WifiRadioCombinationMatrix getSupportedRadioCombinationsMatrix(); + WifiRadioCombination[] getSupportedRadioCombinations(); + + /** + * Get capabilities supported by this chip. + * + * @return Chip capabilities represented by |WifiChipCapabilities|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.FAILURE_UNKNOWN| + * + */ + WifiChipCapabilities getWifiChipCapabilities(); /** * Retrieve a list of usable Wifi channels for the specified band & @@ -820,7 +808,15 @@ interface IWifiChip { * |WifiStatusCode.FAILURE_UNKNOWN| */ WifiUsableChannel[] getUsableChannels( - in WifiBand band, in WifiIfaceMode ifaceModeMask, in UsableChannelFilter filterMask); + in WifiBand band, in int ifaceModeMask, in int filterMask); + + /* + * Set the max power level the chip is allowed to transmit on for 6Ghz AFC. + * @param afcChannelAllowance Specifies the power limitations for 6Ghz AFC. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_NOT_SUPPORTED| + */ + void setAfcChannelAllowance(in AfcChannelAllowance afcChannelAllowance); /** * Requests notifications of significant events on this chip. Multiple calls @@ -982,8 +978,7 @@ interface IWifiChip { * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, * |WifiStatusCode.ERROR_INVALID_ARGS|, */ - void setCoexUnsafeChannels( - in CoexUnsafeChannel[] unsafeChannels, in CoexRestriction restrictions); + void setCoexUnsafeChannels(in CoexUnsafeChannel[] unsafeChannels, in int restrictions); /** * Set country code for this Wifi chip. @@ -1093,4 +1088,65 @@ interface IWifiChip { * |WifiStatusCode.ERROR_UNKNOWN| */ void triggerSubsystemRestart(); + + /** + * Channel category mask. + */ + @VintfStability + @Backing(type="int") + enum ChannelCategoryMask { + INDOOR_CHANNEL = 1 << 0, + DFS_CHANNEL = 1 << 1, + } + + /** + * API to enable or disable the feature of allowing current STA-connected channel for WFA GO, + * SAP and Aware when the regulatory allows. + * If the channel category is enabled and allowed by the regulatory, the HAL method + * getUsableChannels() will contain the current STA-connected channel if that channel belongs + * to that category. + * @param channelCategoryEnableFlag Bitmask of |ChannelCategoryMask| values. + * For each bit, 1 enables the channel category and 0 disables that channel category. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.FAILURE_UNKNOWN| + */ + void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag); + + /** + * Multi-Link Operation modes. + */ + @VintfStability + @Backing(type="int") + enum ChipMloMode { + /** + * Default mode for Multi-Link Operation. + */ + DEFAULT = 0, + /** + * Low latency mode for Multi-link operation. + */ + LOW_LATENCY = 1, + /** + * High throughput mode for Multi-link operation. + */ + HIGH_THROUGHPUT = 2, + /** + * Low power mode for Multi-link operation. + */ + LOW_POWER = 3, + } + + /** + * Set mode for Multi-Link Operation. Various modes are defined by the enum |ChipMloMode|. + * + * @param mode MLO mode as defined by the enum |ChipMloMode| + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + * + */ + void setMloMode(in ChipMloMode mode); } diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl index 45644b402e..e5bb34ef5e 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl @@ -17,12 +17,16 @@ package android.hardware.wifi; import android.hardware.wifi.IWifiNanIfaceEventCallback; +import android.hardware.wifi.NanBootstrappingRequest; +import android.hardware.wifi.NanBootstrappingResponse; import android.hardware.wifi.NanConfigRequest; import android.hardware.wifi.NanConfigRequestSupplemental; import android.hardware.wifi.NanEnableRequest; import android.hardware.wifi.NanInitiateDataPathRequest; +import android.hardware.wifi.NanPairingRequest; import android.hardware.wifi.NanPublishRequest; import android.hardware.wifi.NanRespondToDataPathIndicationRequest; +import android.hardware.wifi.NanRespondToPairingIndicationRequest; import android.hardware.wifi.NanSubscribeRequest; import android.hardware.wifi.NanTransmitFollowupRequest; @@ -75,6 +79,7 @@ interface IWifiNanIface { * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyCreateDataInterfaceResponse|. * * @param cmdId Command Id to use for this invocation. + * @param ifaceName The name of the interface, e.g. "aware0". * @throws ServiceSpecificException with one of the following values: * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, * |WifiStatusCode.ERROR_UNKNOWN| @@ -86,6 +91,7 @@ interface IWifiNanIface { * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDeleteDataInterfaceResponse|. * * @param cmdId Command Id to use for this invocation. + * @param ifaceName The name of the interface, e.g. "aware0". * @throws ServiceSpecificException with one of the following values: * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, * |WifiStatusCode.ERROR_UNKNOWN| @@ -236,6 +242,38 @@ interface IWifiNanIface { */ void terminateDataPathRequest(in char cmdId, in int ndpInstanceId); + /** + * Start the suspension of a discovery service. During the suspend state, the Wi-Fi Aware + * device must not transmit or receive frames for this session including any active NDPs. If + * all discovery sessions are suspended then the Wi-Fi Aware device must not transmit or + * receive any Wi-Fi Aware frames. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifySuspendResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param sessionId ID of the publish/subscribe discovery session to be suspended. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void suspendRequest(in char cmdId, in byte sessionId); + + /** + * Stop the suspension of a discovery service. Resume cancels an ongoing suspend for this Wi-Fi + * Aware discovery session and automatically resumes the session and any associated NDPs to the + * state before they were suspended. The Wi-Fi Aware resume operation should be faster than + * recreating the corresponding discovery session and NDPs with the same benefit of power. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyResumeResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param sessionId ID of the publish/subscribe discovery session to be resumed. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void resumeRequest(in char cmdId, in byte sessionId); + /** * NAN transmit follow up message request. * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTransmitFollowupResponse|. @@ -248,4 +286,74 @@ interface IWifiNanIface { * |WifiStatusCode.ERROR_UNKNOWN| */ void transmitFollowupRequest(in char cmdId, in NanTransmitFollowupRequest msg); + + /** + * Initiate a NAN pairing operation: Initiator. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyInitiatePairingResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param msg Instance of |NanPairingRequest|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void initiatePairingRequest(in char cmdId, in NanPairingRequest msg); + + /** + * Respond to a received request indication of NAN pairing setup operation. + * An indication is received by the Responder from the Initiator. + * Asynchronous response is with + * |IWifiNanIfaceEventCallback.notifyRespondToPairingIndicationResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param msg Instance of |NanRespondToPairingIndicationRequest|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void respondToPairingIndicationRequest( + in char cmdId, in NanRespondToPairingIndicationRequest msg); + + /** + * Initiate a NAN pairing bootstrapping operation: Initiator. + * Asynchronous response is with + * |IWifiNanIfaceEventCallback.notifyInitiateBootstrappingResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param msg Instance of |NanBootstrappingRequest|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void initiateBootstrappingRequest(in char cmdId, in NanBootstrappingRequest msg); + + /** + * Respond to a received request indication of NAN pairing bootstrapping operation. + * An indication is received by the Responder from the Initiator. + * Asynchronous response is with + * |IWifiNanIfaceEventCallback.notifyRespondToPairingIndicationResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param msg Instance of |notifyRespondToBootstrappingIndicationResponse|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void respondToBootstrappingIndicationRequest(in char cmdId, in NanBootstrappingResponse msg); + + /** + * Aware pairing termination request. Executed by either the Initiator or Responder. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTerminatePairingResponse|. + * + * @param cmdId Command Id to use for this invocation. + * @param pairingInstanceId Pairing instance ID to be terminated. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void terminatePairingRequest(in char cmdId, in int pairingInstanceId); } diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl index 470b7ba013..3649b7bf73 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl @@ -16,6 +16,8 @@ package android.hardware.wifi; +import android.hardware.wifi.NanBootstrappingConfirmInd; +import android.hardware.wifi.NanBootstrappingRequestInd; import android.hardware.wifi.NanCapabilities; import android.hardware.wifi.NanClusterEventInd; import android.hardware.wifi.NanDataPathConfirmInd; @@ -23,8 +25,10 @@ import android.hardware.wifi.NanDataPathRequestInd; import android.hardware.wifi.NanDataPathScheduleUpdateInd; import android.hardware.wifi.NanFollowupReceivedInd; import android.hardware.wifi.NanMatchInd; +import android.hardware.wifi.NanPairingConfirmInd; +import android.hardware.wifi.NanPairingRequestInd; import android.hardware.wifi.NanStatus; - +import android.hardware.wifi.NanSuspensionModeChangeInd; /** * NAN Response and Asynchronous Event Callbacks. * @@ -128,7 +132,7 @@ oneway interface IWifiNanIfaceEventCallback { /** * Callback providing status on a completed followup message transmit operation. * - * @param cmdId Command Id corresponding to the original |transmitFollowupRequest| request. + * @param id Command ID corresponding to the original |transmitFollowupRequest| request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.NO_OTA_ACK| @@ -136,11 +140,18 @@ oneway interface IWifiNanIfaceEventCallback { */ void eventTransmitFollowup(in char id, in NanStatus status); + /** + * Callback indicating that device suspension mode status change + * + * @param event NanSuspensionModeChangeInd containing event details. + */ + void eventSuspensionModeChanged(in NanSuspensionModeChangeInd event); + /** * Callback invoked in response to a capability request * |IWifiNanIface.getCapabilitiesRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * @param capabilities Capability data. @@ -151,7 +162,7 @@ oneway interface IWifiNanIfaceEventCallback { /** * Callback invoked in response to a config request |IWifiNanIface.configRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -164,7 +175,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to a create data interface request * |IWifiNanIface.createDataInterfaceRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -176,7 +187,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to a delete data interface request * |IWifiNanIface.deleteDataInterfaceRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -187,7 +198,7 @@ oneway interface IWifiNanIfaceEventCallback { /** * Callback invoked in response to a disable request |IWifiNanIface.disableRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.PROTOCOL_FAILURE| @@ -197,7 +208,7 @@ oneway interface IWifiNanIfaceEventCallback { /** * Callback invoked in response to an enable request |IWifiNanIface.enableRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.ALREADY_ENABLED| @@ -212,7 +223,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to an initiate data path request * |IWifiNanIface.initiateDataPathRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -227,7 +238,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to a respond to data path indication request * |IWifiNanIface.respondToDataPathIndicationRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -241,7 +252,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked to notify the status of the start publish request * |IWifiNanIface.startPublishRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -256,7 +267,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked to notify the status of the start subscribe request * |IWifiNanIface.startSubscribeRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -271,7 +282,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to a stop publish request * |IWifiNanIface.stopPublishRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_SESSION_ID| @@ -283,7 +294,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to a stop subscribe request * |IWifiNanIface.stopSubscribeRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_SESSION_ID| @@ -295,7 +306,7 @@ oneway interface IWifiNanIfaceEventCallback { * Callback invoked in response to a terminate data path request * |IWifiNanIface.terminateDataPathRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -305,11 +316,37 @@ oneway interface IWifiNanIfaceEventCallback { */ void notifyTerminateDataPathResponse(in char id, in NanStatus status); + /** + * Callback invoked in response to a suspension request + * |IWifiNanIface.suspendRequest|. + * + * @param id Command ID corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_SESSION_ID| + * |NanStatusCode.INVALID_STATE| + * |NanStatusCode.INTERNAL_FAILURE| + */ + void notifySuspendResponse(in char id, in NanStatus status); + + /** + * Callback invoked in response to a resume request + * |IWifiNanIface.resumeRequest|. + * + * @param id Command ID corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_SESSION_ID| + * |NanStatusCode.INVALID_STATE| + * |NanStatusCode.INTERNAL_FAILURE| + */ + void notifyResumeResponse(in char id, in NanStatus status); + /** * Callback invoked in response to a transmit followup request * |IWifiNanIface.transmitFollowupRequest|. * - * @param cmdId Command Id corresponding to the original request. + * @param id Command ID corresponding to the original request. * @param status NanStatus of the operation. Possible status codes are: * |NanStatusCode.SUCCESS| * |NanStatusCode.INVALID_ARGS| @@ -319,4 +356,109 @@ oneway interface IWifiNanIfaceEventCallback { * |NanStatusCode.FOLLOWUP_TX_QUEUE_FULL| */ void notifyTransmitFollowupResponse(in char id, in NanStatus status); + + /** + * Callback indicating that a NAN pairing setup/verification has been requested by + * an Initiator peer (received by the intended Responder). + * + * @param event NanPairingRequestInd containing event details. + */ + void eventPairingRequest(in NanPairingRequestInd event); + + /** + * Callback indicating that a NAN pairing setup/verification has been completed. + * Received by both Initiator and Responder. + * + * @param event NanPairingConfirmInd containing event details. + */ + void eventPairingConfirm(in NanPairingConfirmInd event); + + /** + * Callback invoked in response to an initiate NAN pairing request + * |IWifiNanIface.initiatePairingRequest|. + * + * @param id Command ID corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_ARGS| + * |NanStatusCode.INTERNAL_FAILURE| + * |NanStatusCode.PROTOCOL_FAILURE| + * |NanStatusCode.INVALID_PEER_ID| + * @param pairingInstanceId ID of the new pairing being negotiated (on successful status). + */ + void notifyInitiatePairingResponse(in char id, in NanStatus status, in int pairingInstanceId); + + /** + * Callback invoked in response to a respond to NAN pairing indication request + * |IWifiNanIface.respondToPairingIndicationRequest|. + * + * @param id Command ID corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_ARGS| + * |NanStatusCode.INTERNAL_FAILURE| + * |NanStatusCode.PROTOCOL_FAILURE| + * |NanStatusCode.INVALID_NDP_ID| + */ + void notifyRespondToPairingIndicationResponse(in char id, in NanStatus status); + + /** + * Callback indicating that a NAN bootstrapping setup has been requested by + * an Initiator peer (received by the intended Responder). + * + * @param event NanBootstrappingRequestInd containing event details. + */ + void eventBootstrappingRequest(in NanBootstrappingRequestInd event); + + /** + * Callback indicating that a NAN bootstrapping setuphas been completed. + * Received by Initiator. + * + * @param event NanBootstrappingConfirmInd containing event details. + */ + void eventBootstrappingConfirm(in NanBootstrappingConfirmInd event); + + /** + * Callback invoked in response to an initiate NAN pairing bootstrapping request + * |IWifiNanIface.initiateBootstrappingRequest|. + * + * @param id Command ID corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_ARGS| + * |NanStatusCode.INTERNAL_FAILURE| + * |NanStatusCode.PROTOCOL_FAILURE| + * |NanStatusCode.INVALID_PEER_ID| + * @param bootstrappingInstanceId ID of the new pairing being negotiated (on successful status). + */ + void notifyInitiateBootstrappingResponse( + in char id, in NanStatus status, in int bootstrappingInstanceId); + + /** + * Callback invoked in response to a respond to pairing bootstrapping indication request + * |IWifiNanIface.respondToBootstrappingIndicationRequest|. + * + * @param id Command ID corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_ARGS| + * |NanStatusCode.INTERNAL_FAILURE| + * |NanStatusCode.PROTOCOL_FAILURE| + * |NanStatusCode.INVALID_NDP_ID| + */ + void notifyRespondToBootstrappingIndicationResponse(in char id, in NanStatus status); + + /** + * Callback invoked in response to a terminate pairing request + * |IWifiNanIface.terminatePairingRequest|. + * + * @param id Command Id corresponding to the original request. + * @param status NanStatus of the operation. Possible status codes are: + * |NanStatusCode.SUCCESS| + * |NanStatusCode.INVALID_ARGS| + * |NanStatusCode.INTERNAL_FAILURE| + * |NanStatusCode.PROTOCOL_FAILURE| + * |NanStatusCode.INVALID_PAIRING_ID| + */ + void notifyTerminatePairingResponse(in char id, in NanStatus status); } diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl index 2dd57b235c..6d6afafc12 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl @@ -38,7 +38,7 @@ interface IWifiStaIface { */ @VintfStability @Backing(type="int") - enum StaIfaceCapabilityMask { + enum FeatureSetMask { /** * Support for APF APIs. APF (Android Packet Filter) is a * BPF-like packet filtering bytecode executed by the firmware. @@ -99,10 +99,6 @@ interface IWifiStaIface { * Support for keep alive packet offload. */ KEEP_ALIVE = 1 << 13, - /** - * Support for tracking connection packets' fate. - */ - DEBUG_PACKET_FATE = 1 << 14, } /** @@ -194,15 +190,15 @@ interface IWifiStaIface { StaBackgroundScanCapabilities getBackgroundScanCapabilities(); /** - * Get the capabilities supported by this STA iface. + * Get the features supported by this STA iface. * - * @return Bitset of |StaIfaceCapabilityMask| values. + * @return Bitset of |FeatureSetMask| values. * @throws ServiceSpecificException with one of the following values: * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| */ - StaIfaceCapabilityMask getCapabilities(); + int getFeatureSet(); /** * API to retrieve the fates of inbound packets. @@ -291,22 +287,6 @@ interface IWifiStaIface { */ StaRoamingCapabilities getRoamingCapabilities(); - /** - * Used to query the list of valid frequencies (depending on the country - * code set) for the provided band. These channels may be specified in the - * |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan - * request. - * - * @param band Band for which the frequency list is being generated. - * @return Vector of valid frequencies for the provided band. - * @throws ServiceSpecificException with one of the following values: - * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, - * |WifiStatusCode.ERROR_NOT_SUPPORTED|, - * |WifiStatusCode.ERROR_NOT_AVAILABLE|, - * |WifiStatusCode.ERROR_UNKNOWN| - */ - int[] getValidFrequenciesForBand(in WifiBand band); - /** * Installs an APF program on this iface, replacing an existing * program if present. @@ -552,4 +532,24 @@ interface IWifiStaIface { * |WifiStatusCode.ERROR_UNKNOWN| */ void stopSendingKeepAlivePackets(in int cmdId); + + /** + * Set maximum acceptable DTIM multiplier to hardware driver. + * Any multiplier larger than this maximum value must not be accepted since it will cause + * packet loss higher than what the system can accept, which will cause unexpected behavior + * for apps, and may interrupt the network connection. + * + * When STA is in the power saving mode and system is suspended, + * the wake up interval will be set to: + * 1) multiplier * DTIM period if multiplier > 0. + * 2) the driver default value if multiplier <= 0. + * Some implementations may apply an additional cap to wake up interval in the case of 1). + * + * @param multiplier integer maximum DTIM multiplier value to set. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void setDtimMultiplier(in int multiplier); } diff --git a/wifi/aidl/android/hardware/wifi/MacAddress.aidl b/wifi/aidl/android/hardware/wifi/MacAddress.aidl index d59dfe3c0f..d2385658cc 100644 --- a/wifi/aidl/android/hardware/wifi/MacAddress.aidl +++ b/wifi/aidl/android/hardware/wifi/MacAddress.aidl @@ -20,8 +20,6 @@ package android.hardware.wifi; * Byte array representing a Mac Address. Use when we need to * pass an array of Mac Addresses to a method, as variable-sized * 2D arrays are not supported in AIDL. - * - * TODO (b/210705533): Replace this type with a 2D byte array. */ @VintfStability parcelable MacAddress { diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl new file mode 100644 index 0000000000..e72c940777 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanBootstrappingResponseCode; +import android.hardware.wifi.NanStatus; + +/** + * See Wi-Fi Aware R4.0 section 9.5.21.7 + */ +@VintfStability +parcelable NanBootstrappingConfirmInd { + /** + * Id of the bootstrapping session. Obtained as part of earlier + |IWifiNanIface.initiateBootstrappingRequest| success notification. + */ + int bootstrappingInstanceId; + + /** + * Indicate whether the bootstrapping method negotiation accept or not + */ + NanBootstrappingResponseCode responseCode; + + /** + * Failure reason if |acceptRequest| is false. + */ + NanStatus reasonCode; + + /** + * The delay of bootstrapping in seconds for the follow up request. + */ + int comeBackDelay; + + /** + * Cookie received from peer with |comeBackDelay| for follow up |NanBootstrappingRequest| + */ + byte[] cookie; +} diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl new file mode 100644 index 0000000000..da2ff25073 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingMethod.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Pairing bootstrapping method flag. + * See Wi-Fi Aware R4.0 section 9.5.21.7 table 128 + */ +@VintfStability +@Backing(type="int") +enum NanBootstrappingMethod { + BOOTSTRAPPING_OPPORTUNISTIC_MASK = 1 << 0, + BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = 1 << 1, + BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = 1 << 2, + BOOTSTRAPPING_QR_DISPLAY_MASK = 1 << 3, + BOOTSTRAPPING_NFC_TAG_MASK = 1 << 4, + BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = 1 << 5, + BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = 1 << 6, + BOOTSTRAPPING_QR_SCAN_MASK = 1 << 7, + BOOTSTRAPPING_NFC_READER_MASK = 1 << 8, + BOOTSTRAPPING_SERVICE_MANAGED_MASK = 1 << 14, + BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = 1 << 15 +} diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl new file mode 100644 index 0000000000..4b74cd9e20 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanBootstrappingMethod; + +/** + * See Wi-Fi Aware R4.0 section 9.5.21.7 + */ +@VintfStability +parcelable NanBootstrappingRequest { + /** + * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or + * |IWifiNanIfaceEventCallback.eventFollowupReceived|. + */ + int peerId; + + /** + * NAN management interface MAC address of the peer. Obtained as part of an earlier + * |IWifiNanIfaceEventCallback.eventMatch| or + * |IWifiNanIfaceEventCallback.eventFollowupReceived|. + */ + byte[6] peerDiscMacAddr; + + /** + * One of |NanBootstrappingMethod| indicating the bootstrapping method in the request. + */ + NanBootstrappingMethod requestBootstrappingMethod; + + /** + * Cookie received from previous |NanBootstrappingConfirmInd| for comeback request. + */ + byte[] cookie; +} diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl new file mode 100644 index 0000000000..6f43892bf2 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequestInd.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanBootstrappingMethod; + +/** + * NAN Data path request indication message structure. + * Event indication received by an intended Responder when a NAN + * data request is initiated by an Initiator. See Wi-Fi Aware R4.0 section 9.5.21.7 + */ +@VintfStability +parcelable NanBootstrappingRequestInd { + /** + * Discovery session (publish or subscribe) ID of a previously created discovery session. The + * bootstrapping request is received in the context of this discovery session. + * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID + */ + byte discoverySessionId; + /** + * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| + * or to set up a data-path. + */ + int peerId; + /** + * MAC address of the Initiator peer. This is the MAC address of the peer's + * management/discovery NAN interface. + */ + byte[6] peerDiscMacAddr; + + /** + * ID of bootstrapping session. Used to identify the bootstrapping further negotiation/APIs. + */ + int bootstrappingInstanceId; + + /** + * One of |NanBootstrappingMethod| indicating the bootstrapping method in the incoming request. + */ + NanBootstrappingMethod requestBootstrappingMethod; +} diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl new file mode 100644 index 0000000000..dbe892316e --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * See Wi-Fi Aware R4.0 section 9.5.21.7 + */ +@VintfStability +parcelable NanBootstrappingResponse { + /** + * ID of bootstrapping session. Used to identify the bootstrapping further negotiation/APIs. + */ + int bootstrappingInstanceId; + /** + * True if accept the request, false otherwise. + */ + boolean acceptRequest; +} diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponseCode.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponseCode.aidl new file mode 100644 index 0000000000..17076bf77b --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponseCode.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Response code from peer NAN Bootstrapping request + */ +@VintfStability +@Backing(type="int") +enum NanBootstrappingResponseCode { + NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0, + NAN_BOOTSTRAPPING_REQUEST_REJECT, + NAN_BOOTSTRAPPING_REQUEST_COMEBACK, +} diff --git a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl index 6042a05da8..f581c5e6cf 100644 --- a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl +++ b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl @@ -16,8 +16,6 @@ package android.hardware.wifi; -import android.hardware.wifi.NanCipherSuiteType; - /** * NDP Capabilities response. */ @@ -78,11 +76,31 @@ parcelable NanCapabilities { */ int maxSubscribeInterfaceAddresses; /** - * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used. + * Bitmap of |NanCipherSuiteType| values indicating the set of supported cipher suites. */ - NanCipherSuiteType supportedCipherSuites; + int supportedCipherSuites; /** - * Flag to indicate id instant communication mode is supported. + * Flag to indicate if instant communication mode is supported. */ boolean instantCommunicationModeSupportFlag; + /** + * Flag to indicate if 6 GHz is supported. + */ + boolean supports6g; + /** + * Flag to indicate if High Efficiency is supported. + */ + boolean supportsHe; + /** + * Flag to indicate if NAN pairing is supported. + */ + boolean supportsPairing; + /** + * Flag to indicate if setting NAN cluster ID is supported. + */ + boolean supportsSetClusterId; + /** + * Flag to indicate if NAN suspension is supported. + */ + boolean supportsSuspension; } diff --git a/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl index 9e3d684a9d..91b5cafedb 100644 --- a/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl +++ b/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl @@ -17,20 +17,38 @@ package android.hardware.wifi; /** - * Cipher suite flags. + * Cipher suite flags. Wi-Fi Aware Specification 4.0 section 9.5.21.1. */ @VintfStability @Backing(type="int") enum NanCipherSuiteType { NONE = 0, + /** + * NCS-SK-128 + */ SHARED_KEY_128_MASK = 1 << 0, + /** + * NCS-SK-256 + */ SHARED_KEY_256_MASK = 1 << 1, /** - * NCS-PK-128 + * NCS-PK-2WDH-128 */ - PUBLIC_KEY_128_MASK = 1 << 2, + PUBLIC_KEY_2WDH_128_MASK = 1 << 2, /** - * NCS-PK-256 + * NCS-PK-2WDH-256 */ - PUBLIC_KEY_256_MASK = 1 << 3, + PUBLIC_KEY_2WDH_256_MASK = 1 << 3, + /** + * bit 4 and bit 5 are reserved for NCS-GTK-CCMP-128 and NCS-GTK-CCMP-256. Which are not used + * from framework + */ + /** + * NCS-PK-PASN-128 + */ + PUBLIC_KEY_PASN_128_MASK = 1 << 6, + /** + * NCS-PK-PASN-256 + */ + PUBLIC_KEY_PASN_256_MASK = 1 << 7, } diff --git a/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl b/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl index eb01a9f731..338a549aeb 100644 --- a/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl +++ b/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl @@ -60,4 +60,8 @@ parcelable NanConfigRequestSupplemental { * Controls which channel NAN instant communication mode operates on. */ int instantModeChannel; + /** + * Controls which cluster to join. + */ + int clusterId; } diff --git a/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl index 42a5616949..9a2013bf12 100644 --- a/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl +++ b/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl @@ -31,7 +31,8 @@ parcelable NanDataPathSecurityConfig { */ NanDataPathSecurityType securityType; /** - * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must + * One of |NanCipherSuiteType| indicating the cipher type for data-paths. + * If |securityType| is |NanDataPathSecurityType.OPEN|, then this must * be set to |NanCipherSuiteType.NONE|. Otherwise a non-|NanCipherSuiteType.NONE| cipher suite * must be specified. */ diff --git a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl index ca1e01693e..58777c5d65 100644 --- a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl +++ b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl @@ -18,7 +18,6 @@ package android.hardware.wifi; import android.hardware.wifi.NanDataPathSecurityConfig; import android.hardware.wifi.NanMatchAlg; -import android.hardware.wifi.NanRangingIndication; /** * Configurations of NAN discovery sessions. Common to publish and subscribe discovery. @@ -143,10 +142,11 @@ parcelable NanDiscoveryCommonConfig { */ int rangingIntervalMs; /** - * The type of ranging feedback to be provided by discovery session matches - * |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true. + * Bitmap of |NanRangingIndication| values indicating the type of ranging feedback + * to be provided by discovery session matches in |IWifiNanIfaceEventCallback.eventMatch|. + * Only relevant if |rangingRequired| is true. */ - NanRangingIndication configRangingIndications; + int configRangingIndications; /** * The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then * |configRangingIndications| is used to determine whether ingress and/or egress (or neither) @@ -155,4 +155,10 @@ parcelable NanDiscoveryCommonConfig { */ char distanceIngressCm; char distanceEgressCm; + /** + * Specifies whether suspension can be possible in this discovery session. + * The request would fail if |enableSessionSuspendability| is true but + * |NanCapabilities.supportsSuspension| is false. + */ + boolean enableSessionSuspendability; } diff --git a/wifi/aidl/android/hardware/wifi/WifiRadioCombinationMatrix.aidl b/wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl similarity index 68% rename from wifi/aidl/android/hardware/wifi/WifiRadioCombinationMatrix.aidl rename to wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl index b79a8189d7..807081b2cb 100644 --- a/wifi/aidl/android/hardware/wifi/WifiRadioCombinationMatrix.aidl +++ b/wifi/aidl/android/hardware/wifi/NanIdentityResolutionAttribute.aidl @@ -16,16 +16,19 @@ package android.hardware.wifi; -import android.hardware.wifi.WifiRadioCombination; - /** - * Wifi radio combinations matrix retrieved via - * |IWifiChip.getSupportedRadioCombinationsMatrix|. + * NIRA for pairing identity resolution. + * See Wi-Fi Aware R4.0 section 9.5.21.6 */ @VintfStability -parcelable WifiRadioCombinationMatrix { +parcelable NanIdentityResolutionAttribute { /** - * List of all the possible radio combinations that the chip can operate. + * A random byte string to generate tag */ - WifiRadioCombination[] radioCombinations; + byte[8] nonce; + + /** + * A resolvable identity to identify Nan identity key + */ + byte[8] tag; } diff --git a/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl b/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl index 264a873a3e..2f2532929f 100644 --- a/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanInitiateDataPathRequest.aidl @@ -69,4 +69,9 @@ parcelable NanInitiateDataPathRequest { * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites */ byte[] serviceNameOutOfBand; + /** + * ID of an active publish or subscribe discovery session. + * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID + */ + byte discoverySessionId; } diff --git a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl index 896cde0c82..5a04376c75 100644 --- a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl +++ b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl @@ -17,7 +17,8 @@ package android.hardware.wifi; import android.hardware.wifi.NanCipherSuiteType; -import android.hardware.wifi.NanRangingIndication; +import android.hardware.wifi.NanIdentityResolutionAttribute; +import android.hardware.wifi.NanPairingConfig; /** * Match indication structure. @@ -79,8 +80,9 @@ parcelable NanMatchInd { */ byte rssiValue; /** - * Cipher type for data-paths constructed in the context of this discovery session. Valid if - * |peerRequiresSecurityEnabledInNdp| is true. + * One of |NanCipherSuiteType| indicating the cipher type for data-paths constructed + * in the context of this discovery session. + * Valid if |peerRequiresSecurityEnabledInNdp| is true. */ NanCipherSuiteType peerCipherType; /** @@ -115,15 +117,24 @@ parcelable NanMatchInd { */ int rangingMeasurementInMm; /** - * The ranging event(s) which triggered the ranging. e.g. can indicate that continuous ranging - * was requested, or else that an ingress event occurred. + * Bitmap of |NanRangingIndication| values indicating the ranging event(s) which triggered the + * ranging. e.g. can indicate that continuous ranging was requested, or else that an ingress + * event occurred. */ - NanRangingIndication rangingIndicationType; + int rangingIndicationType; /** * Security Context Identifier attribute contains PMKID. Shall be included in NDP setup and - * response messages. Security Context Identifie identifies the Security Context. For NAN + * response messages. Security Context Identifier identifies the Security Context. For NAN * Shared Key Cipher Suite, this field contains the 16 octet PMKID identifying the PMK used for * setting up the Secure Data Path. */ byte[] scid; + /** + * The config for NAN pairing set by the peer + */ + NanPairingConfig peerPairingConfig; + /** + * The NIRA from peer for NAN pairing verification + */ + NanIdentityResolutionAttribute peerNira; } diff --git a/wifi/aidl/android/hardware/wifi/NanPairingAkm.aidl b/wifi/aidl/android/hardware/wifi/NanPairingAkm.aidl new file mode 100644 index 0000000000..a823a3f4b7 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingAkm.aidl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * The AKM used in the NAN pairing. + */ +@VintfStability @Backing(type="int") enum NanPairingAkm { SAE = 0, PASN=1 } diff --git a/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl b/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl new file mode 100644 index 0000000000..609dac2d96 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingConfig.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * The NAN pairing config + */ +@VintfStability +parcelable NanPairingConfig { + /** + * Enable NAN pairing setup + */ + boolean enablePairingSetup; + /** + * Enable cache NIK/NPK after NAN pairing setup + */ + boolean enablePairingCache; + /** + * Enable NAN pairing verification with cached NIK/NPK + */ + boolean enablePairingVerification; + /** + * Bitmap of |NanBootstrappingMethod| values indicating the set of + * supported bootstrapping methods. + */ + int supportedBootstrappingMethods; +} diff --git a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl new file mode 100644 index 0000000000..a5670ec460 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanPairingRequestType; +import android.hardware.wifi.NanStatus; +import android.hardware.wifi.NpkSecurityAssociation; + +/** + * NAN pairing confirmation indication structure. Event indication is + * received on both initiator and responder side when negotiation for a + * pairing finishes on success or failure. See Wi-Fi Aware R4.0 section 7.6.1.4 + */ +@VintfStability +parcelable NanPairingConfirmInd { + /** + * ID of the pairing session. + */ + int pairingInstanceId; + /** + * Indicates whether the pairing setup succeeded (true) or failed (false). + */ + boolean pairingSuccess; + /** + * Failure reason if |pairingSuccess| is false. + */ + NanStatus status; + /** + * Indicate the pairing session is of setup or verification + */ + NanPairingRequestType requestType; + /** + * Whether should cache the negotiated NIK/NPK for future verification + */ + boolean enablePairingCache; + /** + * The security association negotiated for the pairing, can be cached for future verification + */ + NpkSecurityAssociation npksa; +} diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl new file mode 100644 index 0000000000..0c2080b9e0 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanPairingRequestType; +import android.hardware.wifi.NanPairingSecurityConfig; + +/** + * NAN pairing initiate request. + * Can be used for setup (the initial pairing request) or + * verification (re-pairing for paired devices). + * See Wi-Fi Aware R4.0 section 7.6.1.1 + */ +@VintfStability +parcelable NanPairingRequest { + /** + * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or + * |IWifiNanIfaceEventCallback.eventFollowupReceived|. + */ + int peerId; + /** + * NAN management interface MAC address of the peer. Obtained as part of an earlier + * |IWifiNanIfaceEventCallback.eventMatch| or + * |IWifiNanIfaceEventCallback.eventFollowupReceived|. + */ + byte[6] peerDiscMacAddr; + /** + * Indicate the pairing session is for setup or verification + */ + NanPairingRequestType requestType; + /** + * Whether to cache the negotiated NIK/NPK for future verification + */ + boolean enablePairingCache; + /** + * The Identity key for pairing, can be used for pairing verification + */ + byte[16] pairingIdentityKey; + /** + * Security config used for the pairing + */ + NanPairingSecurityConfig securityConfig; +} diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl new file mode 100644 index 0000000000..ec8548f0f5 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanIdentityResolutionAttribute; +import android.hardware.wifi.NanPairingRequestType; + +/** + * NAN pairing request indication message structure. + * Event indication received by an intended Responder when a + * pairing request is initiated by an Initiator. See Wi-Fi Aware R4.0 section 7.6.1.3 + */ +@VintfStability +parcelable NanPairingRequestInd { + /** + * Discovery session (publish or subscribe) ID of a previously created discovery session. The + * pairing request is received in the context of this discovery session. + * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID + */ + byte discoverySessionId; + /** + * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| + * or to set up a data-path. + */ + int peerId; + /** + * MAC address of the Initiator peer. This is the MAC address of the peer's + * management/discovery NAN interface. + */ + byte[6] peerDiscMacAddr; + /** + * ID of the NAN pairing Used to identify the pairing in further negotiation/APIs. + */ + int pairingInstanceId; + /** + * Indicate the pairing session is of setup or verification + */ + NanPairingRequestType requestType; + /** + * Whether should cache the negotiated NIK/NPK for future verification + */ + boolean enablePairingCache; + /** + * The NIRA from peer for NAN pairing verification + */ + NanIdentityResolutionAttribute peerNira; +} diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequestType.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequestType.aidl new file mode 100644 index 0000000000..a69d04ec94 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingRequestType.aidl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Type of the request of pairing + */ +@VintfStability +@Backing(type="int") +enum NanPairingRequestType { + NAN_PAIRING_SETUP = 0, + NAN_PAIRING_VERIFICATION +} diff --git a/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl b/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl new file mode 100644 index 0000000000..a601751d4f --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanCipherSuiteType; +import android.hardware.wifi.NanPairingAkm; +import android.hardware.wifi.NanPairingSecurityType; + +/** + * Configuration of NAN data-path security. + */ +@VintfStability +parcelable NanPairingSecurityConfig { + /** + * Security configuration of the NAN pairing. |NanPairingSecurityType.PMK| for verification. + * |NanPairingSecurityType.PASSPHRASE| and |NanPairingSecurityType.OPPORTUNISTIC| for setup + */ + NanPairingSecurityType securityType; + /** + * Optional Pairwise Master Key (PMK). Must be specified (and is only used) if |securityType| is + * set to |NanDataPathSecurityType.PMK|. + * Ref: IEEE 802.11i + */ + byte[32] pmk; + /** + * Optional Passphrase. Must be specified (and is only used) if |securityType| is set to + * |NanDataPathSecurityType.PASSPHRASE|. + * Min length: |IWifiNanIface.MIN_DATA_PATH_CONFIG_PASSPHRASE_LENGTH| + * Max length: |IWifiNanIface.MAX_DATA_PATH_CONFIG_PASSPHRASE_LENGTH| + * NAN Spec: Appendix: Mapping passphrase to PMK for NCS-SK Cipher Suites + */ + byte[] passphrase; + /** + * The AKM for key exchange + */ + NanPairingAkm akm; + /** + * Cipher type for pairing. Must be one of |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK| + * or |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|. + */ + NanCipherSuiteType cipherType; +} diff --git a/wifi/aidl/android/hardware/wifi/NanPairingSecurityType.aidl b/wifi/aidl/android/hardware/wifi/NanPairingSecurityType.aidl new file mode 100644 index 0000000000..0f97d516f6 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanPairingSecurityType.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * NAN pairing security configuration options. + */ +@VintfStability +@Backing(type="int") +enum NanPairingSecurityType { + OPPORTUNISTIC, + PMK, + PASSPHRASE, +} diff --git a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl index 6dd079cea3..956a7dfb26 100644 --- a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl @@ -17,6 +17,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanDiscoveryCommonConfig; +import android.hardware.wifi.NanPairingConfig; import android.hardware.wifi.NanPublishType; import android.hardware.wifi.NanTxType; @@ -46,4 +47,12 @@ parcelable NanPublishRequest { * the device must automatically accept the data-path request and complete the negotiation. */ boolean autoAcceptDataPathRequests; + /** + * The config for NAN pairing + */ + NanPairingConfig pairingConfig; + /** + * The Identity key for pairing, will generate NIRA for verification by the peer + */ + byte[16] identityKey; } diff --git a/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl b/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl index 6960e71fba..e543b7bf07 100644 --- a/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanRespondToDataPathIndicationRequest.aidl @@ -58,4 +58,9 @@ parcelable NanRespondToDataPathIndicationRequest { * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites */ byte[] serviceNameOutOfBand; + /** + * ID of an active publish or subscribe discovery session. + * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID + */ + byte discoverySessionId; } diff --git a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl new file mode 100644 index 0000000000..fab2a40be6 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanPairingRequestType; +import android.hardware.wifi.NanPairingSecurityConfig; + +/** + * Response to a pairing request from a peer. + * See Wi-Fi Aware R4.0 section 7.6.1.2 + */ +@VintfStability +parcelable NanRespondToPairingIndicationRequest { + /** + * Accept (true) or reject (false) the request. + * NAN Spec: Data Path Attributes / NDP Attribute / Type and Status + */ + boolean acceptRequest; + /** + * ID of the NAN pairing for which we're responding. Obtained as part of the request in + * |IWifiNanIfaceEventCallback.eventPairingRequest|. + */ + int pairingInstanceId; + /** + * Indicate the pairing session is of setup or verification + */ + NanPairingRequestType requestType; + /** + * Whether should cache the negotiated NIK/NPK for future verification + */ + boolean enablePairingCache; + /** + * The Identity key for pairing, can be used for pairing verification + */ + byte[16] pairingIdentityKey; + /** + * Security config used for the pairing + */ + NanPairingSecurityConfig securityConfig; +} diff --git a/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl b/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl index d63a50e45a..6706839aa4 100644 --- a/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl +++ b/wifi/aidl/android/hardware/wifi/NanStatusCode.aidl @@ -71,4 +71,24 @@ enum NanStatusCode { * Unsupported concurrency of NAN and another feature - NAN disabled. */ UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12, + /** + * If the pairing id is invalid + */ + INVALID_PAIRING_ID = 13, + /** + * If the bootstrapping id is invalid + */ + INVALID_BOOTSTRAPPING_ID = 14, + /* + * If same request is received again + */ + REDUNDANT_REQUEST = 15, + /* + * If current request is not supported + */ + NOT_SUPPORTED = 16, + /* + * If no Wifi Aware connection is active + */ + NO_CONNECTION = 17 } diff --git a/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl index 12c11702b8..0b246eda8c 100644 --- a/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl @@ -18,6 +18,7 @@ package android.hardware.wifi; import android.hardware.wifi.MacAddress; import android.hardware.wifi.NanDiscoveryCommonConfig; +import android.hardware.wifi.NanPairingConfig; import android.hardware.wifi.NanSrfType; import android.hardware.wifi.NanSubscribeType; @@ -67,4 +68,12 @@ parcelable NanSubscribeRequest { * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / Address Set */ MacAddress[] intfAddr; + /** + * Security config used for the pairing + */ + NanPairingConfig pairingConfig; + /** + * The Identity key for pairing, will generate NIRA for verification by the peer + */ + byte[16] identityKey; } diff --git a/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl b/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl new file mode 100644 index 0000000000..057e63b041 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NanSuspensionModeChangeInd.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Event indication that the device entered or exited the suspension mode + */ +@VintfStability +parcelable NanSuspensionModeChangeInd { + /** + * Indication whether the device has entered or exited the NAN suspension mode(deep sleep) + */ + boolean isSuspended; +} diff --git a/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl b/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl new file mode 100644 index 0000000000..4d65a41286 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.NanCipherSuiteType; +import android.hardware.wifi.NanPairingAkm; + +/** + * The security association info after Aware Pairing setup. + */ +@VintfStability +parcelable NpkSecurityAssociation { + /** + * The Aware pairing identity from the peer + */ + byte[16] peerNanIdentityKey; + /** + * The Aware pairing identity for local device + */ + byte[16] localNanIdentityKey; + /** + * The PMK is used in this security association + */ + byte[32] npk; + /** + * The AKM is used for key exchange in this security association + */ + NanPairingAkm akm; + /** + * Cipher type for pairing. Must be one of |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK| or + * |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|. + */ + NanCipherSuiteType cipherType; +} diff --git a/wifi/aidl/android/hardware/wifi/RttBw.aidl b/wifi/aidl/android/hardware/wifi/RttBw.aidl index 9d42dc04e1..be9ecbd944 100644 --- a/wifi/aidl/android/hardware/wifi/RttBw.aidl +++ b/wifi/aidl/android/hardware/wifi/RttBw.aidl @@ -22,6 +22,7 @@ package android.hardware.wifi; @VintfStability @Backing(type="int") enum RttBw { + BW_UNSPECIFIED = 0x0, BW_5MHZ = 0x01, BW_10MHZ = 0x02, BW_20MHZ = 0x04, diff --git a/wifi/aidl/android/hardware/wifi/RttResult.aidl b/wifi/aidl/android/hardware/wifi/RttResult.aidl index 565cce7b94..6c45e2c349 100644 --- a/wifi/aidl/android/hardware/wifi/RttResult.aidl +++ b/wifi/aidl/android/hardware/wifi/RttResult.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi; +import android.hardware.wifi.RttBw; import android.hardware.wifi.RttStatus; import android.hardware.wifi.RttType; import android.hardware.wifi.WifiInformationElement; @@ -132,4 +133,15 @@ parcelable RttResult { * For 11mc only. */ WifiInformationElement lcr; + /** + * RTT channel frequency in MHz + * If frequency is unknown, this will be set to 0. + */ + int channelFreqMHz; + /** + * RTT packet bandwidth. + * This value is an average bandwidth of the bandwidths of measurement + * frames. Cap the average close to a specific valid RttBw. + */ + RttBw packetBw; } diff --git a/wifi/aidl/android/hardware/wifi/Ssid.aidl b/wifi/aidl/android/hardware/wifi/Ssid.aidl index fd985a3f10..230cef619b 100644 --- a/wifi/aidl/android/hardware/wifi/Ssid.aidl +++ b/wifi/aidl/android/hardware/wifi/Ssid.aidl @@ -20,8 +20,6 @@ package android.hardware.wifi; * Byte array representing an Ssid. Use when we need to * pass an array of Ssid's to a method, as variable-sized * 2D arrays are not supported in AIDL. - * - * TODO (b/210705533): Replace this type with a 2D byte array. */ @VintfStability parcelable Ssid { diff --git a/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl index 7bd87b2917..76b510dd6e 100644 --- a/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl +++ b/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl @@ -16,7 +16,6 @@ package android.hardware.wifi; -import android.hardware.wifi.StaBackgroundScanBucketEventReportSchemeMask; import android.hardware.wifi.WifiBand; /** @@ -50,7 +49,7 @@ parcelable StaBackgroundScanBucketParameters { * Bitset of |StaBackgroundScanBucketEventReportSchemeMask| values controlling * when events for this bucket must be reported. */ - StaBackgroundScanBucketEventReportSchemeMask eventReportScheme; + int eventReportScheme; /** * For exponential back off. If |exponentialMaxPeriodInMs| is non-zero or * different than period, then this bucket is an exponential backoff bucket diff --git a/wifi/aidl/android/hardware/wifi/StaLinkLayerIfaceStats.aidl b/wifi/aidl/android/hardware/wifi/StaLinkLayerIfaceStats.aidl index 78f8caa6a7..3f8718fe74 100644 --- a/wifi/aidl/android/hardware/wifi/StaLinkLayerIfaceStats.aidl +++ b/wifi/aidl/android/hardware/wifi/StaLinkLayerIfaceStats.aidl @@ -16,64 +16,13 @@ package android.hardware.wifi; -import android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats; -import android.hardware.wifi.StaLinkLayerIfacePacketStats; -import android.hardware.wifi.StaPeerInfo; +import android.hardware.wifi.StaLinkLayerLinkStats; /** - * Iface statistics for the current connection. + * Iface statistics for the current connection. Current connection may have + * single or multiple links. */ @VintfStability parcelable StaLinkLayerIfaceStats { - /** - * Number beacons received from the connected AP. - */ - int beaconRx; - /** - * Access Point Beacon and Management frames RSSI (averaged). - */ - int avgRssiMgmt; - /** - * WME Best Effort Access Category packet counters. - */ - StaLinkLayerIfacePacketStats wmeBePktStats; - /** - * WME Background Access Category packet counters. - */ - StaLinkLayerIfacePacketStats wmeBkPktStats; - /** - * WME Video Access Category packet counters. - */ - StaLinkLayerIfacePacketStats wmeViPktStats; - /** - * WME Voice Access Category packet counters. - */ - StaLinkLayerIfacePacketStats wmeVoPktStats; - /** - * Duty cycle for the iface. - * If this iface is being served using time slicing on a radio with one or more ifaces - * (i.e MCC), then the duty cycle assigned to this iface in %. - * If not using time slicing (i.e SCC or DBS), set to 100. - */ - byte timeSliceDutyCycleInPercent; - /** - * WME Best Effort (BE) Access Category (AC) contention time statistics. - */ - StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; - /** - * WME Background (BK) Access Category (AC) contention time statistics. - */ - StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; - /** - * WME Video (VI) Access Category (AC) contention time statistics. - */ - StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; - /** - * WME Voice (VO) Access Category (AC) contention time statistics. - */ - StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; - /** - * Per peer statistics. - */ - StaPeerInfo[] peers; + StaLinkLayerLinkStats[] links; } diff --git a/wifi/aidl/android/hardware/wifi/StaLinkLayerLinkStats.aidl b/wifi/aidl/android/hardware/wifi/StaLinkLayerLinkStats.aidl new file mode 100644 index 0000000000..25195430fe --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/StaLinkLayerLinkStats.aidl @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.StaLinkLayerIfaceContentionTimeStats; +import android.hardware.wifi.StaLinkLayerIfacePacketStats; +import android.hardware.wifi.StaPeerInfo; + +/** + * Per Link statistics for the current connection. For MLO, this is + * the statistics for one link in the connection. + */ +@VintfStability +parcelable StaLinkLayerLinkStats { + /** + * Identifier for the link within MLO. For single link operation this field + * is not relevant and can be set to 0. + */ + int linkId; + /** + * Radio identifier on which the link is currently operating. Refer + * |StaLinkLayerRadioStats.radioId|. + */ + int radioId; + /** + * Frequency of the link in Mhz. + */ + int frequencyMhz; + /** + * Number of beacons received from the connected AP on the link. + */ + int beaconRx; + /** + * Access Point Beacon and Management frames RSSI (averaged) on the link. + */ + int avgRssiMgmt; + /** + * WME Best Effort Access Category packet counters on the link. + */ + StaLinkLayerIfacePacketStats wmeBePktStats; + /** + * WME Background Access Category packet counters on the link. + */ + StaLinkLayerIfacePacketStats wmeBkPktStats; + /** + * WME Video Access Category packet counters on the link. + */ + StaLinkLayerIfacePacketStats wmeViPktStats; + /** + * WME Voice Access Category packet counters on the link. + */ + StaLinkLayerIfacePacketStats wmeVoPktStats; + /** + * Duty cycle for the link. + * If this link is being served using time slicing on a radio with one or + * more links then the duty cycle assigned to this link in %. If not using + * time slicing, set to 100. + */ + byte timeSliceDutyCycleInPercent; + /** + * WME Best Effort (BE) Access Category (AC) contention time statistics on + * the link. + */ + StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; + /** + * WME Background (BK) Access Category (AC) contention time statistics on + * the link. + */ + StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; + /** + * WME Video (VI) Access Category (AC) contention time statistics on the + * link. + */ + StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; + /** + * WME Voice (VO) Access Category (AC) contention time statistics on the + * link. + */ + StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; + /** + * Per peer statistics for the link. + */ + StaPeerInfo[] peers; + /** + * Various states of the link. + */ + @Backing(type="int") + @VintfStability + enum StaLinkState { + /** + * Chip does not support reporting the state of the link. + */ + UNKNOWN = 0, + /** + * Link has not been in use since last report. It is placed in power save. All management, + * control and data frames for the MLO connection are carried over other links. In this + * state the link will not listen to beacons even in DTIM period and does not perform any + * GTK/IGTK/BIGTK updates but remains associated. + */ + NOT_IN_USE = 1 << 0, + /** + * Link is in use. In presence of traffic, it is set to be power active. When the traffic + * stops, the link will go into power save mode and will listen for beacons every DTIM + * period. + * + */ + IN_USE = 1 << 1, + } + /** + * State of the link. Refer |StaLinkState|. + */ + StaLinkState state; +} diff --git a/wifi/aidl/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/android/hardware/wifi/StaScanData.aidl index 9d6bd5378d..abc56385ad 100644 --- a/wifi/aidl/android/hardware/wifi/StaScanData.aidl +++ b/wifi/aidl/android/hardware/wifi/StaScanData.aidl @@ -16,7 +16,6 @@ package android.hardware.wifi; -import android.hardware.wifi.StaScanDataFlagMask; import android.hardware.wifi.StaScanResult; /** @@ -26,9 +25,9 @@ import android.hardware.wifi.StaScanResult; @VintfStability parcelable StaScanData { /** - * Bitset containing |ScanDataFlagMask| values. + * Bitset of |ScanDataFlagMask| values. */ - StaScanDataFlagMask flags; + int flags; /** * Bitset where each bit indicates if the bucket with that index (starting at * 0) was scanned. diff --git a/wifi/aidl/android/hardware/wifi/WifiChipCapabilities.aidl b/wifi/aidl/android/hardware/wifi/WifiChipCapabilities.aidl new file mode 100644 index 0000000000..77b904957e --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/WifiChipCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * WifiChipCapabilities captures various Wifi chip capability params. + */ +@VintfStability +parcelable WifiChipCapabilities { + /** + * Maximum number of links supported by the chip for MLO association. + */ + int maxMloAssociationLinkCount; + /** + * Maximum number of Simultaneous Transmit and Receive (STR) links used + * in Multi-Link Operation. The maximum number of STR links used can be + * different from the maximum number of radios supported by the chip. + * + * This is a static configuration of the chip. + */ + int maxMloStrLinkCount; + /** + * Maximum number of concurrent TDLS sessions that can be enabled + * by framework via ISupplicantStaIface#initiateTdlsSetup(). + */ + int maxConcurrentTdlsSessionCount; +} diff --git a/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl index d92e4cce94..077c17e696 100644 --- a/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl +++ b/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl @@ -17,7 +17,6 @@ package android.hardware.wifi; import android.hardware.wifi.WifiChannelWidthInMhz; -import android.hardware.wifi.WifiIfaceMode; /** * Wifi usable channel information. @@ -33,7 +32,8 @@ parcelable WifiUsableChannel { */ WifiChannelWidthInMhz channelBandwidth; /** - * Iface modes feasible on this channel. + * Iface modes feasible on this channel, represented as a bitmask + * of |WifiIfaceMode| values. */ - WifiIfaceMode ifaceModeMask; + int ifaceModeMask; } diff --git a/wifi/1.6/default/Android.bp b/wifi/aidl/default/Android.bp similarity index 67% rename from wifi/1.6/default/Android.bp rename to wifi/aidl/default/Android.bp index 0f98e71445..91d609ddc7 100644 --- a/wifi/1.6/default/Android.bp +++ b/wifi/aidl/default/Android.bp @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Android Open Source Project +// Copyright (C) 2022 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ soong_config_module_type { "hidl_feature_disable_ap", // WIFI_HIDL_FEATURE_DISABLE_AP "hidl_feature_disable_ap_mac_randomization", // WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION "avoid_iface_reset_mac_change", // WIFI_AVOID_IFACE_RESET_MAC_CHANGE + "wifi_skip_state_toggle_off_on_for_nan", // WIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN ], value_variables: [ "hal_interface_combinations", // WIFI_HAL_INTERFACE_COMBINATIONS @@ -36,7 +37,7 @@ soong_config_module_type { } wifi_hal_cc_defaults { - name: "android.hardware.wifi@1.0-service-cppflags-defaults", + name: "android.hardware.wifi-service-cppflags-defaults", soong_config_variables: { hidl_feature_aware: { cppflags: ["-DWIFI_HIDL_FEATURE_AWARE"], @@ -53,6 +54,9 @@ wifi_hal_cc_defaults { avoid_iface_reset_mac_change: { cppflags: ["-DWIFI_AVOID_IFACE_RESET_MAC_CHANGE"], }, + wifi_skip_state_toggle_off_on_for_nan: { + cppflags: ["-DWIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN"], + }, hal_interface_combinations: { cppflags: ["-DWIFI_HAL_INTERFACE_COMBINATIONS=%s"], }, @@ -60,8 +64,8 @@ wifi_hal_cc_defaults { } cc_library_static { - name: "android.hardware.wifi@1.0-service-lib", - defaults: ["android.hardware.wifi@1.0-service-cppflags-defaults"], + name: "android.hardware.wifi-service-lib", + defaults: ["android.hardware.wifi-service-cppflags-defaults"], proprietary: true, compile_multilib: "first", cppflags: [ @@ -72,8 +76,8 @@ cc_library_static { // Allow implicit fallthroughs in wifi_legacy_hal.cpp until they are fixed. cflags: ["-Wno-error=implicit-fallthrough"], srcs: [ - "hidl_struct_util.cpp", - "hidl_sync_util.cpp", + "aidl_struct_util.cpp", + "aidl_sync_util.cpp", "ringbuffer.cpp", "wifi.cpp", "wifi_ap_iface.cpp", @@ -93,29 +97,23 @@ cc_library_static { shared_libs: [ "libbase", + "libbinder_ndk", "libcutils", - "libhidlbase", "liblog", "libnl", "libutils", "libwifi-hal", "libwifi-system-iface", "libxml2", - "android.hardware.wifi@1.0", - "android.hardware.wifi@1.1", - "android.hardware.wifi@1.2", - "android.hardware.wifi@1.3", - "android.hardware.wifi@1.4", - "android.hardware.wifi@1.5", - "android.hardware.wifi@1.6", + "android.hardware.wifi-V1-ndk", ], export_include_dirs: ["."], } cc_binary { - name: "android.hardware.wifi@1.0-service", - vintf_fragments: ["android.hardware.wifi@1.0-service.xml"], + name: "android.hardware.wifi-service", + vintf_fragments: ["android.hardware.wifi-service.xml"], relative_install_path: "hw", proprietary: true, cppflags: [ @@ -126,30 +124,24 @@ cc_binary { srcs: ["service.cpp"], shared_libs: [ "libbase", + "libbinder_ndk", "libcutils", - "libhidlbase", "liblog", "libnl", "libutils", "libwifi-hal", "libwifi-system-iface", "libxml2", - "android.hardware.wifi@1.0", - "android.hardware.wifi@1.1", - "android.hardware.wifi@1.2", - "android.hardware.wifi@1.3", - "android.hardware.wifi@1.4", - "android.hardware.wifi@1.5", - "android.hardware.wifi@1.6", + "android.hardware.wifi-V1-ndk", ], - static_libs: ["android.hardware.wifi@1.0-service-lib"], - init_rc: ["android.hardware.wifi@1.0-service.rc"], + static_libs: ["android.hardware.wifi-service-lib"], + init_rc: ["android.hardware.wifi-service.rc"], } cc_binary { - name: "android.hardware.wifi@1.0-service-lazy", - vintf_fragments: ["android.hardware.wifi@1.0-service.xml"], - overrides: ["android.hardware.wifi@1.0-service"], + name: "android.hardware.wifi-service-lazy", + vintf_fragments: ["android.hardware.wifi-service.xml"], + overrides: ["android.hardware.wifi-service"], cflags: ["-DLAZY_SERVICE"], relative_install_path: "hw", proprietary: true, @@ -161,28 +153,22 @@ cc_binary { srcs: ["service.cpp"], shared_libs: [ "libbase", + "libbinder_ndk", "libcutils", - "libhidlbase", "liblog", "libnl", "libutils", "libwifi-hal", "libwifi-system-iface", "libxml2", - "android.hardware.wifi@1.0", - "android.hardware.wifi@1.1", - "android.hardware.wifi@1.2", - "android.hardware.wifi@1.3", - "android.hardware.wifi@1.4", - "android.hardware.wifi@1.5", - "android.hardware.wifi@1.6", + "android.hardware.wifi-V1-ndk", ], - static_libs: ["android.hardware.wifi@1.0-service-lib"], - init_rc: ["android.hardware.wifi@1.0-service-lazy.rc"], + static_libs: ["android.hardware.wifi-service-lib"], + init_rc: ["android.hardware.wifi-service-lazy.rc"], } cc_test { - name: "android.hardware.wifi@1.0-service-tests", + name: "android.hardware.wifi-service-tests", proprietary: true, compile_multilib: "first", cppflags: [ @@ -191,7 +177,7 @@ cc_test { "-Wextra", ], srcs: [ - "tests/hidl_struct_util_unit_tests.cpp", + "tests/aidl_struct_util_unit_tests.cpp", "tests/main.cpp", "tests/mock_interface_tool.cpp", "tests/mock_wifi_feature_flags.cpp", @@ -206,19 +192,13 @@ cc_test { static_libs: [ "libgmock", "libgtest", - "android.hardware.wifi@1.0", - "android.hardware.wifi@1.1", - "android.hardware.wifi@1.2", - "android.hardware.wifi@1.3", - "android.hardware.wifi@1.4", - "android.hardware.wifi@1.5", - "android.hardware.wifi@1.6", - "android.hardware.wifi@1.0-service-lib", + "android.hardware.wifi-V1-ndk", + "android.hardware.wifi-service-lib", ], shared_libs: [ "libbase", + "libbinder_ndk", "libcutils", - "libhidlbase", "liblog", "libnl", "libutils", @@ -228,11 +208,11 @@ cc_test { } filegroup { - name: "default-android.hardware.wifi@1.0-service.rc", - srcs: ["android.hardware.wifi@1.0-service.rc"], + name: "default-android.hardware.wifi-service.rc", + srcs: ["android.hardware.wifi-service.rc"], } filegroup { - name: "default-android.hardware.wifi@1.0-service.xml", - srcs: ["android.hardware.wifi@1.0-service.xml"], + name: "default-android.hardware.wifi-service.xml", + srcs: ["android.hardware.wifi-service.xml"], } diff --git a/wifi/1.6/default/THREADING.README b/wifi/aidl/default/THREADING.README similarity index 82% rename from wifi/1.6/default/THREADING.README rename to wifi/aidl/default/THREADING.README index 8366ca0201..45679da069 100644 --- a/wifi/1.6/default/THREADING.README +++ b/wifi/aidl/default/THREADING.README @@ -1,7 +1,7 @@ Vendor HAL Threading Model ========================== The vendor HAL service has two threads: -1. HIDL thread: This is the main thread which processes all the incoming HIDL +1. AIDL thread: This is the main thread which processes all the incoming AIDL RPC's. 2. Legacy HAL event loop thread: This is the thread forked off for processing the legacy HAL event loop (wifi_event_loop()). This thread is used to process @@ -11,9 +11,9 @@ callbacks passed to the legacy HAL API's are invoked on this thread. Synchronization Concerns ======================== wifi_legacy_hal.cpp has a bunch of global "C" style functions to handle the -legacy callbacks. Each of these "C" style function invokes a corresponding +legacy callbacks. Each of these "C" style functions invokes a corresponding "std::function" version of the callback which does the actual processing. -The variables holding these "std::function" callbacks are reset from the HIDL +The variables holding these "std::function" callbacks are reset from the AIDL thread when they are no longer used. For example: stopGscan() will reset the corresponding "on_gscan_*" callback variables which were set when startGscan() was invoked. This is not thread safe since these callback variables are @@ -24,12 +24,12 @@ Synchronization Solution Adding a global lock seems to be the most trivial solution to the problem. a) All of the asynchronous "C" style callbacks will acquire the global lock before invoking the corresponding "std::function" callback variables. -b) All of the HIDL methods will also acquire the global lock before processing -(in hidl_return_util::validateAndCall()). +b) All of the AIDL methods will also acquire the global lock before processing +(in aidl_return_util::validateAndCall()). Note: It's important that we only acquire the global lock for asynchronous callbacks, because there is no guarantee (or documentation to clarify) that the synchronous callbacks are invoked on the same invocation thread. If that is not the case in some implementation, we will end up deadlocking the system since the -HIDL thread would have acquired the global lock which is needed by the +AIDL thread would have acquired the global lock which is needed by the synchronous callback executed on the legacy hal event loop thread. diff --git a/wifi/aidl/default/aidl_callback_util.h b/wifi/aidl/default/aidl_callback_util.h new file mode 100644 index 0000000000..f8ba53ba81 --- /dev/null +++ b/wifi/aidl/default/aidl_callback_util.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef AIDL_CALLBACK_UTIL_H_ +#define AIDL_CALLBACK_UTIL_H_ + +#include + +#include +#include +#include + +namespace { +std::unordered_map callback_handler_map_; +std::mutex callback_handler_lock_; +} + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +namespace aidl_callback_util { + +// Provides a class to manage callbacks for the various AIDL interfaces and +// handle the death of the process hosting each callback. +template +class AidlCallbackHandler { + public: + AidlCallbackHandler() { + death_handler_ = AIBinder_DeathRecipient_new(AidlCallbackHandler::onCallbackDeath); + } + ~AidlCallbackHandler() { invalidate(); } + + bool addCallback(const std::shared_ptr& cb) { + std::unique_lock lk(callback_handler_lock_); + void* cbPtr = reinterpret_cast(cb->asBinder().get()); + const auto& cbPosition = findCbInSet(cbPtr); + if (cbPosition != cb_set_.end()) { + LOG(WARNING) << "Duplicate death notification registration"; + return true; + } + + if (AIBinder_linkToDeath(cb->asBinder().get(), death_handler_, cbPtr /* cookie */) != + STATUS_OK) { + LOG(ERROR) << "Failed to register death notification"; + return false; + } + + callback_handler_map_[cbPtr] = reinterpret_cast(this); + cb_set_.insert(cb); + // unique_lock unlocked here + return true; + } + + const std::set>& getCallbacks() { + std::unique_lock lk(callback_handler_lock_); + // unique_lock unlocked here + return cb_set_; + } + + void invalidate() { + std::unique_lock lk(callback_handler_lock_); + for (auto cb : cb_set_) { + void* cookie = reinterpret_cast(cb->asBinder().get()); + if (AIBinder_unlinkToDeath(cb->asBinder().get(), death_handler_, cookie) != STATUS_OK) { + LOG(ERROR) << "Failed to deregister death notification"; + } + if (!removeCbFromHandlerMap(cookie)) { + LOG(ERROR) << "Failed to remove callback from handler map"; + } + } + cb_set_.clear(); + // unique_lock unlocked here + } + + // Entry point for the death handling logic. AIBinder_DeathRecipient + // can only call a static function, so use the cookie to find the + // proper handler and route the request there. + static void onCallbackDeath(void* cookie) { + std::unique_lock lk(callback_handler_lock_); + auto cbQuery = callback_handler_map_.find(cookie); + if (cbQuery == callback_handler_map_.end()) { + LOG(ERROR) << "Invalid death cookie received"; + return; + } + + AidlCallbackHandler* cbHandler = reinterpret_cast(cbQuery->second); + if (cbHandler == nullptr) { + LOG(ERROR) << "Handler mapping contained an invalid handler"; + return; + } + cbHandler->handleCallbackDeath(cbQuery->first); + // unique_lock unlocked here + } + + private: + std::set> cb_set_; + AIBinder_DeathRecipient* death_handler_; + + typename std::set>::iterator findCbInSet(void* cbPtr) { + const auto& cbPosition = std::find_if( + cb_set_.begin(), cb_set_.end(), [cbPtr](const std::shared_ptr& p) { + return cbPtr == reinterpret_cast(p->asBinder().get()); + }); + return cbPosition; + } + + bool removeCbFromHandlerMap(void* cbPtr) { + auto cbQuery = callback_handler_map_.find(cbPtr); + if (cbQuery != callback_handler_map_.end()) { + callback_handler_map_.erase(cbQuery); + return true; + } + return false; + } + + void handleCallbackDeath(void* cbPtr) { + const auto& cbPosition = findCbInSet(cbPtr); + if (cbPosition == cb_set_.end()) { + LOG(ERROR) << "Unknown callback death notification received"; + return; + } + cb_set_.erase(cbPosition); + + if (!removeCbFromHandlerMap(cbPtr)) { + LOG(ERROR) << "Callback was not in callback handler map"; + } + } + + DISALLOW_COPY_AND_ASSIGN(AidlCallbackHandler); +}; + +} // namespace aidl_callback_util +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // AIDL_CALLBACK_UTIL_H_ diff --git a/wifi/aidl/default/aidl_return_util.h b/wifi/aidl/default/aidl_return_util.h new file mode 100644 index 0000000000..9a49a22e2a --- /dev/null +++ b/wifi/aidl/default/aidl_return_util.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef AIDL_RETURN_UTIL_H_ +#define AIDL_RETURN_UTIL_H_ + +#include "aidl_sync_util.h" +#include "wifi_status_util.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +namespace aidl_return_util { +using aidl::android::hardware::wifi::WifiStatusCode; +using aidl::android::hardware::wifi::aidl_sync_util::acquireGlobalLock; + +/** + * These utility functions are used to invoke a method on the provided + * AIDL interface object. + * These functions checks if the provided AIDL interface object is valid. + * a) If valid, Invokes the corresponding internal implementation function of + * the AIDL method. + * b) If invalid, return without calling the internal implementation function. + */ + +// Use for AIDL methods which return only an AIDL status. +template +::ndk::ScopedAStatus validateAndCall(ObjT* obj, WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, Args&&... args) { + const auto lock = acquireGlobalLock(); + if (obj->isValid()) { + return (obj->*work)(std::forward(args)...); + } else { + return createWifiStatus(status_code_if_invalid); + } +} + +// Use for AIDL methods which return only an AIDL status. +// This version passes the global lock acquired to the body of the method. +template +::ndk::ScopedAStatus validateAndCallWithLock(ObjT* obj, WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, Args&&... args) { + auto lock = acquireGlobalLock(); + if (obj->isValid()) { + return (obj->*work)(&lock, std::forward(args)...); + } else { + return createWifiStatus(status_code_if_invalid); + } +} + +// Use for AIDL methods which have a return value along with the AIDL status +template +::ndk::ScopedAStatus validateAndCall(ObjT* obj, WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, ReturnT* ret_val, Args&&... args) { + const auto lock = acquireGlobalLock(); + if (obj->isValid()) { + auto call_pair = (obj->*work)(std::forward(args)...); + *ret_val = call_pair.first; + return std::forward<::ndk::ScopedAStatus>(call_pair.second); + } else { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(status_code_if_invalid)); + } +} + +} // namespace aidl_return_util +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl +#endif // AIDL_RETURN_UTIL_H_ diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp new file mode 100644 index 0000000000..7bc2eeb349 --- /dev/null +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -0,0 +1,3359 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "aidl_struct_util.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +namespace aidl_struct_util { + +WifiChannelWidthInMhz convertLegacyWifiChannelWidthToAidl(legacy_hal::wifi_channel_width type); + +std::string safeConvertChar(const char* str, size_t max_len) { + const char* c = str; + size_t size = 0; + while (*c && (unsigned char)*c < 128 && size < max_len) { + ++size; + ++c; + } + return std::string(str, size); +} + +inline std::vector uintToIntVec(const std::vector& in) { + return std::vector(in.begin(), in.end()); +} + +IWifiChip::FeatureSetMask convertLegacyChipFeatureToAidl(uint64_t feature) { + switch (feature) { + case WIFI_FEATURE_SET_TX_POWER_LIMIT: + return IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT; + case WIFI_FEATURE_USE_BODY_HEAD_SAR: + return IWifiChip::FeatureSetMask::USE_BODY_HEAD_SAR; + case WIFI_FEATURE_D2D_RTT: + return IWifiChip::FeatureSetMask::D2D_RTT; + case WIFI_FEATURE_D2AP_RTT: + return IWifiChip::FeatureSetMask::D2AP_RTT; + case WIFI_FEATURE_INFRA_60G: + return IWifiChip::FeatureSetMask::WIGIG; + case WIFI_FEATURE_SET_LATENCY_MODE: + return IWifiChip::FeatureSetMask::SET_LATENCY_MODE; + case WIFI_FEATURE_P2P_RAND_MAC: + return IWifiChip::FeatureSetMask::P2P_RAND_MAC; + case WIFI_FEATURE_AFC_CHANNEL: + return IWifiChip::FeatureSetMask::SET_AFC_CHANNEL_ALLOWANCE; + }; + CHECK(false) << "Unknown legacy feature: " << feature; + return {}; +} + +IWifiStaIface::FeatureSetMask convertLegacyStaIfaceFeatureToAidl(uint64_t feature) { + switch (feature) { + case WIFI_FEATURE_GSCAN: + return IWifiStaIface::FeatureSetMask::BACKGROUND_SCAN; + case WIFI_FEATURE_LINK_LAYER_STATS: + return IWifiStaIface::FeatureSetMask::LINK_LAYER_STATS; + case WIFI_FEATURE_RSSI_MONITOR: + return IWifiStaIface::FeatureSetMask::RSSI_MONITOR; + case WIFI_FEATURE_CONTROL_ROAMING: + return IWifiStaIface::FeatureSetMask::CONTROL_ROAMING; + case WIFI_FEATURE_IE_WHITELIST: + return IWifiStaIface::FeatureSetMask::PROBE_IE_ALLOWLIST; + case WIFI_FEATURE_SCAN_RAND: + return IWifiStaIface::FeatureSetMask::SCAN_RAND; + case WIFI_FEATURE_INFRA_5G: + return IWifiStaIface::FeatureSetMask::STA_5G; + case WIFI_FEATURE_HOTSPOT: + return IWifiStaIface::FeatureSetMask::HOTSPOT; + case WIFI_FEATURE_PNO: + return IWifiStaIface::FeatureSetMask::PNO; + case WIFI_FEATURE_TDLS: + return IWifiStaIface::FeatureSetMask::TDLS; + case WIFI_FEATURE_TDLS_OFFCHANNEL: + return IWifiStaIface::FeatureSetMask::TDLS_OFFCHANNEL; + case WIFI_FEATURE_CONFIG_NDO: + return IWifiStaIface::FeatureSetMask::ND_OFFLOAD; + case WIFI_FEATURE_MKEEP_ALIVE: + return IWifiStaIface::FeatureSetMask::KEEP_ALIVE; + }; + CHECK(false) << "Unknown legacy feature: " << feature; + return {}; +} + +bool convertLegacyChipFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* aidl_feature_set) { + if (!aidl_feature_set) { + return false; + } + *aidl_feature_set = 0; + std::vector features = {WIFI_FEATURE_SET_TX_POWER_LIMIT, + WIFI_FEATURE_USE_BODY_HEAD_SAR, + WIFI_FEATURE_D2D_RTT, + WIFI_FEATURE_D2AP_RTT, + WIFI_FEATURE_INFRA_60G, + WIFI_FEATURE_SET_LATENCY_MODE, + WIFI_FEATURE_P2P_RAND_MAC, + WIFI_FEATURE_AFC_CHANNEL}; + for (const auto feature : features) { + if (feature & legacy_feature_set) { + *aidl_feature_set |= static_cast(convertLegacyChipFeatureToAidl(feature)); + } + } + + return true; +} + +WifiDebugRingBufferFlags convertLegacyDebugRingBufferFlagsToAidl(uint32_t flag) { + switch (flag) { + case WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES: + return WifiDebugRingBufferFlags::HAS_BINARY_ENTRIES; + case WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES: + return WifiDebugRingBufferFlags::HAS_ASCII_ENTRIES; + }; + CHECK(false) << "Unknown legacy flag: " << flag; + return {}; +} + +bool convertLegacyDebugRingBufferStatusToAidl( + const legacy_hal::wifi_ring_buffer_status& legacy_status, + WifiDebugRingBufferStatus* aidl_status) { + if (!aidl_status) { + return false; + } + *aidl_status = {}; + aidl_status->ringName = safeConvertChar(reinterpret_cast(legacy_status.name), + sizeof(legacy_status.name)); + aidl_status->flags = 0; + for (const auto flag : + {WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES, WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES}) { + if (flag & legacy_status.flags) { + aidl_status->flags |= static_cast::type>( + convertLegacyDebugRingBufferFlagsToAidl(flag)); + } + } + aidl_status->ringId = legacy_status.ring_id; + aidl_status->sizeInBytes = legacy_status.ring_buffer_byte_size; + // Calculate free size of the ring the buffer. We don't need to send the + // exact read/write pointers that were there in the legacy HAL interface. + if (legacy_status.written_bytes >= legacy_status.read_bytes) { + aidl_status->freeSizeInBytes = legacy_status.ring_buffer_byte_size - + (legacy_status.written_bytes - legacy_status.read_bytes); + } else { + aidl_status->freeSizeInBytes = legacy_status.read_bytes - legacy_status.written_bytes; + } + aidl_status->verboseLevel = legacy_status.verbose_level; + return true; +} + +bool convertLegacyVectorOfDebugRingBufferStatusToAidl( + const std::vector& legacy_status_vec, + std::vector* aidl_status_vec) { + if (!aidl_status_vec) { + return false; + } + *aidl_status_vec = {}; + for (const auto& legacy_status : legacy_status_vec) { + WifiDebugRingBufferStatus aidl_status; + if (!convertLegacyDebugRingBufferStatusToAidl(legacy_status, &aidl_status)) { + return false; + } + aidl_status_vec->push_back(aidl_status); + } + return true; +} + +bool convertLegacyWakeReasonStatsToAidl(const legacy_hal::WakeReasonStats& legacy_stats, + WifiDebugHostWakeReasonStats* aidl_stats) { + if (!aidl_stats) { + return false; + } + *aidl_stats = {}; + aidl_stats->totalCmdEventWakeCnt = legacy_stats.wake_reason_cnt.total_cmd_event_wake; + aidl_stats->cmdEventWakeCntPerType = uintToIntVec(legacy_stats.cmd_event_wake_cnt); + aidl_stats->totalDriverFwLocalWakeCnt = legacy_stats.wake_reason_cnt.total_driver_fw_local_wake; + aidl_stats->driverFwLocalWakeCntPerType = uintToIntVec(legacy_stats.driver_fw_local_wake_cnt); + aidl_stats->totalRxPacketWakeCnt = legacy_stats.wake_reason_cnt.total_rx_data_wake; + aidl_stats->rxPktWakeDetails.rxUnicastCnt = + legacy_stats.wake_reason_cnt.rx_wake_details.rx_unicast_cnt; + aidl_stats->rxPktWakeDetails.rxMulticastCnt = + legacy_stats.wake_reason_cnt.rx_wake_details.rx_multicast_cnt; + aidl_stats->rxPktWakeDetails.rxBroadcastCnt = + legacy_stats.wake_reason_cnt.rx_wake_details.rx_broadcast_cnt; + aidl_stats->rxMulticastPkWakeDetails.ipv4RxMulticastAddrCnt = + legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.ipv4_rx_multicast_addr_cnt; + aidl_stats->rxMulticastPkWakeDetails.ipv6RxMulticastAddrCnt = + legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.ipv6_rx_multicast_addr_cnt; + aidl_stats->rxMulticastPkWakeDetails.otherRxMulticastAddrCnt = + legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.other_rx_multicast_addr_cnt; + aidl_stats->rxIcmpPkWakeDetails.icmpPkt = + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp_pkt; + aidl_stats->rxIcmpPkWakeDetails.icmp6Pkt = + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_pkt; + aidl_stats->rxIcmpPkWakeDetails.icmp6Ra = + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ra; + aidl_stats->rxIcmpPkWakeDetails.icmp6Na = + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_na; + aidl_stats->rxIcmpPkWakeDetails.icmp6Ns = + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ns; + return true; +} + +legacy_hal::wifi_power_scenario convertAidlTxPowerScenarioToLegacy( + IWifiChip::TxPowerScenario aidl_scenario) { + switch (aidl_scenario) { + case IWifiChip::TxPowerScenario::VOICE_CALL: + return legacy_hal::WIFI_POWER_SCENARIO_VOICE_CALL; + case IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF: + return legacy_hal::WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF; + case IWifiChip::TxPowerScenario::ON_HEAD_CELL_ON: + return legacy_hal::WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON; + case IWifiChip::TxPowerScenario::ON_BODY_CELL_OFF: + return legacy_hal::WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF; + case IWifiChip::TxPowerScenario::ON_BODY_CELL_ON: + return legacy_hal::WIFI_POWER_SCENARIO_ON_BODY_CELL_ON; + }; + CHECK(false); +} + +legacy_hal::wifi_latency_mode convertAidlLatencyModeToLegacy( + IWifiChip::LatencyMode aidl_latency_mode) { + switch (aidl_latency_mode) { + case IWifiChip::LatencyMode::NORMAL: + return legacy_hal::WIFI_LATENCY_MODE_NORMAL; + case IWifiChip::LatencyMode::LOW: + return legacy_hal::WIFI_LATENCY_MODE_LOW; + } + CHECK(false); +} + +bool convertLegacyWifiMacInfoToAidl(const legacy_hal::WifiMacInfo& legacy_mac_info, + IWifiChipEventCallback::RadioModeInfo* aidl_radio_mode_info) { + if (!aidl_radio_mode_info) { + return false; + } + *aidl_radio_mode_info = {}; + + aidl_radio_mode_info->radioId = legacy_mac_info.wlan_mac_id; + // Convert from bitmask of bands in the legacy HAL to enum value in + // the AIDL interface. + if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_6_0_BAND && + legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND && + legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_2_4_BAND) { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_24GHZ_5GHZ_6GHZ; + } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_6_0_BAND && + legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND) { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_5GHZ_6GHZ; + } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_6_0_BAND) { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_6GHZ; + } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_2_4_BAND && + legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND) { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_24GHZ_5GHZ; + } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_2_4_BAND) { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_24GHZ; + } else if (legacy_mac_info.mac_band & legacy_hal::WLAN_MAC_5_0_BAND) { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_5GHZ; + } else { + aidl_radio_mode_info->bandInfo = WifiBand::BAND_UNSPECIFIED; + } + std::vector iface_info_vec; + for (const auto& legacy_iface_info : legacy_mac_info.iface_infos) { + IWifiChipEventCallback::IfaceInfo iface_info; + iface_info.name = legacy_iface_info.name; + iface_info.channel = legacy_iface_info.channel; + iface_info_vec.push_back(iface_info); + } + aidl_radio_mode_info->ifaceInfos = iface_info_vec; + return true; +} + +uint32_t convertAidlWifiBandToLegacyMacBand(WifiBand aidl_band) { + switch (aidl_band) { + case WifiBand::BAND_24GHZ: + return legacy_hal::WLAN_MAC_2_4_BAND; + case WifiBand::BAND_5GHZ: + case WifiBand::BAND_5GHZ_DFS: + case WifiBand::BAND_5GHZ_WITH_DFS: + return legacy_hal::WLAN_MAC_5_0_BAND; + case WifiBand::BAND_24GHZ_5GHZ: + case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS: + return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND); + case WifiBand::BAND_6GHZ: + return legacy_hal::WLAN_MAC_6_0_BAND; + case WifiBand::BAND_5GHZ_6GHZ: + return (legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_6_0_BAND); + case WifiBand::BAND_24GHZ_5GHZ_6GHZ: + case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS_6GHZ: + return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | + legacy_hal::WLAN_MAC_6_0_BAND); + case WifiBand::BAND_60GHZ: + return legacy_hal::WLAN_MAC_60_0_BAND; + default: + return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | + legacy_hal::WLAN_MAC_6_0_BAND | legacy_hal::WLAN_MAC_60_0_BAND); + } +} + +WifiBand convertLegacyMacBandToAidlWifiBand(uint32_t band) { + switch (band) { + case legacy_hal::WLAN_MAC_2_4_BAND: + return WifiBand::BAND_24GHZ; + case legacy_hal::WLAN_MAC_5_0_BAND: + return WifiBand::BAND_5GHZ; + case legacy_hal::WLAN_MAC_6_0_BAND: + return WifiBand::BAND_6GHZ; + case legacy_hal::WLAN_MAC_60_0_BAND: + return WifiBand::BAND_60GHZ; + default: + return WifiBand::BAND_UNSPECIFIED; + } +} + +uint32_t convertAidlWifiIfaceModeToLegacy(uint32_t aidl_iface_mask) { + uint32_t legacy_iface_mask = 0; + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_STA)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_STA); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_SOFTAP)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_SOFTAP); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_P2P_CLIENT)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_P2P_CLIENT); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_P2P_GO)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_P2P_GO); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_NAN)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_NAN); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_TDLS)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_TDLS); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_MESH)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_MESH); + } + if (aidl_iface_mask & static_cast(WifiIfaceMode::IFACE_MODE_IBSS)) { + legacy_iface_mask |= (1 << legacy_hal::WIFI_INTERFACE_IBSS); + } + return legacy_iface_mask; +} + +uint32_t convertLegacyWifiInterfaceModeToAidl(uint32_t legacy_iface_mask) { + uint32_t aidl_iface_mask = 0; + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_STA)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_STA); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_SOFTAP)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_SOFTAP); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_P2P_CLIENT)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_P2P_CLIENT); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_P2P_GO)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_P2P_GO); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_NAN)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_NAN); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_TDLS)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_TDLS); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_MESH)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_MESH); + } + if (legacy_iface_mask & (1 << legacy_hal::WIFI_INTERFACE_IBSS)) { + aidl_iface_mask |= static_cast(WifiIfaceMode::IFACE_MODE_IBSS); + } + return aidl_iface_mask; +} + +uint32_t convertAidlUsableChannelFilterToLegacy(uint32_t aidl_filter_mask) { + uint32_t legacy_filter_mask = 0; + if (aidl_filter_mask & + static_cast(IWifiChip::UsableChannelFilter::CELLULAR_COEXISTENCE)) { + legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CELLULAR_COEXISTENCE; + } + if (aidl_filter_mask & static_cast(IWifiChip::UsableChannelFilter::CONCURRENCY)) { + legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY; + } + if (aidl_filter_mask & static_cast(IWifiChip::UsableChannelFilter::NAN_INSTANT_MODE)) { + legacy_filter_mask |= WIFI_USABLE_CHANNEL_FILTER_NAN_INSTANT_MODE; + } + return legacy_filter_mask; +} + +bool convertLegacyWifiUsableChannelToAidl( + const legacy_hal::wifi_usable_channel& legacy_usable_channel, + WifiUsableChannel* aidl_usable_channel) { + if (!aidl_usable_channel) { + return false; + } + *aidl_usable_channel = {}; + aidl_usable_channel->channel = legacy_usable_channel.freq; + aidl_usable_channel->channelBandwidth = + convertLegacyWifiChannelWidthToAidl(legacy_usable_channel.width); + aidl_usable_channel->ifaceModeMask = + convertLegacyWifiInterfaceModeToAidl(legacy_usable_channel.iface_mode_mask); + + return true; +} + +bool convertLegacyWifiUsableChannelsToAidl( + const std::vector& legacy_usable_channels, + std::vector* aidl_usable_channels) { + if (!aidl_usable_channels) { + return false; + } + *aidl_usable_channels = {}; + for (const auto& legacy_usable_channel : legacy_usable_channels) { + WifiUsableChannel aidl_usable_channel; + if (!convertLegacyWifiUsableChannelToAidl(legacy_usable_channel, &aidl_usable_channel)) { + return false; + } + aidl_usable_channels->push_back(aidl_usable_channel); + } + return true; +} + +bool convertLegacyWifiMacInfosToAidl( + const std::vector& legacy_mac_infos, + std::vector* aidl_radio_mode_infos) { + if (!aidl_radio_mode_infos) { + return false; + } + *aidl_radio_mode_infos = {}; + + for (const auto& legacy_mac_info : legacy_mac_infos) { + IWifiChipEventCallback::RadioModeInfo aidl_radio_mode_info; + if (!convertLegacyWifiMacInfoToAidl(legacy_mac_info, &aidl_radio_mode_info)) { + return false; + } + aidl_radio_mode_infos->push_back(aidl_radio_mode_info); + } + return true; +} + +bool convertLegacyStaIfaceFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* aidl_feature_set) { + if (!aidl_feature_set) { + return false; + } + *aidl_feature_set = 0; + for (const auto feature : + {WIFI_FEATURE_GSCAN, WIFI_FEATURE_LINK_LAYER_STATS, WIFI_FEATURE_RSSI_MONITOR, + WIFI_FEATURE_CONTROL_ROAMING, WIFI_FEATURE_IE_WHITELIST, WIFI_FEATURE_SCAN_RAND, + WIFI_FEATURE_INFRA_5G, WIFI_FEATURE_HOTSPOT, WIFI_FEATURE_PNO, WIFI_FEATURE_TDLS, + WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE}) { + if (feature & legacy_feature_set) { + *aidl_feature_set |= static_cast(convertLegacyStaIfaceFeatureToAidl(feature)); + } + } + // There is no flag for this one in the legacy feature set. Adding it to the + // set because all the current devices support it. + *aidl_feature_set |= static_cast(IWifiStaIface::FeatureSetMask::APF); + return true; +} + +bool convertLegacyApfCapabilitiesToAidl(const legacy_hal::PacketFilterCapabilities& legacy_caps, + StaApfPacketFilterCapabilities* aidl_caps) { + if (!aidl_caps) { + return false; + } + *aidl_caps = {}; + aidl_caps->version = legacy_caps.version; + aidl_caps->maxLength = legacy_caps.max_len; + return true; +} + +uint8_t convertAidlGscanReportEventFlagToLegacy( + StaBackgroundScanBucketEventReportSchemeMask aidl_flag) { + using AidlFlag = StaBackgroundScanBucketEventReportSchemeMask; + switch (aidl_flag) { + case AidlFlag::EACH_SCAN: + return REPORT_EVENTS_EACH_SCAN; + case AidlFlag::FULL_RESULTS: + return REPORT_EVENTS_FULL_RESULTS; + case AidlFlag::NO_BATCH: + return REPORT_EVENTS_NO_BATCH; + }; + CHECK(false); +} + +StaScanDataFlagMask convertLegacyGscanDataFlagToAidl(uint8_t legacy_flag) { + switch (legacy_flag) { + case legacy_hal::WIFI_SCAN_FLAG_INTERRUPTED: + return StaScanDataFlagMask::INTERRUPTED; + }; + CHECK(false) << "Unknown legacy flag: " << legacy_flag; + // To silence the compiler warning about reaching the end of non-void + // function. + return {}; +} + +bool convertLegacyGscanCapabilitiesToAidl(const legacy_hal::wifi_gscan_capabilities& legacy_caps, + StaBackgroundScanCapabilities* aidl_caps) { + if (!aidl_caps) { + return false; + } + *aidl_caps = {}; + aidl_caps->maxCacheSize = legacy_caps.max_scan_cache_size; + aidl_caps->maxBuckets = legacy_caps.max_scan_buckets; + aidl_caps->maxApCachePerScan = legacy_caps.max_ap_cache_per_scan; + aidl_caps->maxReportingThreshold = legacy_caps.max_scan_reporting_threshold; + return true; +} + +legacy_hal::wifi_band convertAidlWifiBandToLegacy(WifiBand band) { + switch (band) { + case WifiBand::BAND_UNSPECIFIED: + return legacy_hal::WIFI_BAND_UNSPECIFIED; + case WifiBand::BAND_24GHZ: + return legacy_hal::WIFI_BAND_BG; + case WifiBand::BAND_5GHZ: + return legacy_hal::WIFI_BAND_A; + case WifiBand::BAND_5GHZ_DFS: + return legacy_hal::WIFI_BAND_A_DFS; + case WifiBand::BAND_5GHZ_WITH_DFS: + return legacy_hal::WIFI_BAND_A_WITH_DFS; + case WifiBand::BAND_24GHZ_5GHZ: + return legacy_hal::WIFI_BAND_ABG; + case WifiBand::BAND_24GHZ_5GHZ_WITH_DFS: + return legacy_hal::WIFI_BAND_ABG_WITH_DFS; + default: + CHECK(false); + return {}; + }; +} + +bool convertAidlGscanParamsToLegacy(const StaBackgroundScanParameters& aidl_scan_params, + legacy_hal::wifi_scan_cmd_params* legacy_scan_params) { + if (!legacy_scan_params) { + return false; + } + *legacy_scan_params = {}; + legacy_scan_params->base_period = aidl_scan_params.basePeriodInMs; + legacy_scan_params->max_ap_per_scan = aidl_scan_params.maxApPerScan; + legacy_scan_params->report_threshold_percent = aidl_scan_params.reportThresholdPercent; + legacy_scan_params->report_threshold_num_scans = aidl_scan_params.reportThresholdNumScans; + if (aidl_scan_params.buckets.size() > MAX_BUCKETS) { + return false; + } + legacy_scan_params->num_buckets = aidl_scan_params.buckets.size(); + for (uint32_t bucket_idx = 0; bucket_idx < aidl_scan_params.buckets.size(); bucket_idx++) { + const StaBackgroundScanBucketParameters& aidl_bucket_spec = + aidl_scan_params.buckets[bucket_idx]; + legacy_hal::wifi_scan_bucket_spec& legacy_bucket_spec = + legacy_scan_params->buckets[bucket_idx]; + if (aidl_bucket_spec.bucketIdx >= MAX_BUCKETS) { + return false; + } + legacy_bucket_spec.bucket = aidl_bucket_spec.bucketIdx; + legacy_bucket_spec.band = convertAidlWifiBandToLegacy(aidl_bucket_spec.band); + legacy_bucket_spec.period = aidl_bucket_spec.periodInMs; + legacy_bucket_spec.max_period = aidl_bucket_spec.exponentialMaxPeriodInMs; + legacy_bucket_spec.base = aidl_bucket_spec.exponentialBase; + legacy_bucket_spec.step_count = aidl_bucket_spec.exponentialStepCount; + legacy_bucket_spec.report_events = 0; + using AidlFlag = StaBackgroundScanBucketEventReportSchemeMask; + for (const auto flag : {AidlFlag::EACH_SCAN, AidlFlag::FULL_RESULTS, AidlFlag::NO_BATCH}) { + if (aidl_bucket_spec.eventReportScheme & + static_cast::type>(flag)) { + legacy_bucket_spec.report_events |= convertAidlGscanReportEventFlagToLegacy(flag); + } + } + if (aidl_bucket_spec.frequencies.size() > MAX_CHANNELS) { + return false; + } + legacy_bucket_spec.num_channels = aidl_bucket_spec.frequencies.size(); + for (uint32_t freq_idx = 0; freq_idx < aidl_bucket_spec.frequencies.size(); freq_idx++) { + legacy_bucket_spec.channels[freq_idx].channel = aidl_bucket_spec.frequencies[freq_idx]; + } + } + return true; +} + +bool convertLegacyIeToAidl(const legacy_hal::wifi_information_element& legacy_ie, + WifiInformationElement* aidl_ie) { + if (!aidl_ie) { + return false; + } + *aidl_ie = {}; + aidl_ie->id = legacy_ie.id; + aidl_ie->data = std::vector(legacy_ie.data, legacy_ie.data + legacy_ie.len); + return true; +} + +bool convertLegacyIeBlobToAidl(const uint8_t* ie_blob, uint32_t ie_blob_len, + std::vector* aidl_ies) { + if (!ie_blob || !aidl_ies) { + return false; + } + *aidl_ies = {}; + const uint8_t* ies_begin = ie_blob; + const uint8_t* ies_end = ie_blob + ie_blob_len; + const uint8_t* next_ie = ies_begin; + using wifi_ie = legacy_hal::wifi_information_element; + constexpr size_t kIeHeaderLen = sizeof(wifi_ie); + // Each IE should at least have the header (i.e |id| & |len| fields). + while (next_ie + kIeHeaderLen <= ies_end) { + const wifi_ie& legacy_ie = (*reinterpret_cast(next_ie)); + uint32_t curr_ie_len = kIeHeaderLen + legacy_ie.len; + if (next_ie + curr_ie_len > ies_end) { + LOG(ERROR) << "Error parsing IE blob. Next IE: " << (void*)next_ie + << ", Curr IE len: " << curr_ie_len << ", IEs End: " << (void*)ies_end; + break; + } + WifiInformationElement aidl_ie; + if (!convertLegacyIeToAidl(legacy_ie, &aidl_ie)) { + LOG(ERROR) << "Error converting IE. Id: " << legacy_ie.id << ", len: " << legacy_ie.len; + break; + } + aidl_ies->push_back(std::move(aidl_ie)); + next_ie += curr_ie_len; + } + // Check if the blob has been fully consumed. + if (next_ie != ies_end) { + LOG(ERROR) << "Failed to fully parse IE blob. Next IE: " << (void*)next_ie + << ", IEs End: " << (void*)ies_end; + } + return true; +} + +bool convertLegacyGscanResultToAidl(const legacy_hal::wifi_scan_result& legacy_scan_result, + bool has_ie_data, StaScanResult* aidl_scan_result) { + if (!aidl_scan_result) { + return false; + } + *aidl_scan_result = {}; + aidl_scan_result->timeStampInUs = legacy_scan_result.ts; + aidl_scan_result->ssid = std::vector( + legacy_scan_result.ssid, + legacy_scan_result.ssid + + strnlen(legacy_scan_result.ssid, sizeof(legacy_scan_result.ssid) - 1)); + aidl_scan_result->bssid = std::array(); + std::copy(legacy_scan_result.bssid, legacy_scan_result.bssid + 6, + std::begin(aidl_scan_result->bssid)); + aidl_scan_result->frequency = legacy_scan_result.channel; + aidl_scan_result->rssi = legacy_scan_result.rssi; + aidl_scan_result->beaconPeriodInMs = legacy_scan_result.beacon_period; + aidl_scan_result->capability = legacy_scan_result.capability; + if (has_ie_data) { + std::vector ies; + if (!convertLegacyIeBlobToAidl(reinterpret_cast(legacy_scan_result.ie_data), + legacy_scan_result.ie_length, &ies)) { + return false; + } + aidl_scan_result->informationElements = std::move(ies); + } + return true; +} + +bool convertLegacyCachedGscanResultsToAidl( + const legacy_hal::wifi_cached_scan_results& legacy_cached_scan_result, + StaScanData* aidl_scan_data) { + if (!aidl_scan_data) { + return false; + } + *aidl_scan_data = {}; + int32_t flags = 0; + for (const auto flag : {legacy_hal::WIFI_SCAN_FLAG_INTERRUPTED}) { + if (legacy_cached_scan_result.flags & flag) { + flags |= static_cast::type>( + convertLegacyGscanDataFlagToAidl(flag)); + } + } + aidl_scan_data->flags = flags; + aidl_scan_data->bucketsScanned = legacy_cached_scan_result.buckets_scanned; + + CHECK(legacy_cached_scan_result.num_results >= 0 && + legacy_cached_scan_result.num_results <= MAX_AP_CACHE_PER_SCAN); + std::vector aidl_scan_results; + for (int32_t result_idx = 0; result_idx < legacy_cached_scan_result.num_results; result_idx++) { + StaScanResult aidl_scan_result; + if (!convertLegacyGscanResultToAidl(legacy_cached_scan_result.results[result_idx], false, + &aidl_scan_result)) { + return false; + } + aidl_scan_results.push_back(aidl_scan_result); + } + aidl_scan_data->results = std::move(aidl_scan_results); + return true; +} + +bool convertLegacyVectorOfCachedGscanResultsToAidl( + const std::vector& legacy_cached_scan_results, + std::vector* aidl_scan_datas) { + if (!aidl_scan_datas) { + return false; + } + *aidl_scan_datas = {}; + for (const auto& legacy_cached_scan_result : legacy_cached_scan_results) { + StaScanData aidl_scan_data; + if (!convertLegacyCachedGscanResultsToAidl(legacy_cached_scan_result, &aidl_scan_data)) { + return false; + } + aidl_scan_datas->push_back(aidl_scan_data); + } + return true; +} + +WifiDebugTxPacketFate convertLegacyDebugTxPacketFateToAidl(legacy_hal::wifi_tx_packet_fate fate) { + switch (fate) { + case legacy_hal::TX_PKT_FATE_ACKED: + return WifiDebugTxPacketFate::ACKED; + case legacy_hal::TX_PKT_FATE_SENT: + return WifiDebugTxPacketFate::SENT; + case legacy_hal::TX_PKT_FATE_FW_QUEUED: + return WifiDebugTxPacketFate::FW_QUEUED; + case legacy_hal::TX_PKT_FATE_FW_DROP_INVALID: + return WifiDebugTxPacketFate::FW_DROP_INVALID; + case legacy_hal::TX_PKT_FATE_FW_DROP_NOBUFS: + return WifiDebugTxPacketFate::FW_DROP_NOBUFS; + case legacy_hal::TX_PKT_FATE_FW_DROP_OTHER: + return WifiDebugTxPacketFate::FW_DROP_OTHER; + case legacy_hal::TX_PKT_FATE_DRV_QUEUED: + return WifiDebugTxPacketFate::DRV_QUEUED; + case legacy_hal::TX_PKT_FATE_DRV_DROP_INVALID: + return WifiDebugTxPacketFate::DRV_DROP_INVALID; + case legacy_hal::TX_PKT_FATE_DRV_DROP_NOBUFS: + return WifiDebugTxPacketFate::DRV_DROP_NOBUFS; + case legacy_hal::TX_PKT_FATE_DRV_DROP_OTHER: + return WifiDebugTxPacketFate::DRV_DROP_OTHER; + }; + CHECK(false) << "Unknown legacy fate type: " << fate; +} + +WifiDebugRxPacketFate convertLegacyDebugRxPacketFateToAidl(legacy_hal::wifi_rx_packet_fate fate) { + switch (fate) { + case legacy_hal::RX_PKT_FATE_SUCCESS: + return WifiDebugRxPacketFate::SUCCESS; + case legacy_hal::RX_PKT_FATE_FW_QUEUED: + return WifiDebugRxPacketFate::FW_QUEUED; + case legacy_hal::RX_PKT_FATE_FW_DROP_FILTER: + return WifiDebugRxPacketFate::FW_DROP_FILTER; + case legacy_hal::RX_PKT_FATE_FW_DROP_INVALID: + return WifiDebugRxPacketFate::FW_DROP_INVALID; + case legacy_hal::RX_PKT_FATE_FW_DROP_NOBUFS: + return WifiDebugRxPacketFate::FW_DROP_NOBUFS; + case legacy_hal::RX_PKT_FATE_FW_DROP_OTHER: + return WifiDebugRxPacketFate::FW_DROP_OTHER; + case legacy_hal::RX_PKT_FATE_DRV_QUEUED: + return WifiDebugRxPacketFate::DRV_QUEUED; + case legacy_hal::RX_PKT_FATE_DRV_DROP_FILTER: + return WifiDebugRxPacketFate::DRV_DROP_FILTER; + case legacy_hal::RX_PKT_FATE_DRV_DROP_INVALID: + return WifiDebugRxPacketFate::DRV_DROP_INVALID; + case legacy_hal::RX_PKT_FATE_DRV_DROP_NOBUFS: + return WifiDebugRxPacketFate::DRV_DROP_NOBUFS; + case legacy_hal::RX_PKT_FATE_DRV_DROP_OTHER: + return WifiDebugRxPacketFate::DRV_DROP_OTHER; + }; + CHECK(false) << "Unknown legacy fate type: " << fate; +} + +WifiDebugPacketFateFrameType convertLegacyDebugPacketFateFrameTypeToAidl( + legacy_hal::frame_type type) { + switch (type) { + case legacy_hal::FRAME_TYPE_UNKNOWN: + return WifiDebugPacketFateFrameType::UNKNOWN; + case legacy_hal::FRAME_TYPE_ETHERNET_II: + return WifiDebugPacketFateFrameType::ETHERNET_II; + case legacy_hal::FRAME_TYPE_80211_MGMT: + return WifiDebugPacketFateFrameType::MGMT_80211; + }; + CHECK(false) << "Unknown legacy frame type: " << type; +} + +bool convertLegacyDebugPacketFateFrameToAidl(const legacy_hal::frame_info& legacy_frame, + WifiDebugPacketFateFrameInfo* aidl_frame) { + if (!aidl_frame) { + return false; + } + *aidl_frame = {}; + aidl_frame->frameType = convertLegacyDebugPacketFateFrameTypeToAidl(legacy_frame.payload_type); + aidl_frame->frameLen = legacy_frame.frame_len; + aidl_frame->driverTimestampUsec = legacy_frame.driver_timestamp_usec; + aidl_frame->firmwareTimestampUsec = legacy_frame.firmware_timestamp_usec; + const uint8_t* frame_begin = + reinterpret_cast(legacy_frame.frame_content.ethernet_ii_bytes); + aidl_frame->frameContent = + std::vector(frame_begin, frame_begin + legacy_frame.frame_len); + return true; +} + +bool convertLegacyDebugTxPacketFateToAidl(const legacy_hal::wifi_tx_report& legacy_fate, + WifiDebugTxPacketFateReport* aidl_fate) { + if (!aidl_fate) { + return false; + } + *aidl_fate = {}; + aidl_fate->fate = convertLegacyDebugTxPacketFateToAidl(legacy_fate.fate); + return convertLegacyDebugPacketFateFrameToAidl(legacy_fate.frame_inf, &aidl_fate->frameInfo); +} + +bool convertLegacyVectorOfDebugTxPacketFateToAidl( + const std::vector& legacy_fates, + std::vector* aidl_fates) { + if (!aidl_fates) { + return false; + } + *aidl_fates = {}; + for (const auto& legacy_fate : legacy_fates) { + WifiDebugTxPacketFateReport aidl_fate; + if (!convertLegacyDebugTxPacketFateToAidl(legacy_fate, &aidl_fate)) { + return false; + } + aidl_fates->push_back(aidl_fate); + } + return true; +} + +bool convertLegacyDebugRxPacketFateToAidl(const legacy_hal::wifi_rx_report& legacy_fate, + WifiDebugRxPacketFateReport* aidl_fate) { + if (!aidl_fate) { + return false; + } + *aidl_fate = {}; + aidl_fate->fate = convertLegacyDebugRxPacketFateToAidl(legacy_fate.fate); + return convertLegacyDebugPacketFateFrameToAidl(legacy_fate.frame_inf, &aidl_fate->frameInfo); +} + +bool convertLegacyVectorOfDebugRxPacketFateToAidl( + const std::vector& legacy_fates, + std::vector* aidl_fates) { + if (!aidl_fates) { + return false; + } + *aidl_fates = {}; + for (const auto& legacy_fate : legacy_fates) { + WifiDebugRxPacketFateReport aidl_fate; + if (!convertLegacyDebugRxPacketFateToAidl(legacy_fate, &aidl_fate)) { + return false; + } + aidl_fates->push_back(aidl_fate); + } + return true; +} + +bool convertLegacyLinkLayerRadioStatsToAidl( + const legacy_hal::LinkLayerRadioStats& legacy_radio_stat, + StaLinkLayerRadioStats* aidl_radio_stat) { + if (!aidl_radio_stat) { + return false; + } + *aidl_radio_stat = {}; + + aidl_radio_stat->radioId = legacy_radio_stat.stats.radio; + aidl_radio_stat->onTimeInMs = legacy_radio_stat.stats.on_time; + aidl_radio_stat->txTimeInMs = legacy_radio_stat.stats.tx_time; + aidl_radio_stat->rxTimeInMs = legacy_radio_stat.stats.rx_time; + aidl_radio_stat->onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan; + aidl_radio_stat->txTimeInMsPerLevel = uintToIntVec(legacy_radio_stat.tx_time_per_levels); + aidl_radio_stat->onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd; + aidl_radio_stat->onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan; + aidl_radio_stat->onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan; + aidl_radio_stat->onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan; + aidl_radio_stat->onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20; + + std::vector aidl_channel_stats; + + for (const auto& channel_stat : legacy_radio_stat.channel_stats) { + WifiChannelStats aidl_channel_stat; + aidl_channel_stat.onTimeInMs = channel_stat.on_time; + aidl_channel_stat.ccaBusyTimeInMs = channel_stat.cca_busy_time; + aidl_channel_stat.channel.width = WifiChannelWidthInMhz::WIDTH_20; + aidl_channel_stat.channel.centerFreq = channel_stat.channel.center_freq; + aidl_channel_stat.channel.centerFreq0 = channel_stat.channel.center_freq0; + aidl_channel_stat.channel.centerFreq1 = channel_stat.channel.center_freq1; + aidl_channel_stats.push_back(aidl_channel_stat); + } + + aidl_radio_stat->channelStats = aidl_channel_stats; + + return true; +} + +bool convertLegacyLinkLayerMlStatsToAidl(const legacy_hal::LinkLayerMlStats& legacy_ml_stats, + StaLinkLayerStats* aidl_stats) { + if (!aidl_stats) { + return false; + } + *aidl_stats = {}; + std::vector links; + // Iterate over each links + for (const auto& link : legacy_ml_stats.links) { + StaLinkLayerLinkStats linkStats = {}; + linkStats.linkId = link.stat.link_id; + linkStats.radioId = link.stat.radio; + linkStats.frequencyMhz = link.stat.frequency; + linkStats.beaconRx = link.stat.beacon_rx; + linkStats.avgRssiMgmt = link.stat.rssi_mgmt; + linkStats.wmeBePktStats.rxMpdu = link.stat.ac[legacy_hal::WIFI_AC_BE].rx_mpdu; + linkStats.wmeBePktStats.txMpdu = link.stat.ac[legacy_hal::WIFI_AC_BE].tx_mpdu; + linkStats.wmeBePktStats.lostMpdu = link.stat.ac[legacy_hal::WIFI_AC_BE].mpdu_lost; + linkStats.wmeBePktStats.retries = link.stat.ac[legacy_hal::WIFI_AC_BE].retries; + linkStats.wmeBeContentionTimeStats.contentionTimeMinInUsec = + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_min; + linkStats.wmeBeContentionTimeStats.contentionTimeMaxInUsec = + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_max; + linkStats.wmeBeContentionTimeStats.contentionTimeAvgInUsec = + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_avg; + linkStats.wmeBeContentionTimeStats.contentionNumSamples = + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_num_samples; + linkStats.wmeBkPktStats.rxMpdu = link.stat.ac[legacy_hal::WIFI_AC_BK].rx_mpdu; + linkStats.wmeBkPktStats.txMpdu = link.stat.ac[legacy_hal::WIFI_AC_BK].tx_mpdu; + linkStats.wmeBkPktStats.lostMpdu = link.stat.ac[legacy_hal::WIFI_AC_BK].mpdu_lost; + linkStats.wmeBkPktStats.retries = link.stat.ac[legacy_hal::WIFI_AC_BK].retries; + linkStats.wmeBkContentionTimeStats.contentionTimeMinInUsec = + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_min; + linkStats.wmeBkContentionTimeStats.contentionTimeMaxInUsec = + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_max; + linkStats.wmeBkContentionTimeStats.contentionTimeAvgInUsec = + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_avg; + linkStats.wmeBkContentionTimeStats.contentionNumSamples = + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_num_samples; + linkStats.wmeViPktStats.rxMpdu = link.stat.ac[legacy_hal::WIFI_AC_VI].rx_mpdu; + linkStats.wmeViPktStats.txMpdu = link.stat.ac[legacy_hal::WIFI_AC_VI].tx_mpdu; + linkStats.wmeViPktStats.lostMpdu = link.stat.ac[legacy_hal::WIFI_AC_VI].mpdu_lost; + linkStats.wmeViPktStats.retries = link.stat.ac[legacy_hal::WIFI_AC_VI].retries; + linkStats.wmeViContentionTimeStats.contentionTimeMinInUsec = + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_min; + linkStats.wmeViContentionTimeStats.contentionTimeMaxInUsec = + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_max; + linkStats.wmeViContentionTimeStats.contentionTimeAvgInUsec = + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_avg; + linkStats.wmeViContentionTimeStats.contentionNumSamples = + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_num_samples; + linkStats.wmeVoPktStats.rxMpdu = link.stat.ac[legacy_hal::WIFI_AC_VO].rx_mpdu; + linkStats.wmeVoPktStats.txMpdu = link.stat.ac[legacy_hal::WIFI_AC_VO].tx_mpdu; + linkStats.wmeVoPktStats.lostMpdu = link.stat.ac[legacy_hal::WIFI_AC_VO].mpdu_lost; + linkStats.wmeVoPktStats.retries = link.stat.ac[legacy_hal::WIFI_AC_VO].retries; + linkStats.wmeVoContentionTimeStats.contentionTimeMinInUsec = + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_min; + linkStats.wmeVoContentionTimeStats.contentionTimeMaxInUsec = + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_max; + linkStats.wmeVoContentionTimeStats.contentionTimeAvgInUsec = + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_avg; + linkStats.wmeVoContentionTimeStats.contentionNumSamples = + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_num_samples; + linkStats.timeSliceDutyCycleInPercent = link.stat.time_slicing_duty_cycle_percent; + // peer info legacy_stats conversion. + std::vector aidl_peers_info_stats; + for (const auto& legacy_peer_info_stats : link.peers) { + StaPeerInfo aidl_peer_info_stats; + if (!convertLegacyPeerInfoStatsToAidl(legacy_peer_info_stats, &aidl_peer_info_stats)) { + return false; + } + aidl_peers_info_stats.push_back(aidl_peer_info_stats); + } + linkStats.peers = aidl_peers_info_stats; + // Push link stats to aidl stats. + links.push_back(linkStats); + } + aidl_stats->iface.links = links; + // radio legacy_stats conversion. + std::vector aidl_radios_stats; + for (const auto& legacy_radio_stats : legacy_ml_stats.radios) { + StaLinkLayerRadioStats aidl_radio_stats; + if (!convertLegacyLinkLayerRadioStatsToAidl(legacy_radio_stats, &aidl_radio_stats)) { + return false; + } + aidl_radios_stats.push_back(aidl_radio_stats); + } + aidl_stats->radios = aidl_radios_stats; + aidl_stats->timeStampInMs = ::android::uptimeMillis(); + + return true; +} + +bool convertLegacyLinkLayerStatsToAidl(const legacy_hal::LinkLayerStats& legacy_stats, + StaLinkLayerStats* aidl_stats) { + if (!aidl_stats) { + return false; + } + *aidl_stats = {}; + std::vector links; + StaLinkLayerLinkStats linkStats = {}; + // iface legacy_stats conversion. + linkStats.linkId = 0; + linkStats.beaconRx = legacy_stats.iface.beacon_rx; + linkStats.avgRssiMgmt = legacy_stats.iface.rssi_mgmt; + linkStats.wmeBePktStats.rxMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu; + linkStats.wmeBePktStats.txMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu; + linkStats.wmeBePktStats.lostMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost; + linkStats.wmeBePktStats.retries = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries; + linkStats.wmeBeContentionTimeStats.contentionTimeMinInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min; + linkStats.wmeBeContentionTimeStats.contentionTimeMaxInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max; + linkStats.wmeBeContentionTimeStats.contentionTimeAvgInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg; + linkStats.wmeBeContentionTimeStats.contentionNumSamples = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples; + linkStats.wmeBkPktStats.rxMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu; + linkStats.wmeBkPktStats.txMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu; + linkStats.wmeBkPktStats.lostMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost; + linkStats.wmeBkPktStats.retries = legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries; + linkStats.wmeBkContentionTimeStats.contentionTimeMinInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min; + linkStats.wmeBkContentionTimeStats.contentionTimeMaxInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max; + linkStats.wmeBkContentionTimeStats.contentionTimeAvgInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg; + linkStats.wmeBkContentionTimeStats.contentionNumSamples = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples; + linkStats.wmeViPktStats.rxMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu; + linkStats.wmeViPktStats.txMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu; + linkStats.wmeViPktStats.lostMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost; + linkStats.wmeViPktStats.retries = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries; + linkStats.wmeViContentionTimeStats.contentionTimeMinInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min; + linkStats.wmeViContentionTimeStats.contentionTimeMaxInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max; + linkStats.wmeViContentionTimeStats.contentionTimeAvgInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg; + linkStats.wmeViContentionTimeStats.contentionNumSamples = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples; + linkStats.wmeVoPktStats.rxMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu; + linkStats.wmeVoPktStats.txMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu; + linkStats.wmeVoPktStats.lostMpdu = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost; + linkStats.wmeVoPktStats.retries = legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries; + linkStats.wmeVoContentionTimeStats.contentionTimeMinInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min; + linkStats.wmeVoContentionTimeStats.contentionTimeMaxInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max; + linkStats.wmeVoContentionTimeStats.contentionTimeAvgInUsec = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg; + linkStats.wmeVoContentionTimeStats.contentionNumSamples = + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples; + linkStats.timeSliceDutyCycleInPercent = legacy_stats.iface.info.time_slicing_duty_cycle_percent; + // peer info legacy_stats conversion. + std::vector aidl_peers_info_stats; + for (const auto& legacy_peer_info_stats : legacy_stats.peers) { + StaPeerInfo aidl_peer_info_stats; + if (!convertLegacyPeerInfoStatsToAidl(legacy_peer_info_stats, &aidl_peer_info_stats)) { + return false; + } + aidl_peers_info_stats.push_back(aidl_peer_info_stats); + } + linkStats.peers = aidl_peers_info_stats; + links.push_back(linkStats); + aidl_stats->iface.links = links; + // radio legacy_stats conversion. + std::vector aidl_radios_stats; + for (const auto& legacy_radio_stats : legacy_stats.radios) { + StaLinkLayerRadioStats aidl_radio_stats; + if (!convertLegacyLinkLayerRadioStatsToAidl(legacy_radio_stats, &aidl_radio_stats)) { + return false; + } + aidl_radios_stats.push_back(aidl_radio_stats); + } + aidl_stats->radios = aidl_radios_stats; + aidl_stats->timeStampInMs = ::android::uptimeMillis(); + return true; +} + +bool convertLegacyPeerInfoStatsToAidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, + StaPeerInfo* aidl_peer_info_stats) { + if (!aidl_peer_info_stats) { + return false; + } + *aidl_peer_info_stats = {}; + aidl_peer_info_stats->staCount = legacy_peer_info_stats.peer_info.bssload.sta_count; + aidl_peer_info_stats->chanUtil = legacy_peer_info_stats.peer_info.bssload.chan_util; + + std::vector aidlRateStats; + for (const auto& legacy_rate_stats : legacy_peer_info_stats.rate_stats) { + StaRateStat rateStat; + if (!convertLegacyWifiRateInfoToAidl(legacy_rate_stats.rate, &rateStat.rateInfo)) { + return false; + } + rateStat.txMpdu = legacy_rate_stats.tx_mpdu; + rateStat.rxMpdu = legacy_rate_stats.rx_mpdu; + rateStat.mpduLost = legacy_rate_stats.mpdu_lost; + rateStat.retries = legacy_rate_stats.retries; + aidlRateStats.push_back(rateStat); + } + aidl_peer_info_stats->rateStats = aidlRateStats; + return true; +} + +bool convertLegacyRoamingCapabilitiesToAidl( + const legacy_hal::wifi_roaming_capabilities& legacy_caps, + StaRoamingCapabilities* aidl_caps) { + if (!aidl_caps) { + return false; + } + *aidl_caps = {}; + aidl_caps->maxBlocklistSize = legacy_caps.max_blacklist_size; + aidl_caps->maxAllowlistSize = legacy_caps.max_whitelist_size; + return true; +} + +bool convertAidlRoamingConfigToLegacy(const StaRoamingConfig& aidl_config, + legacy_hal::wifi_roaming_config* legacy_config) { + if (!legacy_config) { + return false; + } + *legacy_config = {}; + if (aidl_config.bssidBlocklist.size() > MAX_BLACKLIST_BSSID || + aidl_config.ssidAllowlist.size() > MAX_WHITELIST_SSID) { + return false; + } + legacy_config->num_blacklist_bssid = aidl_config.bssidBlocklist.size(); + uint32_t i = 0; + for (const auto& bssid : aidl_config.bssidBlocklist) { + CHECK(bssid.data.size() == sizeof(legacy_hal::mac_addr)); + memcpy(legacy_config->blacklist_bssid[i++], bssid.data.data(), bssid.data.size()); + } + legacy_config->num_whitelist_ssid = aidl_config.ssidAllowlist.size(); + i = 0; + for (const auto& ssid : aidl_config.ssidAllowlist) { + CHECK(ssid.data.size() <= sizeof(legacy_hal::ssid_t::ssid_str)); + legacy_config->whitelist_ssid[i].length = ssid.data.size(); + memcpy(legacy_config->whitelist_ssid[i].ssid_str, ssid.data.data(), ssid.data.size()); + i++; + } + return true; +} + +legacy_hal::fw_roaming_state_t convertAidlRoamingStateToLegacy(StaRoamingState state) { + switch (state) { + case StaRoamingState::ENABLED: + return legacy_hal::ROAMING_ENABLE; + case StaRoamingState::DISABLED: + return legacy_hal::ROAMING_DISABLE; + }; + CHECK(false); +} + +legacy_hal::NanMatchAlg convertAidlNanMatchAlgToLegacy(NanMatchAlg type) { + switch (type) { + case NanMatchAlg::MATCH_ONCE: + return legacy_hal::NAN_MATCH_ALG_MATCH_ONCE; + case NanMatchAlg::MATCH_CONTINUOUS: + return legacy_hal::NAN_MATCH_ALG_MATCH_CONTINUOUS; + case NanMatchAlg::MATCH_NEVER: + return legacy_hal::NAN_MATCH_ALG_MATCH_NEVER; + } + CHECK(false); +} + +legacy_hal::NanPublishType convertAidlNanPublishTypeToLegacy(NanPublishType type) { + switch (type) { + case NanPublishType::UNSOLICITED: + return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED; + case NanPublishType::SOLICITED: + return legacy_hal::NAN_PUBLISH_TYPE_SOLICITED; + case NanPublishType::UNSOLICITED_SOLICITED: + return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED; + } + CHECK(false); +} + +legacy_hal::NanTxType convertAidlNanTxTypeToLegacy(NanTxType type) { + switch (type) { + case NanTxType::BROADCAST: + return legacy_hal::NAN_TX_TYPE_BROADCAST; + case NanTxType::UNICAST: + return legacy_hal::NAN_TX_TYPE_UNICAST; + } + CHECK(false); +} + +legacy_hal::NanSubscribeType convertAidlNanSubscribeTypeToLegacy(NanSubscribeType type) { + switch (type) { + case NanSubscribeType::PASSIVE: + return legacy_hal::NAN_SUBSCRIBE_TYPE_PASSIVE; + case NanSubscribeType::ACTIVE: + return legacy_hal::NAN_SUBSCRIBE_TYPE_ACTIVE; + } + CHECK(false); +} + +legacy_hal::NanSRFType convertAidlNanSrfTypeToLegacy(NanSrfType type) { + switch (type) { + case NanSrfType::BLOOM_FILTER: + return legacy_hal::NAN_SRF_ATTR_BLOOM_FILTER; + case NanSrfType::PARTIAL_MAC_ADDR: + return legacy_hal::NAN_SRF_ATTR_PARTIAL_MAC_ADDR; + } + CHECK(false); +} + +legacy_hal::NanDataPathChannelCfg convertAidlNanDataPathChannelCfgToLegacy( + NanDataPathChannelCfg type) { + switch (type) { + case NanDataPathChannelCfg::CHANNEL_NOT_REQUESTED: + return legacy_hal::NAN_DP_CHANNEL_NOT_REQUESTED; + case NanDataPathChannelCfg::REQUEST_CHANNEL_SETUP: + return legacy_hal::NAN_DP_REQUEST_CHANNEL_SETUP; + case NanDataPathChannelCfg::FORCE_CHANNEL_SETUP: + return legacy_hal::NAN_DP_FORCE_CHANNEL_SETUP; + } + CHECK(false); +} + +legacy_hal::NanPairingRequestType convertAidlNanPairingRequestTypeToLegacy( + NanPairingRequestType type) { + switch (type) { + case NanPairingRequestType::NAN_PAIRING_SETUP: + return legacy_hal::NAN_PAIRING_SETUP; + case NanPairingRequestType::NAN_PAIRING_VERIFICATION: + return legacy_hal::NAN_PAIRING_VERIFICATION; + } + LOG(FATAL); +} + +NanPairingRequestType convertLegacyNanPairingRequestTypeToAidl( + legacy_hal::NanPairingRequestType type) { + switch (type) { + case legacy_hal::NAN_PAIRING_SETUP: + return NanPairingRequestType::NAN_PAIRING_SETUP; + case legacy_hal::NAN_PAIRING_VERIFICATION: + return NanPairingRequestType::NAN_PAIRING_VERIFICATION; + } + LOG(FATAL); +} + +legacy_hal::NanAkm convertAidlAkmTypeToLegacy(NanPairingAkm type) { + switch (type) { + case NanPairingAkm::SAE: + return legacy_hal::SAE; + case NanPairingAkm::PASN: + return legacy_hal::PASN; + } + LOG(FATAL); +} + +NanPairingAkm convertLegacyAkmTypeToAidl(legacy_hal::NanAkm type) { + switch (type) { + case legacy_hal::SAE: + return NanPairingAkm::SAE; + case legacy_hal::PASN: + return NanPairingAkm::PASN; + } + LOG(FATAL); +} + +uint16_t convertAidlBootstrappingMethodToLegacy(NanBootstrappingMethod type) { + switch (type) { + case NanBootstrappingMethod::BOOTSTRAPPING_OPPORTUNISTIC_MASK: + return NAN_PAIRING_BOOTSTRAPPING_OPPORTUNISTIC_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK: + return NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK: + return NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_QR_DISPLAY_MASK: + return NAN_PAIRING_BOOTSTRAPPING_QR_DISPLAY_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_NFC_TAG_MASK: + return NAN_PAIRING_BOOTSTRAPPING_NFC_TAG_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK: + return NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK: + return NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_QR_SCAN_MASK: + return NAN_PAIRING_BOOTSTRAPPING_QR_SCAN_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_NFC_READER_MASK: + return NAN_PAIRING_BOOTSTRAPPING_NFC_READER_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_SERVICE_MANAGED_MASK: + return NAN_PAIRING_BOOTSTRAPPING_SERVICE_MANAGED_MASK; + case NanBootstrappingMethod::BOOTSTRAPPING_HANDSHAKE_SHIP_MASK: + return NAN_PAIRING_BOOTSTRAPPING_HANDSHAKE_SHIP_MASK; + } + LOG(FATAL); +} + +NanBootstrappingMethod convertLegacyBootstrappingMethodToAidl(uint16_t type) { + switch (type) { + case NAN_PAIRING_BOOTSTRAPPING_OPPORTUNISTIC_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_OPPORTUNISTIC_MASK; + case NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK; + case NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK; + case NAN_PAIRING_BOOTSTRAPPING_QR_DISPLAY_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_QR_DISPLAY_MASK; + case NAN_PAIRING_BOOTSTRAPPING_NFC_TAG_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_NFC_TAG_MASK; + case NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK; + case NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK; + case NAN_PAIRING_BOOTSTRAPPING_QR_SCAN_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_QR_SCAN_MASK; + case NAN_PAIRING_BOOTSTRAPPING_NFC_READER_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_NFC_READER_MASK; + case NAN_PAIRING_BOOTSTRAPPING_SERVICE_MANAGED_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_SERVICE_MANAGED_MASK; + case NAN_PAIRING_BOOTSTRAPPING_HANDSHAKE_SHIP_MASK: + return NanBootstrappingMethod::BOOTSTRAPPING_HANDSHAKE_SHIP_MASK; + } + LOG(FATAL); + return {}; +} + +bool covertAidlPairingConfigToLegacy(const NanPairingConfig& aidl_config, + legacy_hal::NanPairingConfig* legacy_config) { + if (!legacy_config) { + LOG(ERROR) << "covertAidlPairingConfigToLegacy: legacy_config is null"; + return false; + } + legacy_config->enable_pairing_setup = aidl_config.enablePairingSetup ? 0x1 : 0x0; + legacy_config->enable_pairing_cache = aidl_config.enablePairingCache ? 0x1 : 0x0; + legacy_config->enable_pairing_verification = aidl_config.enablePairingVerification ? 0x1 : 0x0; + legacy_config->supported_bootstrapping_methods = aidl_config.supportedBootstrappingMethods; + return true; +} + +bool convertLegacyPairingConfigToAidl(const legacy_hal::NanPairingConfig& legacy_config, + NanPairingConfig* aidl_config) { + if (!aidl_config) { + LOG(ERROR) << "convertLegacyPairingConfigToAidl: aidl_nira is null"; + return false; + } + *aidl_config = {}; + aidl_config->enablePairingSetup = legacy_config.enable_pairing_setup == 0x1; + aidl_config->enablePairingCache = legacy_config.enable_pairing_cache == 0x1; + aidl_config->enablePairingVerification = legacy_config.enable_pairing_verification == 0x1; + aidl_config->supportedBootstrappingMethods = legacy_config.supported_bootstrapping_methods; + return true; +} + +bool convertLegacyNiraToAidl(const legacy_hal::NanIdentityResolutionAttribute& legacy_nira, + NanIdentityResolutionAttribute* aidl_nira) { + if (!aidl_nira) { + LOG(ERROR) << "convertLegacyNiraToAidl: aidl_nira is null"; + return false; + } + *aidl_nira = {}; + aidl_nira->nonce = std::array(); + std::copy(legacy_nira.nonce, legacy_nira.nonce + 8, std::begin(aidl_nira->nonce)); + aidl_nira->tag = std::array(); + std::copy(legacy_nira.tag, legacy_nira.tag + 8, std::begin(aidl_nira->tag)); + return true; +} + +bool convertLegacyNpsaToAidl(const legacy_hal::NpkSecurityAssociation& legacy_npsa, + NpkSecurityAssociation* aidl_npsa) { + if (!aidl_npsa) { + LOG(ERROR) << "convertLegacyNiraToAidl: aidl_nira is null"; + return false; + } + *aidl_npsa = {}; + aidl_npsa->peerNanIdentityKey = std::array(); + std::copy(legacy_npsa.peer_nan_identity_key, legacy_npsa.peer_nan_identity_key + 16, + std::begin(aidl_npsa->peerNanIdentityKey)); + aidl_npsa->localNanIdentityKey = std::array(); + std::copy(legacy_npsa.local_nan_identity_key, legacy_npsa.local_nan_identity_key + 16, + std::begin(aidl_npsa->localNanIdentityKey)); + aidl_npsa->npk = std::array(); + std::copy(legacy_npsa.npk.pmk, legacy_npsa.npk.pmk + 32, std::begin(aidl_npsa->npk)); + aidl_npsa->akm = convertLegacyAkmTypeToAidl(legacy_npsa.akm); + aidl_npsa->cipherType = (NanCipherSuiteType)legacy_npsa.cipher_type; + return true; +} + +NanStatusCode convertLegacyNanStatusTypeToAidl(legacy_hal::NanStatusType type) { + switch (type) { + case legacy_hal::NAN_STATUS_SUCCESS: + return NanStatusCode::SUCCESS; + case legacy_hal::NAN_STATUS_INTERNAL_FAILURE: + return NanStatusCode::INTERNAL_FAILURE; + case legacy_hal::NAN_STATUS_PROTOCOL_FAILURE: + return NanStatusCode::PROTOCOL_FAILURE; + case legacy_hal::NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID: + return NanStatusCode::INVALID_SESSION_ID; + case legacy_hal::NAN_STATUS_NO_RESOURCE_AVAILABLE: + return NanStatusCode::NO_RESOURCES_AVAILABLE; + case legacy_hal::NAN_STATUS_INVALID_PARAM: + return NanStatusCode::INVALID_ARGS; + case legacy_hal::NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID: + return NanStatusCode::INVALID_PEER_ID; + case legacy_hal::NAN_STATUS_INVALID_NDP_ID: + return NanStatusCode::INVALID_NDP_ID; + case legacy_hal::NAN_STATUS_NAN_NOT_ALLOWED: + return NanStatusCode::NAN_NOT_ALLOWED; + case legacy_hal::NAN_STATUS_NO_OTA_ACK: + return NanStatusCode::NO_OTA_ACK; + case legacy_hal::NAN_STATUS_ALREADY_ENABLED: + return NanStatusCode::ALREADY_ENABLED; + case legacy_hal::NAN_STATUS_FOLLOWUP_QUEUE_FULL: + return NanStatusCode::FOLLOWUP_TX_QUEUE_FULL; + case legacy_hal::NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED: + return NanStatusCode::UNSUPPORTED_CONCURRENCY_NAN_DISABLED; + case legacy_hal::NAN_STATUS_INVALID_PAIRING_ID: + return NanStatusCode::INVALID_PAIRING_ID; + case legacy_hal::NAN_STATUS_INVALID_BOOTSTRAPPING_ID: + return NanStatusCode::INVALID_BOOTSTRAPPING_ID; + case legacy_hal::NAN_STATUS_REDUNDANT_REQUEST: + return NanStatusCode::REDUNDANT_REQUEST; + case legacy_hal::NAN_STATUS_NOT_SUPPORTED: + return NanStatusCode::NOT_SUPPORTED; + case legacy_hal::NAN_STATUS_NO_CONNECTION: + return NanStatusCode::NO_CONNECTION; + } + CHECK(false); +} + +void convertToNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len, + NanStatus* nanStatus) { + nanStatus->status = convertLegacyNanStatusTypeToAidl(type); + nanStatus->description = safeConvertChar(str, max_len); +} + +bool convertAidlNanEnableRequestToLegacy(const NanEnableRequest& aidl_request1, + const NanConfigRequestSupplemental& aidl_request2, + legacy_hal::NanEnableRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanEnableRequestToLegacy: null legacy_request"; + return false; + } + *legacy_request = {}; + + legacy_request->config_2dot4g_support = 1; + legacy_request->support_2dot4g_val = + aidl_request1.operateInBand[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_support_5g = 1; + legacy_request->support_5g_val = + aidl_request1.operateInBand[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + legacy_request->config_hop_count_limit = 1; + legacy_request->hop_count_limit_val = aidl_request1.hopCountMax; + legacy_request->master_pref = aidl_request1.configParams.masterPref; + legacy_request->discovery_indication_cfg = 0; + legacy_request->discovery_indication_cfg |= + aidl_request1.configParams.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; + legacy_request->discovery_indication_cfg |= + aidl_request1.configParams.disableStartedClusterIndication ? 0x2 : 0x0; + legacy_request->discovery_indication_cfg |= + aidl_request1.configParams.disableJoinedClusterIndication ? 0x4 : 0x0; + legacy_request->config_sid_beacon = 1; + if (aidl_request1.configParams.numberOfPublishServiceIdsInBeacon < 0) { + LOG(ERROR) << "convertAidlNanEnableRequestToLegacy: " + "numberOfPublishServiceIdsInBeacon < 0"; + return false; + } + legacy_request->sid_beacon_val = + (aidl_request1.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | + (aidl_request1.configParams.numberOfPublishServiceIdsInBeacon << 1); + legacy_request->config_subscribe_sid_beacon = 1; + if (aidl_request1.configParams.numberOfSubscribeServiceIdsInBeacon < 0) { + LOG(ERROR) << "convertAidlNanEnableRequestToLegacy: " + "numberOfSubscribeServiceIdsInBeacon < 0"; + return false; + } + legacy_request->subscribe_sid_beacon_val = + (aidl_request1.configParams.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | + (aidl_request1.configParams.numberOfSubscribeServiceIdsInBeacon << 1); + legacy_request->config_rssi_window_size = 1; + legacy_request->rssi_window_size_val = aidl_request1.configParams.rssiWindowSize; + legacy_request->config_disc_mac_addr_randomization = 1; + legacy_request->disc_mac_addr_rand_interval_sec = + aidl_request1.configParams.macAddressRandomizationIntervalSec; + legacy_request->config_2dot4g_rssi_close = 1; + if (aidl_request1.configParams.bandSpecificConfig.size() != 3) { + LOG(ERROR) << "convertAidlNanEnableRequestToLegacy: " + "bandSpecificConfig.size() != 3"; + return false; + } + legacy_request->rssi_close_2dot4g_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .rssiClose; + legacy_request->config_2dot4g_rssi_middle = 1; + legacy_request->rssi_middle_2dot4g_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .rssiMiddle; + legacy_request->config_2dot4g_rssi_proximity = 1; + legacy_request->rssi_proximity_2dot4g_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .rssiCloseProximity; + legacy_request->config_scan_params = 1; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .scanPeriodSec; + legacy_request->config_dw.config_2dot4g_dw_band = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .validDiscoveryWindowIntervalVal; + legacy_request->config_dw.dw_2dot4g_interval_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .discoveryWindowIntervalVal; + legacy_request->config_5g_rssi_close = 1; + legacy_request->rssi_close_5g_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiClose; + legacy_request->config_5g_rssi_middle = 1; + legacy_request->rssi_middle_5g_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiMiddle; + legacy_request->config_5g_rssi_close_proximity = 1; + legacy_request->rssi_close_proximity_5g_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiCloseProximity; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .scanPeriodSec; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .scanPeriodSec; + legacy_request->config_dw.config_5g_dw_band = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .validDiscoveryWindowIntervalVal; + legacy_request->config_dw.dw_5g_interval_val = + aidl_request1.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .discoveryWindowIntervalVal; + if (aidl_request1.debugConfigs.validClusterIdVals) { + legacy_request->cluster_low = aidl_request1.debugConfigs.clusterIdBottomRangeVal; + legacy_request->cluster_high = aidl_request1.debugConfigs.clusterIdTopRangeVal; + } else { // need 'else' since not configurable in legacy HAL + legacy_request->cluster_low = 0x0000; + legacy_request->cluster_high = 0xFFFF; + } + legacy_request->config_intf_addr = aidl_request1.debugConfigs.validIntfAddrVal; + memcpy(legacy_request->intf_addr_val, aidl_request1.debugConfigs.intfAddrVal.data(), 6); + legacy_request->config_oui = aidl_request1.debugConfigs.validOuiVal; + legacy_request->oui_val = aidl_request1.debugConfigs.ouiVal; + legacy_request->config_random_factor_force = + aidl_request1.debugConfigs.validRandomFactorForceVal; + legacy_request->random_factor_force_val = aidl_request1.debugConfigs.randomFactorForceVal; + legacy_request->config_hop_count_force = aidl_request1.debugConfigs.validHopCountForceVal; + legacy_request->hop_count_force_val = aidl_request1.debugConfigs.hopCountForceVal; + legacy_request->config_24g_channel = aidl_request1.debugConfigs.validDiscoveryChannelVal; + legacy_request->channel_24g_val = + aidl_request1.debugConfigs.discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_5g_channel = aidl_request1.debugConfigs.validDiscoveryChannelVal; + legacy_request->channel_5g_val = + aidl_request1.debugConfigs.discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + legacy_request->config_2dot4g_beacons = aidl_request1.debugConfigs.validUseBeaconsInBandVal; + legacy_request->beacon_2dot4g_val = + aidl_request1.debugConfigs.useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_5g_beacons = aidl_request1.debugConfigs.validUseBeaconsInBandVal; + legacy_request->beacon_5g_val = + aidl_request1.debugConfigs.useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + legacy_request->config_2dot4g_sdf = aidl_request1.debugConfigs.validUseSdfInBandVal; + legacy_request->sdf_2dot4g_val = + aidl_request1.debugConfigs.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_5g_sdf = aidl_request1.debugConfigs.validUseSdfInBandVal; + legacy_request->sdf_5g_val = + aidl_request1.debugConfigs.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + + legacy_request->config_discovery_beacon_int = 1; + legacy_request->discovery_beacon_interval = aidl_request2.discoveryBeaconIntervalMs; + legacy_request->config_nss = 1; + legacy_request->nss = aidl_request2.numberOfSpatialStreamsInDiscovery; + legacy_request->config_dw_early_termination = 1; + legacy_request->enable_dw_termination = aidl_request2.enableDiscoveryWindowEarlyTermination; + legacy_request->config_enable_ranging = 1; + legacy_request->enable_ranging = aidl_request2.enableRanging; + + legacy_request->config_enable_instant_mode = 1; + legacy_request->enable_instant_mode = aidl_request2.enableInstantCommunicationMode; + legacy_request->config_instant_mode_channel = 1; + legacy_request->instant_mode_channel = aidl_request2.instantModeChannel; + + return true; +} + +bool convertAidlNanConfigRequestToLegacy(const NanConfigRequest& aidl_request1, + const NanConfigRequestSupplemental& aidl_request2, + legacy_hal::NanConfigRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanConfigRequestToLegacy: null legacy_request"; + return false; + } + *legacy_request = {}; + + legacy_request->master_pref = aidl_request1.masterPref; + legacy_request->discovery_indication_cfg = 0; + legacy_request->discovery_indication_cfg |= + aidl_request1.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; + legacy_request->discovery_indication_cfg |= + aidl_request1.disableStartedClusterIndication ? 0x2 : 0x0; + legacy_request->discovery_indication_cfg |= + aidl_request1.disableJoinedClusterIndication ? 0x4 : 0x0; + legacy_request->config_sid_beacon = 1; + if (aidl_request1.numberOfPublishServiceIdsInBeacon < 0) { + LOG(ERROR) << "convertAidlNanConfigRequestToLegacy: " + "numberOfPublishServiceIdsInBeacon < 0"; + return false; + } + legacy_request->sid_beacon = (aidl_request1.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | + (aidl_request1.numberOfPublishServiceIdsInBeacon << 1); + legacy_request->config_subscribe_sid_beacon = 1; + if (aidl_request1.numberOfSubscribeServiceIdsInBeacon < 0) { + LOG(ERROR) << "convertAidlNanConfigRequestToLegacy: " + "numberOfSubscribeServiceIdsInBeacon < 0"; + return false; + } + legacy_request->subscribe_sid_beacon_val = + (aidl_request1.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | + (aidl_request1.numberOfSubscribeServiceIdsInBeacon << 1); + legacy_request->config_rssi_window_size = 1; + legacy_request->rssi_window_size_val = aidl_request1.rssiWindowSize; + legacy_request->config_disc_mac_addr_randomization = 1; + legacy_request->disc_mac_addr_rand_interval_sec = + aidl_request1.macAddressRandomizationIntervalSec; + + legacy_request->config_scan_params = 1; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec; + legacy_request->config_dw.config_2dot4g_dw_band = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .validDiscoveryWindowIntervalVal; + legacy_request->config_dw.dw_2dot4g_interval_val = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .discoveryWindowIntervalVal; + + legacy_request->config_5g_rssi_close_proximity = 1; + legacy_request->rssi_close_proximity_5g_val = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiCloseProximity; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec; + legacy_request->config_dw.config_5g_dw_band = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .validDiscoveryWindowIntervalVal; + legacy_request->config_dw.dw_5g_interval_val = + aidl_request1.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .discoveryWindowIntervalVal; + + legacy_request->config_discovery_beacon_int = 1; + legacy_request->discovery_beacon_interval = aidl_request2.discoveryBeaconIntervalMs; + legacy_request->config_nss = 1; + legacy_request->nss = aidl_request2.numberOfSpatialStreamsInDiscovery; + legacy_request->config_dw_early_termination = 1; + legacy_request->enable_dw_termination = aidl_request2.enableDiscoveryWindowEarlyTermination; + legacy_request->config_enable_ranging = 1; + legacy_request->enable_ranging = aidl_request2.enableRanging; + + legacy_request->config_enable_instant_mode = 1; + legacy_request->enable_instant_mode = aidl_request2.enableInstantCommunicationMode; + legacy_request->config_instant_mode_channel = 1; + legacy_request->instant_mode_channel = aidl_request2.instantModeChannel; + legacy_request->config_cluster_id = 1; + legacy_request->cluster_id_val = aidl_request2.clusterId; + + return true; +} + +bool convertAidlNanPublishRequestToLegacy(const NanPublishRequest& aidl_request, + legacy_hal::NanPublishRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: null legacy_request"; + return false; + } + *legacy_request = {}; + + legacy_request->publish_id = static_cast(aidl_request.baseConfigs.sessionId); + legacy_request->ttl = aidl_request.baseConfigs.ttlSec; + legacy_request->period = aidl_request.baseConfigs.discoveryWindowPeriod; + legacy_request->publish_count = aidl_request.baseConfigs.discoveryCount; + legacy_request->service_name_len = aidl_request.baseConfigs.serviceName.size(); + if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: service_name_len " + "too large"; + return false; + } + memcpy(legacy_request->service_name, aidl_request.baseConfigs.serviceName.data(), + legacy_request->service_name_len); + legacy_request->publish_match_indicator = + convertAidlNanMatchAlgToLegacy(aidl_request.baseConfigs.discoveryMatchIndicator); + legacy_request->service_specific_info_len = aidl_request.baseConfigs.serviceSpecificInfo.size(); + if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: " + "service_specific_info_len too large"; + return false; + } + memcpy(legacy_request->service_specific_info, + aidl_request.baseConfigs.serviceSpecificInfo.data(), + legacy_request->service_specific_info_len); + legacy_request->sdea_service_specific_info_len = + aidl_request.baseConfigs.extendedServiceSpecificInfo.size(); + if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: " + "sdea_service_specific_info_len too large"; + return false; + } + memcpy(legacy_request->sdea_service_specific_info, + aidl_request.baseConfigs.extendedServiceSpecificInfo.data(), + legacy_request->sdea_service_specific_info_len); + legacy_request->rx_match_filter_len = aidl_request.baseConfigs.rxMatchFilter.size(); + if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: " + "rx_match_filter_len too large"; + return false; + } + memcpy(legacy_request->rx_match_filter, aidl_request.baseConfigs.rxMatchFilter.data(), + legacy_request->rx_match_filter_len); + legacy_request->tx_match_filter_len = aidl_request.baseConfigs.txMatchFilter.size(); + if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: " + "tx_match_filter_len too large"; + return false; + } + memcpy(legacy_request->tx_match_filter, aidl_request.baseConfigs.txMatchFilter.data(), + legacy_request->tx_match_filter_len); + legacy_request->rssi_threshold_flag = aidl_request.baseConfigs.useRssiThreshold; + legacy_request->recv_indication_cfg = 0; + legacy_request->recv_indication_cfg |= + aidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0; + legacy_request->recv_indication_cfg |= + aidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; + legacy_request->recv_indication_cfg |= + aidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; + legacy_request->recv_indication_cfg |= 0x8; + legacy_request->cipher_type = (unsigned int)aidl_request.baseConfigs.securityConfig.cipherType; + + legacy_request->scid_len = aidl_request.baseConfigs.securityConfig.scid.size(); + if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: scid_len too large"; + return false; + } + memcpy(legacy_request->scid, aidl_request.baseConfigs.securityConfig.scid.data(), + legacy_request->scid_len); + + if (aidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = + aidl_request.baseConfigs.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, + aidl_request.baseConfigs.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (aidl_request.baseConfigs.securityConfig.securityType == + NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + aidl_request.baseConfigs.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + aidl_request.baseConfigs.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + legacy_request->sdea_params.security_cfg = + (aidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + + legacy_request->sdea_params.ranging_state = aidl_request.baseConfigs.rangingRequired + ? legacy_hal::NAN_RANGING_ENABLE + : legacy_hal::NAN_RANGING_DISABLE; + legacy_request->ranging_cfg.ranging_interval_msec = aidl_request.baseConfigs.rangingIntervalMs; + legacy_request->ranging_cfg.config_ranging_indications = + aidl_request.baseConfigs.configRangingIndications; + legacy_request->ranging_cfg.distance_ingress_mm = + aidl_request.baseConfigs.distanceIngressCm * 10; + legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10; + 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->publish_type = convertAidlNanPublishTypeToLegacy(aidl_request.publishType); + legacy_request->tx_type = convertAidlNanTxTypeToLegacy(aidl_request.txType); + legacy_request->service_responder_policy = aidl_request.autoAcceptDataPathRequests + ? legacy_hal::NAN_SERVICE_ACCEPT_POLICY_ALL + : legacy_hal::NAN_SERVICE_ACCEPT_POLICY_NONE; + memcpy(legacy_request->nan_identity_key, aidl_request.identityKey.data(), NAN_IDENTITY_KEY_LEN); + if (!covertAidlPairingConfigToLegacy(aidl_request.pairingConfig, + &legacy_request->nan_pairing_config)) { + LOG(ERROR) << "convertAidlNanPublishRequestToLegacy: invalid pairing config"; + return false; + } + legacy_request->enable_suspendability = aidl_request.baseConfigs.enableSessionSuspendability; + + return true; +} + +bool convertAidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& aidl_request, + legacy_hal::NanSubscribeRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->subscribe_id = static_cast(aidl_request.baseConfigs.sessionId); + legacy_request->ttl = aidl_request.baseConfigs.ttlSec; + legacy_request->period = aidl_request.baseConfigs.discoveryWindowPeriod; + legacy_request->subscribe_count = aidl_request.baseConfigs.discoveryCount; + legacy_request->service_name_len = aidl_request.baseConfigs.serviceName.size(); + if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "service_name_len too large"; + return false; + } + memcpy(legacy_request->service_name, aidl_request.baseConfigs.serviceName.data(), + legacy_request->service_name_len); + legacy_request->subscribe_match_indicator = + convertAidlNanMatchAlgToLegacy(aidl_request.baseConfigs.discoveryMatchIndicator); + legacy_request->service_specific_info_len = aidl_request.baseConfigs.serviceSpecificInfo.size(); + if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "service_specific_info_len too large"; + return false; + } + memcpy(legacy_request->service_specific_info, + aidl_request.baseConfigs.serviceSpecificInfo.data(), + legacy_request->service_specific_info_len); + legacy_request->sdea_service_specific_info_len = + aidl_request.baseConfigs.extendedServiceSpecificInfo.size(); + if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "sdea_service_specific_info_len too large"; + return false; + } + memcpy(legacy_request->sdea_service_specific_info, + aidl_request.baseConfigs.extendedServiceSpecificInfo.data(), + legacy_request->sdea_service_specific_info_len); + legacy_request->rx_match_filter_len = aidl_request.baseConfigs.rxMatchFilter.size(); + if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "rx_match_filter_len too large"; + return false; + } + memcpy(legacy_request->rx_match_filter, aidl_request.baseConfigs.rxMatchFilter.data(), + legacy_request->rx_match_filter_len); + legacy_request->tx_match_filter_len = aidl_request.baseConfigs.txMatchFilter.size(); + if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "tx_match_filter_len too large"; + return false; + } + memcpy(legacy_request->tx_match_filter, aidl_request.baseConfigs.txMatchFilter.data(), + legacy_request->tx_match_filter_len); + legacy_request->rssi_threshold_flag = aidl_request.baseConfigs.useRssiThreshold; + legacy_request->recv_indication_cfg = 0; + legacy_request->recv_indication_cfg |= + aidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0; + legacy_request->recv_indication_cfg |= + aidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; + legacy_request->recv_indication_cfg |= + aidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; + legacy_request->cipher_type = (unsigned int)aidl_request.baseConfigs.securityConfig.cipherType; + if (aidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = + aidl_request.baseConfigs.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, + aidl_request.baseConfigs.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (aidl_request.baseConfigs.securityConfig.securityType == + NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + aidl_request.baseConfigs.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + aidl_request.baseConfigs.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + legacy_request->sdea_params.security_cfg = + (aidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->sdea_params.ranging_state = aidl_request.baseConfigs.rangingRequired + ? legacy_hal::NAN_RANGING_ENABLE + : legacy_hal::NAN_RANGING_DISABLE; + legacy_request->ranging_cfg.ranging_interval_msec = aidl_request.baseConfigs.rangingIntervalMs; + legacy_request->ranging_cfg.config_ranging_indications = + aidl_request.baseConfigs.configRangingIndications; + legacy_request->ranging_cfg.distance_ingress_mm = + aidl_request.baseConfigs.distanceIngressCm * 10; + legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10; + 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->subscribe_type = + convertAidlNanSubscribeTypeToLegacy(aidl_request.subscribeType); + legacy_request->serviceResponseFilter = convertAidlNanSrfTypeToLegacy(aidl_request.srfType); + legacy_request->serviceResponseInclude = aidl_request.srfRespondIfInAddressSet + ? legacy_hal::NAN_SRF_INCLUDE_RESPOND + : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND; + legacy_request->useServiceResponseFilter = + aidl_request.shouldUseSrf ? legacy_hal::NAN_USE_SRF : legacy_hal::NAN_DO_NOT_USE_SRF; + legacy_request->ssiRequiredForMatchIndication = + aidl_request.isSsiRequiredForMatch ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND + : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND; + legacy_request->num_intf_addr_present = aidl_request.intfAddr.size(); + if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: " + "num_intf_addr_present - too many"; + return false; + } + for (int i = 0; i < legacy_request->num_intf_addr_present; i++) { + memcpy(legacy_request->intf_addr[i], aidl_request.intfAddr[i].data.data(), 6); + } + memcpy(legacy_request->nan_identity_key, aidl_request.identityKey.data(), NAN_IDENTITY_KEY_LEN); + if (!covertAidlPairingConfigToLegacy(aidl_request.pairingConfig, + &legacy_request->nan_pairing_config)) { + LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: invalid pairing config"; + return false; + } + legacy_request->enable_suspendability = aidl_request.baseConfigs.enableSessionSuspendability; + + return true; +} + +bool convertAidlNanTransmitFollowupRequestToLegacy( + const NanTransmitFollowupRequest& aidl_request, + legacy_hal::NanTransmitFollowupRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanTransmitFollowupRequestToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); + legacy_request->requestor_instance_id = aidl_request.peerId; + memcpy(legacy_request->addr, aidl_request.addr.data(), 6); + legacy_request->priority = aidl_request.isHighPriority ? legacy_hal::NAN_TX_PRIORITY_HIGH + : legacy_hal::NAN_TX_PRIORITY_NORMAL; + legacy_request->dw_or_faw = aidl_request.shouldUseDiscoveryWindow + ? legacy_hal::NAN_TRANSMIT_IN_DW + : legacy_hal::NAN_TRANSMIT_IN_FAW; + legacy_request->service_specific_info_len = aidl_request.serviceSpecificInfo.size(); + if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { + LOG(ERROR) << "convertAidlNanTransmitFollowupRequestToLegacy: " + "service_specific_info_len too large"; + return false; + } + memcpy(legacy_request->service_specific_info, aidl_request.serviceSpecificInfo.data(), + legacy_request->service_specific_info_len); + legacy_request->sdea_service_specific_info_len = + aidl_request.extendedServiceSpecificInfo.size(); + if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { + LOG(ERROR) << "convertAidlNanTransmitFollowupRequestToLegacy: " + "sdea_service_specific_info_len too large"; + return false; + } + memcpy(legacy_request->sdea_service_specific_info, + aidl_request.extendedServiceSpecificInfo.data(), + legacy_request->sdea_service_specific_info_len); + legacy_request->recv_indication_cfg = aidl_request.disableFollowupResultIndication ? 0x1 : 0x0; + + return true; +} + +bool convertAidlNanDataPathInitiatorRequestToLegacy( + const NanInitiateDataPathRequest& aidl_request, + legacy_hal::NanDataPathInitiatorRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->requestor_instance_id = aidl_request.peerId; + memcpy(legacy_request->peer_disc_mac_addr, aidl_request.peerDiscMacAddr.data(), 6); + legacy_request->channel_request_type = + convertAidlNanDataPathChannelCfgToLegacy(aidl_request.channelRequestType); + legacy_request->channel = aidl_request.channel; + if (strnlen(aidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "ifaceName too long"; + return false; + } + strlcpy(legacy_request->ndp_iface, aidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + legacy_request->ndp_cfg.security_cfg = + (aidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->app_info.ndp_app_info_len = aidl_request.appInfo.size(); + if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "ndp_app_info_len too large"; + return false; + } + memcpy(legacy_request->app_info.ndp_app_info, aidl_request.appInfo.data(), + legacy_request->app_info.ndp_app_info_len); + legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType; + if (aidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = aidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, aidl_request.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (aidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + aidl_request.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + aidl_request.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + legacy_request->service_name_len = aidl_request.serviceNameOutOfBand.size(); + if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: " + "service_name_len too large"; + return false; + } + memcpy(legacy_request->service_name, aidl_request.serviceNameOutOfBand.data(), + legacy_request->service_name_len); + legacy_request->scid_len = aidl_request.securityConfig.scid.size(); + if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { + LOG(ERROR) << "convertAidlNanDataPathInitiatorRequestToLegacy: scid_len too large"; + return false; + } + memcpy(legacy_request->scid, aidl_request.securityConfig.scid.data(), legacy_request->scid_len); + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); + + return true; +} + +bool convertAidlNanDataPathIndicationResponseToLegacy( + const NanRespondToDataPathIndicationRequest& aidl_request, + legacy_hal::NanDataPathIndicationResponse* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->rsp_code = aidl_request.acceptRequest ? legacy_hal::NAN_DP_REQUEST_ACCEPT + : legacy_hal::NAN_DP_REQUEST_REJECT; + legacy_request->ndp_instance_id = aidl_request.ndpInstanceId; + if (strnlen(aidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "ifaceName too long"; + return false; + } + strlcpy(legacy_request->ndp_iface, aidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + legacy_request->ndp_cfg.security_cfg = + (aidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->app_info.ndp_app_info_len = aidl_request.appInfo.size(); + if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "ndp_app_info_len too large"; + return false; + } + memcpy(legacy_request->app_info.ndp_app_info, aidl_request.appInfo.data(), + legacy_request->app_info.ndp_app_info_len); + legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType; + if (aidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = aidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, aidl_request.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (aidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + aidl_request.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + aidl_request.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + legacy_request->service_name_len = aidl_request.serviceNameOutOfBand.size(); + if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: " + "service_name_len too large"; + return false; + } + memcpy(legacy_request->service_name, aidl_request.serviceNameOutOfBand.data(), + legacy_request->service_name_len); + legacy_request->scid_len = aidl_request.securityConfig.scid.size(); + if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { + LOG(ERROR) << "convertAidlNanDataPathIndicationResponseToLegacy: scid_len too large"; + return false; + } + memcpy(legacy_request->scid, aidl_request.securityConfig.scid.data(), legacy_request->scid_len); + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); + + return true; +} + +bool convertLegacyNanResponseHeaderToAidl(const legacy_hal::NanResponseMsg& legacy_response, + NanStatus* nanStatus) { + if (!nanStatus) { + LOG(ERROR) << "convertLegacyNanResponseHeaderToAidl: nanStatus is null"; + return false; + } + *nanStatus = {}; + + convertToNanStatus(legacy_response.status, legacy_response.nan_error, + sizeof(legacy_response.nan_error), nanStatus); + return true; +} + +bool convertLegacyNanCapabilitiesResponseToAidl(const legacy_hal::NanCapabilities& legacy_response, + NanCapabilities* aidl_response) { + if (!aidl_response) { + LOG(ERROR) << "convertLegacyNanCapabilitiesResponseToAidl: " + "aidl_response is null"; + return false; + } + *aidl_response = {}; + + aidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters; + aidl_response->maxPublishes = legacy_response.max_publishes; + aidl_response->maxSubscribes = legacy_response.max_subscribes; + aidl_response->maxServiceNameLen = legacy_response.max_service_name_len; + aidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len; + aidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len; + aidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len; + aidl_response->maxExtendedServiceSpecificInfoLen = + legacy_response.max_sdea_service_specific_info_len; + aidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces; + aidl_response->maxNdpSessions = legacy_response.max_ndp_sessions; + aidl_response->maxAppInfoLen = legacy_response.max_app_info_len; + aidl_response->maxQueuedTransmitFollowupMsgs = + legacy_response.max_queued_transmit_followup_msgs; + aidl_response->maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address; + aidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported; + aidl_response->instantCommunicationModeSupportFlag = legacy_response.is_instant_mode_supported; + aidl_response->supports6g = legacy_response.is_6g_supported; + aidl_response->supportsHe = legacy_response.is_he_supported; + 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; + + return true; +} + +bool convertLegacyNanMatchIndToAidl(const legacy_hal::NanMatchInd& legacy_ind, + NanMatchInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanMatchIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; + aidl_ind->peerId = legacy_ind.requestor_instance_id; + aidl_ind->addr = std::array(); + std::copy(legacy_ind.addr, legacy_ind.addr + 6, std::begin(aidl_ind->addr)); + aidl_ind->serviceSpecificInfo = std::vector( + legacy_ind.service_specific_info, + legacy_ind.service_specific_info + legacy_ind.service_specific_info_len); + aidl_ind->extendedServiceSpecificInfo = std::vector( + legacy_ind.sdea_service_specific_info, + legacy_ind.sdea_service_specific_info + legacy_ind.sdea_service_specific_info_len); + aidl_ind->matchFilter = + std::vector(legacy_ind.sdf_match_filter, + legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len); + aidl_ind->matchOccurredInBeaconFlag = legacy_ind.match_occured_flag == 1; // NOTYPO + aidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1; + aidl_ind->rssiValue = legacy_ind.rssi_value; + aidl_ind->peerCipherType = (NanCipherSuiteType)legacy_ind.peer_cipher_type; + aidl_ind->peerRequiresSecurityEnabledInNdp = + legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; + aidl_ind->peerRequiresRanging = + legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE; + aidl_ind->rangingMeasurementInMm = legacy_ind.range_info.range_measurement_mm; + aidl_ind->rangingIndicationType = legacy_ind.range_info.ranging_event_type; + aidl_ind->scid = std::vector(legacy_ind.scid, legacy_ind.scid + legacy_ind.scid_len); + + if (!convertLegacyNiraToAidl(legacy_ind.nira, &aidl_ind->peerNira)) { + LOG(ERROR) << "convertLegacyNanMatchIndToAidl: invalid NIRA"; + return false; + } + if (!convertLegacyPairingConfigToAidl(legacy_ind.peer_pairing_config, + &aidl_ind->peerPairingConfig)) { + LOG(ERROR) << "convertLegacyNanMatchIndToAidl: invalid pairing config"; + return false; + } + return true; +} + +bool convertLegacyNanFollowupIndToAidl(const legacy_hal::NanFollowupInd& legacy_ind, + NanFollowupReceivedInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanFollowupIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; + aidl_ind->peerId = legacy_ind.requestor_instance_id; + aidl_ind->addr = std::array(); + std::copy(legacy_ind.addr, legacy_ind.addr + 6, std::begin(aidl_ind->addr)); + aidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1; + aidl_ind->serviceSpecificInfo = std::vector( + legacy_ind.service_specific_info, + legacy_ind.service_specific_info + legacy_ind.service_specific_info_len); + aidl_ind->extendedServiceSpecificInfo = std::vector( + legacy_ind.sdea_service_specific_info, + legacy_ind.sdea_service_specific_info + legacy_ind.sdea_service_specific_info_len); + + return true; +} + +bool convertLegacyNanDataPathRequestIndToAidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, + NanDataPathRequestInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanDataPathRequestIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->discoverySessionId = legacy_ind.service_instance_id; + aidl_ind->peerDiscMacAddr = std::array(); + std::copy(legacy_ind.peer_disc_mac_addr, legacy_ind.peer_disc_mac_addr + 6, + std::begin(aidl_ind->peerDiscMacAddr)); + aidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id; + aidl_ind->securityRequired = + legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; + aidl_ind->appInfo = std::vector( + legacy_ind.app_info.ndp_app_info, + legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len); + + return true; +} + +bool convertLegacyNdpChannelInfoToAidl(const legacy_hal::NanChannelInfo& legacy_struct, + NanDataPathChannelInfo* aidl_struct) { + if (!aidl_struct) { + LOG(ERROR) << "convertLegacyNdpChannelInfoToAidl: aidl_struct is null"; + return false; + } + *aidl_struct = {}; + + aidl_struct->channelFreq = legacy_struct.channel; + aidl_struct->channelBandwidth = convertLegacyWifiChannelWidthToAidl( + (legacy_hal::wifi_channel_width)legacy_struct.bandwidth); + aidl_struct->numSpatialStreams = legacy_struct.nss; + + return true; +} + +bool convertLegacyNanDataPathConfirmIndToAidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, + NanDataPathConfirmInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id; + aidl_ind->dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT; + aidl_ind->peerNdiMacAddr = std::array(); + std::copy(legacy_ind.peer_ndi_mac_addr, legacy_ind.peer_ndi_mac_addr + 6, + std::begin(aidl_ind->peerNdiMacAddr)); + aidl_ind->appInfo = std::vector( + legacy_ind.app_info.ndp_app_info, + legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len); + aidl_ind->status.status = convertLegacyNanStatusTypeToAidl(legacy_ind.reason_code); + aidl_ind->status.description = ""; + + std::vector channelInfo; + for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { + NanDataPathChannelInfo aidl_struct; + if (!convertLegacyNdpChannelInfoToAidl(legacy_ind.channel_info[i], &aidl_struct)) { + return false; + } + channelInfo.push_back(aidl_struct); + } + aidl_ind->channelInfo = channelInfo; + + return true; +} + +bool convertLegacyNanDataPathScheduleUpdateIndToAidl( + const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, + NanDataPathScheduleUpdateInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToAidl: " + "aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->peerDiscoveryAddress = std::array(); + std::copy(legacy_ind.peer_mac_addr, legacy_ind.peer_mac_addr + 6, + std::begin(aidl_ind->peerDiscoveryAddress)); + std::vector channelInfo; + for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { + NanDataPathChannelInfo aidl_struct; + if (!convertLegacyNdpChannelInfoToAidl(legacy_ind.channel_info[i], &aidl_struct)) { + return false; + } + channelInfo.push_back(aidl_struct); + } + aidl_ind->channelInfo = channelInfo; + std::vector ndpInstanceIds; + for (unsigned int i = 0; i < legacy_ind.num_ndp_instances; ++i) { + ndpInstanceIds.push_back(legacy_ind.ndp_instance_id[i]); + } + aidl_ind->ndpInstanceIds = uintToIntVec(ndpInstanceIds); + + return true; +} + +legacy_hal::wifi_rtt_type convertAidlRttTypeToLegacy(RttType type) { + switch (type) { + case RttType::ONE_SIDED: + return legacy_hal::RTT_TYPE_1_SIDED; + case RttType::TWO_SIDED: + return legacy_hal::RTT_TYPE_2_SIDED; + }; + CHECK(false); +} + +RttType convertLegacyRttTypeToAidl(legacy_hal::wifi_rtt_type type) { + switch (type) { + case legacy_hal::RTT_TYPE_1_SIDED: + return RttType::ONE_SIDED; + case legacy_hal::RTT_TYPE_2_SIDED: + return RttType::TWO_SIDED; + }; + CHECK(false) << "Unknown legacy type: " << type; +} + +legacy_hal::rtt_peer_type convertAidlRttPeerTypeToLegacy(RttPeerType type) { + switch (type) { + case RttPeerType::AP: + return legacy_hal::RTT_PEER_AP; + case RttPeerType::STA: + return legacy_hal::RTT_PEER_STA; + case RttPeerType::P2P_GO: + return legacy_hal::RTT_PEER_P2P_GO; + case RttPeerType::P2P_CLIENT: + return legacy_hal::RTT_PEER_P2P_CLIENT; + case RttPeerType::NAN_TYPE: + return legacy_hal::RTT_PEER_NAN; + }; + CHECK(false); +} + +legacy_hal::wifi_channel_width convertAidlWifiChannelWidthToLegacy(WifiChannelWidthInMhz type) { + switch (type) { + case WifiChannelWidthInMhz::WIDTH_20: + return legacy_hal::WIFI_CHAN_WIDTH_20; + case WifiChannelWidthInMhz::WIDTH_40: + return legacy_hal::WIFI_CHAN_WIDTH_40; + case WifiChannelWidthInMhz::WIDTH_80: + return legacy_hal::WIFI_CHAN_WIDTH_80; + case WifiChannelWidthInMhz::WIDTH_160: + return legacy_hal::WIFI_CHAN_WIDTH_160; + case WifiChannelWidthInMhz::WIDTH_80P80: + return legacy_hal::WIFI_CHAN_WIDTH_80P80; + case WifiChannelWidthInMhz::WIDTH_5: + return legacy_hal::WIFI_CHAN_WIDTH_5; + case WifiChannelWidthInMhz::WIDTH_10: + return legacy_hal::WIFI_CHAN_WIDTH_10; + case WifiChannelWidthInMhz::WIDTH_320: + return legacy_hal::WIFI_CHAN_WIDTH_320; + case WifiChannelWidthInMhz::WIDTH_INVALID: + return legacy_hal::WIFI_CHAN_WIDTH_INVALID; + }; + CHECK(false); +} + +WifiChannelWidthInMhz convertLegacyWifiChannelWidthToAidl(legacy_hal::wifi_channel_width type) { + switch (type) { + case legacy_hal::WIFI_CHAN_WIDTH_20: + return WifiChannelWidthInMhz::WIDTH_20; + case legacy_hal::WIFI_CHAN_WIDTH_40: + return WifiChannelWidthInMhz::WIDTH_40; + case legacy_hal::WIFI_CHAN_WIDTH_80: + return WifiChannelWidthInMhz::WIDTH_80; + case legacy_hal::WIFI_CHAN_WIDTH_160: + return WifiChannelWidthInMhz::WIDTH_160; + case legacy_hal::WIFI_CHAN_WIDTH_80P80: + return WifiChannelWidthInMhz::WIDTH_80P80; + case legacy_hal::WIFI_CHAN_WIDTH_5: + return WifiChannelWidthInMhz::WIDTH_5; + case legacy_hal::WIFI_CHAN_WIDTH_10: + return WifiChannelWidthInMhz::WIDTH_10; + case legacy_hal::WIFI_CHAN_WIDTH_320: + return WifiChannelWidthInMhz::WIDTH_320; + default: + return WifiChannelWidthInMhz::WIDTH_INVALID; + }; +} + +legacy_hal::wifi_rtt_preamble convertAidlRttPreambleToLegacy(RttPreamble type) { + switch (type) { + case RttPreamble::LEGACY: + return legacy_hal::WIFI_RTT_PREAMBLE_LEGACY; + case RttPreamble::HT: + return legacy_hal::WIFI_RTT_PREAMBLE_HT; + case RttPreamble::VHT: + return legacy_hal::WIFI_RTT_PREAMBLE_VHT; + case RttPreamble::HE: + return legacy_hal::WIFI_RTT_PREAMBLE_HE; + case RttPreamble::EHT: + return legacy_hal::WIFI_RTT_PREAMBLE_EHT; + }; + CHECK(false); +} + +RttPreamble convertLegacyRttPreambleToAidl(legacy_hal::wifi_rtt_preamble type) { + switch (type) { + case legacy_hal::WIFI_RTT_PREAMBLE_LEGACY: + return RttPreamble::LEGACY; + case legacy_hal::WIFI_RTT_PREAMBLE_HT: + return RttPreamble::HT; + case legacy_hal::WIFI_RTT_PREAMBLE_VHT: + return RttPreamble::VHT; + case legacy_hal::WIFI_RTT_PREAMBLE_HE: + return RttPreamble::HE; + case legacy_hal::WIFI_RTT_PREAMBLE_EHT: + return RttPreamble::EHT; + }; + CHECK(false) << "Unknown legacy type: " << type; +} + +legacy_hal::wifi_rtt_bw convertAidlRttBwToLegacy(RttBw type) { + switch (type) { + case RttBw::BW_5MHZ: + return legacy_hal::WIFI_RTT_BW_5; + case RttBw::BW_10MHZ: + return legacy_hal::WIFI_RTT_BW_10; + case RttBw::BW_20MHZ: + return legacy_hal::WIFI_RTT_BW_20; + case RttBw::BW_40MHZ: + return legacy_hal::WIFI_RTT_BW_40; + case RttBw::BW_80MHZ: + return legacy_hal::WIFI_RTT_BW_80; + case RttBw::BW_160MHZ: + return legacy_hal::WIFI_RTT_BW_160; + case RttBw::BW_320MHZ: + return legacy_hal::WIFI_RTT_BW_320; + case RttBw::BW_UNSPECIFIED: + return legacy_hal::WIFI_RTT_BW_UNSPECIFIED; + }; + CHECK(false); +} + +RttBw convertLegacyRttBwToAidl(legacy_hal::wifi_rtt_bw type) { + switch (type) { + case legacy_hal::WIFI_RTT_BW_5: + return RttBw::BW_5MHZ; + case legacy_hal::WIFI_RTT_BW_10: + return RttBw::BW_10MHZ; + case legacy_hal::WIFI_RTT_BW_20: + return RttBw::BW_20MHZ; + case legacy_hal::WIFI_RTT_BW_40: + return RttBw::BW_40MHZ; + case legacy_hal::WIFI_RTT_BW_80: + return RttBw::BW_80MHZ; + case legacy_hal::WIFI_RTT_BW_160: + return RttBw::BW_160MHZ; + case legacy_hal::WIFI_RTT_BW_320: + return RttBw::BW_320MHZ; + case legacy_hal::WIFI_RTT_BW_UNSPECIFIED: + return RttBw::BW_UNSPECIFIED; + }; + CHECK(false) << "Unknown legacy type: " << type; +} + +legacy_hal::wifi_motion_pattern convertAidlRttMotionPatternToLegacy(RttMotionPattern type) { + switch (type) { + case RttMotionPattern::NOT_EXPECTED: + return legacy_hal::WIFI_MOTION_NOT_EXPECTED; + case RttMotionPattern::EXPECTED: + return legacy_hal::WIFI_MOTION_EXPECTED; + case RttMotionPattern::UNKNOWN: + return legacy_hal::WIFI_MOTION_UNKNOWN; + }; + CHECK(false); +} + +WifiRatePreamble convertLegacyWifiRatePreambleToAidl(uint8_t preamble) { + switch (preamble) { + case 0: + return WifiRatePreamble::OFDM; + case 1: + return WifiRatePreamble::CCK; + case 2: + return WifiRatePreamble::HT; + case 3: + return WifiRatePreamble::VHT; + case 4: + return WifiRatePreamble::HE; + case 5: + return WifiRatePreamble::EHT; + default: + return WifiRatePreamble::RESERVED; + }; + CHECK(false) << "Unknown legacy preamble: " << preamble; +} + +WifiRateNss convertLegacyWifiRateNssToAidl(uint8_t nss) { + switch (nss) { + case 0: + return WifiRateNss::NSS_1x1; + case 1: + return WifiRateNss::NSS_2x2; + case 2: + return WifiRateNss::NSS_3x3; + case 3: + return WifiRateNss::NSS_4x4; + }; + CHECK(false) << "Unknown legacy nss: " << nss; + return {}; +} + +RttStatus convertLegacyRttStatusToAidl(legacy_hal::wifi_rtt_status status) { + switch (status) { + case legacy_hal::RTT_STATUS_SUCCESS: + return RttStatus::SUCCESS; + case legacy_hal::RTT_STATUS_FAILURE: + return RttStatus::FAILURE; + case legacy_hal::RTT_STATUS_FAIL_NO_RSP: + return RttStatus::FAIL_NO_RSP; + case legacy_hal::RTT_STATUS_FAIL_REJECTED: + return RttStatus::FAIL_REJECTED; + case legacy_hal::RTT_STATUS_FAIL_NOT_SCHEDULED_YET: + return RttStatus::FAIL_NOT_SCHEDULED_YET; + case legacy_hal::RTT_STATUS_FAIL_TM_TIMEOUT: + return RttStatus::FAIL_TM_TIMEOUT; + case legacy_hal::RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL: + return RttStatus::FAIL_AP_ON_DIFF_CHANNEL; + case legacy_hal::RTT_STATUS_FAIL_NO_CAPABILITY: + return RttStatus::FAIL_NO_CAPABILITY; + case legacy_hal::RTT_STATUS_ABORTED: + return RttStatus::ABORTED; + case legacy_hal::RTT_STATUS_FAIL_INVALID_TS: + return RttStatus::FAIL_INVALID_TS; + case legacy_hal::RTT_STATUS_FAIL_PROTOCOL: + return RttStatus::FAIL_PROTOCOL; + case legacy_hal::RTT_STATUS_FAIL_SCHEDULE: + return RttStatus::FAIL_SCHEDULE; + case legacy_hal::RTT_STATUS_FAIL_BUSY_TRY_LATER: + return RttStatus::FAIL_BUSY_TRY_LATER; + case legacy_hal::RTT_STATUS_INVALID_REQ: + return RttStatus::INVALID_REQ; + case legacy_hal::RTT_STATUS_NO_WIFI: + return RttStatus::NO_WIFI; + case legacy_hal::RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE: + return RttStatus::FAIL_FTM_PARAM_OVERRIDE; + case legacy_hal::RTT_STATUS_NAN_RANGING_PROTOCOL_FAILURE: + return RttStatus::NAN_RANGING_PROTOCOL_FAILURE; + case legacy_hal::RTT_STATUS_NAN_RANGING_CONCURRENCY_NOT_SUPPORTED: + return RttStatus::NAN_RANGING_CONCURRENCY_NOT_SUPPORTED; + }; + CHECK(false) << "Unknown legacy status: " << status; +} + +bool convertAidlWifiChannelInfoToLegacy(const WifiChannelInfo& aidl_info, + legacy_hal::wifi_channel_info* legacy_info) { + if (!legacy_info) { + return false; + } + *legacy_info = {}; + legacy_info->width = convertAidlWifiChannelWidthToLegacy(aidl_info.width); + legacy_info->center_freq = aidl_info.centerFreq; + legacy_info->center_freq0 = aidl_info.centerFreq0; + legacy_info->center_freq1 = aidl_info.centerFreq1; + return true; +} + +bool convertLegacyWifiChannelInfoToAidl(const legacy_hal::wifi_channel_info& legacy_info, + WifiChannelInfo* aidl_info) { + if (!aidl_info) { + return false; + } + *aidl_info = {}; + aidl_info->width = convertLegacyWifiChannelWidthToAidl(legacy_info.width); + aidl_info->centerFreq = legacy_info.center_freq; + aidl_info->centerFreq0 = legacy_info.center_freq0; + aidl_info->centerFreq1 = legacy_info.center_freq1; + return true; +} + +bool convertAidlRttConfigToLegacy(const RttConfig& aidl_config, + legacy_hal::wifi_rtt_config* legacy_config) { + if (!legacy_config) { + return false; + } + *legacy_config = {}; + CHECK(aidl_config.addr.size() == sizeof(legacy_config->addr)); + memcpy(legacy_config->addr, aidl_config.addr.data(), aidl_config.addr.size()); + legacy_config->type = convertAidlRttTypeToLegacy(aidl_config.type); + legacy_config->peer = convertAidlRttPeerTypeToLegacy(aidl_config.peer); + if (!convertAidlWifiChannelInfoToLegacy(aidl_config.channel, &legacy_config->channel)) { + return false; + } + legacy_config->burst_period = aidl_config.burstPeriod; + legacy_config->num_burst = aidl_config.numBurst; + legacy_config->num_frames_per_burst = aidl_config.numFramesPerBurst; + legacy_config->num_retries_per_rtt_frame = aidl_config.numRetriesPerRttFrame; + legacy_config->num_retries_per_ftmr = aidl_config.numRetriesPerFtmr; + legacy_config->LCI_request = aidl_config.mustRequestLci; + legacy_config->LCR_request = aidl_config.mustRequestLcr; + legacy_config->burst_duration = aidl_config.burstDuration; + legacy_config->preamble = convertAidlRttPreambleToLegacy(aidl_config.preamble); + legacy_config->bw = convertAidlRttBwToLegacy(aidl_config.bw); + return true; +} + +bool convertAidlVectorOfRttConfigToLegacy( + const std::vector& aidl_configs, + std::vector* legacy_configs) { + if (!legacy_configs) { + return false; + } + *legacy_configs = {}; + for (const auto& aidl_config : aidl_configs) { + legacy_hal::wifi_rtt_config legacy_config; + if (!convertAidlRttConfigToLegacy(aidl_config, &legacy_config)) { + return false; + } + legacy_configs->push_back(legacy_config); + } + return true; +} + +bool convertAidlRttLciInformationToLegacy(const RttLciInformation& aidl_info, + legacy_hal::wifi_lci_information* legacy_info) { + if (!legacy_info) { + return false; + } + *legacy_info = {}; + legacy_info->latitude = aidl_info.latitude; + legacy_info->longitude = aidl_info.longitude; + legacy_info->altitude = aidl_info.altitude; + legacy_info->latitude_unc = aidl_info.latitudeUnc; + legacy_info->longitude_unc = aidl_info.longitudeUnc; + legacy_info->altitude_unc = aidl_info.altitudeUnc; + legacy_info->motion_pattern = convertAidlRttMotionPatternToLegacy(aidl_info.motionPattern); + legacy_info->floor = aidl_info.floor; + legacy_info->height_above_floor = aidl_info.heightAboveFloor; + legacy_info->height_unc = aidl_info.heightUnc; + return true; +} + +bool convertAidlRttLcrInformationToLegacy(const RttLcrInformation& aidl_info, + legacy_hal::wifi_lcr_information* legacy_info) { + if (!legacy_info) { + return false; + } + *legacy_info = {}; + CHECK(aidl_info.countryCode.size() == sizeof(legacy_info->country_code)); + memcpy(legacy_info->country_code, aidl_info.countryCode.data(), aidl_info.countryCode.size()); + if (aidl_info.civicInfo.size() > sizeof(legacy_info->civic_info)) { + return false; + } + legacy_info->length = aidl_info.civicInfo.size(); + memcpy(legacy_info->civic_info, aidl_info.civicInfo.c_str(), aidl_info.civicInfo.size()); + return true; +} + +bool convertAidlRttResponderToLegacy(const RttResponder& aidl_responder, + legacy_hal::wifi_rtt_responder* legacy_responder) { + if (!legacy_responder) { + return false; + } + *legacy_responder = {}; + if (!convertAidlWifiChannelInfoToLegacy(aidl_responder.channel, &legacy_responder->channel)) { + return false; + } + legacy_responder->preamble = convertAidlRttPreambleToLegacy(aidl_responder.preamble); + return true; +} + +bool convertLegacyRttResponderToAidl(const legacy_hal::wifi_rtt_responder& legacy_responder, + RttResponder* aidl_responder) { + if (!aidl_responder) { + return false; + } + *aidl_responder = {}; + if (!convertLegacyWifiChannelInfoToAidl(legacy_responder.channel, &aidl_responder->channel)) { + return false; + } + aidl_responder->preamble = convertLegacyRttPreambleToAidl(legacy_responder.preamble); + return true; +} + +bool convertLegacyRttCapabilitiesToAidl( + const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, + RttCapabilities* aidl_capabilities) { + if (!aidl_capabilities) { + return false; + } + *aidl_capabilities = {}; + aidl_capabilities->rttOneSidedSupported = legacy_capabilities.rtt_one_sided_supported; + aidl_capabilities->rttFtmSupported = legacy_capabilities.rtt_ftm_supported; + aidl_capabilities->lciSupported = legacy_capabilities.lci_support; + aidl_capabilities->lcrSupported = legacy_capabilities.lcr_support; + aidl_capabilities->responderSupported = legacy_capabilities.responder_supported; + int32_t preambleSupport = 0; + for (const auto flag : {legacy_hal::WIFI_RTT_PREAMBLE_LEGACY, legacy_hal::WIFI_RTT_PREAMBLE_HT, + legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE, + legacy_hal::WIFI_RTT_PREAMBLE_EHT}) { + if (legacy_capabilities.preamble_support & flag) { + preambleSupport |= static_cast::type>( + convertLegacyRttPreambleToAidl(flag)); + } + } + aidl_capabilities->preambleSupport = static_cast(preambleSupport); + int32_t bwSupport = 0; + for (const auto flag : + {legacy_hal::WIFI_RTT_BW_5, legacy_hal::WIFI_RTT_BW_10, legacy_hal::WIFI_RTT_BW_20, + legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160, + legacy_hal::WIFI_RTT_BW_320}) { + if (legacy_capabilities.bw_support & flag) { + bwSupport |= + static_cast::type>(convertLegacyRttBwToAidl(flag)); + } + } + aidl_capabilities->bwSupport = static_cast(bwSupport); + aidl_capabilities->mcVersion = legacy_capabilities.mc_version; + return true; +} + +bool convertLegacyWifiRateInfoToAidl(const legacy_hal::wifi_rate& legacy_rate, + WifiRateInfo* aidl_rate) { + if (!aidl_rate) { + return false; + } + *aidl_rate = {}; + aidl_rate->preamble = convertLegacyWifiRatePreambleToAidl(legacy_rate.preamble); + aidl_rate->nss = convertLegacyWifiRateNssToAidl(legacy_rate.nss); + aidl_rate->bw = convertLegacyWifiChannelWidthToAidl( + static_cast(legacy_rate.bw)); + aidl_rate->rateMcsIdx = legacy_rate.rateMcsIdx; + aidl_rate->bitRateInKbps = legacy_rate.bitrate; + return true; +} + +bool convertLegacyRttResultToAidl(const legacy_hal::wifi_rtt_result& legacy_result, + RttResult* aidl_result) { + if (!aidl_result) { + return false; + } + *aidl_result = {}; + aidl_result->addr = std::array(); + CHECK(sizeof(legacy_result.addr) == aidl_result->addr.size()); + std::copy(legacy_result.addr, legacy_result.addr + 6, std::begin(aidl_result->addr)); + aidl_result->burstNum = legacy_result.burst_num; + aidl_result->measurementNumber = legacy_result.measurement_number; + aidl_result->successNumber = legacy_result.success_number; + aidl_result->numberPerBurstPeer = legacy_result.number_per_burst_peer; + aidl_result->status = convertLegacyRttStatusToAidl(legacy_result.status); + aidl_result->retryAfterDuration = legacy_result.retry_after_duration; + aidl_result->type = convertLegacyRttTypeToAidl(legacy_result.type); + aidl_result->rssi = legacy_result.rssi; + aidl_result->rssiSpread = legacy_result.rssi_spread; + if (!convertLegacyWifiRateInfoToAidl(legacy_result.tx_rate, &aidl_result->txRate)) { + return false; + } + if (!convertLegacyWifiRateInfoToAidl(legacy_result.rx_rate, &aidl_result->rxRate)) { + return false; + } + aidl_result->rtt = legacy_result.rtt; + aidl_result->rttSd = legacy_result.rtt_sd; + aidl_result->rttSpread = legacy_result.rtt_spread; + aidl_result->distanceInMm = legacy_result.distance_mm; + aidl_result->distanceSdInMm = legacy_result.distance_sd_mm; + aidl_result->distanceSpreadInMm = legacy_result.distance_spread_mm; + aidl_result->timeStampInUs = legacy_result.ts; + aidl_result->burstDurationInMs = legacy_result.burst_duration; + aidl_result->negotiatedBurstNum = legacy_result.negotiated_burst_num; + if (legacy_result.LCI && !convertLegacyIeToAidl(*legacy_result.LCI, &aidl_result->lci)) { + return false; + } + if (legacy_result.LCR && !convertLegacyIeToAidl(*legacy_result.LCR, &aidl_result->lcr)) { + return false; + } + return true; +} + +bool convertLegacyVectorOfRttResultToAidl( + const std::vector& legacy_results, + std::vector* aidl_results) { + if (!aidl_results) { + return false; + } + *aidl_results = {}; + for (const auto legacy_result : legacy_results) { + RttResult aidl_result; + if (!convertLegacyRttResultToAidl(*legacy_result, &aidl_result)) { + return false; + } + aidl_result.channelFreqMHz = 0; + aidl_result.packetBw = RttBw::BW_UNSPECIFIED; + aidl_results->push_back(aidl_result); + } + return true; +} + +bool convertLegacyVectorOfRttResultV2ToAidl( + const std::vector& legacy_results, + std::vector* aidl_results) { + if (!aidl_results) { + return false; + } + *aidl_results = {}; + for (const auto legacy_result : legacy_results) { + RttResult aidl_result; + if (!convertLegacyRttResultToAidl(legacy_result->rtt_result, &aidl_result)) { + return false; + } + aidl_result.channelFreqMHz = + legacy_result->frequency != UNSPECIFIED ? legacy_result->frequency : 0; + aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->packet_bw); + aidl_results->push_back(aidl_result); + } + return true; +} + +legacy_hal::wifi_interface_type convertAidlIfaceTypeToLegacy(IfaceType aidl_interface_type) { + switch (aidl_interface_type) { + case IfaceType::STA: + return legacy_hal::WIFI_INTERFACE_TYPE_STA; + case IfaceType::AP: + return legacy_hal::WIFI_INTERFACE_TYPE_AP; + case IfaceType::P2P: + return legacy_hal::WIFI_INTERFACE_TYPE_P2P; + case IfaceType::NAN_IFACE: + return legacy_hal::WIFI_INTERFACE_TYPE_NAN; + } + CHECK(false); +} + +legacy_hal::wifi_multi_sta_use_case convertAidlMultiStaUseCaseToLegacy( + IWifiChip::MultiStaUseCase use_case) { + switch (use_case) { + case IWifiChip::MultiStaUseCase::DUAL_STA_TRANSIENT_PREFER_PRIMARY: + return legacy_hal::WIFI_DUAL_STA_TRANSIENT_PREFER_PRIMARY; + case IWifiChip::MultiStaUseCase::DUAL_STA_NON_TRANSIENT_UNBIASED: + return legacy_hal::WIFI_DUAL_STA_NON_TRANSIENT_UNBIASED; + } + CHECK(false); +} + +bool convertAidlCoexUnsafeChannelToLegacy( + const IWifiChip::CoexUnsafeChannel& aidl_unsafe_channel, + legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel) { + if (!legacy_unsafe_channel) { + return false; + } + *legacy_unsafe_channel = {}; + switch (aidl_unsafe_channel.band) { + case WifiBand::BAND_24GHZ: + legacy_unsafe_channel->band = legacy_hal::WLAN_MAC_2_4_BAND; + break; + case WifiBand::BAND_5GHZ: + legacy_unsafe_channel->band = legacy_hal::WLAN_MAC_5_0_BAND; + break; + default: + return false; + }; + legacy_unsafe_channel->channel = aidl_unsafe_channel.channel; + legacy_unsafe_channel->power_cap_dbm = aidl_unsafe_channel.powerCapDbm; + return true; +} + +bool convertAidlVectorOfCoexUnsafeChannelToLegacy( + const std::vector& aidl_unsafe_channels, + std::vector* legacy_unsafe_channels) { + if (!legacy_unsafe_channels) { + return false; + } + *legacy_unsafe_channels = {}; + for (const auto& aidl_unsafe_channel : aidl_unsafe_channels) { + legacy_hal::wifi_coex_unsafe_channel legacy_unsafe_channel; + if (!aidl_struct_util::convertAidlCoexUnsafeChannelToLegacy(aidl_unsafe_channel, + &legacy_unsafe_channel)) { + return false; + } + legacy_unsafe_channels->push_back(legacy_unsafe_channel); + } + return true; +} + +WifiAntennaMode convertLegacyAntennaConfigurationToAidl(uint32_t antenna_cfg) { + switch (antenna_cfg) { + case legacy_hal::WIFI_ANTENNA_1X1: + return WifiAntennaMode::WIFI_ANTENNA_MODE_1X1; + case legacy_hal::WIFI_ANTENNA_2X2: + return WifiAntennaMode::WIFI_ANTENNA_MODE_2X2; + case legacy_hal::WIFI_ANTENNA_3X3: + return WifiAntennaMode::WIFI_ANTENNA_MODE_3X3; + case legacy_hal::WIFI_ANTENNA_4X4: + return WifiAntennaMode::WIFI_ANTENNA_MODE_4X4; + default: + return WifiAntennaMode::WIFI_ANTENNA_MODE_UNSPECIFIED; + } +} + +bool convertLegacyWifiRadioConfigurationToAidl( + legacy_hal::wifi_radio_configuration* radio_configuration, + WifiRadioConfiguration* aidl_radio_configuration) { + if (!aidl_radio_configuration) { + return false; + } + *aidl_radio_configuration = {}; + aidl_radio_configuration->bandInfo = + aidl_struct_util::convertLegacyMacBandToAidlWifiBand(radio_configuration->band); + if (aidl_radio_configuration->bandInfo == WifiBand::BAND_UNSPECIFIED) { + LOG(ERROR) << "Unspecified band"; + return false; + } + aidl_radio_configuration->antennaMode = + aidl_struct_util::convertLegacyAntennaConfigurationToAidl( + radio_configuration->antenna_cfg); + return true; +} + +bool convertLegacyRadioCombinationsMatrixToAidl( + legacy_hal::wifi_radio_combination_matrix* legacy_matrix, + std::vector* aidl_combinations) { + if (!aidl_combinations || !legacy_matrix) { + return false; + } + *aidl_combinations = {}; + + int num_combinations = legacy_matrix->num_radio_combinations; + if (!num_combinations) { + LOG(ERROR) << "zero radio combinations"; + return false; + } + wifi_radio_combination* l_radio_combinations_ptr = legacy_matrix->radio_combinations; + for (int i = 0; i < num_combinations; i++) { + int num_configurations = l_radio_combinations_ptr->num_radio_configurations; + WifiRadioCombination radioCombination; + std::vector radio_configurations_vec; + if (!num_configurations) { + LOG(ERROR) << "zero radio configurations"; + return false; + } + for (int j = 0; j < num_configurations; j++) { + WifiRadioConfiguration radioConfiguration; + wifi_radio_configuration* l_radio_configurations_ptr = + &l_radio_combinations_ptr->radio_configurations[j]; + if (!aidl_struct_util::convertLegacyWifiRadioConfigurationToAidl( + l_radio_configurations_ptr, &radioConfiguration)) { + LOG(ERROR) << "Error converting wifi radio configuration"; + return false; + } + radio_configurations_vec.push_back(radioConfiguration); + } + radioCombination.radioConfigurations = radio_configurations_vec; + aidl_combinations->push_back(radioCombination); + l_radio_combinations_ptr = + (wifi_radio_combination*)((u8*)l_radio_combinations_ptr + + sizeof(wifi_radio_combination) + + (sizeof(wifi_radio_configuration) * num_configurations)); + } + return true; +} + +bool convertAidlNanPairingInitiatorRequestToLegacy(const NanPairingRequest& aidl_request, + legacy_hal::NanPairingRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanPairingInitiatorRequestToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->requestor_instance_id = aidl_request.peerId; + memcpy(legacy_request->peer_disc_mac_addr, aidl_request.peerDiscMacAddr.data(), 6); + legacy_request->nan_pairing_request_type = + convertAidlNanPairingRequestTypeToLegacy(aidl_request.requestType); + legacy_request->enable_pairing_cache = aidl_request.enablePairingCache; + + memcpy(legacy_request->nan_identity_key, aidl_request.pairingIdentityKey.data(), + NAN_IDENTITY_KEY_LEN); + + legacy_request->is_opportunistic = + aidl_request.securityConfig.securityType == NanPairingSecurityType::OPPORTUNISTIC ? 1 + : 0; + legacy_request->akm = convertAidlAkmTypeToLegacy(aidl_request.securityConfig.akm); + legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType; + if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = aidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertAidlNanPairingInitiatorRequestToLegacy: " + "invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, aidl_request.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + aidl_request.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanPairingInitiatorRequestToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanPairingInitiatorRequestToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + aidl_request.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + + return true; +} + +bool convertAidlNanPairingIndicationResponseToLegacy( + const NanRespondToPairingIndicationRequest& aidl_request, + legacy_hal::NanPairingIndicationResponse* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanPairingIndicationResponseToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->pairing_instance_id = aidl_request.pairingInstanceId; + legacy_request->nan_pairing_request_type = + convertAidlNanPairingRequestTypeToLegacy(aidl_request.requestType); + legacy_request->enable_pairing_cache = aidl_request.enablePairingCache; + + memcpy(legacy_request->nan_identity_key, aidl_request.pairingIdentityKey.data(), + NAN_IDENTITY_KEY_LEN); + + legacy_request->is_opportunistic = + aidl_request.securityConfig.securityType == NanPairingSecurityType::OPPORTUNISTIC ? 1 + : 0; + legacy_request->akm = convertAidlAkmTypeToLegacy(aidl_request.securityConfig.akm); + legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType; + legacy_request->rsp_code = + aidl_request.acceptRequest ? NAN_PAIRING_REQUEST_ACCEPT : NAN_PAIRING_REQUEST_REJECT; + if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = aidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertAidlNanPairingIndicationResponseToLegacy: " + "invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, aidl_request.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + aidl_request.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanPairingIndicationResponseToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertAidlNanPairingIndicationResponseToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + aidl_request.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + + return true; +} + +bool convertAidlNanBootstrappingInitiatorRequestToLegacy( + const NanBootstrappingRequest& aidl_request, + legacy_hal::NanBootstrappingRequest* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanBootstrappingInitiatorRequestToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->requestor_instance_id = aidl_request.peerId; + memcpy(legacy_request->peer_disc_mac_addr, aidl_request.peerDiscMacAddr.data(), 6); + legacy_request->request_bootstrapping_method = + convertAidlBootstrappingMethodToLegacy(aidl_request.requestBootstrappingMethod); + legacy_request->cookie_length = aidl_request.cookie.size(); + + memcpy(legacy_request->cookie, aidl_request.cookie.data(), legacy_request->cookie_length); + + return true; +} + +bool convertAidlNanBootstrappingIndicationResponseToLegacy( + const NanBootstrappingResponse& aidl_request, + legacy_hal::NanBootstrappingIndicationResponse* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertAidlNanBootstrappingIndicationResponseToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->service_instance_id = aidl_request.bootstrappingInstanceId; + legacy_request->rsp_code = aidl_request.acceptRequest ? NAN_BOOTSTRAPPING_REQUEST_ACCEPT + : NAN_BOOTSTRAPPING_REQUEST_REJECT; + + return true; +} + +bool convertLegacyNanPairingRequestIndToAidl(const legacy_hal::NanPairingRequestInd& legacy_ind, + NanPairingRequestInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanPairingRequestIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; + aidl_ind->peerId = legacy_ind.requestor_instance_id; + aidl_ind->peerDiscMacAddr = std::array(); + std::copy(legacy_ind.peer_disc_mac_addr, legacy_ind.peer_disc_mac_addr + 6, + std::begin(aidl_ind->peerDiscMacAddr)); + aidl_ind->pairingInstanceId = legacy_ind.pairing_instance_id; + aidl_ind->enablePairingCache = legacy_ind.enable_pairing_cache == 1; + aidl_ind->requestType = + convertLegacyNanPairingRequestTypeToAidl(legacy_ind.nan_pairing_request_type); + if (!convertLegacyNiraToAidl(legacy_ind.nira, &aidl_ind->peerNira)) { + return false; + } + return true; +} + +bool convertLegacyNanPairingConfirmIndToAidl(const legacy_hal::NanPairingConfirmInd& legacy_ind, + NanPairingConfirmInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanPairingRequestIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->pairingInstanceId = legacy_ind.pairing_instance_id; + aidl_ind->enablePairingCache = legacy_ind.enable_pairing_cache == 1; + aidl_ind->requestType = + convertLegacyNanPairingRequestTypeToAidl(legacy_ind.nan_pairing_request_type); + aidl_ind->pairingSuccess = legacy_ind.rsp_code == NAN_PAIRING_REQUEST_ACCEPT; + aidl_ind->status.status = convertLegacyNanStatusTypeToAidl(legacy_ind.reason_code); + if (!convertLegacyNpsaToAidl(legacy_ind.npk_security_association, &aidl_ind->npksa)) { + return false; + } + return true; +} + +bool convertLegacyNanBootstrappingRequestIndToAidl( + const legacy_hal::NanBootstrappingRequestInd& legacy_ind, + NanBootstrappingRequestInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanBootstrappingRequestIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; + aidl_ind->peerId = legacy_ind.requestor_instance_id; + aidl_ind->peerDiscMacAddr = std::array(); + std::copy(legacy_ind.peer_disc_mac_addr, legacy_ind.peer_disc_mac_addr + 6, + std::begin(aidl_ind->peerDiscMacAddr)); + aidl_ind->bootstrappingInstanceId = legacy_ind.bootstrapping_instance_id; + aidl_ind->requestBootstrappingMethod = + convertLegacyBootstrappingMethodToAidl(legacy_ind.request_bootstrapping_method); + return true; +} + +bool convertLegacyNanBootstrappingConfirmIndToAidl( + const legacy_hal::NanBootstrappingConfirmInd& legacy_ind, + NanBootstrappingConfirmInd* aidl_ind) { + if (!aidl_ind) { + LOG(ERROR) << "convertLegacyNanBootstrappingConfirmIndToAidl: aidl_ind is null"; + return false; + } + *aidl_ind = {}; + + aidl_ind->bootstrappingInstanceId = legacy_ind.bootstrapping_instance_id; + aidl_ind->responseCode = static_cast(legacy_ind.rsp_code); + aidl_ind->reasonCode.status = convertLegacyNanStatusTypeToAidl(legacy_ind.reason_code); + aidl_ind->comeBackDelay = legacy_ind.come_back_delay; + aidl_ind->cookie = + std::vector(legacy_ind.cookie, legacy_ind.cookie + legacy_ind.cookie_length); + return true; +} + +bool convertLegacyWifiChipCapabilitiesToAidl( + const legacy_hal::wifi_chip_capabilities& legacy_chip_capabilities, + WifiChipCapabilities& aidl_chip_capabilities) { + aidl_chip_capabilities.maxMloStrLinkCount = legacy_chip_capabilities.max_mlo_str_link_count; + aidl_chip_capabilities.maxMloAssociationLinkCount = + legacy_chip_capabilities.max_mlo_association_link_count; + aidl_chip_capabilities.maxConcurrentTdlsSessionCount = + legacy_chip_capabilities.max_concurrent_tdls_session_count; + return true; +} + +uint32_t convertAidlChannelCategoryToLegacy(uint32_t aidl_channel_category_mask) { + uint32_t channel_category_mask = 0; + if (aidl_channel_category_mask & + static_cast(IWifiChip::ChannelCategoryMask::INDOOR_CHANNEL)) { + channel_category_mask |= legacy_hal::WIFI_INDOOR_CHANNEL; + } + if (aidl_channel_category_mask & + static_cast(IWifiChip::ChannelCategoryMask::DFS_CHANNEL)) { + channel_category_mask |= legacy_hal::WIFI_DFS_CHANNEL; + } + return channel_category_mask; +} + +bool convertLegacyIfaceMaskToIfaceConcurrencyType(u32 mask, + std::vector* types) { + if (!mask) return false; + +#ifndef BIT +#define BIT(x) (1 << (x)) +#endif + if (mask & BIT(WIFI_INTERFACE_TYPE_STA)) types->push_back(IfaceConcurrencyType::STA); + if (mask & BIT(WIFI_INTERFACE_TYPE_AP)) types->push_back(IfaceConcurrencyType::AP); + if (mask & BIT(WIFI_INTERFACE_TYPE_AP_BRIDGED)) + types->push_back(IfaceConcurrencyType::AP_BRIDGED); + if (mask & BIT(WIFI_INTERFACE_TYPE_P2P)) types->push_back(IfaceConcurrencyType::P2P); + if (mask & BIT(WIFI_INTERFACE_TYPE_NAN)) types->push_back(IfaceConcurrencyType::NAN_IFACE); + + return true; +} + +bool convertLegacyIfaceCombinationsMatrixToChipMode( + legacy_hal::wifi_iface_concurrency_matrix& legacy_matrix, IWifiChip::ChipMode* chip_mode) { + if (!chip_mode) { + LOG(ERROR) << "chip_mode is null"; + return false; + } + *chip_mode = {}; + + int num_combinations = legacy_matrix.num_iface_combinations; + std::vector driver_Combinations_vec; + if (!num_combinations) { + LOG(ERROR) << "zero iface combinations"; + return false; + } + + for (int i = 0; i < num_combinations; i++) { + IWifiChip::ChipConcurrencyCombination chipComb; + std::vector limits; + wifi_iface_combination* comb = &legacy_matrix.iface_combinations[i]; + if (!comb->num_iface_limits) continue; + for (u32 j = 0; j < comb->num_iface_limits; j++) { + IWifiChip::ChipConcurrencyCombinationLimit chipLimit; + chipLimit.maxIfaces = comb->iface_limits[j].max_limit; + std::vector types; + if (!convertLegacyIfaceMaskToIfaceConcurrencyType(comb->iface_limits[j].iface_mask, + &types)) { + LOG(ERROR) << "Failed to convert from iface_mask:" + << comb->iface_limits[j].iface_mask; + return false; + } + chipLimit.types = types; + limits.push_back(chipLimit); + } + chipComb.limits = limits; + driver_Combinations_vec.push_back(chipComb); + } + + chip_mode->availableCombinations = driver_Combinations_vec; + return true; +} + +} // namespace aidl_struct_util +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h new file mode 100644 index 0000000000..e4ff9638bb --- /dev/null +++ b/wifi/aidl/default/aidl_struct_util.h @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef AIDL_STRUCT_UTIL_H_ +#define AIDL_STRUCT_UTIL_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "wifi_legacy_hal.h" + +/** + * This file contains a bunch of functions to convert structs from the legacy + * HAL to AIDL and vice versa. + */ +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +namespace aidl_struct_util { + +// Chip conversion methods. +bool convertLegacyChipFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* aidl_feature_set); +bool convertLegacyDebugRingBufferStatusToAidl( + const legacy_hal::wifi_ring_buffer_status& legacy_status, + WifiDebugRingBufferStatus* aidl_status); +bool convertLegacyVectorOfDebugRingBufferStatusToAidl( + const std::vector& legacy_status_vec, + std::vector* aidl_status_vec); +bool convertLegacyWakeReasonStatsToAidl(const legacy_hal::WakeReasonStats& legacy_stats, + WifiDebugHostWakeReasonStats* aidl_stats); +legacy_hal::wifi_power_scenario convertAidlTxPowerScenarioToLegacy( + IWifiChip::TxPowerScenario aidl_scenario); +legacy_hal::wifi_latency_mode convertAidlLatencyModeToLegacy( + IWifiChip::LatencyMode aidl_latency_mode); +bool convertLegacyWifiMacInfosToAidl( + const std::vector& legacy_mac_infos, + std::vector* aidl_radio_mode_infos); +legacy_hal::wifi_interface_type convertAidlIfaceTypeToLegacy(IfaceType aidl_interface_type); +legacy_hal::wifi_multi_sta_use_case convertAidlMultiStaUseCaseToLegacy( + IWifiChip::MultiStaUseCase use_case); +bool convertAidlCoexUnsafeChannelToLegacy( + const IWifiChip::CoexUnsafeChannel& aidl_unsafe_channel, + legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel); +bool convertAidlVectorOfCoexUnsafeChannelToLegacy( + const std::vector& aidl_unsafe_channels, + std::vector* legacy_unsafe_channels); +bool convertLegacyRadioCombinationsMatrixToAidl( + legacy_hal::wifi_radio_combination_matrix* legacy_matrix, + std::vector* aidl_combinations); +WifiBand convertLegacyMacBandToAidlWifiBand(uint32_t band); +WifiAntennaMode convertLegacyAntennaConfigurationToAidl(uint32_t antenna_cfg); +bool convertLegacyIfaceCombinationsMatrixToChipMode( + legacy_hal::wifi_iface_concurrency_matrix& legacy_matrix, IWifiChip::ChipMode* chip_mode); + +// STA iface conversion methods. +bool convertLegacyStaIfaceFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* aidl_feature_set); +bool convertLegacyApfCapabilitiesToAidl(const legacy_hal::PacketFilterCapabilities& legacy_caps, + StaApfPacketFilterCapabilities* aidl_caps); +bool convertLegacyGscanCapabilitiesToAidl(const legacy_hal::wifi_gscan_capabilities& legacy_caps, + StaBackgroundScanCapabilities* aidl_caps); +legacy_hal::wifi_band convertAidlWifiBandToLegacy(WifiBand band); +bool convertAidlGscanParamsToLegacy(const StaBackgroundScanParameters& aidl_scan_params, + legacy_hal::wifi_scan_cmd_params* legacy_scan_params); +// |has_ie_data| indicates whether or not the wifi_scan_result includes 802.11 +// Information Elements (IEs) +bool convertLegacyGscanResultToAidl(const legacy_hal::wifi_scan_result& legacy_scan_result, + bool has_ie_data, StaScanResult* aidl_scan_result); +// |cached_results| is assumed to not include IEs. +bool convertLegacyVectorOfCachedGscanResultsToAidl( + const std::vector& legacy_cached_scan_results, + std::vector* aidl_scan_datas); +bool convertLegacyLinkLayerMlStatsToAidl(const legacy_hal::LinkLayerMlStats& legacy_ml_stats, + StaLinkLayerStats* aidl_stats); +bool convertLegacyLinkLayerStatsToAidl(const legacy_hal::LinkLayerStats& legacy_stats, + StaLinkLayerStats* aidl_stats); +bool convertLegacyRoamingCapabilitiesToAidl( + const legacy_hal::wifi_roaming_capabilities& legacy_caps, + StaRoamingCapabilities* aidl_caps); +bool convertAidlRoamingConfigToLegacy(const StaRoamingConfig& aidl_config, + legacy_hal::wifi_roaming_config* legacy_config); +legacy_hal::fw_roaming_state_t convertAidlRoamingStateToLegacy(StaRoamingState state); +bool convertLegacyVectorOfDebugTxPacketFateToAidl( + const std::vector& legacy_fates, + std::vector* aidl_fates); +bool convertLegacyVectorOfDebugRxPacketFateToAidl( + const std::vector& legacy_fates, + std::vector* aidl_fates); + +// NAN iface conversion methods. +void convertToNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len, + NanStatus* nanStatus); +bool convertAidlNanEnableRequestToLegacy(const NanEnableRequest& aidl_request1, + const NanConfigRequestSupplemental& aidl_request2, + legacy_hal::NanEnableRequest* legacy_request); +bool convertAidlNanConfigRequestToLegacy(const NanConfigRequest& aidl_request1, + const NanConfigRequestSupplemental& aidl_request2, + legacy_hal::NanConfigRequest* legacy_request); +bool convertAidlNanPublishRequestToLegacy(const NanPublishRequest& aidl_request, + legacy_hal::NanPublishRequest* legacy_request); +bool convertAidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& aidl_request, + legacy_hal::NanSubscribeRequest* legacy_request); +bool convertAidlNanTransmitFollowupRequestToLegacy( + const NanTransmitFollowupRequest& aidl_request, + legacy_hal::NanTransmitFollowupRequest* legacy_request); +bool convertAidlNanDataPathInitiatorRequestToLegacy( + const NanInitiateDataPathRequest& aidl_request, + legacy_hal::NanDataPathInitiatorRequest* legacy_request); +bool convertAidlNanDataPathIndicationResponseToLegacy( + const NanRespondToDataPathIndicationRequest& aidl_response, + legacy_hal::NanDataPathIndicationResponse* legacy_response); +bool convertLegacyNanResponseHeaderToAidl(const legacy_hal::NanResponseMsg& legacy_response, + NanStatus* nanStatus); +bool convertLegacyNanCapabilitiesResponseToAidl(const legacy_hal::NanCapabilities& legacy_response, + NanCapabilities* aidl_response); +bool convertLegacyNanMatchIndToAidl(const legacy_hal::NanMatchInd& legacy_ind, + NanMatchInd* aidl_ind); +bool convertLegacyNanFollowupIndToAidl(const legacy_hal::NanFollowupInd& legacy_ind, + NanFollowupReceivedInd* aidl_ind); +bool convertLegacyNanDataPathRequestIndToAidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, + NanDataPathRequestInd* aidl_ind); +bool convertLegacyNanDataPathConfirmIndToAidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, + NanDataPathConfirmInd* aidl_ind); +bool convertLegacyNanDataPathScheduleUpdateIndToAidl( + const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, + NanDataPathScheduleUpdateInd* aidl_ind); + +// RTT controller conversion methods. +bool convertAidlVectorOfRttConfigToLegacy(const std::vector& aidl_configs, + std::vector* legacy_configs); +bool convertAidlRttLciInformationToLegacy(const RttLciInformation& aidl_info, + legacy_hal::wifi_lci_information* legacy_info); +bool convertAidlRttLcrInformationToLegacy(const RttLcrInformation& aidl_info, + legacy_hal::wifi_lcr_information* legacy_info); +bool convertAidlRttResponderToLegacy(const RttResponder& aidl_responder, + legacy_hal::wifi_rtt_responder* legacy_responder); +bool convertAidlWifiChannelInfoToLegacy(const WifiChannelInfo& aidl_info, + legacy_hal::wifi_channel_info* legacy_info); +bool convertLegacyRttResponderToAidl(const legacy_hal::wifi_rtt_responder& legacy_responder, + RttResponder* aidl_responder); +bool convertLegacyRttCapabilitiesToAidl( + const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, + RttCapabilities* aidl_capabilities); +bool convertLegacyVectorOfRttResultToAidl( + const std::vector& legacy_results, + std::vector* aidl_results); +bool convertLegacyVectorOfRttResultV2ToAidl( + const std::vector& legacy_results, + std::vector* aidl_results); +uint32_t convertAidlWifiBandToLegacyMacBand(WifiBand band); +uint32_t convertAidlWifiIfaceModeToLegacy(uint32_t aidl_iface_mask); +uint32_t convertAidlUsableChannelFilterToLegacy(uint32_t aidl_filter_mask); +bool convertLegacyWifiUsableChannelsToAidl( + const std::vector& legacy_usable_channels, + std::vector* aidl_usable_channels); +bool convertLegacyPeerInfoStatsToAidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, + StaPeerInfo* aidl_peer_info_stats); +bool convertLegacyWifiRateInfoToAidl(const legacy_hal::wifi_rate& legacy_rate, + WifiRateInfo* aidl_rate); +bool convertLegacyWifiChipCapabilitiesToAidl( + const legacy_hal::wifi_chip_capabilities& legacy_chip_capabilities, + WifiChipCapabilities& aidl_chip_capabilities); +bool convertAidlNanPairingInitiatorRequestToLegacy(const NanPairingRequest& aidl_request, + legacy_hal::NanPairingRequest* legacy_request); +bool convertAidlNanPairingIndicationResponseToLegacy( + const NanRespondToPairingIndicationRequest& aidl_response, + legacy_hal::NanPairingIndicationResponse* legacy_response); +bool convertAidlNanBootstrappingInitiatorRequestToLegacy( + const NanBootstrappingRequest& aidl_request, + legacy_hal::NanBootstrappingRequest* legacy_request); +bool convertAidlNanBootstrappingIndicationResponseToLegacy( + const NanBootstrappingResponse& aidl_response, + legacy_hal::NanBootstrappingIndicationResponse* legacy_response); +bool convertLegacyNanPairingRequestIndToAidl(const legacy_hal::NanPairingRequestInd& legacy_ind, + NanPairingRequestInd* aidl_ind); +bool convertLegacyNanPairingConfirmIndToAidl(const legacy_hal::NanPairingConfirmInd& legacy_ind, + NanPairingConfirmInd* aidl_ind); +bool convertLegacyNanBootstrappingRequestIndToAidl( + const legacy_hal::NanBootstrappingRequestInd& legacy_ind, + NanBootstrappingRequestInd* aidl_ind); +bool convertLegacyNanBootstrappingConfirmIndToAidl( + const legacy_hal::NanBootstrappingConfirmInd& legacy_ind, + NanBootstrappingConfirmInd* aidl_ind); +uint32_t convertAidlChannelCategoryToLegacy(uint32_t aidl_channel_category_mask); +} // namespace aidl_struct_util +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // AIDL_STRUCT_UTIL_H_ diff --git a/wifi/1.6/default/hidl_sync_util.cpp b/wifi/aidl/default/aidl_sync_util.cpp similarity index 78% rename from wifi/1.6/default/hidl_sync_util.cpp rename to wifi/aidl/default/aidl_sync_util.cpp index 358d95e668..d81eb81182 100644 --- a/wifi/1.6/default/hidl_sync_util.cpp +++ b/wifi/aidl/default/aidl_sync_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,24 @@ * limitations under the License. */ -#include "hidl_sync_util.h" +#include "aidl_sync_util.h" namespace { std::recursive_mutex g_mutex; } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -namespace hidl_sync_util { +namespace aidl_sync_util { std::unique_lock acquireGlobalLock() { return std::unique_lock{g_mutex}; } -} // namespace hidl_sync_util -} // namespace implementation -} // namespace V1_6 +} // namespace aidl_sync_util } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/hidl_sync_util.h b/wifi/aidl/default/aidl_sync_util.h similarity index 71% rename from wifi/1.6/default/hidl_sync_util.h rename to wifi/aidl/default/aidl_sync_util.h index 2c1c37b0ad..a61cd3f57c 100644 --- a/wifi/1.6/default/hidl_sync_util.h +++ b/wifi/aidl/default/aidl_sync_util.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,24 +14,22 @@ * limitations under the License. */ -#ifndef HIDL_SYNC_UTIL_H_ -#define HIDL_SYNC_UTIL_H_ +#ifndef AIDL_SYNC_UTIL_H_ +#define AIDL_SYNC_UTIL_H_ #include // Utility that provides a global lock to synchronize access between -// the HIDL thread and the legacy HAL's event loop. +// the AIDL thread and the legacy HAL's event loop. +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -namespace hidl_sync_util { +namespace aidl_sync_util { std::unique_lock acquireGlobalLock(); -} // namespace hidl_sync_util -} // namespace implementation -} // namespace V1_6 +} // namespace aidl_sync_util } // namespace wifi } // namespace hardware } // namespace android -#endif // HIDL_SYNC_UTIL_H_ +} // namespace aidl +#endif // AIDL_SYNC_UTIL_H_ diff --git a/wifi/aidl/default/android.hardware.wifi-service-lazy.rc b/wifi/aidl/default/android.hardware.wifi-service-lazy.rc new file mode 100644 index 0000000000..12d3ff7bde --- /dev/null +++ b/wifi/aidl/default/android.hardware.wifi-service-lazy.rc @@ -0,0 +1,8 @@ +service vendor.wifi_hal_legacy /vendor/bin/hw/android.hardware.wifi-service-lazy + interface aidl android.hardware.wifi.IWifi/default + oneshot + disabled + class hal + capabilities NET_ADMIN NET_RAW SYS_MODULE + user wifi + group wifi gps diff --git a/wifi/aidl/default/android.hardware.wifi-service.rc b/wifi/aidl/default/android.hardware.wifi-service.rc new file mode 100644 index 0000000000..ec8acf5767 --- /dev/null +++ b/wifi/aidl/default/android.hardware.wifi-service.rc @@ -0,0 +1,6 @@ +service vendor.wifi_hal_legacy /vendor/bin/hw/android.hardware.wifi-service + interface aidl android.hardware.wifi.IWifi/default + class hal + capabilities NET_ADMIN NET_RAW SYS_MODULE + user wifi + group wifi gps diff --git a/wifi/aidl/default/android.hardware.wifi-service.xml b/wifi/aidl/default/android.hardware.wifi-service.xml new file mode 100644 index 0000000000..5398ee77b5 --- /dev/null +++ b/wifi/aidl/default/android.hardware.wifi-service.xml @@ -0,0 +1,6 @@ + + + android.hardware.wifi + IWifi/default + + diff --git a/wifi/1.6/default/ringbuffer.cpp b/wifi/aidl/default/ringbuffer.cpp similarity index 92% rename from wifi/1.6/default/ringbuffer.cpp rename to wifi/aidl/default/ringbuffer.cpp index 981bf7bce7..9d08a7368e 100644 --- a/wifi/1.6/default/ringbuffer.cpp +++ b/wifi/aidl/default/ringbuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,14 @@ * limitations under the License. */ -#include - #include "ringbuffer.h" +#include + +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { Ringbuffer::Ringbuffer(size_t maxSize) : size_(0), maxSize_(maxSize) {} @@ -57,8 +56,7 @@ void Ringbuffer::clear() { size_ = 0; } -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/ringbuffer.h b/wifi/aidl/default/ringbuffer.h similarity index 90% rename from wifi/1.6/default/ringbuffer.h rename to wifi/aidl/default/ringbuffer.h index c6a1e4c52d..80c0c11045 100644 --- a/wifi/1.6/default/ringbuffer.h +++ b/wifi/aidl/default/ringbuffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,11 +20,10 @@ #include #include +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { /** * Ringbuffer object used to store debug data. @@ -53,10 +52,9 @@ class Ringbuffer { size_t maxSize_; }; -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // RINGBUFFER_H_ diff --git a/wifi/aidl/default/service.cpp b/wifi/aidl/default/service.cpp new file mode 100644 index 0000000000..789a7a5868 --- /dev/null +++ b/wifi/aidl/default/service.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "wifi.h" +#include "wifi_feature_flags.h" +#include "wifi_legacy_hal.h" +#include "wifi_legacy_hal_factory.h" +#include "wifi_mode_controller.h" + +using aidl::android::hardware::wifi::feature_flags::WifiFeatureFlags; +using aidl::android::hardware::wifi::legacy_hal::WifiLegacyHal; +using aidl::android::hardware::wifi::legacy_hal::WifiLegacyHalFactory; +using aidl::android::hardware::wifi::mode_controller::WifiModeController; + +#ifdef LAZY_SERVICE +const bool kLazyService = true; +#else +const bool kLazyService = false; +#endif + +int main(int /*argc*/, char** argv) { + signal(SIGPIPE, SIG_IGN); + android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM)); + LOG(INFO) << "Wifi Hal is booting up..."; + + // Prepare the RPC-serving thread pool. Allocate 1 thread in the pool, + // which our main thread will join below. + ABinderProcess_setThreadPoolMaxThreadCount(1); + + const auto iface_tool = std::make_shared<::android::wifi_system::InterfaceTool>(); + const auto legacy_hal_factory = std::make_shared(iface_tool); + + // Setup binder service + std::shared_ptr service = + ndk::SharedRefBase::make( + iface_tool, legacy_hal_factory, std::make_shared(), + std::make_shared()); + std::string instance = + std::string() + aidl::android::hardware::wifi::Wifi::descriptor + "/default"; + if (kLazyService) { + auto result = + AServiceManager_registerLazyService(service->asBinder().get(), instance.c_str()); + CHECK_EQ(result, STATUS_OK) << "Failed to register lazy wifi HAL"; + } else { + auto result = AServiceManager_addService(service->asBinder().get(), instance.c_str()); + CHECK_EQ(result, STATUS_OK) << "Failed to register wifi HAL"; + } + + ABinderProcess_startThreadPool(); + LOG(INFO) << "Joining RPC thread pool"; + ABinderProcess_joinThreadPool(); + + LOG(INFO) << "Wifi Hal is terminating..."; + return 0; +} diff --git a/wifi/aidl/default/tests/README.md b/wifi/aidl/default/tests/README.md new file mode 100644 index 0000000000..fc0a98ad92 --- /dev/null +++ b/wifi/aidl/default/tests/README.md @@ -0,0 +1,14 @@ +# Vendor HAL gTest Suite + +## Overview +Rather than testing an active instance of the service like the VTS tests, +this test suite will test individual files from the Vendor HAL. +This is especially useful for testing conversion methods (see `aidl_struct_util_unit_tests.cpp`), +but can also be used to test things like `wifi_chip`. + +## Usage +Run the test script with a device connected: + +``` +./runtests.sh +``` diff --git a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp new file mode 100644 index 0000000000..5c334f8d56 --- /dev/null +++ b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp @@ -0,0 +1,873 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "aidl_struct_util.h" + +using testing::Test; + +namespace { +constexpr uint32_t kMacId1 = 1; +constexpr uint32_t kMacId2 = 2; +constexpr uint32_t kIfaceChannel1 = 3; +constexpr uint32_t kIfaceChannel2 = 5; +constexpr char kIfaceName1[] = "wlan0"; +constexpr char kIfaceName2[] = "wlan1"; +constexpr uint8_t kMacAddress[] = {0x02, 0x12, 0x45, 0x56, 0xab, 0xcc}; +byte LCI[] = {0x27, 0x1A, 0x1, 0x00, 0x8, 0x01, 0x00, 0x08, 0x00, 0x10, 0x52, + 0x83, 0x4d, 0x12, 0xef, 0xd2, 0xb0, 0x8b, 0x9b, 0x4b, 0xf1, 0xcc, + 0x2c, 0x00, 0x00, 0x41, 0x06, 0x03, 0x06, 0x00, 0x80}; +byte LCR[] = {0x27, 0xE, 0x1, 0x00, 0xB, 0x01, 0x00, 0x0b, 0x00, 0x09, + 0x55, 0x53, 0x18, 0x05, 0x39, 0x34, 0x30, 0x34, 0x33}; +} // namespace + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +class AidlStructUtilTest : public Test {}; + +TEST_F(AidlStructUtilTest, CanConvertLegacyWifiMacInfosToAidlWithOneMac) { + std::vector legacy_mac_infos; + legacy_hal::WifiMacInfo legacy_mac_info1 = { + .wlan_mac_id = kMacId1, + .mac_band = legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_2_4_BAND}; + legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, .channel = kIfaceChannel1}; + legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, .channel = kIfaceChannel2}; + legacy_mac_info1.iface_infos.push_back(legacy_iface_info1); + legacy_mac_info1.iface_infos.push_back(legacy_iface_info2); + legacy_mac_infos.push_back(legacy_mac_info1); + + std::vector aidl_radio_mode_infos; + ASSERT_TRUE(aidl_struct_util::convertLegacyWifiMacInfosToAidl(legacy_mac_infos, + &aidl_radio_mode_infos)); + + ASSERT_EQ(1u, aidl_radio_mode_infos.size()); + auto aidl_radio_mode_info1 = aidl_radio_mode_infos[0]; + EXPECT_EQ(legacy_mac_info1.wlan_mac_id, (uint32_t)aidl_radio_mode_info1.radioId); + EXPECT_EQ(WifiBand::BAND_24GHZ_5GHZ, aidl_radio_mode_info1.bandInfo); + ASSERT_EQ(2u, aidl_radio_mode_info1.ifaceInfos.size()); + auto aidl_iface_info1 = aidl_radio_mode_info1.ifaceInfos[0]; + EXPECT_EQ(legacy_iface_info1.name, aidl_iface_info1.name); + EXPECT_EQ(static_cast(legacy_iface_info1.channel), aidl_iface_info1.channel); + auto aidl_iface_info2 = aidl_radio_mode_info1.ifaceInfos[1]; + EXPECT_EQ(legacy_iface_info2.name, aidl_iface_info2.name); + EXPECT_EQ(static_cast(legacy_iface_info2.channel), aidl_iface_info2.channel); +} + +TEST_F(AidlStructUtilTest, CanConvertLegacyWifiMacInfosToAidlWithTwoMac) { + std::vector legacy_mac_infos; + legacy_hal::WifiMacInfo legacy_mac_info1 = {.wlan_mac_id = kMacId1, + .mac_band = legacy_hal::WLAN_MAC_5_0_BAND}; + legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, .channel = kIfaceChannel1}; + legacy_hal::WifiMacInfo legacy_mac_info2 = {.wlan_mac_id = kMacId2, + .mac_band = legacy_hal::WLAN_MAC_2_4_BAND}; + legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, .channel = kIfaceChannel2}; + legacy_mac_info1.iface_infos.push_back(legacy_iface_info1); + legacy_mac_infos.push_back(legacy_mac_info1); + legacy_mac_info2.iface_infos.push_back(legacy_iface_info2); + legacy_mac_infos.push_back(legacy_mac_info2); + + std::vector aidl_radio_mode_infos; + ASSERT_TRUE(aidl_struct_util::convertLegacyWifiMacInfosToAidl(legacy_mac_infos, + &aidl_radio_mode_infos)); + + ASSERT_EQ(2u, aidl_radio_mode_infos.size()); + + // Find mac info 1. + const auto aidl_radio_mode_info1 = + std::find_if(aidl_radio_mode_infos.begin(), aidl_radio_mode_infos.end(), + [&legacy_mac_info1](const IWifiChipEventCallback::RadioModeInfo& x) { + return (uint32_t)x.radioId == legacy_mac_info1.wlan_mac_id; + }); + ASSERT_NE(aidl_radio_mode_infos.end(), aidl_radio_mode_info1); + EXPECT_EQ(WifiBand::BAND_5GHZ, aidl_radio_mode_info1->bandInfo); + ASSERT_EQ(1u, aidl_radio_mode_info1->ifaceInfos.size()); + auto aidl_iface_info1 = aidl_radio_mode_info1->ifaceInfos[0]; + EXPECT_EQ(legacy_iface_info1.name, aidl_iface_info1.name); + EXPECT_EQ(static_cast(legacy_iface_info1.channel), aidl_iface_info1.channel); + + // Find mac info 2. + const auto aidl_radio_mode_info2 = + std::find_if(aidl_radio_mode_infos.begin(), aidl_radio_mode_infos.end(), + [&legacy_mac_info2](const IWifiChipEventCallback::RadioModeInfo& x) { + return (uint32_t)x.radioId == legacy_mac_info2.wlan_mac_id; + }); + ASSERT_NE(aidl_radio_mode_infos.end(), aidl_radio_mode_info2); + EXPECT_EQ(WifiBand::BAND_24GHZ, aidl_radio_mode_info2->bandInfo); + ASSERT_EQ(1u, aidl_radio_mode_info2->ifaceInfos.size()); + auto aidl_iface_info2 = aidl_radio_mode_info2->ifaceInfos[0]; + EXPECT_EQ(legacy_iface_info2.name, aidl_iface_info2.name); + EXPECT_EQ(static_cast(legacy_iface_info2.channel), aidl_iface_info2.channel); +} + +TEST_F(AidlStructUtilTest, canConvertLegacyLinkLayerMlStatsToAidl) { + legacy_hal::LinkLayerMlStats legacy_ml_stats{}; + // Add two radio stats + legacy_ml_stats.radios.push_back(legacy_hal::LinkLayerRadioStats{}); + legacy_ml_stats.radios.push_back(legacy_hal::LinkLayerRadioStats{}); + // Add two links. + legacy_ml_stats.links.push_back(legacy_hal::LinkStats{}); + legacy_ml_stats.links.push_back(legacy_hal::LinkStats{}); + // Set stats for each link. + for (legacy_hal::LinkStats& link : legacy_ml_stats.links) { + link.peers.push_back(legacy_hal::WifiPeerInfo{}); + link.peers.push_back(legacy_hal::WifiPeerInfo{}); + link.stat.beacon_rx = rand(); + // MLO link id: 0 - 15 + link.stat.link_id = rand() % 16; + // Maximum number of radios is limited to 3 for testing. + link.stat.radio = rand() % 4; + link.stat.frequency = rand(); + // RSSI: 0 to -127 + link.stat.rssi_mgmt = (rand() % 128) * -1; + link.stat.ac[legacy_hal::WIFI_AC_BE].rx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].tx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].mpdu_lost = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].retries = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_min = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_max = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_avg = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BE].contention_num_samples = rand(); + + link.stat.ac[legacy_hal::WIFI_AC_BK].rx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].tx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].mpdu_lost = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].retries = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_min = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_max = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_avg = rand(); + link.stat.ac[legacy_hal::WIFI_AC_BK].contention_num_samples = rand(); + + link.stat.ac[legacy_hal::WIFI_AC_VI].rx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].tx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].mpdu_lost = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].retries = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_min = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_max = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_avg = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VI].contention_num_samples = rand(); + + link.stat.ac[legacy_hal::WIFI_AC_VO].rx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].tx_mpdu = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].mpdu_lost = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].retries = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_min = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_max = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_avg = rand(); + link.stat.ac[legacy_hal::WIFI_AC_VO].contention_num_samples = rand(); + + link.stat.time_slicing_duty_cycle_percent = rand() % 101; + link.stat.num_peers = 2; + + // Set peer stats for each of the peers. + for (auto& peer : link.peers) { + // Max station count is limited to 32 for testing. + peer.peer_info.bssload.sta_count = rand() % 33; + peer.peer_info.bssload.chan_util = rand() % 101; + wifi_rate_stat rate_stat1 = { + .rate = {3, 1, 2, 5, 0, 0}, + .tx_mpdu = 0, + .rx_mpdu = 1, + .mpdu_lost = 2, + .retries = 3, + .retries_short = 4, + .retries_long = 5, + }; + wifi_rate_stat rate_stat2 = { + .rate = {2, 2, 1, 6, 0, 1}, + .tx_mpdu = 6, + .rx_mpdu = 7, + .mpdu_lost = 8, + .retries = 9, + .retries_short = 10, + .retries_long = 11, + }; + peer.rate_stats.push_back(rate_stat1); + peer.rate_stats.push_back(rate_stat2); + } + } + // Set radio stats + for (auto& radio : legacy_ml_stats.radios) { + // Maximum number of radios is limited to 3 for testing. + radio.stats.radio = rand() % 4; + radio.stats.on_time = rand(); + radio.stats.tx_time = rand(); + radio.stats.rx_time = rand(); + radio.stats.on_time_scan = rand(); + radio.stats.on_time_nbd = rand(); + radio.stats.on_time_gscan = rand(); + radio.stats.on_time_roam_scan = rand(); + radio.stats.on_time_pno_scan = rand(); + radio.stats.on_time_hs20 = rand(); + for (int i = 0; i < 4; i++) { + radio.tx_time_per_levels.push_back(rand()); + } + + legacy_hal::wifi_channel_stat channel_stat1 = { + .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 2437, 2437, 0}, + .on_time = 0x1111, + .cca_busy_time = 0x55, + }; + legacy_hal::wifi_channel_stat channel_stat2 = { + .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 5180, 5180, 0}, + .on_time = 0x2222, + .cca_busy_time = 0x66, + }; + radio.channel_stats.push_back(channel_stat1); + radio.channel_stats.push_back(channel_stat2); + } + // Convert to AIDL + StaLinkLayerStats converted{}; + aidl_struct_util::convertLegacyLinkLayerMlStatsToAidl(legacy_ml_stats, &converted); + // Validate + int l = 0; + for (legacy_hal::LinkStats& link : legacy_ml_stats.links) { + EXPECT_EQ(link.stat.link_id, (uint8_t)converted.iface.links[l].linkId); + EXPECT_EQ(link.stat.radio, converted.iface.links[l].radioId); + EXPECT_EQ(link.stat.frequency, (uint32_t)converted.iface.links[l].frequencyMhz); + EXPECT_EQ(link.stat.beacon_rx, (uint32_t)converted.iface.links[l].beaconRx); + EXPECT_EQ(link.stat.rssi_mgmt, converted.iface.links[l].avgRssiMgmt); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].rx_mpdu, + converted.iface.links[l].wmeBePktStats.rxMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].tx_mpdu, + converted.iface.links[l].wmeBePktStats.txMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].mpdu_lost, + converted.iface.links[l].wmeBePktStats.lostMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].retries, + converted.iface.links[l].wmeBePktStats.retries); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_min, + (uint32_t)converted.iface.links[l] + .wmeBeContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_max, + (uint32_t)converted.iface.links[l] + .wmeBeContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].contention_time_avg, + (uint32_t)converted.iface.links[l] + .wmeBeContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BE].contention_num_samples, + (uint32_t)converted.iface.links[l].wmeBeContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].rx_mpdu, + converted.iface.links[l].wmeBkPktStats.rxMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].tx_mpdu, + converted.iface.links[l].wmeBkPktStats.txMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].mpdu_lost, + converted.iface.links[l].wmeBkPktStats.lostMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].retries, + converted.iface.links[l].wmeBkPktStats.retries); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_min, + (uint32_t)converted.iface.links[l] + .wmeBkContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_max, + (uint32_t)converted.iface.links[l] + .wmeBkContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].contention_time_avg, + (uint32_t)converted.iface.links[l] + .wmeBkContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_BK].contention_num_samples, + (uint32_t)converted.iface.links[l].wmeBkContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].rx_mpdu, + converted.iface.links[l].wmeViPktStats.rxMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].tx_mpdu, + converted.iface.links[l].wmeViPktStats.txMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].mpdu_lost, + converted.iface.links[l].wmeViPktStats.lostMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].retries, + converted.iface.links[l].wmeViPktStats.retries); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_min, + (uint32_t)converted.iface.links[l] + .wmeViContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_max, + (uint32_t)converted.iface.links[l] + .wmeViContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].contention_time_avg, + (uint32_t)converted.iface.links[l] + .wmeViContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VI].contention_num_samples, + (uint32_t)converted.iface.links[l].wmeViContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].rx_mpdu, + converted.iface.links[l].wmeVoPktStats.rxMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].tx_mpdu, + converted.iface.links[l].wmeVoPktStats.txMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].mpdu_lost, + converted.iface.links[l].wmeVoPktStats.lostMpdu); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].retries, + converted.iface.links[l].wmeVoPktStats.retries); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_min, + (uint32_t)converted.iface.links[l] + .wmeVoContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_max, + (uint32_t)converted.iface.links[l] + .wmeVoContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].contention_time_avg, + (uint32_t)converted.iface.links[l] + .wmeVoContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(link.stat.ac[legacy_hal::WIFI_AC_VO].contention_num_samples, + (uint32_t)converted.iface.links[l].wmeVoContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(link.stat.time_slicing_duty_cycle_percent, + converted.iface.links[l].timeSliceDutyCycleInPercent); + + EXPECT_EQ(link.peers.size(), converted.iface.links[l].peers.size()); + for (size_t i = 0; i < link.peers.size(); i++) { + EXPECT_EQ(link.peers[i].peer_info.bssload.sta_count, + converted.iface.links[l].peers[i].staCount); + EXPECT_EQ(link.peers[i].peer_info.bssload.chan_util, + converted.iface.links[l].peers[i].chanUtil); + for (size_t j = 0; j < link.peers[i].rate_stats.size(); j++) { + EXPECT_EQ( + link.peers[i].rate_stats[j].rate.preamble, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].rateInfo.preamble); + EXPECT_EQ(link.peers[i].rate_stats[j].rate.nss, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].rateInfo.nss); + EXPECT_EQ(link.peers[i].rate_stats[j].rate.bw, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].rateInfo.bw); + EXPECT_EQ(link.peers[i].rate_stats[j].rate.rateMcsIdx, + (uint32_t)converted.iface.links[l] + .peers[i] + .rateStats[j] + .rateInfo.rateMcsIdx); + EXPECT_EQ(link.peers[i].rate_stats[j].tx_mpdu, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].txMpdu); + EXPECT_EQ(link.peers[i].rate_stats[j].rx_mpdu, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].rxMpdu); + EXPECT_EQ(link.peers[i].rate_stats[j].mpdu_lost, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].mpduLost); + EXPECT_EQ(link.peers[i].rate_stats[j].retries, + (uint32_t)converted.iface.links[l].peers[i].rateStats[j].retries); + } + } + ++l; + } // loop over links + + EXPECT_EQ(legacy_ml_stats.radios.size(), converted.radios.size()); + for (size_t i = 0; i < legacy_ml_stats.radios.size(); i++) { + EXPECT_EQ(legacy_ml_stats.radios[i].stats.radio, converted.radios[i].radioId); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time, + (uint32_t)converted.radios[i].onTimeInMs); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.tx_time, + (uint32_t)converted.radios[i].txTimeInMs); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.rx_time, + (uint32_t)converted.radios[i].rxTimeInMs); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time_scan, + (uint32_t)converted.radios[i].onTimeInMsForScan); + EXPECT_EQ(legacy_ml_stats.radios[i].tx_time_per_levels.size(), + converted.radios[i].txTimeInMsPerLevel.size()); + for (size_t j = 0; j < legacy_ml_stats.radios[i].tx_time_per_levels.size(); j++) { + EXPECT_EQ(legacy_ml_stats.radios[i].tx_time_per_levels[j], + (uint32_t)converted.radios[i].txTimeInMsPerLevel[j]); + } + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time_nbd, + (uint32_t)converted.radios[i].onTimeInMsForNanScan); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time_gscan, + (uint32_t)converted.radios[i].onTimeInMsForBgScan); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time_roam_scan, + (uint32_t)converted.radios[i].onTimeInMsForRoamScan); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time_pno_scan, + (uint32_t)converted.radios[i].onTimeInMsForPnoScan); + EXPECT_EQ(legacy_ml_stats.radios[i].stats.on_time_hs20, + (uint32_t)converted.radios[i].onTimeInMsForHs20Scan); + EXPECT_EQ(legacy_ml_stats.radios[i].channel_stats.size(), + converted.radios[i].channelStats.size()); + for (size_t k = 0; k < legacy_ml_stats.radios[i].channel_stats.size(); k++) { + auto& legacy_channel_st = legacy_ml_stats.radios[i].channel_stats[k]; + EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20, + converted.radios[i].channelStats[k].channel.width); + EXPECT_EQ(legacy_channel_st.channel.center_freq, + converted.radios[i].channelStats[k].channel.centerFreq); + EXPECT_EQ(legacy_channel_st.channel.center_freq0, + converted.radios[i].channelStats[k].channel.centerFreq0); + EXPECT_EQ(legacy_channel_st.channel.center_freq1, + converted.radios[i].channelStats[k].channel.centerFreq1); + EXPECT_EQ(legacy_channel_st.cca_busy_time, + (uint32_t)converted.radios[i].channelStats[k].ccaBusyTimeInMs); + EXPECT_EQ(legacy_channel_st.on_time, + (uint32_t)converted.radios[i].channelStats[k].onTimeInMs); + } + } +} + +TEST_F(AidlStructUtilTest, canConvertLegacyLinkLayerStatsToAidl) { + legacy_hal::LinkLayerStats legacy_stats{}; + legacy_stats.radios.push_back(legacy_hal::LinkLayerRadioStats{}); + legacy_stats.radios.push_back(legacy_hal::LinkLayerRadioStats{}); + legacy_stats.peers.push_back(legacy_hal::WifiPeerInfo{}); + legacy_stats.peers.push_back(legacy_hal::WifiPeerInfo{}); + legacy_stats.iface.beacon_rx = rand(); + // RSSI: 0 to -127 + legacy_stats.iface.rssi_mgmt = rand() % 128; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples = rand(); + + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples = rand(); + + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples = rand(); + + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg = rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples = rand(); + + legacy_stats.iface.info.time_slicing_duty_cycle_percent = rand() % 101; + legacy_stats.iface.num_peers = 1; + + for (auto& radio : legacy_stats.radios) { + // Max number of radios limit to 3. + radio.stats.radio = rand() % 4; + radio.stats.on_time = rand(); + radio.stats.tx_time = rand(); + radio.stats.rx_time = rand(); + radio.stats.on_time_scan = rand(); + radio.stats.on_time_nbd = rand(); + radio.stats.on_time_gscan = rand(); + radio.stats.on_time_roam_scan = rand(); + radio.stats.on_time_pno_scan = rand(); + radio.stats.on_time_hs20 = rand(); + for (int i = 0; i < 4; i++) { + radio.tx_time_per_levels.push_back(rand()); + } + + legacy_hal::wifi_channel_stat channel_stat1 = { + .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 2437, 2437, 0}, + .on_time = 0x1111, + .cca_busy_time = 0x55, + }; + legacy_hal::wifi_channel_stat channel_stat2 = { + .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 5180, 5180, 0}, + .on_time = 0x2222, + .cca_busy_time = 0x66, + }; + radio.channel_stats.push_back(channel_stat1); + radio.channel_stats.push_back(channel_stat2); + } + + for (auto& peer : legacy_stats.peers) { + // Max number of stations is limited to 32 for testing. + peer.peer_info.bssload.sta_count = rand() % 33; + peer.peer_info.bssload.chan_util = rand() % 101; + wifi_rate_stat rate_stat1 = { + .rate = {3, 1, 2, 5, 0, 0}, + .tx_mpdu = 0, + .rx_mpdu = 1, + .mpdu_lost = 2, + .retries = 3, + .retries_short = 4, + .retries_long = 5, + }; + wifi_rate_stat rate_stat2 = { + .rate = {2, 2, 1, 6, 0, 1}, + .tx_mpdu = 6, + .rx_mpdu = 7, + .mpdu_lost = 8, + .retries = 9, + .retries_short = 10, + .retries_long = 11, + }; + peer.rate_stats.push_back(rate_stat1); + peer.rate_stats.push_back(rate_stat2); + } + + StaLinkLayerStats converted{}; + aidl_struct_util::convertLegacyLinkLayerStatsToAidl(legacy_stats, &converted); + EXPECT_EQ(0, converted.iface.links[0].linkId); + EXPECT_EQ(legacy_stats.iface.beacon_rx, (uint32_t)converted.iface.links[0].beaconRx); + EXPECT_EQ(legacy_stats.iface.rssi_mgmt, converted.iface.links[0].avgRssiMgmt); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu, + converted.iface.links[0].wmeBePktStats.rxMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu, + converted.iface.links[0].wmeBePktStats.txMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost, + converted.iface.links[0].wmeBePktStats.lostMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries, + converted.iface.links[0].wmeBePktStats.retries); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min, + (uint32_t)converted.iface.links[0].wmeBeContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max, + (uint32_t)converted.iface.links[0].wmeBeContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg, + (uint32_t)converted.iface.links[0].wmeBeContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples, + (uint32_t)converted.iface.links[0].wmeBeContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu, + converted.iface.links[0].wmeBkPktStats.rxMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu, + converted.iface.links[0].wmeBkPktStats.txMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost, + converted.iface.links[0].wmeBkPktStats.lostMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries, + converted.iface.links[0].wmeBkPktStats.retries); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min, + (uint32_t)converted.iface.links[0].wmeBkContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max, + (uint32_t)converted.iface.links[0].wmeBkContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg, + (uint32_t)converted.iface.links[0].wmeBkContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples, + (uint32_t)converted.iface.links[0].wmeBkContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu, + converted.iface.links[0].wmeViPktStats.rxMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu, + converted.iface.links[0].wmeViPktStats.txMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost, + converted.iface.links[0].wmeViPktStats.lostMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries, + converted.iface.links[0].wmeViPktStats.retries); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min, + (uint32_t)converted.iface.links[0].wmeViContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max, + (uint32_t)converted.iface.links[0].wmeViContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg, + (uint32_t)converted.iface.links[0].wmeViContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples, + (uint32_t)converted.iface.links[0].wmeViContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu, + converted.iface.links[0].wmeVoPktStats.rxMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu, + converted.iface.links[0].wmeVoPktStats.txMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost, + converted.iface.links[0].wmeVoPktStats.lostMpdu); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries, + converted.iface.links[0].wmeVoPktStats.retries); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min, + (uint32_t)converted.iface.links[0].wmeVoContentionTimeStats.contentionTimeMinInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max, + (uint32_t)converted.iface.links[0].wmeVoContentionTimeStats.contentionTimeMaxInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg, + (uint32_t)converted.iface.links[0].wmeVoContentionTimeStats.contentionTimeAvgInUsec); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples, + (uint32_t)converted.iface.links[0].wmeVoContentionTimeStats.contentionNumSamples); + + EXPECT_EQ(legacy_stats.iface.info.time_slicing_duty_cycle_percent, + converted.iface.links[0].timeSliceDutyCycleInPercent); + + EXPECT_EQ(legacy_stats.radios.size(), converted.radios.size()); + for (size_t i = 0; i < legacy_stats.radios.size(); i++) { + EXPECT_EQ(legacy_stats.radios[i].stats.radio, converted.radios[i].radioId); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time, (uint32_t)converted.radios[i].onTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, (uint32_t)converted.radios[i].txTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, (uint32_t)converted.radios[i].rxTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time_scan, + (uint32_t)converted.radios[i].onTimeInMsForScan); + EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels.size(), + converted.radios[i].txTimeInMsPerLevel.size()); + for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size(); j++) { + EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels[j], + (uint32_t)converted.radios[i].txTimeInMsPerLevel[j]); + } + EXPECT_EQ(legacy_stats.radios[i].stats.on_time_nbd, + (uint32_t)converted.radios[i].onTimeInMsForNanScan); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time_gscan, + (uint32_t)converted.radios[i].onTimeInMsForBgScan); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time_roam_scan, + (uint32_t)converted.radios[i].onTimeInMsForRoamScan); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time_pno_scan, + (uint32_t)converted.radios[i].onTimeInMsForPnoScan); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time_hs20, + (uint32_t)converted.radios[i].onTimeInMsForHs20Scan); + EXPECT_EQ(legacy_stats.radios[i].channel_stats.size(), + converted.radios[i].channelStats.size()); + for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size(); k++) { + auto& legacy_channel_st = legacy_stats.radios[i].channel_stats[k]; + EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20, + converted.radios[i].channelStats[k].channel.width); + EXPECT_EQ(legacy_channel_st.channel.center_freq, + converted.radios[i].channelStats[k].channel.centerFreq); + EXPECT_EQ(legacy_channel_st.channel.center_freq0, + converted.radios[i].channelStats[k].channel.centerFreq0); + EXPECT_EQ(legacy_channel_st.channel.center_freq1, + converted.radios[i].channelStats[k].channel.centerFreq1); + EXPECT_EQ(legacy_channel_st.cca_busy_time, + (uint32_t)converted.radios[i].channelStats[k].ccaBusyTimeInMs); + EXPECT_EQ(legacy_channel_st.on_time, + (uint32_t)converted.radios[i].channelStats[k].onTimeInMs); + } + } + + EXPECT_EQ(legacy_stats.peers.size(), converted.iface.links[0].peers.size()); + for (size_t i = 0; i < legacy_stats.peers.size(); i++) { + EXPECT_EQ(legacy_stats.peers[i].peer_info.bssload.sta_count, + converted.iface.links[0].peers[i].staCount); + EXPECT_EQ(legacy_stats.peers[i].peer_info.bssload.chan_util, + converted.iface.links[0].peers[i].chanUtil); + for (size_t j = 0; j < legacy_stats.peers[i].rate_stats.size(); j++) { + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.preamble, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].rateInfo.preamble); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.nss, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].rateInfo.nss); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.bw, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].rateInfo.bw); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.rateMcsIdx, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].rateInfo.rateMcsIdx); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].tx_mpdu, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].txMpdu); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rx_mpdu, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].rxMpdu); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].mpdu_lost, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].mpduLost); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].retries, + (uint32_t)converted.iface.links[0].peers[i].rateStats[j].retries); + } + } +} + +TEST_F(AidlStructUtilTest, CanConvertLegacyFeaturesToAidl) { + using AidlChipCaps = IWifiChip::FeatureSetMask; + + uint32_t aidl_features; + uint32_t legacy_feature_set = WIFI_FEATURE_D2D_RTT | WIFI_FEATURE_SET_LATENCY_MODE; + + ASSERT_TRUE( + aidl_struct_util::convertLegacyChipFeaturesToAidl(legacy_feature_set, &aidl_features)); + + EXPECT_EQ((uint32_t)AidlChipCaps::D2D_RTT | (uint32_t)AidlChipCaps::SET_LATENCY_MODE, + aidl_features); +} + +void insertRadioCombination(legacy_hal::wifi_radio_combination* dst_radio_combination_ptr, + int num_radio_configurations, + legacy_hal::wifi_radio_configuration* radio_configuration) { + dst_radio_combination_ptr->num_radio_configurations = num_radio_configurations; + memcpy(dst_radio_combination_ptr->radio_configurations, radio_configuration, + num_radio_configurations * sizeof(legacy_hal::wifi_radio_configuration)); +} + +void verifyRadioCombination(WifiRadioCombination* radioCombination, size_t num_radio_configurations, + legacy_hal::wifi_radio_configuration* radio_configuration) { + EXPECT_EQ(num_radio_configurations, radioCombination->radioConfigurations.size()); + for (size_t i = 0; i < num_radio_configurations; i++) { + EXPECT_EQ(aidl_struct_util::convertLegacyMacBandToAidlWifiBand(radio_configuration->band), + radioCombination->radioConfigurations[i].bandInfo); + EXPECT_EQ(aidl_struct_util::convertLegacyAntennaConfigurationToAidl( + radio_configuration->antenna_cfg), + radioCombination->radioConfigurations[i].antennaMode); + radio_configuration++; + } +} + +TEST_F(AidlStructUtilTest, canConvertLegacyRadioCombinationsMatrixToAidl) { + legacy_hal::wifi_radio_configuration radio_configurations_array1[] = { + {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1}, + }; + legacy_hal::wifi_radio_configuration radio_configurations_array2[] = { + {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2}, + {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_3X3}, + }; + legacy_hal::wifi_radio_configuration radio_configurations_array3[] = { + {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2}, + {.band = legacy_hal::WLAN_MAC_6_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1}, + {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_4X4}, + }; + + int num_radio_configs = 0; + int num_combinations = 0; + std::array buffer; + buffer.fill(0); + legacy_hal::wifi_radio_combination_matrix* legacy_matrix = + reinterpret_cast(buffer.data()); + legacy_hal::wifi_radio_combination* radio_combinations; + + // Prepare a legacy wifi_radio_combination_matrix + legacy_matrix->num_radio_combinations = 3; + // Insert first combination + radio_combinations = + (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations); + insertRadioCombination( + radio_combinations, + sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]), + radio_configurations_array1); + num_combinations++; + num_radio_configs += + sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]); + + // Insert second combination + radio_combinations = + (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations + + (num_combinations * + sizeof(legacy_hal::wifi_radio_combination)) + + (num_radio_configs * + sizeof(wifi_radio_configuration))); + insertRadioCombination( + radio_combinations, + sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]), + radio_configurations_array2); + num_combinations++; + num_radio_configs += + sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]); + + // Insert third combination + radio_combinations = + (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations + + (num_combinations * + sizeof(legacy_hal::wifi_radio_combination)) + + (num_radio_configs * + sizeof(wifi_radio_configuration))); + insertRadioCombination( + radio_combinations, + sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]), + radio_configurations_array3); + + std::vector converted_combinations; + aidl_struct_util::convertLegacyRadioCombinationsMatrixToAidl(legacy_matrix, + &converted_combinations); + + // Verify the conversion + EXPECT_EQ(legacy_matrix->num_radio_combinations, converted_combinations.size()); + verifyRadioCombination( + &converted_combinations[0], + sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]), + radio_configurations_array1); + verifyRadioCombination( + &converted_combinations[1], + sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]), + radio_configurations_array2); + verifyRadioCombination( + &converted_combinations[2], + sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]), + radio_configurations_array3); +} + +void verifyRttResult(wifi_rtt_result* legacy_rtt_result_ptr, RttResult* aidl_results_ptr) { + EXPECT_EQ((int)legacy_rtt_result_ptr->burst_num, aidl_results_ptr->burstNum); + EXPECT_EQ((int)legacy_rtt_result_ptr->measurement_number, aidl_results_ptr->measurementNumber); + EXPECT_EQ((int)legacy_rtt_result_ptr->success_number, aidl_results_ptr->successNumber); + EXPECT_EQ(legacy_rtt_result_ptr->number_per_burst_peer, aidl_results_ptr->numberPerBurstPeer); + EXPECT_EQ(legacy_rtt_result_ptr->retry_after_duration, aidl_results_ptr->retryAfterDuration); + EXPECT_EQ(legacy_rtt_result_ptr->rssi, aidl_results_ptr->rssi); + EXPECT_EQ(legacy_rtt_result_ptr->rssi_spread, aidl_results_ptr->rssiSpread); + EXPECT_EQ(legacy_rtt_result_ptr->rtt, aidl_results_ptr->rtt); + EXPECT_EQ(legacy_rtt_result_ptr->rtt_sd, aidl_results_ptr->rttSd); + EXPECT_EQ(legacy_rtt_result_ptr->rtt_spread, aidl_results_ptr->rttSpread); + EXPECT_EQ(legacy_rtt_result_ptr->distance_mm, aidl_results_ptr->distanceInMm); + EXPECT_EQ(legacy_rtt_result_ptr->distance_sd_mm, aidl_results_ptr->distanceSdInMm); + EXPECT_EQ(legacy_rtt_result_ptr->distance_spread_mm, aidl_results_ptr->distanceSpreadInMm); + EXPECT_EQ(legacy_rtt_result_ptr->ts, aidl_results_ptr->timeStampInUs); + EXPECT_EQ(legacy_rtt_result_ptr->burst_duration, aidl_results_ptr->burstDurationInMs); + EXPECT_EQ(legacy_rtt_result_ptr->negotiated_burst_num, aidl_results_ptr->negotiatedBurstNum); + EXPECT_EQ(legacy_rtt_result_ptr->LCI->id, aidl_results_ptr->lci.id); + for (int i = 0; i < legacy_rtt_result_ptr->LCI->len; i++) { + EXPECT_EQ(legacy_rtt_result_ptr->LCI->data[i], aidl_results_ptr->lci.data[i]); + } + EXPECT_EQ(legacy_rtt_result_ptr->LCR->id, aidl_results_ptr->lcr.id); + for (int i = 0; i < legacy_rtt_result_ptr->LCR->len; i++) { + EXPECT_EQ(legacy_rtt_result_ptr->LCR->data[i], aidl_results_ptr->lcr.data[i]); + } +} + +void fillLegacyRttResult(wifi_rtt_result* rtt_result_ptr) { + std::copy(std::begin(kMacAddress), std::end(kMacAddress), std::begin(rtt_result_ptr->addr)); + rtt_result_ptr->burst_num = rand(); + rtt_result_ptr->measurement_number = rand(); + rtt_result_ptr->success_number = rand(); + rtt_result_ptr->number_per_burst_peer = 0xF & rand(); + rtt_result_ptr->status = RTT_STATUS_SUCCESS; + rtt_result_ptr->retry_after_duration = 0xF & rand(); + rtt_result_ptr->type = RTT_TYPE_2_SIDED; + rtt_result_ptr->rssi = rand(); + rtt_result_ptr->rssi_spread = rand(); + rtt_result_ptr->rtt = rand(); + rtt_result_ptr->rtt_sd = rand(); + rtt_result_ptr->rtt_spread = rand(); + rtt_result_ptr->distance_mm = rand(); + rtt_result_ptr->distance_sd_mm = rand(); + rtt_result_ptr->distance_spread_mm = rand(); + rtt_result_ptr->burst_duration = rand(); + rtt_result_ptr->negotiated_burst_num = rand(); + rtt_result_ptr->LCI = (wifi_information_element*)LCI; + rtt_result_ptr->LCR = (wifi_information_element*)LCR; +} + +TEST_F(AidlStructUtilTest, convertLegacyVectorOfRttResultToAidl) { + std::vector rtt_results_vec; + wifi_rtt_result rttResults[2]; + + // fill legacy rtt results + for (int i = 0; i < 2; i++) { + fillLegacyRttResult(&rttResults[i]); + rtt_results_vec.push_back(&rttResults[i]); + } + + std::vector aidl_results; + aidl_struct_util::convertLegacyVectorOfRttResultToAidl(rtt_results_vec, &aidl_results); + + EXPECT_EQ(rtt_results_vec.size(), aidl_results.size()); + for (size_t i = 0; i < rtt_results_vec.size(); i++) { + verifyRttResult(&rttResults[i], &aidl_results[i]); + EXPECT_EQ(aidl_results[i].channelFreqMHz, 0); + EXPECT_EQ(aidl_results[i].packetBw, RttBw::BW_UNSPECIFIED); + } +} + +TEST_F(AidlStructUtilTest, convertLegacyVectorOfRttResultV2ToAidl) { + std::vector rtt_results_vec_v2; + wifi_rtt_result_v2 rttResults_v2[2]; + + // fill legacy rtt results v2 + for (int i = 0; i < 2; i++) { + fillLegacyRttResult(&rttResults_v2[i].rtt_result); + rttResults_v2[i].frequency = 2412 + i * 5; + rttResults_v2[i].packet_bw = WIFI_RTT_BW_80; + rtt_results_vec_v2.push_back(&rttResults_v2[i]); + } + + std::vector aidl_results; + aidl_struct_util::convertLegacyVectorOfRttResultV2ToAidl(rtt_results_vec_v2, &aidl_results); + + EXPECT_EQ(rtt_results_vec_v2.size(), aidl_results.size()); + for (size_t i = 0; i < rtt_results_vec_v2.size(); i++) { + verifyRttResult(&rttResults_v2[i].rtt_result, &aidl_results[i]); + EXPECT_EQ(aidl_results[i].channelFreqMHz, rttResults_v2[i].frequency); + EXPECT_EQ(aidl_results[i].packetBw, RttBw::BW_80MHZ); + } +} + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/main.cpp b/wifi/aidl/default/tests/main.cpp similarity index 94% rename from wifi/1.6/default/tests/main.cpp rename to wifi/aidl/default/tests/main.cpp index 9aac837242..767422c408 100644 --- a/wifi/1.6/default/tests/main.cpp +++ b/wifi/aidl/default/tests/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/wifi/1.6/default/tests/mock_interface_tool.cpp b/wifi/aidl/default/tests/mock_interface_tool.cpp similarity index 86% rename from wifi/1.6/default/tests/mock_interface_tool.cpp rename to wifi/aidl/default/tests/mock_interface_tool.cpp index b99a16446c..79f3d1e638 100644 --- a/wifi/1.6/default/tests/mock_interface_tool.cpp +++ b/wifi/aidl/default/tests/mock_interface_tool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ #include #include -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 #include "mock_interface_tool.h" namespace android { diff --git a/wifi/1.6/default/tests/mock_interface_tool.h b/wifi/aidl/default/tests/mock_interface_tool.h similarity index 96% rename from wifi/1.6/default/tests/mock_interface_tool.h rename to wifi/aidl/default/tests/mock_interface_tool.h index 7ce3992c7e..9795de8014 100644 --- a/wifi/1.6/default/tests/mock_interface_tool.h +++ b/wifi/aidl/default/tests/mock_interface_tool.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/wifi/1.6/default/tests/mock_wifi_feature_flags.cpp b/wifi/aidl/default/tests/mock_wifi_feature_flags.cpp similarity index 85% rename from wifi/1.6/default/tests/mock_wifi_feature_flags.cpp rename to wifi/aidl/default/tests/mock_wifi_feature_flags.cpp index d10b74c3a0..0c4e59deb3 100644 --- a/wifi/1.6/default/tests/mock_wifi_feature_flags.cpp +++ b/wifi/aidl/default/tests/mock_wifi_feature_flags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,18 +18,16 @@ #include "mock_wifi_feature_flags.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace feature_flags { MockWifiFeatureFlags::MockWifiFeatureFlags() {} } // namespace feature_flags -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/mock_wifi_feature_flags.h b/wifi/aidl/default/tests/mock_wifi_feature_flags.h similarity index 77% rename from wifi/1.6/default/tests/mock_wifi_feature_flags.h rename to wifi/aidl/default/tests/mock_wifi_feature_flags.h index fbe1f7a5ac..9143d15d61 100644 --- a/wifi/1.6/default/tests/mock_wifi_feature_flags.h +++ b/wifi/aidl/default/tests/mock_wifi_feature_flags.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,30 +18,27 @@ #define MOCK_WIFI_FEATURE_FLAGS_H_ #include -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 #include "wifi_feature_flags.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace feature_flags { class MockWifiFeatureFlags : public WifiFeatureFlags { public: MockWifiFeatureFlags(); - MOCK_METHOD1(getChipModes, std::vector(bool is_primary)); + MOCK_METHOD1(getChipModes, std::vector(bool is_primary)); MOCK_METHOD0(isApMacRandomizationDisabled, bool()); }; } // namespace feature_flags -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // MOCK_WIFI_FEATURE_FLAGS_H_ diff --git a/wifi/1.6/default/tests/mock_wifi_iface_util.cpp b/wifi/aidl/default/tests/mock_wifi_iface_util.cpp similarity index 68% rename from wifi/1.6/default/tests/mock_wifi_iface_util.cpp rename to wifi/aidl/default/tests/mock_wifi_iface_util.cpp index 24b16cb469..0f787f22b2 100644 --- a/wifi/1.6/default/tests/mock_wifi_iface_util.cpp +++ b/wifi/aidl/default/tests/mock_wifi_iface_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,22 +18,21 @@ #include #include -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 #include "mock_wifi_iface_util.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace iface_util { -MockWifiIfaceUtil::MockWifiIfaceUtil(const std::weak_ptr iface_tool, - const std::weak_ptr legacy_hal) +MockWifiIfaceUtil::MockWifiIfaceUtil( + const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, + const std::weak_ptr legacy_hal) : WifiIfaceUtil(iface_tool, legacy_hal) {} + } // namespace iface_util -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/mock_wifi_iface_util.h b/wifi/aidl/default/tests/mock_wifi_iface_util.h similarity index 79% rename from wifi/1.6/default/tests/mock_wifi_iface_util.h rename to wifi/aidl/default/tests/mock_wifi_iface_util.h index 2701c36d76..49a8636345 100644 --- a/wifi/1.6/default/tests/mock_wifi_iface_util.h +++ b/wifi/aidl/default/tests/mock_wifi_iface_util.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,30 +21,30 @@ #include "wifi_iface_util.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace iface_util { -class MockWifiIfaceUtil : public WifiIfaceUtil { +class MockWifiIfaceUtil : public iface_util::WifiIfaceUtil { public: - MockWifiIfaceUtil(const std::weak_ptr iface_tool, + MockWifiIfaceUtil(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, const std::weak_ptr legacy_hal); MOCK_METHOD1(getFactoryMacAddress, std::array(const std::string&)); MOCK_METHOD2(setMacAddress, bool(const std::string&, const std::array&)); MOCK_METHOD0(getOrCreateRandomMacAddress, std::array()); - MOCK_METHOD2(registerIfaceEventHandlers, void(const std::string&, IfaceEventHandlers)); + MOCK_METHOD2(registerIfaceEventHandlers, + void(const std::string&, iface_util::IfaceEventHandlers)); MOCK_METHOD1(unregisterIfaceEventHandlers, void(const std::string&)); MOCK_METHOD2(setUpState, bool(const std::string&, bool)); MOCK_METHOD1(ifNameToIndex, unsigned(const std::string&)); }; + } // namespace iface_util -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // MOCK_WIFI_IFACE_UTIL_H_ diff --git a/wifi/1.6/default/tests/mock_wifi_legacy_hal.cpp b/wifi/aidl/default/tests/mock_wifi_legacy_hal.cpp similarity index 69% rename from wifi/1.6/default/tests/mock_wifi_legacy_hal.cpp rename to wifi/aidl/default/tests/mock_wifi_legacy_hal.cpp index 2c558612e3..33b2b1ce36 100644 --- a/wifi/1.6/default/tests/mock_wifi_legacy_hal.cpp +++ b/wifi/aidl/default/tests/mock_wifi_legacy_hal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,22 +18,20 @@ #include #include -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 #include "mock_wifi_legacy_hal.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace legacy_hal { -MockWifiLegacyHal::MockWifiLegacyHal(const std::weak_ptr iface_tool, - const wifi_hal_fn& fn, bool is_primary) +MockWifiLegacyHal::MockWifiLegacyHal( + const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, + const wifi_hal_fn& fn, bool is_primary) : WifiLegacyHal(iface_tool, fn, is_primary) {} } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/mock_wifi_legacy_hal.h b/wifi/aidl/default/tests/mock_wifi_legacy_hal.h similarity index 92% rename from wifi/1.6/default/tests/mock_wifi_legacy_hal.h rename to wifi/aidl/default/tests/mock_wifi_legacy_hal.h index 85dbf0fe49..28129a9947 100644 --- a/wifi/1.6/default/tests/mock_wifi_legacy_hal.h +++ b/wifi/aidl/default/tests/mock_wifi_legacy_hal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,16 +21,15 @@ #include "wifi_legacy_hal.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace legacy_hal { class MockWifiLegacyHal : public WifiLegacyHal { public: - MockWifiLegacyHal(const std::weak_ptr iface_tool, + MockWifiLegacyHal(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, const wifi_hal_fn& fn, bool is_primary); MOCK_METHOD0(initialize, wifi_error()); MOCK_METHOD0(start, wifi_error()); @@ -62,10 +61,9 @@ class MockWifiLegacyHal : public WifiLegacyHal { MOCK_METHOD1(getSupportedFeatureSet, std::pair(const std::string&)); }; } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // MOCK_WIFI_LEGACY_HAL_H_ diff --git a/wifi/1.6/default/tests/mock_wifi_mode_controller.cpp b/wifi/aidl/default/tests/mock_wifi_mode_controller.cpp similarity index 87% rename from wifi/1.6/default/tests/mock_wifi_mode_controller.cpp rename to wifi/aidl/default/tests/mock_wifi_mode_controller.cpp index 446f8296f8..f4cc4c4108 100644 --- a/wifi/1.6/default/tests/mock_wifi_mode_controller.cpp +++ b/wifi/aidl/default/tests/mock_wifi_mode_controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,17 +21,16 @@ #undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 #include "mock_wifi_mode_controller.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace mode_controller { MockWifiModeController::MockWifiModeController() : WifiModeController() {} + } // namespace mode_controller -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/mock_wifi_mode_controller.h b/wifi/aidl/default/tests/mock_wifi_mode_controller.h similarity index 89% rename from wifi/1.6/default/tests/mock_wifi_mode_controller.h rename to wifi/aidl/default/tests/mock_wifi_mode_controller.h index addcc81591..f77f7d0f96 100644 --- a/wifi/1.6/default/tests/mock_wifi_mode_controller.h +++ b/wifi/aidl/default/tests/mock_wifi_mode_controller.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,10 @@ #include "wifi_mode_controller.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace mode_controller { class MockWifiModeController : public WifiModeController { @@ -37,10 +36,9 @@ class MockWifiModeController : public WifiModeController { MOCK_METHOD0(deinitialize, bool()); }; } // namespace mode_controller -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // MOCK_WIFI_MODE_CONTROLLER_H_ diff --git a/wifi/1.6/default/tests/ringbuffer_unit_tests.cpp b/wifi/aidl/default/tests/ringbuffer_unit_tests.cpp similarity index 95% rename from wifi/1.6/default/tests/ringbuffer_unit_tests.cpp rename to wifi/aidl/default/tests/ringbuffer_unit_tests.cpp index eb86194ff0..c257100be9 100644 --- a/wifi/1.6/default/tests/ringbuffer_unit_tests.cpp +++ b/wifi/aidl/default/tests/ringbuffer_unit_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018, The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,10 @@ using testing::Return; using testing::Test; +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { class RingbufferTest : public Test { public: @@ -90,8 +89,8 @@ TEST_F(RingbufferTest, OversizedAppendDoesNotDropExistingData) { ASSERT_EQ(1u, buffer_.getData().size()); EXPECT_EQ(input, buffer_.getData().front()); } -} // namespace implementation -} // namespace V1_6 + } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/runtests.sh b/wifi/aidl/default/tests/runtests.sh similarity index 78% rename from wifi/1.6/default/tests/runtests.sh rename to wifi/aidl/default/tests/runtests.sh index 6bce3ef8c4..228c82b950 100755 --- a/wifi/1.6/default/tests/runtests.sh +++ b/wifi/aidl/default/tests/runtests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright(C) 2017 The Android Open Source Project +# Copyright(C) 2022 The Android Open Source Project # # Licensed under the Apache License, Version 2.0(the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,8 @@ if [ -z $ANDROID_BUILD_TOP ]; then fi set -e -$ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode android.hardware.wifi@1.0-service-tests adb root +adb wait-for-device +$ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode android.hardware.wifi-service-tests adb sync data -adb shell /data/nativetest64/vendor/android.hardware.wifi@1.0-service-tests/android.hardware.wifi@1.0-service-tests +adb shell /data/nativetest64/vendor/android.hardware.wifi-service-tests/android.hardware.wifi-service-tests diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/aidl/default/tests/wifi_chip_unit_tests.cpp similarity index 66% rename from wifi/1.6/default/tests/wifi_chip_unit_tests.cpp rename to wifi/aidl/default/tests/wifi_chip_unit_tests.cpp index 81117c5e06..f9afb4b462 100644 --- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp +++ b/wifi/aidl/default/tests/wifi_chip_unit_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017, The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ #include #include -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 #include "wifi_chip.h" #include "mock_interface_tool.h" @@ -33,28 +32,38 @@ using testing::Return; using testing::Test; namespace { -using android::hardware::wifi::V1_0::ChipId; - -constexpr ChipId kFakeChipId = 5; +constexpr int kFakeChipId = 5; } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { class WifiChipTest : public Test { protected: void setupV1IfaceCombination() { // clang-format off - const hidl_vec combinationsSta = { - {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::P2P}, 1}}} + // 1 STA + 1 P2P + const std::vector combinationsSta = + { + { + { + {{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P}, 1} + } + } + }; + // 1 AP + const std::vector combinationsAp = + { + { + { + {{IfaceConcurrencyType::AP}, 1} + } + } }; - const hidl_vec combinationsAp = { - {{{{IfaceConcurrencyType::AP}, 1}}} - }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta}, {feature_flags::chip_mode_ids::kV1Ap, combinationsAp} }; @@ -64,14 +73,26 @@ class WifiChipTest : public Test { void setupV1_AwareIfaceCombination() { // clang-format off - const hidl_vec combinationsSta = { - {{{{IfaceConcurrencyType::STA}, 1}, - {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} + // 1 STA + 1 of (P2P or NAN) + const std::vector combinationsSta = + { + { + { + {{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN_IFACE}, 1} + } + } }; - const hidl_vec combinationsAp = { - {{{{IfaceConcurrencyType::AP}, 1}}} + // 1 AP + const std::vector combinationsAp = + { + { + { + {{IfaceConcurrencyType::AP}, 1} + } + } }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta}, {feature_flags::chip_mode_ids::kV1Ap, combinationsAp} }; @@ -81,11 +102,17 @@ class WifiChipTest : public Test { void setupV1_AwareDisabledApIfaceCombination() { // clang-format off - const hidl_vec combinationsSta = { - {{{{IfaceConcurrencyType::STA}, 1}, - {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} + // 1 STA + 1 of (P2P or NAN) + const std::vector combinationsSta = + { + { + { + {{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN_IFACE}, 1} + } + } }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta} }; // clang-format on @@ -94,12 +121,23 @@ class WifiChipTest : public Test { void setupV2_AwareIfaceCombination() { // clang-format off - const hidl_vec combinations = { - {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::AP}, 1}}}, - {{{{IfaceConcurrencyType::STA}, 1}, - {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} + // (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN)) + const std::vector combinations = + { + { + { + {{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::AP}, 1} + } + }, + { + { + {{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN_IFACE}, 1} + } + } }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on @@ -108,11 +146,17 @@ class WifiChipTest : public Test { void setupV2_AwareDisabledApIfaceCombination() { // clang-format off - const hidl_vec combinations = { - {{{{IfaceConcurrencyType::STA}, 1}, - {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} + // 1 STA + 1 of (P2P or NAN) + const std::vector combinations = + { + { + { + {{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN_IFACE}, 1} + } + } }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on @@ -121,10 +165,17 @@ class WifiChipTest : public Test { void setup_MultiIfaceCombination() { // clang-format off - const hidl_vec combinations = { - {{{{IfaceConcurrencyType::STA}, 3}, {{IfaceConcurrencyType::AP}, 1}}} + // 3 STA + 1 AP + const std::vector combinations = + { + { + { + {{IfaceConcurrencyType::STA}, 3}, + {{IfaceConcurrencyType::AP}, 1} + } + } }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on @@ -132,134 +183,93 @@ class WifiChipTest : public Test { } void assertNumberOfModes(uint32_t num_modes) { - chip_->getAvailableModes_1_6([num_modes](const WifiStatus& status, - const std::vector& modes) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - // V2_Aware has 1 mode of operation. - ASSERT_EQ(num_modes, modes.size()); - }); + std::vector modes; + ASSERT_TRUE(chip_->getAvailableModes(&modes).isOk()); + // V2_Aware has 1 mode of operation. + ASSERT_EQ(num_modes, modes.size()); } void findModeAndConfigureForIfaceType(const IfaceConcurrencyType& type) { - // This should be aligned with kInvalidModeId in wifi_chip.cpp. - ChipModeId mode_id = UINT32_MAX; - chip_->getAvailableModes_1_6([&mode_id, &type]( - const WifiStatus& status, - const std::vector& modes) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - for (const auto& mode : modes) { - for (const auto& combination : mode.availableCombinations) { - for (const auto& limit : combination.limits) { - if (limit.types.end() != - std::find(limit.types.begin(), limit.types.end(), type)) { - mode_id = mode.id; - } + // This should be aligned with kInvalidModeId in wifi_chip.cpp + int32_t mode_id = INT32_MAX; + std::vector modes; + ASSERT_TRUE(chip_->getAvailableModes(&modes).isOk()); + + for (const auto& mode : modes) { + for (const auto& combination : mode.availableCombinations) { + for (const auto& limit : combination.limits) { + if (limit.types.end() != + std::find(limit.types.begin(), limit.types.end(), type)) { + mode_id = mode.id; } } } - }); - ASSERT_NE(UINT32_MAX, mode_id); + } - chip_->configureChip(mode_id, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + ASSERT_NE(INT32_MAX, mode_id); + ASSERT_TRUE(chip_->configureChip(mode_id).isOk()); } // Returns an empty string on error. std::string createIface(const IfaceType& type) { std::string iface_name; if (type == IfaceType::AP) { - chip_->createApIface( - [&iface_name](const WifiStatus& status, const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); - } else if (type == IfaceType::NAN) { - chip_->createNanIface( - [&iface_name](const WifiStatus& status, - const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + std::shared_ptr iface; + if (!chip_->createApIface(&iface).isOk()) { + return ""; + } + EXPECT_NE(iface.get(), nullptr); + EXPECT_TRUE(iface->getName(&iface_name).isOk()); + } else if (type == IfaceType::NAN_IFACE) { + std::shared_ptr iface; + if (!chip_->createNanIface(&iface).isOk()) { + return ""; + } + EXPECT_NE(iface.get(), nullptr); + EXPECT_TRUE(iface->getName(&iface_name).isOk()); } else if (type == IfaceType::P2P) { - chip_->createP2pIface( - [&iface_name](const WifiStatus& status, const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + std::shared_ptr iface; + if (!chip_->createP2pIface(&iface).isOk()) { + return ""; + } + EXPECT_NE(iface.get(), nullptr); + EXPECT_TRUE(iface->getName(&iface_name).isOk()); } else if (type == IfaceType::STA) { - chip_->createStaIface( - [&iface_name](const WifiStatus& status, const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + std::shared_ptr iface; + if (!chip_->createStaIface(&iface).isOk()) { + return ""; + } + EXPECT_NE(iface.get(), nullptr); + EXPECT_TRUE(iface->getName(&iface_name).isOk()); } return iface_name; } void removeIface(const IfaceType& type, const std::string& iface_name) { if (type == IfaceType::AP) { - chip_->removeApIface(iface_name, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); - } else if (type == IfaceType::NAN) { - chip_->removeNanIface(iface_name, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + ASSERT_TRUE(chip_->removeApIface(iface_name).isOk()); + } else if (type == IfaceType::NAN_IFACE) { + ASSERT_TRUE(chip_->removeNanIface(iface_name).isOk()); } else if (type == IfaceType::P2P) { - chip_->removeP2pIface(iface_name, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + ASSERT_TRUE(chip_->removeP2pIface(iface_name).isOk()); } else if (type == IfaceType::STA) { - chip_->removeStaIface(iface_name, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + ASSERT_TRUE(chip_->removeStaIface(iface_name).isOk()); } } bool createRttController() { - bool success = false; - chip_->createRttController_1_6( - NULL, [&success](const WifiStatus& status, const sp& rtt) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(rtt.get(), nullptr); - success = true; - } - }); - return success; + std::shared_ptr rtt_controller; + auto status = chip_->createRttController(nullptr, &rtt_controller); + return status.isOk(); } static void subsystemRestartHandler(const std::string& /*error*/) {} - sp chip_; - ChipId chip_id_ = kFakeChipId; + std::shared_ptr chip_; + int chip_id_ = kFakeChipId; legacy_hal::wifi_hal_fn fake_func_table_; - std::shared_ptr> iface_tool_{ - new NiceMock}; + std::shared_ptr> iface_tool_{ + new NiceMock<::android::wifi_system::MockInterfaceTool>}; std::shared_ptr> legacy_hal_{ new NiceMock(iface_tool_, fake_func_table_, true)}; std::shared_ptr> mode_controller_{ @@ -271,8 +281,8 @@ class WifiChipTest : public Test { public: void SetUp() override { - chip_ = new WifiChip(chip_id_, true, legacy_hal_, mode_controller_, iface_util_, - feature_flags_, subsystemRestartHandler); + chip_ = WifiChip::create(chip_id_, true, legacy_hal_, mode_controller_, iface_util_, + feature_flags_, subsystemRestartHandler, true); EXPECT_CALL(*mode_controller_, changeFirmwareMode(testing::_)) .WillRepeatedly(testing::Return(true)); @@ -301,7 +311,7 @@ class WifiChipV1IfaceCombinationTest : public WifiChipTest { setupV1IfaceCombination(); WifiChipTest::SetUp(); // V1 has 2 modes of operation. - assertNumberOfModes(2u); + assertNumberOfModes(2); } }; @@ -317,7 +327,7 @@ TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) { TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateAp_ShouldFail) { @@ -348,7 +358,7 @@ TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateP2p_ShouldFail) { TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); } ////////// V1 + Aware Iface Combinations //////////// @@ -376,7 +386,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) { TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateNan_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateAp_ShouldFail) { @@ -393,37 +403,37 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2PNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - const auto p2p_iface_name = createIface(IfaceType::P2P); + std::string p2p_iface_name = createIface(IfaceType::P2P); ASSERT_FALSE(p2p_iface_name.empty()); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); // After removing P2P iface, NAN iface creation should succeed. removeIface(IfaceType::P2P, p2p_iface_name); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - const auto nan_iface_name = createIface(IfaceType::NAN); + std::string nan_iface_name = createIface(IfaceType::NAN_IFACE); ASSERT_FALSE(nan_iface_name.empty()); ASSERT_TRUE(createIface(IfaceType::P2P).empty()); // After removing NAN iface, P2P iface creation should succeed. - removeIface(IfaceType::NAN, nan_iface_name); + removeIface(IfaceType::NAN_IFACE, nan_iface_name); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } @@ -444,7 +454,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateP2p_ShouldFail) { TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) { @@ -460,7 +470,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) { TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowApToSta) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); - const auto ap_iface_name = createIface(IfaceType::AP); + std::string ap_iface_name = createIface(IfaceType::AP); ASSERT_FALSE(ap_iface_name.empty()); ASSERT_FALSE(createRttController()); @@ -475,9 +485,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); - chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF).isOk()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { @@ -485,9 +493,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { ASSERT_EQ(createIface(IfaceType::AP), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); - chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF).isOk()); } ////////// V2 + Aware Iface Combinations //////////// @@ -515,7 +521,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateP2p_ShouldSucceed) { TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNan_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateAp_ShouldSucceed) { @@ -543,9 +549,9 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApSta_ShouldSucceed) { TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_AfterStaApRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); - const auto sta_iface_name = createIface(IfaceType::STA); + std::string sta_iface_name = createIface(IfaceType::STA); ASSERT_FALSE(sta_iface_name.empty()); - const auto ap_iface_name = createIface(IfaceType::AP); + std::string ap_iface_name = createIface(IfaceType::AP); ASSERT_FALSE(ap_iface_name.empty()); ASSERT_TRUE(createIface(IfaceType::STA).empty()); @@ -565,44 +571,44 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_ShouldSucceed) { TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2PNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_AfterP2pRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - const auto p2p_iface_name = createIface(IfaceType::P2P); + std::string p2p_iface_name = createIface(IfaceType::P2P); ASSERT_FALSE(p2p_iface_name.empty()); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); // After removing P2P iface, NAN iface creation should succeed. removeIface(IfaceType::P2P, p2p_iface_name); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_AfterNanRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - const auto nan_iface_name = createIface(IfaceType::NAN); + std::string nan_iface_name = createIface(IfaceType::NAN_IFACE); ASSERT_FALSE(nan_iface_name.empty()); ASSERT_TRUE(createIface(IfaceType::P2P).empty()); // After removing NAN iface, P2P iface creation should succeed. - removeIface(IfaceType::NAN, nan_iface_name); + removeIface(IfaceType::NAN_IFACE, nan_iface_name); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_FALSE(createIface(IfaceType::AP).empty()); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApP2p_ShouldFail) { @@ -614,31 +620,31 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApP2p_ShouldFail) { TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - const auto p2p_iface_name = createIface(IfaceType::P2P); + std::string p2p_iface_name = createIface(IfaceType::P2P); ASSERT_FALSE(p2p_iface_name.empty()); - ASSERT_TRUE(createIface(IfaceType::NAN).empty()); + ASSERT_TRUE(createIface(IfaceType::NAN_IFACE).empty()); // After removing P2P iface, NAN iface creation should succeed. removeIface(IfaceType::P2P, p2p_iface_name); - ASSERT_FALSE(createIface(IfaceType::NAN).empty()); + ASSERT_FALSE(createIface(IfaceType::NAN_IFACE).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); - const auto nan_iface_name = createIface(IfaceType::NAN); + std::string nan_iface_name = createIface(IfaceType::NAN_IFACE); ASSERT_FALSE(nan_iface_name.empty()); ASSERT_TRUE(createIface(IfaceType::P2P).empty()); // After removing NAN iface, P2P iface creation should succeed. - removeIface(IfaceType::NAN, nan_iface_name); + removeIface(IfaceType::NAN_IFACE, nan_iface_name); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_EnsureDifferentIfaceNames) { findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); - const auto sta_iface_name = createIface(IfaceType::STA); - const auto ap_iface_name = createIface(IfaceType::AP); + std::string sta_iface_name = createIface(IfaceType::STA); + std::string ap_iface_name = createIface(IfaceType::AP); ASSERT_FALSE(sta_iface_name.empty()); ASSERT_FALSE(ap_iface_name.empty()); ASSERT_NE(sta_iface_name, ap_iface_name); @@ -667,9 +673,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); - chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF).isOk()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { @@ -677,9 +681,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan1", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); - chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF).isOk()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) { @@ -687,35 +689,29 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); // Create NAN iface - ASSERT_EQ(createIface(IfaceType::NAN), "wlan0"); + ASSERT_EQ(createIface(IfaceType::NAN_IFACE), "wlan0"); // We should have 1 nan iface. - chip_->getNanIfaceNames([](const WifiStatus& status, const hidl_vec& iface_names) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - ASSERT_EQ(iface_names.size(), 1u); - ASSERT_EQ(iface_names[0], "wlan0"); - }); - // Retrieve the exact iface object. - sp nan_iface; - chip_->getNanIface("wlan0", - [&nan_iface](const WifiStatus& status, - const sp& iface) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - ASSERT_NE(iface.get(), nullptr); - nan_iface = iface; - }); + std::vector iface_names; + ASSERT_TRUE(chip_->getNanIfaceNames(&iface_names).isOk()); + ASSERT_EQ(iface_names.size(), 1u); + ASSERT_EQ(iface_names[0], "wlan0"); - // Remove the STA iface. + // Retrieve the nan iface object. + std::shared_ptr nan_iface; + ASSERT_TRUE(chip_->getNanIface("wlan0", &nan_iface).isOk()); + ASSERT_NE(nan_iface.get(), nullptr); + + // Remove the STA iface. We should have 0 nan ifaces now. removeIface(IfaceType::STA, "wlan0"); - // We should have 0 nan iface now. - chip_->getNanIfaceNames([](const WifiStatus& status, const hidl_vec& iface_names) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - ASSERT_EQ(iface_names.size(), 0u); - }); - // Any operation on the nan iface object should return error now. - nan_iface->getName([](const WifiStatus& status, const std::string& /* iface_name */) { - ASSERT_EQ(WifiStatusCode::ERROR_WIFI_IFACE_INVALID, status.code); - }); + ASSERT_TRUE(chip_->getNanIfaceNames(&iface_names).isOk()); + ASSERT_EQ(iface_names.size(), 0u); + + // Any operation on the nan iface object should now return an error. + std::string name; + auto status = nan_iface->getName(&name); + ASSERT_EQ(status.getServiceSpecificError(), + static_cast(WifiStatusCode::ERROR_WIFI_IFACE_INVALID)); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnStaRemove) { @@ -723,30 +719,25 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnS ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); // Create RTT controller - sp rtt_controller; - chip_->createRttController_1_6( - NULL, [&rtt_controller](const WifiStatus& status, const sp& rtt) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(rtt.get(), nullptr); - rtt_controller = rtt; - } - }); + std::shared_ptr rtt_controller; + ASSERT_TRUE(chip_->createRttController(nullptr, &rtt_controller).isOk()); // Remove the STA iface. removeIface(IfaceType::STA, "wlan0"); - // Any operation on the rtt controller object should return error now. - rtt_controller->getBoundIface([](const WifiStatus& status, const sp& /* iface */) { - ASSERT_EQ(WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, status.code); - }); + // Any operation on the rtt controller object should now return an error. + std::shared_ptr bound_iface; + auto status = rtt_controller->getBoundIface(&bound_iface); + ASSERT_EQ(status.getServiceSpecificError(), + static_cast(WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID)); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithSharedNanIface) { property_set("wifi.aware.interface", nullptr); findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); - ASSERT_EQ(createIface(IfaceType::NAN), "wlan0"); - removeIface(IfaceType::NAN, "wlan0"); + ASSERT_EQ(createIface(IfaceType::NAN_IFACE), "wlan0"); + removeIface(IfaceType::NAN_IFACE, "wlan0"); EXPECT_CALL(*iface_util_, setUpState(testing::_, testing::_)).Times(0); } @@ -756,10 +747,10 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithDedicatedNanIface) { ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*iface_util_, ifNameToIndex("aware0")).WillOnce(testing::Return(4)); EXPECT_CALL(*iface_util_, setUpState("aware0", true)).WillOnce(testing::Return(true)); - ASSERT_EQ(createIface(IfaceType::NAN), "aware0"); + ASSERT_EQ(createIface(IfaceType::NAN_IFACE), "aware0"); EXPECT_CALL(*iface_util_, setUpState("aware0", false)).WillOnce(testing::Return(true)); - removeIface(IfaceType::NAN, "aware0"); + removeIface(IfaceType::NAN_IFACE, "aware0"); } ////////// V1 Iface Combinations when AP creation is disabled ////////// @@ -857,8 +848,8 @@ TEST_F(WifiChip_MultiIfaceTest, CreateApStartsWithIdx1) { ASSERT_EQ(createIface(IfaceType::STA), "wlan1"); ASSERT_EQ(createIface(IfaceType::STA), "wlan3"); } -} // namespace implementation -} // namespace V1_6 + } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/tests/wifi_iface_util_unit_tests.cpp b/wifi/aidl/default/tests/wifi_iface_util_unit_tests.cpp similarity index 92% rename from wifi/1.6/default/tests/wifi_iface_util_unit_tests.cpp rename to wifi/aidl/default/tests/wifi_iface_util_unit_tests.cpp index cc9a3340a5..e0db6fdc90 100644 --- a/wifi/1.6/default/tests/wifi_iface_util_unit_tests.cpp +++ b/wifi/aidl/default/tests/wifi_iface_util_unit_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019, The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ #include #include -#undef NAN #include "wifi_iface_util.h" #include "mock_interface_tool.h" @@ -38,16 +37,16 @@ bool isValidUnicastLocallyAssignedMacAddress(const std::array& mac_a } } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace iface_util { + class WifiIfaceUtilTest : public Test { protected: - std::shared_ptr> iface_tool_{ - new NiceMock}; + std::shared_ptr> iface_tool_{ + new NiceMock<::android::wifi_system::MockInterfaceTool>}; legacy_hal::wifi_hal_fn fake_func_table_; std::shared_ptr> legacy_hal_{ new NiceMock(iface_tool_, fake_func_table_, true)}; @@ -89,8 +88,7 @@ TEST_F(WifiIfaceUtilTest, IfaceEventHandlers_SetMacAddress) { ASSERT_FALSE(callback_invoked); } } // namespace iface_util -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp new file mode 100644 index 0000000000..d58a9b0ace --- /dev/null +++ b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "wifi_nan_iface.h" + +#include "mock_interface_tool.h" +#include "mock_wifi_feature_flags.h" +#include "mock_wifi_iface_util.h" +#include "mock_wifi_legacy_hal.h" + +using testing::NiceMock; +using testing::Return; +using testing::Test; + +namespace { +constexpr char kIfaceName[] = "mockWlan0"; +} // namespace + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +bool CaptureIfaceEventHandlers(const std::string& /* iface_name*/, + iface_util::IfaceEventHandlers in_iface_event_handlers, + iface_util::IfaceEventHandlers* out_iface_event_handlers) { + *out_iface_event_handlers = in_iface_event_handlers; + return true; +} + +class MockNanIface : public WifiNanIface { + public: + MockNanIface(const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) + : WifiNanIface(ifname, is_dedicated_iface, legacy_hal, iface_util) {} + + static std::shared_ptr createMock( + const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) { + std::shared_ptr ptr = ndk::SharedRefBase::make( + ifname, is_dedicated_iface, legacy_hal, iface_util); + std::weak_ptr weak_ptr_this(ptr); + ptr->setWeakPtr(weak_ptr_this); + ptr->registerCallbackHandlers(); + return ptr; + } + + // Override getEventCallbacks() so that we can return a mocked callback object. + std::set> getEventCallbacks() override { + return {callback_}; + } + + void setMockCallback(std::shared_ptr cb) { callback_ = cb; } + + private: + std::shared_ptr callback_; +}; + +class MockNanIfaceEventCallback : public IWifiNanIfaceEventCallback { + public: + ndk::SpAIBinder asBinder() override { return ::ndk::SpAIBinder{}; } + bool isRemote() override { return false; } + + ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override { + *_aidl_return = 1; + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override { + *_aidl_return = "some_hash"; + return ndk::ScopedAStatus::ok(); + } + + MOCK_METHOD3(notifyCapabilitiesResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&, const NanCapabilities&)); + MOCK_METHOD2(notifyEnableResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifyConfigResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifyDisableResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD3(notifyStartPublishResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&, int8_t)); + MOCK_METHOD2(notifyStopPublishResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD3(notifyStartSubscribeResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&, int8_t)); + MOCK_METHOD2(notifyStopSubscribeResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifyTransmitFollowupResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifyCreateDataInterfaceResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifyDeleteDataInterfaceResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD3(notifyInitiateDataPathResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&, int32_t)); + MOCK_METHOD2(notifyRespondToDataPathIndicationResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifyTerminateDataPathResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD1(eventClusterEvent, ndk::ScopedAStatus(const NanClusterEventInd&)); + MOCK_METHOD1(eventDisabled, ndk::ScopedAStatus(const NanStatus&)); + MOCK_METHOD2(eventPublishTerminated, ndk::ScopedAStatus(int8_t, const NanStatus&)); + MOCK_METHOD2(eventSubscribeTerminated, ndk::ScopedAStatus(int8_t, const NanStatus&)); + MOCK_METHOD1(eventMatch, ndk::ScopedAStatus(const NanMatchInd&)); + MOCK_METHOD2(eventMatchExpired, ndk::ScopedAStatus(int8_t, int32_t)); + MOCK_METHOD1(eventFollowupReceived, ndk::ScopedAStatus(const NanFollowupReceivedInd&)); + MOCK_METHOD2(eventTransmitFollowup, ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD1(eventDataPathRequest, ndk::ScopedAStatus(const NanDataPathRequestInd&)); + MOCK_METHOD1(eventDataPathConfirm, ndk::ScopedAStatus(const NanDataPathConfirmInd&)); + MOCK_METHOD1(eventDataPathTerminated, ndk::ScopedAStatus(int32_t)); + MOCK_METHOD1(eventDataPathScheduleUpdate, + ndk::ScopedAStatus(const NanDataPathScheduleUpdateInd&)); + MOCK_METHOD1(eventPairingConfirm, ndk::ScopedAStatus(const NanPairingConfirmInd&)); + MOCK_METHOD1(eventPairingRequest, ndk::ScopedAStatus(const NanPairingRequestInd&)); + MOCK_METHOD1(eventBootstrappingConfirm, ndk::ScopedAStatus(const NanBootstrappingConfirmInd&)); + MOCK_METHOD1(eventBootstrappingRequest, ndk::ScopedAStatus(const NanBootstrappingRequestInd&)); + MOCK_METHOD3(notifyInitiatePairingResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&, int32_t)); + MOCK_METHOD2(notifyRespondToPairingIndicationResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD3(notifyInitiateBootstrappingResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&, int32_t)); + MOCK_METHOD2(notifyRespondToBootstrappingIndicationResponse, + ndk::ScopedAStatus(char16_t, const NanStatus&)); + MOCK_METHOD2(notifySuspendResponse, ndk::ScopedAStatus(char16_t, const NanStatus&)); + 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&)); +}; + +class WifiNanIfaceTest : public Test { + protected: + legacy_hal::wifi_hal_fn fake_func_table_; + std::shared_ptr> iface_tool_{ + new NiceMock<::android::wifi_system::MockInterfaceTool>}; + std::shared_ptr> legacy_hal_{ + new NiceMock(iface_tool_, fake_func_table_, true)}; + std::shared_ptr> iface_util_{ + new NiceMock(iface_tool_, legacy_hal_)}; +}; + +TEST_F(WifiNanIfaceTest, IfacEventHandlers_OnStateToggleOffOn) { + // Ensure that event handlers are registered during nan iface creation. + iface_util::IfaceEventHandlers captured_iface_event_handlers = {}; + EXPECT_CALL(*legacy_hal_, nanRegisterCallbackHandlers(testing::_, testing::_)) + .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); + EXPECT_CALL(*iface_util_, registerIfaceEventHandlers(testing::_, testing::_)) + .WillOnce(testing::Invoke(bind(CaptureIfaceEventHandlers, std::placeholders::_1, + std::placeholders::_2, &captured_iface_event_handlers))); + + // Create nan iface and register a callback. + // Note: Since we can't register a callback directly (gTest fails on + // AIBinder_linkToDeath), simulate the registration by overriding + // getEventCallbacks() to return our mock callback object. + std::shared_ptr mock_nan_iface = + MockNanIface::createMock(kIfaceName, false, legacy_hal_, iface_util_); + std::shared_ptr mock_event_callback = + ndk::SharedRefBase::make(); + mock_nan_iface->setMockCallback(mock_event_callback); + + // Ensure that the eventDisabled() function in the mock callback will be invoked. + NanStatus expected_nan_status = {NanStatusCode::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; + EXPECT_CALL(*mock_event_callback, eventDisabled(expected_nan_status)).Times(1); + + // Trigger the iface state toggle callback. + captured_iface_event_handlers.on_state_toggle_off_on(kIfaceName); +} + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi.cpp b/wifi/aidl/default/wifi.cpp similarity index 60% rename from wifi/1.6/default/wifi.cpp rename to wifi/aidl/default/wifi.cpp index c302ce2434..34a7f35d4d 100644 --- a/wifi/1.6/default/wifi.cpp +++ b/wifi/aidl/default/wifi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,28 @@ * limitations under the License. */ +#include "wifi.h" + #include -#include "hidl_return_util.h" -#include "wifi.h" +#include "aidl_return_util.h" +#include "aidl_sync_util.h" #include "wifi_status_util.h" namespace { // Starting Chip ID, will be assigned to primary chip -static constexpr android::hardware::wifi::V1_0::ChipId kPrimaryChipId = 0; +static constexpr int32_t kPrimaryChipId = 0; } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; -using hidl_return_util::validateAndCallWithLock; +using aidl_return_util::validateAndCall; +using aidl_return_util::validateAndCallWithLock; +using aidl_sync_util::acquireGlobalLock; -Wifi::Wifi(const std::shared_ptr iface_tool, +Wifi::Wifi(const std::shared_ptr<::android::wifi_system::InterfaceTool> iface_tool, const std::shared_ptr legacy_hal_factory, const std::shared_ptr mode_controller, const std::shared_ptr feature_flags) @@ -48,86 +50,75 @@ bool Wifi::isValid() { return true; } -Return Wifi::registerEventCallback(const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { +ndk::ScopedAStatus Wifi::registerEventCallback( + const std::shared_ptr& in_callback) { return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::registerEventCallbackInternal, hidl_status_cb, event_callback); + &Wifi::registerEventCallbackInternal, in_callback); } -Return Wifi::registerEventCallback_1_5(const sp& event_callback, - registerEventCallback_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::registerEventCallbackInternal_1_5, hidl_status_cb, - event_callback); +ndk::ScopedAStatus Wifi::isStarted(bool* _aidl_return) { + *_aidl_return = (run_state_ != RunState::STOPPED); + return ndk::ScopedAStatus::ok(); } -Return Wifi::isStarted() { - return run_state_ != RunState::STOPPED; +ndk::ScopedAStatus Wifi::start() { + return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::startInternal); } -Return Wifi::start(start_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::startInternal, - hidl_status_cb); +ndk::ScopedAStatus Wifi::stop() { + return validateAndCallWithLock(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::stopInternal); } -Return Wifi::stop(stop_cb hidl_status_cb) { - return validateAndCallWithLock(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::stopInternal, - hidl_status_cb); -} - -Return Wifi::getChipIds(getChipIds_cb hidl_status_cb) { +ndk::ScopedAStatus Wifi::getChipIds(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::getChipIdsInternal, - hidl_status_cb); + _aidl_return); } -Return Wifi::getChip(ChipId chip_id, getChip_cb hidl_status_cb) { +ndk::ScopedAStatus Wifi::getChip(int32_t in_chipId, std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::getChipInternal, - hidl_status_cb, chip_id); + _aidl_return, in_chipId); } -Return Wifi::debug(const hidl_handle& handle, const hidl_vec&) { - LOG(INFO) << "-----------Debug is called----------------"; +binder_status_t Wifi::dump(int fd, const char** args, uint32_t numArgs) { + const auto lock = acquireGlobalLock(); + LOG(INFO) << "-----------Debug was called----------------"; if (chips_.size() == 0) { - return Void(); + LOG(INFO) << "No chips to display."; + return STATUS_OK; } - for (sp chip : chips_) { + for (std::shared_ptr chip : chips_) { if (!chip.get()) continue; - - chip->debug(handle, {}); + chip->dump(fd, args, numArgs); } - return Void(); + return STATUS_OK; } -WifiStatus Wifi::registerEventCallbackInternal( - const sp& event_callback __unused) { - // Deprecated support for this callback. - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus Wifi::registerEventCallbackInternal_1_5( - const sp& event_callback) { +ndk::ScopedAStatus Wifi::registerEventCallbackInternal( + const std::shared_ptr& event_callback) { if (!event_cb_handler_.addCallback(event_callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -WifiStatus Wifi::startInternal() { +ndk::ScopedAStatus Wifi::startInternal() { if (run_state_ == RunState::STARTED) { - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } else if (run_state_ == RunState::STOPPING) { return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, "HAL is stopping"); } - WifiStatus wifi_status = initializeModeControllerAndLegacyHal(); - if (wifi_status.code == WifiStatusCode::SUCCESS) { + ndk::ScopedAStatus wifi_status = initializeModeControllerAndLegacyHal(); + if (wifi_status.isOk()) { // Register the callback for subsystem restart const auto& on_subsystem_restart_callback = [this](const std::string& error) { - WifiStatus wifi_status = createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error); + ndk::ScopedAStatus wifi_status = createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error); for (const auto& callback : event_cb_handler_.getCallbacks()) { LOG(INFO) << "Attempting to invoke onSubsystemRestart " "callback"; - if (!callback->onSubsystemRestart(wifi_status).isOk()) { + WifiStatusCode errorCode = + static_cast(wifi_status.getServiceSpecificError()); + if (!callback->onSubsystemRestart(errorCode).isOk()) { LOG(ERROR) << "Failed to invoke onSubsystemRestart callback"; } else { LOG(INFO) << "Succeeded to invoke onSubsystemRestart " @@ -137,12 +128,12 @@ WifiStatus Wifi::startInternal() { }; // Create the chip instance once the HAL is started. - android::hardware::wifi::V1_0::ChipId chipId = kPrimaryChipId; + int32_t chipId = kPrimaryChipId; for (auto& hal : legacy_hals_) { chips_.push_back( - new WifiChip(chipId, chipId == kPrimaryChipId, hal, mode_controller_, - std::make_shared(iface_tool_, hal), - feature_flags_, on_subsystem_restart_callback)); + WifiChip::create(chipId, chipId == kPrimaryChipId, hal, mode_controller_, + std::make_shared(iface_tool_, hal), + feature_flags_, on_subsystem_restart_callback, false)); chipId++; } run_state_ = RunState::STARTED; @@ -154,7 +145,9 @@ WifiStatus Wifi::startInternal() { LOG(INFO) << "Wifi HAL started"; } else { for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback->onFailure(wifi_status).isOk()) { + WifiStatusCode errorCode = + static_cast(wifi_status.getServiceSpecificError()); + if (!callback->onFailure(errorCode).isOk()) { LOG(ERROR) << "Failed to invoke onFailure callback"; } } @@ -165,10 +158,10 @@ WifiStatus Wifi::startInternal() { return wifi_status; } -WifiStatus Wifi::stopInternal( +ndk::ScopedAStatus Wifi::stopInternal( /* NONNULL */ std::unique_lock* lock) { if (run_state_ == RunState::STOPPED) { - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } else if (run_state_ == RunState::STOPPING) { return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, "HAL is stopping"); } @@ -177,12 +170,12 @@ WifiStatus Wifi::stopInternal( for (auto& chip : chips_) { if (chip.get()) { chip->invalidate(); - chip.clear(); + chip.reset(); } } chips_.clear(); - WifiStatus wifi_status = stopLegacyHalAndDeinitializeModeController(lock); - if (wifi_status.code == WifiStatusCode::SUCCESS) { + ndk::ScopedAStatus wifi_status = stopLegacyHalAndDeinitializeModeController(lock); + if (wifi_status.isOk()) { for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onStop().isOk()) { LOG(ERROR) << "Failed to invoke onStop callback"; @@ -191,7 +184,9 @@ WifiStatus Wifi::stopInternal( LOG(INFO) << "Wifi HAL stopped"; } else { for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback->onFailure(wifi_status).isOk()) { + WifiStatusCode errorCode = + static_cast(wifi_status.getServiceSpecificError()); + if (!callback->onFailure(errorCode).isOk()) { LOG(ERROR) << "Failed to invoke onFailure callback"; } } @@ -202,27 +197,26 @@ WifiStatus Wifi::stopInternal( return wifi_status; } -std::pair> Wifi::getChipIdsInternal() { - std::vector chip_ids; +std::pair, ndk::ScopedAStatus> Wifi::getChipIdsInternal() { + std::vector chip_ids; for (auto& chip : chips_) { - ChipId chip_id = getChipIdFromWifiChip(chip); - if (chip_id != UINT32_MAX) chip_ids.emplace_back(chip_id); + int32_t chip_id = getChipIdFromWifiChip(chip); + if (chip_id != INT32_MAX) chip_ids.emplace_back(chip_id); } - return {createWifiStatus(WifiStatusCode::SUCCESS), std::move(chip_ids)}; + return {std::move(chip_ids), ndk::ScopedAStatus::ok()}; } -std::pair> Wifi::getChipInternal(ChipId chip_id) { +std::pair, ndk::ScopedAStatus> Wifi::getChipInternal(int32_t chip_id) { for (auto& chip : chips_) { - ChipId cand_id = getChipIdFromWifiChip(chip); - if ((cand_id != UINT32_MAX) && (cand_id == chip_id)) - return {createWifiStatus(WifiStatusCode::SUCCESS), chip}; + int32_t cand_id = getChipIdFromWifiChip(chip); + if ((cand_id != INT32_MAX) && (cand_id == chip_id)) return {chip, ndk::ScopedAStatus::ok()}; } - return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; } -WifiStatus Wifi::initializeModeControllerAndLegacyHal() { +ndk::ScopedAStatus Wifi::initializeModeControllerAndLegacyHal() { if (!mode_controller_->initialize()) { LOG(ERROR) << "Failed to initialize firmware mode controller"; return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); @@ -244,10 +238,10 @@ WifiStatus Wifi::initializeModeControllerAndLegacyHal() { } index++; } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -WifiStatus Wifi::stopLegacyHalAndDeinitializeModeController( +ndk::ScopedAStatus Wifi::stopLegacyHalAndDeinitializeModeController( /* NONNULL */ std::unique_lock* lock) { legacy_hal::wifi_error legacy_status = legacy_hal::WIFI_SUCCESS; int index = 0; @@ -272,23 +266,22 @@ WifiStatus Wifi::stopLegacyHalAndDeinitializeModeController( LOG(ERROR) << "Failed to deinitialize firmware mode controller"; return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -ChipId Wifi::getChipIdFromWifiChip(sp& chip) { - ChipId chip_id = UINT32_MAX; +int32_t Wifi::getChipIdFromWifiChip(std::shared_ptr& chip) { + int32_t chip_id = INT32_MAX; if (chip.get()) { - chip->getId([&](WifiStatus status, uint32_t id) { - if (status.code == WifiStatusCode::SUCCESS) { - chip_id = id; - } - }); + ndk::ScopedAStatus status = chip->getId(&chip_id); + if (!status.isOk()) { + // Reset value if operation failed. + chip_id = INT32_MAX; + } } - return chip_id; } -} // namespace implementation -} // namespace V1_6 + } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/wifi.h b/wifi/aidl/default/wifi.h new file mode 100644 index 0000000000..933452448e --- /dev/null +++ b/wifi/aidl/default/wifi.h @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WIFI_H_ +#define WIFI_H_ + +#include +#include +#include + +#include + +#include "aidl_callback_util.h" +#include "wifi_chip.h" +#include "wifi_feature_flags.h" +#include "wifi_legacy_hal.h" +#include "wifi_legacy_hal_factory.h" +#include "wifi_mode_controller.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +/** + * Root AIDL interface object used to control the Wifi HAL. + */ +class Wifi : public BnWifi { + public: + Wifi(const std::shared_ptr<::android::wifi_system::InterfaceTool> iface_tool, + const std::shared_ptr legacy_hal_factory, + const std::shared_ptr mode_controller, + const std::shared_ptr feature_flags); + + bool isValid(); + + // AIDL methods exposed. + ndk::ScopedAStatus registerEventCallback( + const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus isStarted(bool* _aidl_return) override; + ndk::ScopedAStatus start() override; + ndk::ScopedAStatus stop() override; + ndk::ScopedAStatus getChipIds(std::vector* _aidl_return) override; + ndk::ScopedAStatus getChip(int32_t in_chipId, + std::shared_ptr* _aidl_return) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + + private: + enum class RunState { STOPPED, STARTED, STOPPING }; + + // Corresponding worker functions for the AIDL methods. + ndk::ScopedAStatus registerEventCallbackInternal( + const std::shared_ptr& event_callback __unused); + ndk::ScopedAStatus startInternal(); + ndk::ScopedAStatus stopInternal(std::unique_lock* lock); + std::pair, ndk::ScopedAStatus> getChipIdsInternal(); + std::pair, ndk::ScopedAStatus> getChipInternal(int32_t chip_id); + + ndk::ScopedAStatus initializeModeControllerAndLegacyHal(); + ndk::ScopedAStatus stopLegacyHalAndDeinitializeModeController( + std::unique_lock* lock); + int32_t getChipIdFromWifiChip(std::shared_ptr& chip); + + // Instance is created in this root level |IWifi| AIDL interface object + // and shared with all the child AIDL interface objects. + std::shared_ptr<::android::wifi_system::InterfaceTool> iface_tool_; + std::shared_ptr legacy_hal_factory_; + std::shared_ptr mode_controller_; + std::vector> legacy_hals_; + std::shared_ptr feature_flags_; + RunState run_state_; + std::vector> chips_; + aidl_callback_util::AidlCallbackHandler event_cb_handler_; + + DISALLOW_COPY_AND_ASSIGN(Wifi); +}; + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // WIFI_H_ diff --git a/wifi/1.6/default/wifi_ap_iface.cpp b/wifi/aidl/default/wifi_ap_iface.cpp similarity index 54% rename from wifi/1.6/default/wifi_ap_iface.cpp rename to wifi/aidl/default/wifi_ap_iface.cpp index b2957db13f..77797502d3 100644 --- a/wifi/1.6/default/wifi_ap_iface.cpp +++ b/wifi/aidl/default/wifi_ap_iface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ +#include "wifi_ap_iface.h" + #include -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_ap_iface.h" +#include "aidl_return_util.h" +#include "aidl_struct_util.h" #include "wifi_status_util.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; +using aidl_return_util::validateAndCall; WifiApIface::WifiApIface(const std::string& ifname, const std::vector& instances, const std::weak_ptr legacy_hal, @@ -54,76 +54,48 @@ void WifiApIface::removeInstance(std::string instance) { instances_.erase(std::remove(instances_.begin(), instances_.end(), instance), instances_.end()); } -Return WifiApIface::getName(getName_cb hidl_status_cb) { +ndk::ScopedAStatus WifiApIface::getName(std::string* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getNameInternal, hidl_status_cb); + &WifiApIface::getNameInternal, _aidl_return); } -Return WifiApIface::getType(getType_cb hidl_status_cb) { +ndk::ScopedAStatus WifiApIface::setCountryCode(const std::array& in_code) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getTypeInternal, hidl_status_cb); + &WifiApIface::setCountryCodeInternal, in_code); } -Return WifiApIface::setCountryCode(const hidl_array& code, - setCountryCode_cb hidl_status_cb) { +ndk::ScopedAStatus WifiApIface::setMacAddress(const std::array& in_mac) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::setCountryCodeInternal, hidl_status_cb, code); + &WifiApIface::setMacAddressInternal, in_mac); } -Return WifiApIface::getValidFrequenciesForBand(V1_0::WifiBand band, - getValidFrequenciesForBand_cb hidl_status_cb) { +ndk::ScopedAStatus WifiApIface::getFactoryMacAddress(std::array* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getValidFrequenciesForBandInternal, hidl_status_cb, band); -} - -Return WifiApIface::setMacAddress(const hidl_array& mac, - setMacAddress_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::setMacAddressInternal, hidl_status_cb, mac); -} - -Return WifiApIface::getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getFactoryMacAddressInternal, hidl_status_cb, + &WifiApIface::getFactoryMacAddressInternal, _aidl_return, instances_.size() > 0 ? instances_[0] : ifname_); } -Return WifiApIface::resetToFactoryMacAddress(resetToFactoryMacAddress_cb hidl_status_cb) { +ndk::ScopedAStatus WifiApIface::resetToFactoryMacAddress() { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::resetToFactoryMacAddressInternal, hidl_status_cb); + &WifiApIface::resetToFactoryMacAddressInternal); } -Return WifiApIface::getBridgedInstances(getBridgedInstances_cb hidl_status_cb) { +ndk::ScopedAStatus WifiApIface::getBridgedInstances(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getBridgedInstancesInternal, hidl_status_cb); + &WifiApIface::getBridgedInstancesInternal, _aidl_return); } -std::pair WifiApIface::getNameInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; +std::pair WifiApIface::getNameInternal() { + return {ifname_, ndk::ScopedAStatus::ok()}; } -std::pair WifiApIface::getTypeInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::AP}; -} - -WifiStatus WifiApIface::setCountryCodeInternal(const std::array& code) { +ndk::ScopedAStatus WifiApIface::setCountryCodeInternal(const std::array& code) { legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setCountryCode( instances_.size() > 0 ? instances_[0] : ifname_, code); return createWifiStatusFromLegacyError(legacy_status); } -std::pair> -WifiApIface::getValidFrequenciesForBandInternal(V1_0::WifiBand band) { - static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch"); - legacy_hal::wifi_error legacy_status; - std::vector valid_frequencies; - std::tie(legacy_status, valid_frequencies) = legacy_hal_.lock()->getValidFrequenciesForBand( - instances_.size() > 0 ? instances_[0] : ifname_, - hidl_struct_util::convertHidlWifiBandToLegacy(band)); - return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies}; -} - -WifiStatus WifiApIface::setMacAddressInternal(const std::array& mac) { +ndk::ScopedAStatus WifiApIface::setMacAddressInternal(const std::array& mac) { // Support random MAC up to 2 interfaces if (instances_.size() == 2) { int rbyte = 1; @@ -145,35 +117,35 @@ WifiStatus WifiApIface::setMacAddressInternal(const std::array& mac) LOG(ERROR) << "Fail to config MAC for interface " << ifname_; return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -std::pair> WifiApIface::getFactoryMacAddressInternal( +std::pair, ndk::ScopedAStatus> WifiApIface::getFactoryMacAddressInternal( const std::string& ifaceName) { std::array mac = iface_util_.lock()->getFactoryMacAddress(ifaceName); if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && mac[4] == 0 && mac[5] == 0) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), mac}; + return {mac, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), mac}; + return {mac, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiApIface::resetToFactoryMacAddressInternal() { - std::pair> getMacResult; +ndk::ScopedAStatus WifiApIface::resetToFactoryMacAddressInternal() { + std::pair, ndk::ScopedAStatus> getMacResult; if (instances_.size() == 2) { for (auto const& intf : instances_) { getMacResult = getFactoryMacAddressInternal(intf); LOG(DEBUG) << "Reset MAC to factory MAC on " << intf; - if (getMacResult.first.code != WifiStatusCode::SUCCESS || - !iface_util_.lock()->setMacAddress(intf, getMacResult.second)) { + if (!getMacResult.second.isOk() || + !iface_util_.lock()->setMacAddress(intf, getMacResult.first)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } } - // It needs to set mac address for bridged interface, otherwise the mac + // We need to set mac address for bridged interface, otherwise the mac // address of the bridged interface will be changed after one of the - // instance down. Thus we are generating a random MAC address for the - // bridged interface even if we got the request to reset the Factory - // MAC. Since the bridged interface is an internal interface for the - // operation of bpf and others networking operation. + // instances goes down. Thus we are generating a random MAC address for + // the bridged interface even if we got the request to reset the Factory + // MAC. This is because the bridged interface is an internal interface + // for the operation of bpf and other networking operations. if (!iface_util_.lock()->setMacAddress(ifname_, iface_util_.lock()->createRandomMacAddress())) { LOG(ERROR) << "Fail to config MAC for bridged interface " << ifname_; @@ -182,23 +154,19 @@ WifiStatus WifiApIface::resetToFactoryMacAddressInternal() { } else { getMacResult = getFactoryMacAddressInternal(ifname_); LOG(DEBUG) << "Reset MAC to factory MAC on " << ifname_; - if (getMacResult.first.code != WifiStatusCode::SUCCESS || - !iface_util_.lock()->setMacAddress(ifname_, getMacResult.second)) { + if (!getMacResult.second.isOk() || + !iface_util_.lock()->setMacAddress(ifname_, getMacResult.first)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -std::pair> WifiApIface::getBridgedInstancesInternal() { - std::vector instances; - for (const auto& instance_name : instances_) { - instances.push_back(instance_name); - } - return {createWifiStatus(WifiStatusCode::SUCCESS), instances}; +std::pair, ndk::ScopedAStatus> WifiApIface::getBridgedInstancesInternal() { + return {instances_, ndk::ScopedAStatus::ok()}; } -} // namespace implementation -} // namespace V1_6 + } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/wifi_ap_iface.h b/wifi/aidl/default/wifi_ap_iface.h new file mode 100644 index 0000000000..7378f98acf --- /dev/null +++ b/wifi/aidl/default/wifi_ap_iface.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WIFI_AP_IFACE_H_ +#define WIFI_AP_IFACE_H_ + +#include +#include + +#include "wifi_iface_util.h" +#include "wifi_legacy_hal.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +/** + * AIDL interface object used to control an AP Iface instance. + */ +class WifiApIface : public BnWifiApIface { + public: + WifiApIface(const std::string& ifname, const std::vector& instances, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + // Refer to |WifiChip::invalidate()|. + void invalidate(); + bool isValid(); + std::string getName(); + void removeInstance(std::string instance); + + // AIDL methods exposed. + ndk::ScopedAStatus getName(std::string* _aidl_return) override; + ndk::ScopedAStatus setCountryCode(const std::array& in_code) override; + ndk::ScopedAStatus setMacAddress(const std::array& in_mac) override; + ndk::ScopedAStatus getFactoryMacAddress(std::array* _aidl_return) override; + ndk::ScopedAStatus resetToFactoryMacAddress() override; + ndk::ScopedAStatus getBridgedInstances(std::vector* _aidl_return) override; + + private: + // Corresponding worker functions for the AIDL methods. + std::pair getNameInternal(); + ndk::ScopedAStatus setCountryCodeInternal(const std::array& code); + ndk::ScopedAStatus setMacAddressInternal(const std::array& mac); + std::pair, ndk::ScopedAStatus> getFactoryMacAddressInternal( + const std::string& ifaceName); + ndk::ScopedAStatus resetToFactoryMacAddressInternal(); + std::pair, ndk::ScopedAStatus> getBridgedInstancesInternal(); + + std::string ifname_; + std::vector instances_; + std::weak_ptr legacy_hal_; + std::weak_ptr iface_util_; + bool is_valid_; + + DISALLOW_COPY_AND_ASSIGN(WifiApIface); +}; + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // WIFI_AP_IFACE_H_ diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp similarity index 65% rename from wifi/1.6/default/wifi_chip.cpp rename to wifi/aidl/default/wifi_chip.cpp index c7c00b17fd..6dd9156414 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/aidl/default/wifi_chip.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,30 +14,29 @@ * limitations under the License. */ -#include +#include "wifi_chip.h" #include #include #include +#include #include #include #include -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_chip.h" +#include "aidl_return_util.h" +#include "aidl_struct_util.h" +#include "wifi_legacy_hal.h" #include "wifi_status_util.h" #define P2P_MGMT_DEVICE_PREFIX "p2p-dev-" namespace { -using android::sp; +using aidl::android::hardware::wifi::IfaceType; +using aidl::android::hardware::wifi::IWifiChip; +using CoexRestriction = aidl::android::hardware::wifi::IWifiChip::CoexRestriction; +using ChannelCategoryMask = aidl::android::hardware::wifi::IWifiChip::ChannelCategoryMask; using android::base::unique_fd; -using android::hardware::hidl_string; -using android::hardware::hidl_vec; -using android::hardware::wifi::V1_0::ChipModeId; -using android::hardware::wifi::V1_0::IfaceType; -using android::hardware::wifi::V1_0::IWifiChip; constexpr char kCpioMagic[] = "070701"; constexpr size_t kMaxBufferSizeBytes = 1024 * 1024 * 3; @@ -50,13 +49,13 @@ constexpr unsigned kMaxWlanIfaces = 5; constexpr char kApBridgeIfacePrefix[] = "ap_br_"; template -void invalidateAndClear(std::vector>& ifaces, sp iface) { +void invalidateAndClear(std::vector>& ifaces, std::shared_ptr iface) { iface->invalidate(); ifaces.erase(std::remove(ifaces.begin(), ifaces.end(), iface), ifaces.end()); } template -void invalidateAndClearAll(std::vector>& ifaces) { +void invalidateAndClearAll(std::vector>& ifaces) { for (const auto& iface : ifaces) { iface->invalidate(); } @@ -64,8 +63,8 @@ void invalidateAndClearAll(std::vector>& ifaces) { } template -std::vector getNames(std::vector>& ifaces) { - std::vector names; +std::vector getNames(std::vector>& ifaces) { + std::vector names; for (const auto& iface : ifaces) { names.emplace_back(iface->getName()); } @@ -73,8 +72,9 @@ std::vector getNames(std::vector>& ifaces) { } template -sp findUsingName(std::vector>& ifaces, const std::string& name) { - std::vector names; +std::shared_ptr findUsingName(std::vector>& ifaces, + const std::string& name) { + std::vector names; for (const auto& iface : ifaces) { if (name == iface->getName()) { return iface; @@ -169,8 +169,8 @@ void setActiveWlanIfaceNameProperty(const std::string& ifname) { } } -// delete files that meet either conditions: -// 1. older than a predefined time in the wifi tombstone dir. +// Delete files that meet either condition: +// 1. Older than a predefined time in the wifi tombstone dir. // 2. Files in excess to a predefined amount, starting from the oldest ones bool removeOldFilesInternal() { time_t now = time(0); @@ -354,20 +354,20 @@ std::vector makeCharVec(const std::string& str) { } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; -using hidl_return_util::validateAndCallWithLock; +using aidl_return_util::validateAndCall; +using aidl_return_util::validateAndCallWithLock; -WifiChip::WifiChip(ChipId chip_id, bool is_primary, +WifiChip::WifiChip(int32_t chip_id, bool is_primary, const std::weak_ptr legacy_hal, const std::weak_ptr mode_controller, const std::shared_ptr iface_util, const std::weak_ptr feature_flags, - const std::function& handler) + const std::function& handler, + bool using_dynamic_iface_combination) : chip_id_(chip_id), legacy_hal_(legacy_hal), mode_controller_(mode_controller), @@ -376,10 +376,54 @@ WifiChip::WifiChip(ChipId chip_id, bool is_primary, current_mode_id_(feature_flags::chip_mode_ids::kInvalid), modes_(feature_flags.lock()->getChipModes(is_primary)), debug_ring_buffer_cb_registered_(false), + using_dynamic_iface_combination_(using_dynamic_iface_combination), subsystemCallbackHandler_(handler) { setActiveWlanIfaceNameProperty(kNoActiveWlanIfaceNamePropertyValue); } +void WifiChip::retrieveDynamicIfaceCombination() { + if (using_dynamic_iface_combination_) return; + + legacy_hal::wifi_iface_concurrency_matrix legacy_matrix; + legacy_hal::wifi_error legacy_status; + + std::tie(legacy_status, legacy_matrix) = + legacy_hal_.lock()->getSupportedIfaceConcurrencyMatrix(); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get SupportedIfaceCombinations matrix from legacy HAL: " + << legacyErrorToString(legacy_status); + return; + } + + IWifiChip::ChipMode aidl_chip_mode; + if (!aidl_struct_util::convertLegacyIfaceCombinationsMatrixToChipMode(legacy_matrix, + &aidl_chip_mode)) { + LOG(ERROR) << "Failed convertLegacyIfaceCombinationsMatrixToChipMode() "; + return; + } + + LOG(INFO) << "Reloading iface concurrency combination from driver"; + aidl_chip_mode.id = feature_flags::chip_mode_ids::kV3; + modes_.clear(); + modes_.push_back(aidl_chip_mode); + using_dynamic_iface_combination_ = true; +} + +std::shared_ptr WifiChip::create( + int32_t chip_id, bool is_primary, const std::weak_ptr legacy_hal, + const std::weak_ptr mode_controller, + const std::shared_ptr iface_util, + const std::weak_ptr feature_flags, + const std::function& handler, + bool using_dynamic_iface_combination) { + std::shared_ptr ptr = ndk::SharedRefBase::make( + chip_id, is_primary, legacy_hal, mode_controller, iface_util, feature_flags, handler, + using_dynamic_iface_combination); + std::weak_ptr weak_ptr_this(ptr); + ptr->setWeakPtr(weak_ptr_this); + return ptr; +} + void WifiChip::invalidate() { if (!writeRingbufferFilesInternal()) { LOG(ERROR) << "Error writing files to flash"; @@ -391,348 +435,305 @@ void WifiChip::invalidate() { is_valid_ = false; } +void WifiChip::setWeakPtr(std::weak_ptr ptr) { + weak_ptr_this_ = ptr; +} + bool WifiChip::isValid() { return is_valid_; } -std::set> WifiChip::getEventCallbacks() { +std::set> WifiChip::getEventCallbacks() { return event_cb_handler_.getCallbacks(); } -Return WifiChip::getId(getId_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getId(int32_t* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, &WifiChip::getIdInternal, - hidl_status_cb); + _aidl_return); } -// Deprecated support for this callback -Return WifiChip::registerEventCallback(const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::registerEventCallback( + const std::shared_ptr& event_callback) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::registerEventCallbackInternal, hidl_status_cb, - event_callback); + &WifiChip::registerEventCallbackInternal, event_callback); } -Return WifiChip::getCapabilities(getCapabilities_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getFeatureSet(int32_t* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getCapabilitiesInternal, hidl_status_cb); + &WifiChip::getFeatureSetInternal, _aidl_return); } -Return WifiChip::getAvailableModes(getAvailableModes_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getAvailableModes(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getAvailableModesInternal, hidl_status_cb); + &WifiChip::getAvailableModesInternal, _aidl_return); } -Return WifiChip::configureChip(ChipModeId mode_id, configureChip_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::configureChip(int32_t in_modeId) { return validateAndCallWithLock(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::configureChipInternal, hidl_status_cb, mode_id); + &WifiChip::configureChipInternal, in_modeId); } -Return WifiChip::getMode(getMode_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getMode(int32_t* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getModeInternal, hidl_status_cb); + &WifiChip::getModeInternal, _aidl_return); } -Return WifiChip::requestChipDebugInfo(requestChipDebugInfo_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::requestChipDebugInfo(IWifiChip::ChipDebugInfo* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::requestChipDebugInfoInternal, hidl_status_cb); + &WifiChip::requestChipDebugInfoInternal, _aidl_return); } -Return WifiChip::requestDriverDebugDump(requestDriverDebugDump_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::requestDriverDebugDump(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::requestDriverDebugDumpInternal, hidl_status_cb); + &WifiChip::requestDriverDebugDumpInternal, _aidl_return); } -Return WifiChip::requestFirmwareDebugDump(requestFirmwareDebugDump_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::requestFirmwareDebugDump(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::requestFirmwareDebugDumpInternal, hidl_status_cb); + &WifiChip::requestFirmwareDebugDumpInternal, _aidl_return); } -Return WifiChip::createApIface(createApIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::createApIface(std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createApIfaceInternal, hidl_status_cb); + &WifiChip::createApIfaceInternal, _aidl_return); } -Return WifiChip::createBridgedApIface(createBridgedApIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::createBridgedApIface(std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createBridgedApIfaceInternal, hidl_status_cb); + &WifiChip::createBridgedApIfaceInternal, _aidl_return); } -Return WifiChip::getApIfaceNames(getApIfaceNames_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getApIfaceNames(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getApIfaceNamesInternal, hidl_status_cb); + &WifiChip::getApIfaceNamesInternal, _aidl_return); } -Return WifiChip::getApIface(const hidl_string& ifname, getApIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getApIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getApIfaceInternal, hidl_status_cb, ifname); + &WifiChip::getApIfaceInternal, _aidl_return, in_ifname); } -Return WifiChip::removeApIface(const hidl_string& ifname, removeApIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::removeApIface(const std::string& in_ifname) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeApIfaceInternal, hidl_status_cb, ifname); + &WifiChip::removeApIfaceInternal, in_ifname); } -Return WifiChip::removeIfaceInstanceFromBridgedApIface( - const hidl_string& ifname, const hidl_string& ifInstanceName, - removeIfaceInstanceFromBridgedApIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::removeIfaceInstanceFromBridgedApIface( + const std::string& in_brIfaceName, const std::string& in_ifaceInstanceName) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal, hidl_status_cb, - ifname, ifInstanceName); + &WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal, in_brIfaceName, + in_ifaceInstanceName); } -Return WifiChip::createNanIface(createNanIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::createNanIface(std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createNanIfaceInternal, hidl_status_cb); + &WifiChip::createNanIfaceInternal, _aidl_return); } -Return WifiChip::getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getNanIfaceNames(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getNanIfaceNamesInternal, hidl_status_cb); + &WifiChip::getNanIfaceNamesInternal, _aidl_return); } -Return WifiChip::getNanIface(const hidl_string& ifname, getNanIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getNanIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getNanIfaceInternal, hidl_status_cb, ifname); + &WifiChip::getNanIfaceInternal, _aidl_return, in_ifname); } -Return WifiChip::removeNanIface(const hidl_string& ifname, removeNanIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::removeNanIface(const std::string& in_ifname) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeNanIfaceInternal, hidl_status_cb, ifname); + &WifiChip::removeNanIfaceInternal, in_ifname); } -Return WifiChip::createP2pIface(createP2pIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::createP2pIface(std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createP2pIfaceInternal, hidl_status_cb); + &WifiChip::createP2pIfaceInternal, _aidl_return); } -Return WifiChip::getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getP2pIfaceNames(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getP2pIfaceNamesInternal, hidl_status_cb); + &WifiChip::getP2pIfaceNamesInternal, _aidl_return); } -Return WifiChip::getP2pIface(const hidl_string& ifname, getP2pIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getP2pIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getP2pIfaceInternal, hidl_status_cb, ifname); + &WifiChip::getP2pIfaceInternal, _aidl_return, in_ifname); } -Return WifiChip::removeP2pIface(const hidl_string& ifname, removeP2pIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::removeP2pIface(const std::string& in_ifname) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeP2pIfaceInternal, hidl_status_cb, ifname); + &WifiChip::removeP2pIfaceInternal, in_ifname); } -Return WifiChip::createStaIface(createStaIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::createStaIface(std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createStaIfaceInternal, hidl_status_cb); + &WifiChip::createStaIfaceInternal, _aidl_return); } -Return WifiChip::getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getStaIfaceNames(std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getStaIfaceNamesInternal, hidl_status_cb); + &WifiChip::getStaIfaceNamesInternal, _aidl_return); } -Return WifiChip::getStaIface(const hidl_string& ifname, getStaIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getStaIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getStaIfaceInternal, hidl_status_cb, ifname); + &WifiChip::getStaIfaceInternal, _aidl_return, in_ifname); } -Return WifiChip::removeStaIface(const hidl_string& ifname, removeStaIface_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::removeStaIface(const std::string& in_ifname) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeStaIfaceInternal, hidl_status_cb, ifname); + &WifiChip::removeStaIfaceInternal, in_ifname); } -Return WifiChip::createRttController(const sp& bound_iface, - createRttController_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::createRttController( + const std::shared_ptr& in_boundIface, + std::shared_ptr* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createRttControllerInternal, hidl_status_cb, bound_iface); + &WifiChip::createRttControllerInternal, _aidl_return, in_boundIface); } -Return WifiChip::getDebugRingBuffersStatus(getDebugRingBuffersStatus_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getDebugRingBuffersStatus( + std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getDebugRingBuffersStatusInternal, hidl_status_cb); + &WifiChip::getDebugRingBuffersStatusInternal, _aidl_return); } -Return WifiChip::startLoggingToDebugRingBuffer( - const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, - startLoggingToDebugRingBuffer_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::startLoggingToDebugRingBuffer( + const std::string& in_ringName, WifiDebugRingBufferVerboseLevel in_verboseLevel, + int32_t in_maxIntervalInSec, int32_t in_minDataSizeInBytes) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::startLoggingToDebugRingBufferInternal, hidl_status_cb, - ring_name, verbose_level, max_interval_in_sec, min_data_size_in_bytes); + &WifiChip::startLoggingToDebugRingBufferInternal, in_ringName, + in_verboseLevel, in_maxIntervalInSec, in_minDataSizeInBytes); } -Return WifiChip::forceDumpToDebugRingBuffer(const hidl_string& ring_name, - forceDumpToDebugRingBuffer_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::forceDumpToDebugRingBuffer(const std::string& in_ringName) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::forceDumpToDebugRingBufferInternal, hidl_status_cb, - ring_name); + &WifiChip::forceDumpToDebugRingBufferInternal, in_ringName); } -Return WifiChip::flushRingBufferToFile(flushRingBufferToFile_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::flushRingBufferToFile() { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::flushRingBufferToFileInternal, hidl_status_cb); + &WifiChip::flushRingBufferToFileInternal); } -Return WifiChip::stopLoggingToDebugRingBuffer( - stopLoggingToDebugRingBuffer_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::stopLoggingToDebugRingBuffer() { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::stopLoggingToDebugRingBufferInternal, hidl_status_cb); + &WifiChip::stopLoggingToDebugRingBufferInternal); } -Return WifiChip::getDebugHostWakeReasonStats(getDebugHostWakeReasonStats_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getDebugHostWakeReasonStats( + WifiDebugHostWakeReasonStats* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getDebugHostWakeReasonStatsInternal, hidl_status_cb); + &WifiChip::getDebugHostWakeReasonStatsInternal, _aidl_return); } -Return WifiChip::enableDebugErrorAlerts(bool enable, - enableDebugErrorAlerts_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::enableDebugErrorAlerts(bool in_enable) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::enableDebugErrorAlertsInternal, hidl_status_cb, enable); + &WifiChip::enableDebugErrorAlertsInternal, in_enable); } -Return WifiChip::selectTxPowerScenario(V1_1::IWifiChip::TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::selectTxPowerScenario(IWifiChip::TxPowerScenario in_scenario) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::selectTxPowerScenarioInternal, hidl_status_cb, scenario); + &WifiChip::selectTxPowerScenarioInternal, in_scenario); } -Return WifiChip::resetTxPowerScenario(resetTxPowerScenario_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::resetTxPowerScenario() { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::resetTxPowerScenarioInternal, hidl_status_cb); + &WifiChip::resetTxPowerScenarioInternal); } -Return WifiChip::setLatencyMode(LatencyMode mode, setLatencyMode_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::setLatencyMode(IWifiChip::LatencyMode in_mode) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setLatencyModeInternal, hidl_status_cb, mode); + &WifiChip::setLatencyModeInternal, in_mode); } -Return WifiChip::registerEventCallback_1_2( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::registerEventCallbackInternal_1_2, hidl_status_cb, - event_callback); -} - -Return WifiChip::selectTxPowerScenario_1_2(TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::selectTxPowerScenarioInternal_1_2, hidl_status_cb, scenario); -} - -Return WifiChip::getCapabilities_1_3(getCapabilities_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getCapabilitiesInternal_1_3, hidl_status_cb); -} - -Return WifiChip::getCapabilities_1_5(getCapabilities_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getCapabilitiesInternal_1_5, hidl_status_cb); -} - -Return WifiChip::debug(const hidl_handle& handle, const hidl_vec&) { - if (handle != nullptr && handle->numFds >= 1) { - { - std::unique_lock lk(lock_t); - for (const auto& item : ringbuffer_map_) { - forceDumpToDebugRingBufferInternal(item.first); - } - // unique_lock unlocked here +binder_status_t WifiChip::dump(int fd, const char**, uint32_t) { + { + std::unique_lock lk(lock_t); + for (const auto& item : ringbuffer_map_) { + forceDumpToDebugRingBufferInternal(item.first); } - usleep(100 * 1000); // sleep for 100 milliseconds to wait for - // ringbuffer updates. - int fd = handle->data[0]; - if (!writeRingbufferFilesInternal()) { - LOG(ERROR) << "Error writing files to flash"; - } - uint32_t n_error = cpioArchiveFilesInDir(fd, kTombstoneFolderPath); - if (n_error != 0) { - LOG(ERROR) << n_error << " errors occured in cpio function"; - } - fsync(fd); - } else { - LOG(ERROR) << "File handle error"; + // unique_lock unlocked here } - return Void(); + usleep(100 * 1000); // sleep for 100 milliseconds to wait for + // ringbuffer updates. + if (!writeRingbufferFilesInternal()) { + LOG(ERROR) << "Error writing files to flash"; + } + uint32_t n_error = cpioArchiveFilesInDir(fd, kTombstoneFolderPath); + if (n_error != 0) { + LOG(ERROR) << n_error << " errors occurred in cpio function"; + } + fsync(fd); + return STATUS_OK; } -Return WifiChip::createRttController_1_4(const sp& bound_iface, - createRttController_1_4_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::setMultiStaPrimaryConnection(const std::string& in_ifName) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createRttControllerInternal_1_4, hidl_status_cb, bound_iface); + &WifiChip::setMultiStaPrimaryConnectionInternal, in_ifName); } -Return WifiChip::registerEventCallback_1_4( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::setMultiStaUseCase(IWifiChip::MultiStaUseCase in_useCase) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::registerEventCallbackInternal_1_4, hidl_status_cb, - event_callback); + &WifiChip::setMultiStaUseCaseInternal, in_useCase); } -Return WifiChip::setMultiStaPrimaryConnection( - const hidl_string& ifname, setMultiStaPrimaryConnection_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::setCoexUnsafeChannels( + const std::vector& in_unsafeChannels, + int32_t in_restrictions) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setMultiStaPrimaryConnectionInternal, hidl_status_cb, ifname); + &WifiChip::setCoexUnsafeChannelsInternal, in_unsafeChannels, + in_restrictions); } -Return WifiChip::setMultiStaUseCase(MultiStaUseCase use_case, - setMultiStaUseCase_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setMultiStaUseCaseInternal, hidl_status_cb, use_case); -} - -Return WifiChip::setCoexUnsafeChannels(const hidl_vec& unsafeChannels, - hidl_bitfield restrictions, - setCoexUnsafeChannels_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setCoexUnsafeChannelsInternal, hidl_status_cb, unsafeChannels, - restrictions); -} - -Return WifiChip::setCountryCode(const hidl_array& code, - setCountryCode_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::setCountryCode(const std::array& in_code) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiChip::setCountryCodeInternal, hidl_status_cb, code); + &WifiChip::setCountryCodeInternal, in_code); } -Return WifiChip::getUsableChannels( - WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, - getUsableChannels_cb _hidl_cb) { +ndk::ScopedAStatus WifiChip::getUsableChannels(WifiBand in_band, int32_t in_ifaceModeMask, + int32_t in_filterMask, + std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getUsableChannelsInternal, _hidl_cb, band, ifaceModeMask, - filterMask); + &WifiChip::getUsableChannelsInternal, _aidl_return, in_band, + in_ifaceModeMask, in_filterMask); } -Return WifiChip::triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::setAfcChannelAllowance( + const AfcChannelAllowance& afcChannelAllowance) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::triggerSubsystemRestartInternal, hidl_status_cb); + &WifiChip::setAfcChannelAllowanceInternal, afcChannelAllowance); } -Return WifiChip::createRttController_1_6(const sp& bound_iface, - createRttController_1_6_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::triggerSubsystemRestart() { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createRttControllerInternal_1_6, hidl_status_cb, bound_iface); + &WifiChip::triggerSubsystemRestartInternal); } -Return WifiChip::getUsableChannels_1_6( - WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, - getUsableChannels_1_6_cb _hidl_cb) { +ndk::ScopedAStatus WifiChip::getSupportedRadioCombinations( + std::vector* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getUsableChannelsInternal_1_6, _hidl_cb, band, ifaceModeMask, - filterMask); + &WifiChip::getSupportedRadioCombinationsInternal, _aidl_return); } -Return WifiChip::getSupportedRadioCombinationsMatrix( - getSupportedRadioCombinationsMatrix_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::getWifiChipCapabilities(WifiChipCapabilities* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb); + &WifiChip::getWifiChipCapabilitiesInternal, _aidl_return); } -Return WifiChip::getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) { +ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetwork(int32_t in_channelCategoryEnableFlag) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getAvailableModesInternal_1_6, hidl_status_cb); + &WifiChip::enableStaChannelForPeerNetworkInternal, + in_channelCategoryEnableFlag); +} + +ndk::ScopedAStatus WifiChip::setMloMode(const ChipMloMode in_mode) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::setMloModeInternal, in_mode); } void WifiChip::invalidateAndRemoveAllIfaces() { @@ -755,7 +756,7 @@ void WifiChip::invalidateAndRemoveDependencies(const std::string& removed_iface_ if (nan_iface->getName() == removed_iface_name) { nan_iface->invalidate(); for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback->onIfaceRemoved(IfaceType::NAN, removed_iface_name).isOk()) { + if (!callback->onIfaceRemoved(IfaceType::NAN_IFACE, removed_iface_name).isOk()) { LOG(ERROR) << "Failed to invoke onIfaceRemoved callback"; } } @@ -776,89 +777,60 @@ void WifiChip::invalidateAndRemoveDependencies(const std::string& removed_iface_ } } -std::pair WifiChip::getIdInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), chip_id_}; +std::pair WifiChip::getIdInternal() { + return {chip_id_, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::registerEventCallbackInternal( - const sp& /* event_callback */) { - // Deprecated support for this callback. - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -std::pair WifiChip::getCapabilitiesInternal() { - // Deprecated support for this callback. - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), 0}; -} - -std::pair> -WifiChip::getAvailableModesInternal() { - // Deprecated support -- use getAvailableModes_1_6 for more granular concurrency combinations. - std::vector modes_1_0 = {}; - for (const auto& mode_1_6 : modes_) { - std::vector combos_1_0; - for (const auto& combo_1_6 : mode_1_6.availableCombinations) { - std::vector limits_1_0; - for (const auto& limit_1_6 : combo_1_6.limits) { - std::vector types_1_0; - for (IfaceConcurrencyType type_1_6 : limit_1_6.types) { - switch (type_1_6) { - case IfaceConcurrencyType::STA: - types_1_0.push_back(IfaceType::STA); - break; - case IfaceConcurrencyType::AP: - types_1_0.push_back(IfaceType::AP); - break; - case IfaceConcurrencyType::AP_BRIDGED: - // Ignore AP_BRIDGED - break; - case IfaceConcurrencyType::P2P: - types_1_0.push_back(IfaceType::P2P); - break; - case IfaceConcurrencyType::NAN: - types_1_0.push_back(IfaceType::NAN); - break; - } - } - if (types_1_0.empty()) { - continue; - } - V1_0::IWifiChip::ChipIfaceCombinationLimit limit_1_0; - limit_1_0.types = hidl_vec(types_1_0); - limit_1_0.maxIfaces = limit_1_6.maxIfaces; - limits_1_0.push_back(limit_1_0); - } - if (limits_1_0.empty()) { - continue; - } - V1_0::IWifiChip::ChipIfaceCombination combo_1_0; - combo_1_0.limits = hidl_vec(limits_1_0); - combos_1_0.push_back(combo_1_0); - } - if (combos_1_0.empty()) { - continue; - } - V1_0::IWifiChip::ChipMode mode_1_0; - mode_1_0.id = mode_1_6.id; - mode_1_0.availableCombinations = hidl_vec(combos_1_0); - modes_1_0.push_back(mode_1_0); +ndk::ScopedAStatus WifiChip::registerEventCallbackInternal( + const std::shared_ptr& event_callback) { + if (!event_cb_handler_.addCallback(event_callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } - return {createWifiStatus(WifiStatusCode::SUCCESS), modes_1_0}; + return ndk::ScopedAStatus::ok(); } -WifiStatus WifiChip::configureChipInternal( - /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { +std::pair WifiChip::getFeatureSetInternal() { + legacy_hal::wifi_error legacy_status; + uint64_t legacy_feature_set; + uint32_t legacy_logger_feature_set; + const auto ifname = getFirstActiveWlanIfaceName(); + std::tie(legacy_status, legacy_feature_set) = + legacy_hal_.lock()->getSupportedFeatureSet(ifname); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {0, createWifiStatusFromLegacyError(legacy_status)}; + } + std::tie(legacy_status, legacy_logger_feature_set) = + legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + // some devices don't support querying logger feature set + legacy_logger_feature_set = 0; + } + uint32_t aidl_feature_set; + if (!aidl_struct_util::convertLegacyChipFeaturesToAidl(legacy_feature_set, &aidl_feature_set)) { + return {0, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_feature_set, ndk::ScopedAStatus::ok()}; +} + +std::pair, ndk::ScopedAStatus> +WifiChip::getAvailableModesInternal() { + return {modes_, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiChip::configureChipInternal( + /* NONNULL */ std::unique_lock* lock, int32_t mode_id) { if (!isValidModeId(mode_id)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } if (mode_id == current_mode_id_) { LOG(DEBUG) << "Already in the specified mode " << mode_id; - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } - WifiStatus status = handleChipConfiguration(lock, mode_id); - if (status.code != WifiStatusCode::SUCCESS) { + ndk::ScopedAStatus status = handleChipConfiguration(lock, mode_id); + if (!status.isOk()) { + WifiStatusCode errorCode = static_cast(status.getServiceSpecificError()); for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback->onChipReconfigureFailure(status).isOk()) { + if (!callback->onChipReconfigureFailure(errorCode).isOk()) { LOG(ERROR) << "Failed to invoke onChipReconfigureFailure callback"; } } @@ -878,24 +850,24 @@ WifiStatus WifiChip::configureChipInternal( return status; } -std::pair WifiChip::getModeInternal() { +std::pair WifiChip::getModeInternal() { if (!isValidModeId(current_mode_id_)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), current_mode_id_}; + return {current_mode_id_, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), current_mode_id_}; + return {current_mode_id_, ndk::ScopedAStatus::ok()}; } -std::pair WifiChip::requestChipDebugInfoInternal() { - V1_4::IWifiChip::ChipDebugInfo result; +std::pair WifiChip::requestChipDebugInfoInternal() { + IWifiChip::ChipDebugInfo result; legacy_hal::wifi_error legacy_status; std::string driver_desc; const auto ifname = getFirstActiveWlanIfaceName(); std::tie(legacy_status, driver_desc) = legacy_hal_.lock()->getDriverVersion(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to get driver version: " << legacyErrorToString(legacy_status); - WifiStatus status = + ndk::ScopedAStatus status = createWifiStatusFromLegacyError(legacy_status, "failed to get driver version"); - return {status, result}; + return {std::move(result), std::move(status)}; } result.driverDescription = driver_desc.c_str(); @@ -903,59 +875,60 @@ std::pair WifiChip::requestChipDebug std::tie(legacy_status, firmware_desc) = legacy_hal_.lock()->getFirmwareVersion(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware version: " << legacyErrorToString(legacy_status); - WifiStatus status = + ndk::ScopedAStatus status = createWifiStatusFromLegacyError(legacy_status, "failed to get firmware version"); - return {status, result}; + return {std::move(result), std::move(status)}; } result.firmwareDescription = firmware_desc.c_str(); - return {createWifiStatus(WifiStatusCode::SUCCESS), result}; + return {std::move(result), ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::requestDriverDebugDumpInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::requestDriverDebugDumpInternal() { legacy_hal::wifi_error legacy_status; std::vector driver_dump; std::tie(legacy_status, driver_dump) = legacy_hal_.lock()->requestDriverMemoryDump(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to get driver debug dump: " << legacyErrorToString(legacy_status); - return {createWifiStatusFromLegacyError(legacy_status), std::vector()}; + return {std::vector(), createWifiStatusFromLegacyError(legacy_status)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), driver_dump}; + return {driver_dump, ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::requestFirmwareDebugDumpInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::requestFirmwareDebugDumpInternal() { legacy_hal::wifi_error legacy_status; std::vector firmware_dump; std::tie(legacy_status, firmware_dump) = legacy_hal_.lock()->requestFirmwareMemoryDump(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware debug dump: " << legacyErrorToString(legacy_status); - return {createWifiStatusFromLegacyError(legacy_status), {}}; + return {std::vector(), createWifiStatusFromLegacyError(legacy_status)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), firmware_dump}; + return {firmware_dump, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::createVirtualApInterface(const std::string& apVirtIf) { +ndk::ScopedAStatus WifiChip::createVirtualApInterface(const std::string& apVirtIf) { legacy_hal::wifi_error legacy_status; legacy_status = legacy_hal_.lock()->createVirtualInterface( - apVirtIf, hidl_struct_util::convertHidlIfaceTypeToLegacy(IfaceType::AP)); + apVirtIf, aidl_struct_util::convertAidlIfaceTypeToLegacy(IfaceType::AP)); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to add interface: " << apVirtIf << " " << legacyErrorToString(legacy_status); return createWifiStatusFromLegacyError(legacy_status); } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -sp WifiChip::newWifiApIface(std::string& ifname) { +std::shared_ptr WifiChip::newWifiApIface(std::string& ifname) { std::vector ap_instances; for (auto const& it : br_ifaces_ap_instances_) { if (it.first == ifname) { ap_instances = it.second; } } - sp iface = new WifiApIface(ifname, ap_instances, legacy_hal_, iface_util_); + std::shared_ptr iface = + ndk::SharedRefBase::make(ifname, ap_instances, legacy_hal_, iface_util_); ap_ifaces_.push_back(iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onIfaceAdded(IfaceType::AP, ifname).isOk()) { @@ -966,75 +939,77 @@ sp WifiChip::newWifiApIface(std::string& ifname) { return iface; } -std::pair> WifiChip::createApIfaceInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::createApIfaceInternal() { if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {std::shared_ptr(), + createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } std::string ifname = allocateApIfaceName(); - WifiStatus status = createVirtualApInterface(ifname); - if (status.code != WifiStatusCode::SUCCESS) { - return {status, {}}; + ndk::ScopedAStatus status = createVirtualApInterface(ifname); + if (!status.isOk()) { + return {std::shared_ptr(), std::move(status)}; } - sp iface = newWifiApIface(ifname); - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + std::shared_ptr iface = newWifiApIface(ifname); + return {iface, ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::createBridgedApIfaceInternal() { +std::pair, ndk::ScopedAStatus> +WifiChip::createBridgedApIfaceInternal() { if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP_BRIDGED)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } std::vector ap_instances = allocateBridgedApInstanceNames(); if (ap_instances.size() < 2) { LOG(ERROR) << "Fail to allocate two instances"; - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } std::string br_ifname = kApBridgeIfacePrefix + ap_instances[0]; for (int i = 0; i < 2; i++) { - WifiStatus status = createVirtualApInterface(ap_instances[i]); - if (status.code != WifiStatusCode::SUCCESS) { + ndk::ScopedAStatus status = createVirtualApInterface(ap_instances[i]); + if (!status.isOk()) { if (i != 0) { // The failure happened when creating second virtual // iface. legacy_hal_.lock()->deleteVirtualInterface( ap_instances.front()); // Remove the first virtual iface. } - return {status, {}}; + return {nullptr, std::move(status)}; } } br_ifaces_ap_instances_[br_ifname] = ap_instances; if (!iface_util_->createBridge(br_ifname)) { LOG(ERROR) << "Failed createBridge - br_name=" << br_ifname.c_str(); deleteApIface(br_ifname); - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } for (auto const& instance : ap_instances) { // Bind ap instance interface to AP bridge if (!iface_util_->addIfaceToBridge(br_ifname, instance)) { LOG(ERROR) << "Failed add if to Bridge - if_name=" << instance.c_str(); deleteApIface(br_ifname); - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } } - sp iface = newWifiApIface(br_ifname); - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + std::shared_ptr iface = newWifiApIface(br_ifname); + return {iface, ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getApIfaceNamesInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::getApIfaceNamesInternal() { if (ap_ifaces_.empty()) { - return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + return {std::vector(), ndk::ScopedAStatus::ok()}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(ap_ifaces_)}; + return {getNames(ap_ifaces_), ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getApIfaceInternal( +std::pair, ndk::ScopedAStatus> WifiChip::getApIfaceInternal( const std::string& ifname) { const auto iface = findUsingName(ap_ifaces_, ifname); if (!iface.get()) { - return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::removeApIfaceInternal(const std::string& ifname) { +ndk::ScopedAStatus WifiChip::removeApIfaceInternal(const std::string& ifname) { const auto iface = findUsingName(ap_ifaces_, ifname); if (!iface.get()) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -1052,10 +1027,10 @@ WifiStatus WifiChip::removeApIfaceInternal(const std::string& ifname) { } } setActiveWlanIfaceNameProperty(getFirstActiveWlanIfaceName()); - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( +ndk::ScopedAStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( const std::string& ifname, const std::string& ifInstanceName) { const auto iface = findUsingName(ap_ifaces_, ifname); if (!iface.get() || ifInstanceName.empty()) { @@ -1092,12 +1067,12 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( iface->removeInstance(ifInstanceName); setActiveWlanIfaceNameProperty(getFirstActiveWlanIfaceName()); - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -std::pair> WifiChip::createNanIfaceInternal() { - if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::NAN)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; +std::pair, ndk::ScopedAStatus> WifiChip::createNanIfaceInternal() { + if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::NAN_IFACE)) { + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } bool is_dedicated_iface = true; std::string ifname = getPredefinedNanIfaceName(); @@ -1107,77 +1082,80 @@ std::pair> WifiChip::createNanIfaceInternal( ifname = getFirstActiveWlanIfaceName(); is_dedicated_iface = false; } - sp iface = new WifiNanIface(ifname, is_dedicated_iface, legacy_hal_, iface_util_); + std::shared_ptr iface = + WifiNanIface::create(ifname, is_dedicated_iface, legacy_hal_, iface_util_); nan_ifaces_.push_back(iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback->onIfaceAdded(IfaceType::NAN, ifname).isOk()) { + if (!callback->onIfaceAdded(IfaceType::NAN_IFACE, ifname).isOk()) { LOG(ERROR) << "Failed to invoke onIfaceAdded callback"; } } - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getNanIfaceNamesInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::getNanIfaceNamesInternal() { if (nan_ifaces_.empty()) { - return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + return {std::vector(), ndk::ScopedAStatus::ok()}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(nan_ifaces_)}; + return {getNames(nan_ifaces_), ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getNanIfaceInternal( +std::pair, ndk::ScopedAStatus> WifiChip::getNanIfaceInternal( const std::string& ifname) { const auto iface = findUsingName(nan_ifaces_, ifname); if (!iface.get()) { - return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::removeNanIfaceInternal(const std::string& ifname) { +ndk::ScopedAStatus WifiChip::removeNanIfaceInternal(const std::string& ifname) { const auto iface = findUsingName(nan_ifaces_, ifname); if (!iface.get()) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } invalidateAndClear(nan_ifaces_, iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback->onIfaceRemoved(IfaceType::NAN, ifname).isOk()) { + if (!callback->onIfaceRemoved(IfaceType::NAN_IFACE, ifname).isOk()) { LOG(ERROR) << "Failed to invoke onIfaceAdded callback"; } } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -std::pair> WifiChip::createP2pIfaceInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::createP2pIfaceInternal() { if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::P2P)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } std::string ifname = getPredefinedP2pIfaceName(); - sp iface = new WifiP2pIface(ifname, legacy_hal_); + std::shared_ptr iface = + ndk::SharedRefBase::make(ifname, legacy_hal_); p2p_ifaces_.push_back(iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onIfaceAdded(IfaceType::P2P, ifname).isOk()) { LOG(ERROR) << "Failed to invoke onIfaceAdded callback"; } } - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getP2pIfaceNamesInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::getP2pIfaceNamesInternal() { if (p2p_ifaces_.empty()) { - return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + return {std::vector(), ndk::ScopedAStatus::ok()}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(p2p_ifaces_)}; + return {getNames(p2p_ifaces_), ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getP2pIfaceInternal(const std::string& ifname) { +std::pair, ndk::ScopedAStatus> WifiChip::getP2pIfaceInternal( + const std::string& ifname) { const auto iface = findUsingName(p2p_ifaces_, ifname); if (!iface.get()) { - return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) { +ndk::ScopedAStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) { const auto iface = findUsingName(p2p_ifaces_, ifname); if (!iface.get()) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -1188,22 +1166,22 @@ WifiStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) { LOG(ERROR) << "Failed to invoke onIfaceRemoved callback"; } } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -std::pair> WifiChip::createStaIfaceInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::createStaIfaceInternal() { if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; } std::string ifname = allocateStaIfaceName(); legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->createVirtualInterface( - ifname, hidl_struct_util::convertHidlIfaceTypeToLegacy(IfaceType::STA)); + ifname, aidl_struct_util::convertAidlIfaceTypeToLegacy(IfaceType::STA)); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to add interface: " << ifname << " " << legacyErrorToString(legacy_status); - return {createWifiStatusFromLegacyError(legacy_status), {}}; + return {nullptr, createWifiStatusFromLegacyError(legacy_status)}; } - sp iface = new WifiStaIface(ifname, legacy_hal_, iface_util_); + std::shared_ptr iface = WifiStaIface::create(ifname, legacy_hal_, iface_util_); sta_ifaces_.push_back(iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onIfaceAdded(IfaceType::STA, ifname).isOk()) { @@ -1211,26 +1189,26 @@ std::pair> WifiChip::createStaIfaceInternal( } } setActiveWlanIfaceNameProperty(getFirstActiveWlanIfaceName()); - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getStaIfaceNamesInternal() { +std::pair, ndk::ScopedAStatus> WifiChip::getStaIfaceNamesInternal() { if (sta_ifaces_.empty()) { - return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + return {std::vector(), ndk::ScopedAStatus::ok()}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(sta_ifaces_)}; + return {getNames(sta_ifaces_), ndk::ScopedAStatus::ok()}; } -std::pair> WifiChip::getStaIfaceInternal( +std::pair, ndk::ScopedAStatus> WifiChip::getStaIfaceInternal( const std::string& ifname) { const auto iface = findUsingName(sta_ifaces_, ifname); if (!iface.get()) { - return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; + return {iface, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::removeStaIfaceInternal(const std::string& ifname) { +ndk::ScopedAStatus WifiChip::removeStaIfaceInternal(const std::string& ifname) { const auto iface = findUsingName(sta_ifaces_, ifname); if (!iface.get()) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -1249,37 +1227,47 @@ WifiStatus WifiChip::removeStaIfaceInternal(const std::string& ifname) { } } setActiveWlanIfaceNameProperty(getFirstActiveWlanIfaceName()); - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -std::pair> WifiChip::createRttControllerInternal( - const sp& /*bound_iface*/) { - LOG(ERROR) << "createRttController is not supported on this HAL"; - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +std::pair, ndk::ScopedAStatus> +WifiChip::createRttControllerInternal(const std::shared_ptr& bound_iface) { + if (sta_ifaces_.size() == 0 && + !canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) { + LOG(ERROR) << "createRttControllerInternal: Chip cannot support STAs " + "(and RTT by extension)"; + return {nullptr, createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE)}; + } + std::shared_ptr rtt = + WifiRttController::create(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_); + rtt_controllers_.emplace_back(rtt); + return {rtt, ndk::ScopedAStatus::ok()}; } -std::pair> +std::pair, ndk::ScopedAStatus> WifiChip::getDebugRingBuffersStatusInternal() { legacy_hal::wifi_error legacy_status; std::vector legacy_ring_buffer_status_vec; std::tie(legacy_status, legacy_ring_buffer_status_vec) = legacy_hal_.lock()->getRingBuffersStatus(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; + return {std::vector(), + createWifiStatusFromLegacyError(legacy_status)}; } - std::vector hidl_ring_buffer_status_vec; - if (!hidl_struct_util::convertLegacyVectorOfDebugRingBufferStatusToHidl( - legacy_ring_buffer_status_vec, &hidl_ring_buffer_status_vec)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; + std::vector aidl_ring_buffer_status_vec; + if (!aidl_struct_util::convertLegacyVectorOfDebugRingBufferStatusToAidl( + legacy_ring_buffer_status_vec, &aidl_ring_buffer_status_vec)) { + return {std::vector(), + createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_ring_buffer_status_vec}; + return {aidl_ring_buffer_status_vec, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::startLoggingToDebugRingBufferInternal( - const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, +ndk::ScopedAStatus WifiChip::startLoggingToDebugRingBufferInternal( + const std::string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes) { - WifiStatus status = registerDebugRingBufferCallback(); - if (status.code != WifiStatusCode::SUCCESS) { + ndk::ScopedAStatus status = registerDebugRingBufferCallback(); + if (!status.isOk()) { return status; } legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRingBufferLogging( @@ -1290,16 +1278,16 @@ WifiStatus WifiChip::startLoggingToDebugRingBufferInternal( std::pair(ring_name, Ringbuffer(kMaxBufferSizeBytes))); // if verbose logging enabled, turn up HAL daemon logging as well. if (verbose_level < WifiDebugRingBufferVerboseLevel::VERBOSE) { - android::base::SetMinimumLogSeverity(android::base::DEBUG); + ::android::base::SetMinimumLogSeverity(::android::base::DEBUG); } else { - android::base::SetMinimumLogSeverity(android::base::VERBOSE); + ::android::base::SetMinimumLogSeverity(::android::base::VERBOSE); } return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::forceDumpToDebugRingBufferInternal(const hidl_string& ring_name) { - WifiStatus status = registerDebugRingBufferCallback(); - if (status.code != WifiStatusCode::SUCCESS) { +ndk::ScopedAStatus WifiChip::forceDumpToDebugRingBufferInternal(const std::string& ring_name) { + ndk::ScopedAStatus status = registerDebugRingBufferCallback(); + if (!status.isOk()) { return status; } legacy_hal::wifi_error legacy_status = @@ -1308,15 +1296,15 @@ WifiStatus WifiChip::forceDumpToDebugRingBufferInternal(const hidl_string& ring_ return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::flushRingBufferToFileInternal() { +ndk::ScopedAStatus WifiChip::flushRingBufferToFileInternal() { if (!writeRingbufferFilesInternal()) { LOG(ERROR) << "Error writing files to flash"; return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() { +ndk::ScopedAStatus WifiChip::stopLoggingToDebugRingBufferInternal() { legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->deregisterRingBufferCallbackHandler(getFirstActiveWlanIfaceName()); if (legacy_status == legacy_hal::WIFI_SUCCESS) { @@ -1325,29 +1313,29 @@ WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() { return createWifiStatusFromLegacyError(legacy_status); } -std::pair +std::pair WifiChip::getDebugHostWakeReasonStatsInternal() { legacy_hal::wifi_error legacy_status; legacy_hal::WakeReasonStats legacy_stats; std::tie(legacy_status, legacy_stats) = legacy_hal_.lock()->getWakeReasonStats(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; + return {WifiDebugHostWakeReasonStats{}, createWifiStatusFromLegacyError(legacy_status)}; } - WifiDebugHostWakeReasonStats hidl_stats; - if (!hidl_struct_util::convertLegacyWakeReasonStatsToHidl(legacy_stats, &hidl_stats)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; + WifiDebugHostWakeReasonStats aidl_stats; + if (!aidl_struct_util::convertLegacyWakeReasonStatsToAidl(legacy_stats, &aidl_stats)) { + return {WifiDebugHostWakeReasonStats{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_stats}; + return {aidl_stats, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::enableDebugErrorAlertsInternal(bool enable) { +ndk::ScopedAStatus WifiChip::enableDebugErrorAlertsInternal(bool enable) { legacy_hal::wifi_error legacy_status; if (enable) { - android::wp weak_ptr_this(this); + std::weak_ptr weak_ptr_this = weak_ptr_this_; const auto& on_alert_callback = [weak_ptr_this](int32_t error_code, std::vector debug_data) { - const auto shared_ptr_this = weak_ptr_this.promote(); + 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; @@ -1367,106 +1355,50 @@ WifiStatus WifiChip::enableDebugErrorAlertsInternal(bool enable) { return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::selectTxPowerScenarioInternal(V1_1::IWifiChip::TxPowerScenario scenario) { +ndk::ScopedAStatus WifiChip::selectTxPowerScenarioInternal(IWifiChip::TxPowerScenario scenario) { auto legacy_status = legacy_hal_.lock()->selectTxPowerScenario( getFirstActiveWlanIfaceName(), - hidl_struct_util::convertHidlTxPowerScenarioToLegacy(scenario)); + aidl_struct_util::convertAidlTxPowerScenarioToLegacy(scenario)); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::resetTxPowerScenarioInternal() { +ndk::ScopedAStatus WifiChip::resetTxPowerScenarioInternal() { auto legacy_status = legacy_hal_.lock()->resetTxPowerScenario(getFirstActiveWlanIfaceName()); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::setLatencyModeInternal(LatencyMode mode) { +ndk::ScopedAStatus WifiChip::setLatencyModeInternal(IWifiChip::LatencyMode mode) { auto legacy_status = legacy_hal_.lock()->setLatencyMode( - getFirstActiveWlanIfaceName(), hidl_struct_util::convertHidlLatencyModeToLegacy(mode)); + getFirstActiveWlanIfaceName(), aidl_struct_util::convertAidlLatencyModeToLegacy(mode)); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::registerEventCallbackInternal_1_2( - const sp& /* event_callback */) { - // Deprecated support for this callback. - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiChip::selectTxPowerScenarioInternal_1_2(TxPowerScenario scenario) { - auto legacy_status = legacy_hal_.lock()->selectTxPowerScenario( - getFirstActiveWlanIfaceName(), - hidl_struct_util::convertHidlTxPowerScenarioToLegacy_1_2(scenario)); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair WifiChip::getCapabilitiesInternal_1_3() { - // Deprecated support for this callback. - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), 0}; -} - -std::pair WifiChip::getCapabilitiesInternal_1_5() { - legacy_hal::wifi_error legacy_status; - uint64_t legacy_feature_set; - uint32_t legacy_logger_feature_set; - const auto ifname = getFirstActiveWlanIfaceName(); - std::tie(legacy_status, legacy_feature_set) = - legacy_hal_.lock()->getSupportedFeatureSet(ifname); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), 0}; - } - std::tie(legacy_status, legacy_logger_feature_set) = - legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - // some devices don't support querying logger feature set - legacy_logger_feature_set = 0; - } - uint32_t hidl_caps; - if (!hidl_struct_util::convertLegacyFeaturesToHidlChipCapabilities( - legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), 0}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -std::pair> WifiChip::createRttControllerInternal_1_4( - const sp& /*bound_iface*/) { - LOG(ERROR) << "createRttController_1_4 is not supported on this HAL"; - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiChip::registerEventCallbackInternal_1_4( - const sp& event_callback) { - if (!event_cb_handler_.addCallback(event_callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiChip::setMultiStaPrimaryConnectionInternal(const std::string& ifname) { +ndk::ScopedAStatus WifiChip::setMultiStaPrimaryConnectionInternal(const std::string& ifname) { auto legacy_status = legacy_hal_.lock()->multiStaSetPrimaryConnection(ifname); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::setMultiStaUseCaseInternal(MultiStaUseCase use_case) { +ndk::ScopedAStatus WifiChip::setMultiStaUseCaseInternal(IWifiChip::MultiStaUseCase use_case) { auto legacy_status = legacy_hal_.lock()->multiStaSetUseCase( - hidl_struct_util::convertHidlMultiStaUseCaseToLegacy(use_case)); + aidl_struct_util::convertAidlMultiStaUseCaseToLegacy(use_case)); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::setCoexUnsafeChannelsInternal(std::vector unsafe_channels, - uint32_t restrictions) { +ndk::ScopedAStatus WifiChip::setCoexUnsafeChannelsInternal( + std::vector unsafe_channels, int32_t aidl_restrictions) { std::vector legacy_unsafe_channels; - if (!hidl_struct_util::convertHidlVectorOfCoexUnsafeChannelToLegacy(unsafe_channels, + if (!aidl_struct_util::convertAidlVectorOfCoexUnsafeChannelToLegacy(unsafe_channels, &legacy_unsafe_channels)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } uint32_t legacy_restrictions = 0; - if (restrictions & CoexRestriction::WIFI_DIRECT) { + if (aidl_restrictions & static_cast(CoexRestriction::WIFI_DIRECT)) { legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_DIRECT; } - if (restrictions & CoexRestriction::SOFTAP) { + if (aidl_restrictions & static_cast(CoexRestriction::SOFTAP)) { legacy_restrictions |= legacy_hal::wifi_coex_restriction::SOFTAP; } - if (restrictions & CoexRestriction::WIFI_AWARE) { + if (aidl_restrictions & static_cast(CoexRestriction::WIFI_AWARE)) { legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_AWARE; } auto legacy_status = @@ -1474,85 +1406,97 @@ WifiStatus WifiChip::setCoexUnsafeChannelsInternal(std::vector& code) { +ndk::ScopedAStatus WifiChip::setCountryCodeInternal(const std::array& code) { auto legacy_status = legacy_hal_.lock()->setCountryCode(getFirstActiveWlanIfaceName(), code); return createWifiStatusFromLegacyError(legacy_status); } -std::pair> WifiChip::getUsableChannelsInternal( - WifiBand /*band*/, uint32_t /*ifaceModeMask*/, uint32_t /*filterMask*/) { - LOG(ERROR) << "getUsableChannels is not supported on this HAL"; - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiChip::triggerSubsystemRestartInternal() { - auto legacy_status = legacy_hal_.lock()->triggerSubsystemRestart(); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair> WifiChip::createRttControllerInternal_1_6( - const sp& bound_iface) { - if (sta_ifaces_.size() == 0 && - !canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) { - LOG(ERROR) << "createRttControllerInternal_1_6: Chip cannot support STAs " - "(and RTT by extension)"; - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; - } - sp rtt = - new WifiRttController(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_); - rtt_controllers_.emplace_back(rtt); - return {createWifiStatus(WifiStatusCode::SUCCESS), rtt}; -} - -std::pair> WifiChip::getUsableChannelsInternal_1_6( - WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask) { +std::pair, ndk::ScopedAStatus> WifiChip::getUsableChannelsInternal( + WifiBand band, int32_t ifaceModeMask, int32_t filterMask) { legacy_hal::wifi_error legacy_status; std::vector legacy_usable_channels; std::tie(legacy_status, legacy_usable_channels) = legacy_hal_.lock()->getUsableChannels( - hidl_struct_util::convertHidlWifiBandToLegacyMacBand(band), - hidl_struct_util::convertHidlWifiIfaceModeToLegacy(ifaceModeMask), - hidl_struct_util::convertHidlUsableChannelFilterToLegacy(filterMask)); + aidl_struct_util::convertAidlWifiBandToLegacyMacBand(band), + aidl_struct_util::convertAidlWifiIfaceModeToLegacy(ifaceModeMask), + aidl_struct_util::convertAidlUsableChannelFilterToLegacy(filterMask)); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; + return {std::vector(), createWifiStatusFromLegacyError(legacy_status)}; } - std::vector hidl_usable_channels; - if (!hidl_struct_util::convertLegacyWifiUsableChannelsToHidl(legacy_usable_channels, - &hidl_usable_channels)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; + std::vector aidl_usable_channels; + if (!aidl_struct_util::convertLegacyWifiUsableChannelsToAidl(legacy_usable_channels, + &aidl_usable_channels)) { + return {std::vector(), createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels}; + return {aidl_usable_channels, ndk::ScopedAStatus::ok()}; } -std::pair -WifiChip::getSupportedRadioCombinationsMatrixInternal() { +ndk::ScopedAStatus WifiChip::setAfcChannelAllowanceInternal( + const AfcChannelAllowance& afcChannelAllowance) { + LOG(INFO) << "setAfcChannelAllowance is not yet supported. availableAfcFrequencyInfos size=" + << afcChannelAllowance.availableAfcFrequencyInfos.size() + << " availableAfcChannelInfos size=" + << afcChannelAllowance.availableAfcChannelInfos.size() + << " availabilityExpireTimeMs=" << afcChannelAllowance.availabilityExpireTimeMs; + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +std::pair, ndk::ScopedAStatus> +WifiChip::getSupportedRadioCombinationsInternal() { legacy_hal::wifi_error legacy_status; legacy_hal::wifi_radio_combination_matrix* legacy_matrix; + std::vector aidl_combinations; std::tie(legacy_status, legacy_matrix) = legacy_hal_.lock()->getSupportedRadioCombinationsMatrix(); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to get SupportedRadioCombinations matrix from legacy HAL: " << legacyErrorToString(legacy_status); - return {createWifiStatusFromLegacyError(legacy_status), {}}; + return {aidl_combinations, createWifiStatusFromLegacyError(legacy_status)}; } - V1_6::WifiRadioCombinationMatrix hidl_matrix; - if (!hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix, - &hidl_matrix)) { - LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToHidl() "; - return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), {}}; + if (!aidl_struct_util::convertLegacyRadioCombinationsMatrixToAidl(legacy_matrix, + &aidl_combinations)) { + LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToAidl() "; + return {aidl_combinations, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix}; + return {aidl_combinations, ndk::ScopedAStatus::ok()}; } -std::pair> -WifiChip::getAvailableModesInternal_1_6() { - return {createWifiStatus(WifiStatusCode::SUCCESS), modes_}; +std::pair WifiChip::getWifiChipCapabilitiesInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_chip_capabilities legacy_chip_capabilities; + std::tie(legacy_status, legacy_chip_capabilities) = + legacy_hal_.lock()->getWifiChipCapabilities(); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get chip capabilities from legacy HAL: " + << legacyErrorToString(legacy_status); + return {WifiChipCapabilities(), createWifiStatusFromLegacyError(legacy_status)}; + } + WifiChipCapabilities aidl_chip_capabilities; + if (!aidl_struct_util::convertLegacyWifiChipCapabilitiesToAidl(legacy_chip_capabilities, + aidl_chip_capabilities)) { + LOG(ERROR) << "Failed convertLegacyWifiChipCapabilitiesToAidl() "; + return {WifiChipCapabilities(), createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; + } + + return {aidl_chip_capabilities, ndk::ScopedAStatus::ok()}; } -WifiStatus WifiChip::handleChipConfiguration( - /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { +ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetworkInternal( + int32_t channelCategoryEnableFlag) { + auto legacy_status = legacy_hal_.lock()->enableStaChannelForPeerNetwork( + aidl_struct_util::convertAidlChannelCategoryToLegacy(channelCategoryEnableFlag)); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiChip::triggerSubsystemRestartInternal() { + auto legacy_status = legacy_hal_.lock()->triggerSubsystemRestart(); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiChip::handleChipConfiguration( + /* NONNULL */ std::unique_lock* lock, int32_t mode_id) { // If the chip is already configured in a different mode, stop // the legacy HAL and then start it after firmware mode change. if (isValidModeId(current_mode_id_)) { @@ -1581,41 +1525,43 @@ WifiStatus WifiChip::handleChipConfiguration( } // Every time the HAL is restarted, we need to register the // radio mode change callback. - WifiStatus status = registerRadioModeChangeCallback(); - if (status.code != WifiStatusCode::SUCCESS) { - // This probably is not a critical failure? + ndk::ScopedAStatus status = registerRadioModeChangeCallback(); + if (!status.isOk()) { + // This is probably not a critical failure? LOG(ERROR) << "Failed to register radio mode change callback"; } // Extract and save the version information into property. - std::pair version_info; + std::pair version_info; version_info = WifiChip::requestChipDebugInfoInternal(); - if (WifiStatusCode::SUCCESS == version_info.first.code) { + if (version_info.second.isOk()) { property_set("vendor.wlan.firmware.version", - version_info.second.firmwareDescription.c_str()); - property_set("vendor.wlan.driver.version", version_info.second.driverDescription.c_str()); + version_info.first.firmwareDescription.c_str()); + property_set("vendor.wlan.driver.version", version_info.first.driverDescription.c_str()); } + // Get the driver supported interface combination. + retrieveDynamicIfaceCombination(); - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } -WifiStatus WifiChip::registerDebugRingBufferCallback() { +ndk::ScopedAStatus WifiChip::registerDebugRingBufferCallback() { if (debug_ring_buffer_cb_registered_) { - return createWifiStatus(WifiStatusCode::SUCCESS); + return ndk::ScopedAStatus::ok(); } - android::wp weak_ptr_this(this); + std::weak_ptr weak_ptr_this = weak_ptr_this_; const auto& on_ring_buffer_data_callback = [weak_ptr_this](const std::string& name, const std::vector& data, const legacy_hal::wifi_ring_buffer_status& status) { - const auto shared_ptr_this = weak_ptr_this.promote(); + 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; } - WifiDebugRingBufferStatus hidl_status; + WifiDebugRingBufferStatus aidl_status; Ringbuffer::AppendStatus appendstatus; - if (!hidl_struct_util::convertLegacyDebugRingBufferStatusToHidl(status, - &hidl_status)) { + if (!aidl_struct_util::convertLegacyDebugRingBufferStatusToAidl(status, + &aidl_status)) { LOG(ERROR) << "Error converting ring buffer status"; return; } @@ -1636,7 +1582,6 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { shared_ptr_this->writeRingbufferFilesInternal(); return; } - }; legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->registerRingBufferCallbackHandler( getFirstActiveWlanIfaceName(), on_ring_buffer_data_callback); @@ -1647,25 +1592,24 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::registerRadioModeChangeCallback() { - android::wp weak_ptr_this(this); +ndk::ScopedAStatus WifiChip::registerRadioModeChangeCallback() { + std::weak_ptr weak_ptr_this = weak_ptr_this_; const auto& on_radio_mode_change_callback = [weak_ptr_this](const std::vector& mac_infos) { - const auto shared_ptr_this = weak_ptr_this.promote(); + 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; } - std::vector hidl_radio_mode_infos; - if (!hidl_struct_util::convertLegacyWifiMacInfosToHidl(mac_infos, - &hidl_radio_mode_infos)) { + std::vector aidl_radio_mode_infos; + if (!aidl_struct_util::convertLegacyWifiMacInfosToAidl(mac_infos, + &aidl_radio_mode_infos)) { LOG(ERROR) << "Error converting wifi mac info"; return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onRadioModeChange_1_4(hidl_radio_mode_infos).isOk()) { - LOG(ERROR) << "Failed to invoke onRadioModeChange_1_4" - << " callback on: " << toString(callback); + if (!callback->onRadioModeChange(aidl_radio_mode_infos).isOk()) { + LOG(ERROR) << "Failed to invoke onRadioModeChange callback"; } } }; @@ -1675,11 +1619,11 @@ WifiStatus WifiChip::registerRadioModeChangeCallback() { return createWifiStatusFromLegacyError(legacy_status); } -std::vector +std::vector WifiChip::getCurrentModeConcurrencyCombinations() { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; - return {}; + return std::vector(); } for (const auto& mode : modes_) { if (mode.id == current_mode_id_) { @@ -1687,7 +1631,7 @@ WifiChip::getCurrentModeConcurrencyCombinations() { } } CHECK(0) << "Expected to find concurrency combinations for current mode!"; - return {}; + return std::vector(); } // Returns a map indexed by IfaceConcurrencyType with the number of ifaces currently @@ -1707,7 +1651,7 @@ std::map WifiChip::getCurrentConcurrencyCombinatio } iface_counts[IfaceConcurrencyType::AP] = num_ap; iface_counts[IfaceConcurrencyType::AP_BRIDGED] = num_ap_bridged; - iface_counts[IfaceConcurrencyType::NAN] = nan_ifaces_.size(); + iface_counts[IfaceConcurrencyType::NAN_IFACE] = nan_ifaces_.size(); iface_counts[IfaceConcurrencyType::P2P] = p2p_ifaces_.size(); iface_counts[IfaceConcurrencyType::STA] = sta_ifaces_.size(); return iface_counts; @@ -1718,10 +1662,10 @@ std::map WifiChip::getCurrentConcurrencyCombinatio // of each concurrency type in the combination. // This method is a port of HalDeviceManager.expandConcurrencyCombos() from framework. std::vector> WifiChip::expandConcurrencyCombinations( - const V1_6::IWifiChip::ChipConcurrencyCombination& combination) { - uint32_t num_expanded_combos = 1; + const IWifiChip::ChipConcurrencyCombination& combination) { + int32_t num_expanded_combos = 1; for (const auto& limit : combination.limits) { - for (uint32_t i = 0; i < limit.maxIfaces; i++) { + for (int32_t i = 0; i < limit.maxIfaces; i++) { num_expanded_combos *= limit.types.size(); } } @@ -1731,17 +1675,17 @@ std::vector> WifiChip::expandConcurrencyC std::vector> expanded_combos; expanded_combos.resize(num_expanded_combos); for (auto& expanded_combo : expanded_combos) { - for (const auto type : - {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN, - IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { + for (const auto type : {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, + IfaceConcurrencyType::NAN_IFACE, IfaceConcurrencyType::P2P, + IfaceConcurrencyType::STA}) { expanded_combo[type] = 0; } } - uint32_t span = num_expanded_combos; + int32_t span = num_expanded_combos; for (const auto& limit : combination.limits) { - for (uint32_t i = 0; i < limit.maxIfaces; i++) { + for (int32_t i = 0; i < limit.maxIfaces; i++) { span /= limit.types.size(); - for (uint32_t k = 0; k < num_expanded_combos; ++k) { + for (int32_t k = 0; k < num_expanded_combos; ++k) { const auto iface_type = limit.types[(k / span) % limit.types.size()]; expanded_combos[k][iface_type]++; } @@ -1757,8 +1701,8 @@ bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes // Check if we have space for 1 more iface of |type| in this combo for (const auto type : - {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN, - IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { + {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, + IfaceConcurrencyType::NAN_IFACE, IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { size_t num_ifaces_needed = current_combo.at(type); if (type == requested_type) { num_ifaces_needed++; @@ -1802,8 +1746,8 @@ bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyCombo( const std::map& req_combo) { // Check if we have space for 1 more |type| in this combo for (const auto type : - {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN, - IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { + {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, + IfaceConcurrencyType::NAN_IFACE, IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { if (req_combo.count(type) == 0) { // Concurrency type not in the req_combo. continue; @@ -1816,6 +1760,7 @@ bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyCombo( } return true; } + // This method does the following: // a) Enumerate all possible concurrency combos by expanding the current // ChipConcurrencyCombination. @@ -1851,7 +1796,7 @@ bool WifiChip::canCurrentModeSupportConcurrencyType(IfaceConcurrencyType request return canCurrentModeSupportConcurrencyCombo(req_iface_combo); } -bool WifiChip::isValidModeId(ChipModeId mode_id) { +bool WifiChip::isValidModeId(int32_t mode_id) { for (const auto& mode : modes_) { if (mode.id == mode_id) { return true; @@ -1926,9 +1871,10 @@ uint32_t WifiChip::startIdxOfApIface() { // concurrent STA and not dual AP, else start with idx 0. std::string WifiChip::allocateApIfaceName() { // Check if we have a dedicated iface for AP. - std::vector ifnames = getPredefinedApIfaceNames(false); - if (!ifnames.empty()) { - return ifnames[0]; + std::vector ifnames = getPredefinedApIfaceNames(true); + for (auto const& ifname : ifnames) { + if (findUsingName(ap_ifaces_, ifname)) continue; + return ifname; } return allocateApOrStaIfaceName(IfaceType::AP, startIdxOfApIface()); } @@ -2018,7 +1964,7 @@ void WifiChip::invalidateAndClearBridgedApAll() { void WifiChip::deleteApIface(const std::string& if_name) { if (if_name.empty()) return; - // delete bridged interfaces if have + // delete bridged interfaces if any for (auto const& it : br_ifaces_ap_instances_) { if (it.first == if_name) { for (auto const& iface : it.second) { @@ -2054,8 +2000,29 @@ bool WifiChip::findUsingNameFromBridgedApInstances(const std::string& name) { return false; } -} // namespace implementation -} // namespace V1_6 +ndk::ScopedAStatus WifiChip::setMloModeInternal(const WifiChip::ChipMloMode in_mode) { + legacy_hal::wifi_mlo_mode mode; + switch (in_mode) { + case WifiChip::ChipMloMode::DEFAULT: + mode = legacy_hal::wifi_mlo_mode::WIFI_MLO_MODE_DEFAULT; + break; + case WifiChip::ChipMloMode::LOW_LATENCY: + mode = legacy_hal::wifi_mlo_mode::WIFI_MLO_MODE_LOW_LATENCY; + break; + case WifiChip::ChipMloMode::HIGH_THROUGHPUT: + mode = legacy_hal::wifi_mlo_mode::WIFI_MLO_MODE_HIGH_THROUGHPUT; + break; + case WifiChip::ChipMloMode::LOW_POWER: + mode = legacy_hal::wifi_mlo_mode::WIFI_MLO_MODE_LOW_POWER; + break; + default: + PLOG(ERROR) << "Error: invalid mode: " << toString(in_mode); + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + return createWifiStatusFromLegacyError(legacy_hal_.lock()->setMloMode(mode)); +} + } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h new file mode 100644 index 0000000000..1a360320c9 --- /dev/null +++ b/wifi/aidl/default/wifi_chip.h @@ -0,0 +1,301 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WIFI_CHIP_H_ +#define WIFI_CHIP_H_ + +#include +#include +#include + +#include +#include +#include + +#include "aidl_callback_util.h" +#include "ringbuffer.h" +#include "wifi_ap_iface.h" +#include "wifi_feature_flags.h" +#include "wifi_legacy_hal.h" +#include "wifi_mode_controller.h" +#include "wifi_nan_iface.h" +#include "wifi_p2p_iface.h" +#include "wifi_rtt_controller.h" +#include "wifi_sta_iface.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +/** + * AIDL interface object used to control a Wifi HAL chip instance. + * Since there is only a single chip instance used today, there is no + * identifying handle information stored here. + */ +class WifiChip : public BnWifiChip { + public: + WifiChip(int32_t chip_id, bool is_primary, + const std::weak_ptr legacy_hal, + const std::weak_ptr mode_controller, + const std::shared_ptr iface_util, + const std::weak_ptr feature_flags, + const std::function& subsystemCallbackHandler, + bool using_dynamic_iface_combination); + + // Factory method - use instead of default constructor. + static std::shared_ptr create( + int32_t chip_id, bool is_primary, + const std::weak_ptr legacy_hal, + const std::weak_ptr mode_controller, + const std::shared_ptr iface_util, + const std::weak_ptr feature_flags, + const std::function& subsystemCallbackHandler, + bool using_dynamic_iface_combination); + + // AIDL does not provide a built-in mechanism to let the server invalidate + // an AIDL interface object after creation. If any client process holds onto + // a reference to the object in their context, any method calls on that + // reference will continue to be directed to the server. + // + // However Wifi HAL needs to control the lifetime of these objects. So, add + // a public |invalidate| method to |WifiChip| and its child objects. This + // will be used to mark an object invalid when either: + // a) Wifi HAL is stopped, or + // b) Wifi Chip is reconfigured. + // + // All AIDL method implementations should check if the object is still + // marked valid before processing them. + void invalidate(); + bool isValid(); + std::set> getEventCallbacks(); + + // AIDL methods exposed. + ndk::ScopedAStatus getId(int32_t* _aidl_return) override; + ndk::ScopedAStatus registerEventCallback( + const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus getFeatureSet(int32_t* _aidl_return) override; + ndk::ScopedAStatus getAvailableModes(std::vector* _aidl_return) override; + ndk::ScopedAStatus configureChip(int32_t in_modeId) override; + ndk::ScopedAStatus getMode(int32_t* _aidl_return) override; + ndk::ScopedAStatus requestChipDebugInfo(IWifiChip::ChipDebugInfo* _aidl_return) override; + ndk::ScopedAStatus requestDriverDebugDump(std::vector* _aidl_return) override; + ndk::ScopedAStatus requestFirmwareDebugDump(std::vector* _aidl_return) override; + ndk::ScopedAStatus createApIface(std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus createBridgedApIface(std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus getApIfaceNames(std::vector* _aidl_return) override; + ndk::ScopedAStatus getApIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus removeApIface(const std::string& in_ifname) override; + ndk::ScopedAStatus removeIfaceInstanceFromBridgedApIface( + const std::string& in_brIfaceName, const std::string& in_ifaceInstanceName) override; + ndk::ScopedAStatus createNanIface(std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus getNanIfaceNames(std::vector* _aidl_return) override; + ndk::ScopedAStatus getNanIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus removeNanIface(const std::string& in_ifname) override; + ndk::ScopedAStatus createP2pIface(std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus getP2pIfaceNames(std::vector* _aidl_return) override; + ndk::ScopedAStatus getP2pIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus removeP2pIface(const std::string& in_ifname) override; + ndk::ScopedAStatus createStaIface(std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus getStaIfaceNames(std::vector* _aidl_return) override; + ndk::ScopedAStatus getStaIface(const std::string& in_ifname, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus removeStaIface(const std::string& in_ifname) override; + ndk::ScopedAStatus createRttController( + const std::shared_ptr& in_boundIface, + std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus getDebugRingBuffersStatus( + std::vector* _aidl_return) override; + ndk::ScopedAStatus startLoggingToDebugRingBuffer( + const std::string& in_ringName, WifiDebugRingBufferVerboseLevel in_verboseLevel, + int32_t in_maxIntervalInSec, int32_t in_minDataSizeInBytes) override; + ndk::ScopedAStatus forceDumpToDebugRingBuffer(const std::string& in_ringName) override; + ndk::ScopedAStatus flushRingBufferToFile() override; + ndk::ScopedAStatus stopLoggingToDebugRingBuffer() override; + ndk::ScopedAStatus getDebugHostWakeReasonStats( + WifiDebugHostWakeReasonStats* _aidl_return) override; + ndk::ScopedAStatus enableDebugErrorAlerts(bool in_enable) override; + ndk::ScopedAStatus selectTxPowerScenario(IWifiChip::TxPowerScenario in_scenario) override; + ndk::ScopedAStatus resetTxPowerScenario() override; + ndk::ScopedAStatus setLatencyMode(IWifiChip::LatencyMode in_mode) override; + ndk::ScopedAStatus setMultiStaPrimaryConnection(const std::string& in_ifName) override; + ndk::ScopedAStatus setMultiStaUseCase(IWifiChip::MultiStaUseCase in_useCase) override; + ndk::ScopedAStatus setCoexUnsafeChannels( + const std::vector& in_unsafeChannels, + int32_t in_restrictions) override; + ndk::ScopedAStatus setCountryCode(const std::array& in_code) override; + ndk::ScopedAStatus getUsableChannels(WifiBand in_band, int32_t in_ifaceModeMask, + int32_t in_filterMask, + std::vector* _aidl_return) override; + ndk::ScopedAStatus setAfcChannelAllowance( + const AfcChannelAllowance& afcChannelAllowance) override; + ndk::ScopedAStatus triggerSubsystemRestart() override; + ndk::ScopedAStatus getSupportedRadioCombinations( + std::vector* _aidl_return) override; + ndk::ScopedAStatus getWifiChipCapabilities(WifiChipCapabilities* _aidl_return) override; + ndk::ScopedAStatus enableStaChannelForPeerNetwork( + int32_t in_channelCategoryEnableFlag) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override; + + private: + void invalidateAndRemoveAllIfaces(); + // When a STA iface is removed any dependent NAN-ifaces/RTT-controllers are + // invalidated & removed. + void invalidateAndRemoveDependencies(const std::string& removed_iface_name); + + // Corresponding worker functions for the AIDL methods. + std::pair getIdInternal(); + ndk::ScopedAStatus registerEventCallbackInternal( + const std::shared_ptr& event_callback); + std::pair getFeatureSetInternal(); + std::pair, ndk::ScopedAStatus> getAvailableModesInternal(); + ndk::ScopedAStatus configureChipInternal(std::unique_lock* lock, + int32_t mode_id); + std::pair getModeInternal(); + std::pair requestChipDebugInfoInternal(); + std::pair, ndk::ScopedAStatus> requestDriverDebugDumpInternal(); + std::pair, ndk::ScopedAStatus> requestFirmwareDebugDumpInternal(); + std::shared_ptr newWifiApIface(std::string& ifname); + ndk::ScopedAStatus createVirtualApInterface(const std::string& apVirtIf); + std::pair, ndk::ScopedAStatus> createApIfaceInternal(); + std::pair, ndk::ScopedAStatus> createBridgedApIfaceInternal(); + std::pair, ndk::ScopedAStatus> getApIfaceNamesInternal(); + std::pair, ndk::ScopedAStatus> getApIfaceInternal( + const std::string& ifname); + ndk::ScopedAStatus removeApIfaceInternal(const std::string& ifname); + ndk::ScopedAStatus removeIfaceInstanceFromBridgedApIfaceInternal( + const std::string& brIfaceName, const std::string& ifInstanceName); + std::pair, ndk::ScopedAStatus> createNanIfaceInternal(); + std::pair, ndk::ScopedAStatus> getNanIfaceNamesInternal(); + std::pair, ndk::ScopedAStatus> getNanIfaceInternal( + const std::string& ifname); + ndk::ScopedAStatus removeNanIfaceInternal(const std::string& ifname); + std::pair, ndk::ScopedAStatus> createP2pIfaceInternal(); + std::pair, ndk::ScopedAStatus> getP2pIfaceNamesInternal(); + std::pair, ndk::ScopedAStatus> getP2pIfaceInternal( + const std::string& ifname); + ndk::ScopedAStatus removeP2pIfaceInternal(const std::string& ifname); + std::pair, ndk::ScopedAStatus> createStaIfaceInternal(); + std::pair, ndk::ScopedAStatus> getStaIfaceNamesInternal(); + std::pair, ndk::ScopedAStatus> getStaIfaceInternal( + const std::string& ifname); + ndk::ScopedAStatus removeStaIfaceInternal(const std::string& ifname); + std::pair, ndk::ScopedAStatus> createRttControllerInternal( + const std::shared_ptr& bound_iface); + std::pair, ndk::ScopedAStatus> + getDebugRingBuffersStatusInternal(); + ndk::ScopedAStatus startLoggingToDebugRingBufferInternal( + const std::string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes); + ndk::ScopedAStatus forceDumpToDebugRingBufferInternal(const std::string& ring_name); + ndk::ScopedAStatus flushRingBufferToFileInternal(); + ndk::ScopedAStatus stopLoggingToDebugRingBufferInternal(); + std::pair + getDebugHostWakeReasonStatsInternal(); + ndk::ScopedAStatus enableDebugErrorAlertsInternal(bool enable); + ndk::ScopedAStatus selectTxPowerScenarioInternal(IWifiChip::TxPowerScenario scenario); + ndk::ScopedAStatus resetTxPowerScenarioInternal(); + ndk::ScopedAStatus setLatencyModeInternal(IWifiChip::LatencyMode mode); + ndk::ScopedAStatus setMultiStaPrimaryConnectionInternal(const std::string& ifname); + ndk::ScopedAStatus setMultiStaUseCaseInternal(IWifiChip::MultiStaUseCase use_case); + ndk::ScopedAStatus setCoexUnsafeChannelsInternal( + std::vector unsafe_channels, int32_t restrictions); + ndk::ScopedAStatus setCountryCodeInternal(const std::array& in_code); + std::pair, ndk::ScopedAStatus> getUsableChannelsInternal( + WifiBand band, int32_t ifaceModeMask, int32_t filterMask); + ndk::ScopedAStatus enableStaChannelForPeerNetworkInternal(int32_t channelCategoryEnableFlag); + ndk::ScopedAStatus setAfcChannelAllowanceInternal( + const AfcChannelAllowance& afcChannelAllowance); + ndk::ScopedAStatus handleChipConfiguration(std::unique_lock* lock, + int32_t mode_id); + ndk::ScopedAStatus registerDebugRingBufferCallback(); + ndk::ScopedAStatus registerRadioModeChangeCallback(); + + std::vector getCurrentModeConcurrencyCombinations(); + std::map getCurrentConcurrencyCombination(); + std::vector> expandConcurrencyCombinations( + const ChipConcurrencyCombination& combination); + bool canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes( + const std::map& expanded_combo, + IfaceConcurrencyType requested_type); + bool canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType requested_type); + bool canExpandedConcurrencyComboSupportConcurrencyCombo( + const std::map& expanded_combo, + const std::map& req_combo); + bool canCurrentModeSupportConcurrencyCombo( + const std::map& req_combo); + bool canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type); + + bool isValidModeId(int32_t mode_id); + bool isStaApConcurrencyAllowedInCurrentMode(); + bool isDualStaConcurrencyAllowedInCurrentMode(); + uint32_t startIdxOfApIface(); + std::string getFirstActiveWlanIfaceName(); + std::string allocateApOrStaIfaceName(IfaceType type, uint32_t start_idx); + std::string allocateApIfaceName(); + std::vector allocateBridgedApInstanceNames(); + std::string allocateStaIfaceName(); + bool writeRingbufferFilesInternal(); + std::string getWlanIfaceNameWithType(IfaceType type, unsigned idx); + void invalidateAndClearBridgedApAll(); + void deleteApIface(const std::string& if_name); + bool findUsingNameFromBridgedApInstances(const std::string& name); + ndk::ScopedAStatus triggerSubsystemRestartInternal(); + std::pair, ndk::ScopedAStatus> + getSupportedRadioCombinationsInternal(); + std::pair getWifiChipCapabilitiesInternal(); + ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode); + void retrieveDynamicIfaceCombination(); + void setWeakPtr(std::weak_ptr ptr); + + int32_t chip_id_; + std::weak_ptr legacy_hal_; + std::weak_ptr mode_controller_; + std::shared_ptr iface_util_; + std::vector> ap_ifaces_; + std::vector> nan_ifaces_; + std::vector> p2p_ifaces_; + std::vector> sta_ifaces_; + std::vector> rtt_controllers_; + std::map ringbuffer_map_; + bool is_valid_; + // Members pertaining to chip configuration. + int32_t current_mode_id_; + std::mutex lock_t; + std::vector modes_; + // The legacy ring buffer callback API has only a global callback + // registration mechanism. Use this to check if we have already + // registered a callback. + bool debug_ring_buffer_cb_registered_; + bool using_dynamic_iface_combination_; + aidl_callback_util::AidlCallbackHandler event_cb_handler_; + std::weak_ptr weak_ptr_this_; + + const std::function subsystemCallbackHandler_; + std::map> br_ifaces_ap_instances_; + DISALLOW_COPY_AND_ASSIGN(WifiChip); +}; + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // WIFI_CHIP_H_ diff --git a/wifi/1.6/default/wifi_feature_flags.cpp b/wifi/aidl/default/wifi_feature_flags.cpp similarity index 59% rename from wifi/1.6/default/wifi_feature_flags.cpp rename to wifi/aidl/default/wifi_feature_flags.cpp index e80a3cdcb6..3c9f042607 100644 --- a/wifi/1.6/default/wifi_feature_flags.cpp +++ b/wifi/aidl/default/wifi_feature_flags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,17 +21,12 @@ #include "wifi_feature_flags.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace feature_flags { -using V1_0::ChipModeId; -using V1_0::IWifiChip; -using V1_6::IfaceConcurrencyType; - /* The chip may either have a single mode supporting any number of combinations, * or a fixed dual-mode (so it involves firmware loading to switch between * modes) setting. If there is a need to support more modes, it needs to be @@ -41,7 +36,7 @@ using V1_6::IfaceConcurrencyType; * Supported combinations are defined in device's makefile, for example: * WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA, AP}, 1}, {{P2P, NAN}, 1}}, * WIFI_HAL_INTERFACE_COMBINATIONS += {{{STA}, 1}, {{AP}, 2}} - * What means: + * What this means: * Interface concurrency combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface * operations. * Interface concurrency combination 2: 1 STA and 2 AP concurrent iface operations. @@ -71,10 +66,10 @@ using V1_6::IfaceConcurrencyType; */ // clang-format off #ifdef WIFI_HAL_INTERFACE_COMBINATIONS -constexpr ChipModeId kMainModeId = chip_mode_ids::kV3; +constexpr int kMainModeId = chip_mode_ids::kV3; #elif defined(WIFI_HIDL_FEATURE_DUAL_INTERFACE) // former V2 (fixed dual interface) setup expressed as V3 -constexpr ChipModeId kMainModeId = chip_mode_ids::kV3; +constexpr int kMainModeId = chip_mode_ids::kV3; # ifdef WIFI_HIDL_FEATURE_DISABLE_AP # ifdef WIFI_HIDL_FEATURE_AWARE // 1 STA + 1 of (P2P or NAN) @@ -96,7 +91,7 @@ constexpr ChipModeId kMainModeId = chip_mode_ids::kV3; # endif #else // V1 (fixed single interface, dual-mode chip) -constexpr ChipModeId kMainModeId = chip_mode_ids::kV1Sta; +constexpr int kMainModeId = chip_mode_ids::kV1Sta; # ifdef WIFI_HIDL_FEATURE_AWARE // 1 STA + 1 of (P2P or NAN) # define WIFI_HAL_INTERFACE_COMBINATIONS {{{STA}, 1}, {{P2P, NAN}, 1}} @@ -111,44 +106,35 @@ constexpr ChipModeId kMainModeId = chip_mode_ids::kV1Sta; #endif // clang-format on -/** - * Helper class to convert a collection of combination limits to a combination. - * - * The main point here is to simplify the syntax required by - * WIFI_HAL_INTERFACE_COMBINATIONS. - */ -struct ChipConcurrencyCombination - : public hidl_vec { - ChipConcurrencyCombination( - const std::initializer_list list) - : hidl_vec(list) {} - - operator V1_6::IWifiChip::ChipConcurrencyCombination() const { return {*this}; } - - static hidl_vec make_vec( - const std::initializer_list list) { - return hidl_vec( // - std::begin(list), std::end(list)); +// Convert from the legacy format (used by the WIFI_HAL_INTERFACE_COMBINATIONS +// config variable) to a list of ChipConcurrencyCombination objects. +std::vector legacyToChipConcurrencyComboList( + std::vector> legacyLimits) { + std::vector combos; + for (auto& legacyLimit : legacyLimits) { + IWifiChip::ChipConcurrencyCombination combo = {legacyLimit}; + combos.push_back(combo); } -}; + return combos; +} #define STA IfaceConcurrencyType::STA #define AP IfaceConcurrencyType::AP #define AP_BRIDGED IfaceConcurrencyType::AP_BRIDGED #define P2P IfaceConcurrencyType::P2P -#define NAN IfaceConcurrencyType::NAN -static const std::vector kChipModesPrimary{ - {kMainModeId, ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})}, +#define NAN IfaceConcurrencyType::NAN_IFACE +static const std::vector kChipModesPrimary{ + {kMainModeId, legacyToChipConcurrencyComboList({WIFI_HAL_INTERFACE_COMBINATIONS})}, #ifdef WIFI_HAL_INTERFACE_COMBINATIONS_AP {chip_mode_ids::kV1Ap, - ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})}, + legacyToChipConcurrencyComboList({WIFI_HAL_INTERFACE_COMBINATIONS_AP})}, #endif }; -static const std::vector kChipModesSecondary{ +static const std::vector kChipModesSecondary{ #ifdef WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP {chip_mode_ids::kV3, - ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})}, + legacyToChipConcurrencyComboList({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})}, #endif }; @@ -157,50 +143,46 @@ constexpr char kDebugPresetInterfaceCombinationIdxProperty[] = // List of pre-defined concurrency combinations that can be enabled at runtime via // setting the property: "kDebugPresetInterfaceCombinationIdxProperty" to the // corresponding index value. -static const std::vector>> - kDebugChipModes{// Legacy combination - No STA/AP concurrencies. - // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN)) - {"No STA/AP Concurrency", - {{kMainModeId, ChipConcurrencyCombination::make_vec( - {{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, +static const std::vector>> kDebugChipModes{ + // Legacy combination - No STA/AP concurrencies. + // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN)) + {"No STA/AP Concurrency", + {{kMainModeId, + legacyToChipConcurrencyComboList({{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, - // STA + AP concurrency - // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN)) - {"STA + AP Concurrency", - {{kMainModeId, - ChipConcurrencyCombination::make_vec( - {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + // STA + AP concurrency + // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN)) + {"STA + AP Concurrency", + {{kMainModeId, legacyToChipConcurrencyComboList( + {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, - // STA + STA concurrency - // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN)) - {"Dual STA Concurrency", - {{kMainModeId, - ChipConcurrencyCombination::make_vec( - {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, + // STA + STA concurrency + // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN)) + {"Dual STA Concurrency", + {{kMainModeId, legacyToChipConcurrencyComboList( + {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, - // AP + AP + STA concurrency - // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN)) - {"Dual AP Concurrency", - {{kMainModeId, - ChipConcurrencyCombination::make_vec( - {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + // AP + AP + STA concurrency + // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN)) + {"Dual AP Concurrency", + {{kMainModeId, legacyToChipConcurrencyComboList( + {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, - // STA + STA concurrency and AP + AP + STA concurrency - // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN)) - {"Dual STA & Dual AP Concurrency", - {{kMainModeId, - ChipConcurrencyCombination::make_vec( - {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, + // STA + STA concurrency and AP + AP + STA concurrency + // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN)) + {"Dual STA & Dual AP Concurrency", + {{kMainModeId, legacyToChipConcurrencyComboList( + {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, - // STA + STA concurrency - // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA)) - {"Dual STA or STA plus single other interface", - {{kMainModeId, ChipConcurrencyCombination::make_vec( - {{{{STA}, 1}, {{P2P, NAN, AP, AP_BRIDGED}, 1}}, - {{{STA}, 2}}})}}}}; + // STA + STA concurrency + // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA)) + {"Dual STA or STA plus single other interface", + {{kMainModeId, legacyToChipConcurrencyComboList( + {{{{STA}, 1}, {{P2P, NAN, AP, AP_BRIDGED}, 1}}, {{{STA}, 2}}})}}}}; #undef STA #undef AP +#undef AP_BRIDGED #undef P2P #undef NAN @@ -214,7 +196,7 @@ static const std::vector WifiFeatureFlags::getChipModesForPrimary() { +std::vector WifiFeatureFlags::getChipModesForPrimary() { std::array buffer; auto res = property_get(kDebugPresetInterfaceCombinationIdxProperty, buffer.data(), nullptr); // Debug property not set, use the device preset concurrency combination. @@ -228,20 +210,19 @@ std::vector WifiFeatureFlags::getChipModesForPrimary( return kChipModesPrimary; } std::string name; - std::vector chip_modes; + std::vector chip_modes; std::tie(name, chip_modes) = kDebugChipModes[idx]; LOG(INFO) << "Using debug chip mode: <" << name << "> set via property: " << kDebugPresetInterfaceCombinationIdxProperty; return chip_modes; } -std::vector WifiFeatureFlags::getChipModes(bool is_primary) { +std::vector WifiFeatureFlags::getChipModes(bool is_primary) { return (is_primary) ? getChipModesForPrimary() : kChipModesSecondary; } } // namespace feature_flags -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_feature_flags.h b/wifi/aidl/default/wifi_feature_flags.h similarity index 67% rename from wifi/1.6/default/wifi_feature_flags.h rename to wifi/aidl/default/wifi_feature_flags.h index 1635341e3f..af1b6a674d 100644 --- a/wifi/1.6/default/wifi_feature_flags.h +++ b/wifi/aidl/default/wifi_feature_flags.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,24 +17,23 @@ #ifndef WIFI_FEATURE_FLAGS_H_ #define WIFI_FEATURE_FLAGS_H_ -#include +#include +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace feature_flags { namespace chip_mode_ids { // These mode ID's should be unique (even across combo versions). Refer to -// handleChipConfiguration() for it's usage. -constexpr V1_0::ChipModeId kInvalid = UINT32_MAX; +// handleChipConfiguration() for its usage. +constexpr uint32_t kInvalid = UINT32_MAX; // Mode ID's for V1 -constexpr V1_0::ChipModeId kV1Sta = 0; -constexpr V1_0::ChipModeId kV1Ap = 1; +constexpr uint32_t kV1Sta = 0; +constexpr uint32_t kV1Ap = 1; // Mode ID for V3 -constexpr V1_0::ChipModeId kV3 = 3; +constexpr uint32_t kV3 = 3; } // namespace chip_mode_ids class WifiFeatureFlags { @@ -42,17 +41,16 @@ class WifiFeatureFlags { WifiFeatureFlags(); virtual ~WifiFeatureFlags() = default; - virtual std::vector getChipModes(bool is_primary); + virtual std::vector getChipModes(bool is_primary); private: - std::vector getChipModesForPrimary(); + std::vector getChipModesForPrimary(); }; } // namespace feature_flags -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_FEATURE_FLAGS_H_ diff --git a/wifi/1.6/default/wifi_iface_util.cpp b/wifi/aidl/default/wifi_iface_util.cpp similarity index 95% rename from wifi/1.6/default/wifi_iface_util.cpp rename to wifi/aidl/default/wifi_iface_util.cpp index d55e4f8251..f788217dcf 100644 --- a/wifi/1.6/default/wifi_iface_util.cpp +++ b/wifi/aidl/default/wifi_iface_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,33 +14,32 @@ * limitations under the License. */ +#include +#include #include +#include + #include #include #include #include -#include -#include -#include - -#undef NAN #include "wifi_iface_util.h" namespace { // Constants to set the local bit & clear the multicast bit. constexpr uint8_t kMacAddressMulticastMask = 0x01; constexpr uint8_t kMacAddressLocallyAssignedMask = 0x02; + } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace iface_util { -WifiIfaceUtil::WifiIfaceUtil(const std::weak_ptr iface_tool, +WifiIfaceUtil::WifiIfaceUtil(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, const std::weak_ptr legacy_hal) : iface_tool_(iface_tool), legacy_hal_(legacy_hal), @@ -169,8 +168,7 @@ bool WifiIfaceUtil::removeIfaceFromBridge(const std::string& br_name, const std: } } // namespace iface_util -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_iface_util.h b/wifi/aidl/default/wifi_iface_util.h similarity index 89% rename from wifi/1.6/default/wifi_iface_util.h rename to wifi/aidl/default/wifi_iface_util.h index c5db5deed1..a3236a5622 100644 --- a/wifi/1.6/default/wifi_iface_util.h +++ b/wifi/aidl/default/wifi_iface_util.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +17,15 @@ #ifndef WIFI_IFACE_UTIL_H_ #define WIFI_IFACE_UTIL_H_ +#include #include -#include - #include "wifi_legacy_hal.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace iface_util { // Iface event handlers. @@ -42,7 +40,7 @@ struct IfaceEventHandlers { */ class WifiIfaceUtil { public: - WifiIfaceUtil(const std::weak_ptr iface_tool, + WifiIfaceUtil(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, const std::weak_ptr legacy_hal); virtual ~WifiIfaceUtil() = default; @@ -71,17 +69,16 @@ class WifiIfaceUtil { virtual std::array createRandomMacAddress(); private: - std::weak_ptr iface_tool_; + std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool_; std::weak_ptr legacy_hal_; std::unique_ptr> random_mac_address_; std::map event_handlers_map_; }; } // namespace iface_util -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_IFACE_UTIL_H_ diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp similarity index 77% rename from wifi/1.6/default/wifi_legacy_hal.cpp rename to wifi/aidl/default/wifi_legacy_hal.cpp index c9bcdc5dd8..209670bc69 100644 --- a/wifi/1.6/default/wifi_legacy_hal.cpp +++ b/wifi/aidl/default/wifi_legacy_hal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,16 @@ * limitations under the License. */ -#include -#include +#include "wifi_legacy_hal.h" #include #include #include -#include "hidl_sync_util.h" -#include "wifi_legacy_hal.h" +#include +#include + +#include "aidl_sync_util.h" #include "wifi_legacy_hal_stubs.h" namespace { @@ -38,7 +39,7 @@ static constexpr uint32_t kMaxWakeReasonStatsArraySize = 32; static constexpr uint32_t kMaxRingBuffers = 10; static constexpr uint32_t kMaxWifiUsableChannels = 256; static constexpr uint32_t kMaxSupportedRadioCombinationsMatrixLength = 256; -// need a long timeout (1000ms) for chips that unload their driver. +// Need a long timeout (1000ms) for chips that unload their driver. static constexpr uint32_t kMaxStopCompleteWaitMs = 1000; static constexpr char kDriverPropName[] = "wlan.driver.status"; @@ -51,11 +52,10 @@ std::vector makeCharVec(const std::string& str) { } } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace legacy_hal { // Legacy HAL functions accept "C" style function pointers, so use global @@ -65,7 +65,7 @@ namespace legacy_hal { // Callback to be invoked once |stop| is complete std::function on_stop_complete_internal_callback; void onAsyncStopComplete(wifi_handle handle) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_stop_complete_internal_callback) { on_stop_complete_internal_callback(handle); // Invalidate this callback since we don't want this firing again. @@ -92,7 +92,7 @@ void onSyncFirmwareMemoryDump(char* buffer, int buffer_size) { // Callback to be invoked for Gscan events. std::function on_gscan_event_internal_callback; void onAsyncGscanEvent(wifi_request_id id, wifi_scan_event event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_gscan_event_internal_callback) { on_gscan_event_internal_callback(id, event); } @@ -103,7 +103,7 @@ std::function on_gscan_full_result_internal_callback; void onAsyncGscanFullResult(wifi_request_id id, wifi_scan_result* result, uint32_t buckets_scanned) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_gscan_full_result_internal_callback) { on_gscan_full_result_internal_callback(id, result, buckets_scanned); } @@ -119,11 +119,21 @@ void onSyncLinkLayerStatsResult(wifi_request_id id, wifi_iface_stat* iface_stat, } } +// Callback to be invoked for Multi link layer stats results. +std::function + on_link_layer_ml_stats_result_internal_callback; +void onSyncLinkLayerMlStatsResult(wifi_request_id id, wifi_iface_ml_stat* iface_ml_stat, + int num_radios, wifi_radio_stat* radio_stat) { + if (on_link_layer_ml_stats_result_internal_callback) { + on_link_layer_ml_stats_result_internal_callback(id, iface_ml_stat, num_radios, radio_stat); + } +} + // Callback to be invoked for rssi threshold breach. std::function on_rssi_threshold_breached_internal_callback; void onAsyncRssiThresholdBreached(wifi_request_id id, uint8_t* bssid, int8_t rssi) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_rssi_threshold_breached_internal_callback) { on_rssi_threshold_breached_internal_callback(id, bssid, rssi); } @@ -134,7 +144,7 @@ std::function on_ring_buffer_data_internal_callback; void onAsyncRingBufferData(char* ring_name, char* buffer, int buffer_size, wifi_ring_buffer_status* status) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_ring_buffer_data_internal_callback) { on_ring_buffer_data_internal_callback(ring_name, buffer, buffer_size, status); } @@ -143,7 +153,7 @@ void onAsyncRingBufferData(char* ring_name, char* buffer, int buffer_size, // Callback to be invoked for error alert indication. std::function on_error_alert_internal_callback; void onAsyncErrorAlert(wifi_request_id id, char* buffer, int buffer_size, int err_code) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_error_alert_internal_callback) { on_error_alert_internal_callback(id, buffer, buffer_size, err_code); } @@ -153,7 +163,7 @@ void onAsyncErrorAlert(wifi_request_id id, char* buffer, int buffer_size, int er std::function on_radio_mode_change_internal_callback; void onAsyncRadioModeChange(wifi_request_id id, uint32_t num_macs, wifi_mac_info* mac_infos) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_radio_mode_change_internal_callback) { on_radio_mode_change_internal_callback(id, num_macs, mac_infos); } @@ -162,7 +172,7 @@ void onAsyncRadioModeChange(wifi_request_id id, uint32_t num_macs, wifi_mac_info // Callback to be invoked to report subsystem restart std::function on_subsystem_restart_internal_callback; void onAsyncSubsystemRestart(const char* error) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_subsystem_restart_internal_callback) { on_subsystem_restart_internal_callback(error); } @@ -171,11 +181,28 @@ void onAsyncSubsystemRestart(const char* error) { // Callback to be invoked for rtt results results. std::function on_rtt_results_internal_callback; +std::function + on_rtt_results_internal_callback_v2; + +void invalidateRttResultsCallbacks() { + on_rtt_results_internal_callback = nullptr; + on_rtt_results_internal_callback_v2 = nullptr; +}; + void onAsyncRttResults(wifi_request_id id, unsigned num_results, wifi_rtt_result* rtt_results[]) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_rtt_results_internal_callback) { on_rtt_results_internal_callback(id, num_results, rtt_results); - on_rtt_results_internal_callback = nullptr; + invalidateRttResultsCallbacks(); + } +} + +void onAsyncRttResultsV2(wifi_request_id id, unsigned num_results, + wifi_rtt_result_v2* rtt_results_v2[]) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_rtt_results_internal_callback_v2) { + on_rtt_results_internal_callback_v2(id, num_results, rtt_results_v2); + invalidateRttResultsCallbacks(); } } @@ -184,37 +211,37 @@ void onAsyncRttResults(wifi_request_id id, unsigned num_results, wifi_rtt_result // callbacks. // So, handle all of them here directly to avoid adding an unnecessary layer. std::function on_nan_notify_response_user_callback; -void onAysncNanNotifyResponse(transaction_id id, NanResponseMsg* msg) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanNotifyResponse(transaction_id id, NanResponseMsg* msg) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_notify_response_user_callback && msg) { on_nan_notify_response_user_callback(id, *msg); } } std::function on_nan_event_publish_replied_user_callback; -void onAysncNanEventPublishReplied(NanPublishRepliedInd* /* event */) { - LOG(ERROR) << "onAysncNanEventPublishReplied triggered"; +void onAsyncNanEventPublishReplied(NanPublishRepliedInd* /* event */) { + LOG(ERROR) << "onAsyncNanEventPublishReplied triggered"; } std::function on_nan_event_publish_terminated_user_callback; -void onAysncNanEventPublishTerminated(NanPublishTerminatedInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventPublishTerminated(NanPublishTerminatedInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_publish_terminated_user_callback && event) { on_nan_event_publish_terminated_user_callback(*event); } } std::function on_nan_event_match_user_callback; -void onAysncNanEventMatch(NanMatchInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventMatch(NanMatchInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_match_user_callback && event) { on_nan_event_match_user_callback(*event); } } std::function on_nan_event_match_expired_user_callback; -void onAysncNanEventMatchExpired(NanMatchExpiredInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventMatchExpired(NanMatchExpiredInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_match_expired_user_callback && event) { on_nan_event_match_expired_user_callback(*event); } @@ -222,95 +249,95 @@ void onAysncNanEventMatchExpired(NanMatchExpiredInd* event) { std::function on_nan_event_subscribe_terminated_user_callback; -void onAysncNanEventSubscribeTerminated(NanSubscribeTerminatedInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventSubscribeTerminated(NanSubscribeTerminatedInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_subscribe_terminated_user_callback && event) { on_nan_event_subscribe_terminated_user_callback(*event); } } std::function on_nan_event_followup_user_callback; -void onAysncNanEventFollowup(NanFollowupInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventFollowup(NanFollowupInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_followup_user_callback && event) { on_nan_event_followup_user_callback(*event); } } std::function on_nan_event_disc_eng_event_user_callback; -void onAysncNanEventDiscEngEvent(NanDiscEngEventInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventDiscEngEvent(NanDiscEngEventInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_disc_eng_event_user_callback && event) { on_nan_event_disc_eng_event_user_callback(*event); } } std::function on_nan_event_disabled_user_callback; -void onAysncNanEventDisabled(NanDisabledInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventDisabled(NanDisabledInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_disabled_user_callback && event) { on_nan_event_disabled_user_callback(*event); } } std::function on_nan_event_tca_user_callback; -void onAysncNanEventTca(NanTCAInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventTca(NanTCAInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_tca_user_callback && event) { on_nan_event_tca_user_callback(*event); } } std::function on_nan_event_beacon_sdf_payload_user_callback; -void onAysncNanEventBeaconSdfPayload(NanBeaconSdfPayloadInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventBeaconSdfPayload(NanBeaconSdfPayloadInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_beacon_sdf_payload_user_callback && event) { on_nan_event_beacon_sdf_payload_user_callback(*event); } } std::function on_nan_event_data_path_request_user_callback; -void onAysncNanEventDataPathRequest(NanDataPathRequestInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventDataPathRequest(NanDataPathRequestInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_data_path_request_user_callback && event) { on_nan_event_data_path_request_user_callback(*event); } } std::function on_nan_event_data_path_confirm_user_callback; -void onAysncNanEventDataPathConfirm(NanDataPathConfirmInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventDataPathConfirm(NanDataPathConfirmInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_data_path_confirm_user_callback && event) { on_nan_event_data_path_confirm_user_callback(*event); } } std::function on_nan_event_data_path_end_user_callback; -void onAysncNanEventDataPathEnd(NanDataPathEndInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventDataPathEnd(NanDataPathEndInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_data_path_end_user_callback && event) { on_nan_event_data_path_end_user_callback(*event); } } std::function on_nan_event_transmit_follow_up_user_callback; -void onAysncNanEventTransmitFollowUp(NanTransmitFollowupInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventTransmitFollowUp(NanTransmitFollowupInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_transmit_follow_up_user_callback && event) { on_nan_event_transmit_follow_up_user_callback(*event); } } std::function on_nan_event_range_request_user_callback; -void onAysncNanEventRangeRequest(NanRangeRequestInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventRangeRequest(NanRangeRequestInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_range_request_user_callback && event) { on_nan_event_range_request_user_callback(*event); } } std::function on_nan_event_range_report_user_callback; -void onAysncNanEventRangeReport(NanRangeReportInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); +void onAsyncNanEventRangeReport(NanRangeReportInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_range_report_user_callback && event) { on_nan_event_range_report_user_callback(*event); } @@ -318,16 +345,59 @@ void onAysncNanEventRangeReport(NanRangeReportInd* event) { std::function on_nan_event_schedule_update_user_callback; void onAsyncNanEventScheduleUpdate(NanDataPathScheduleUpdateInd* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_nan_event_schedule_update_user_callback && event) { on_nan_event_schedule_update_user_callback(*event); } } +std::function + on_nan_event_suspension_mode_change_user_callback; +void onAsyncNanEventSuspensionModeChange(NanSuspensionModeChangeInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_nan_event_suspension_mode_change_user_callback && event) { + on_nan_event_suspension_mode_change_user_callback(*event); + } +} + +std::function on_nan_event_pairing_request_user_callback; +void onAsyncNanEventPairingRequest(NanPairingRequestInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_nan_event_pairing_request_user_callback && event) { + on_nan_event_pairing_request_user_callback(*event); + } +} + +std::function on_nan_event_pairing_confirm_user_callback; +void onAsyncNanEventPairingConfirm(NanPairingConfirmInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_nan_event_pairing_confirm_user_callback && event) { + on_nan_event_pairing_confirm_user_callback(*event); + } +} + +std::function + on_nan_event_bootstrapping_request_user_callback; +void onAsyncNanEventBootstrappingRequest(NanBootstrappingRequestInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_nan_event_bootstrapping_request_user_callback && event) { + on_nan_event_bootstrapping_request_user_callback(*event); + } +} + +std::function + on_nan_event_bootstrapping_confirm_user_callback; +void onAsyncNanEventBootstrappingConfirm(NanBootstrappingConfirmInd* event) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_nan_event_bootstrapping_confirm_user_callback && event) { + on_nan_event_bootstrapping_confirm_user_callback(*event); + } +} + // Callbacks for the various TWT operations. std::function on_twt_event_setup_response_callback; void onAsyncTwtEventSetupResponse(TwtSetupResponse* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_twt_event_setup_response_callback && event) { on_twt_event_setup_response_callback(*event); } @@ -335,7 +405,7 @@ void onAsyncTwtEventSetupResponse(TwtSetupResponse* event) { std::function on_twt_event_teardown_completion_callback; void onAsyncTwtEventTeardownCompletion(TwtTeardownCompletion* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_twt_event_teardown_completion_callback && event) { on_twt_event_teardown_completion_callback(*event); } @@ -343,7 +413,7 @@ void onAsyncTwtEventTeardownCompletion(TwtTeardownCompletion* event) { std::function on_twt_event_info_frame_received_callback; void onAsyncTwtEventInfoFrameReceived(TwtInfoFrameReceived* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_twt_event_info_frame_received_callback && event) { on_twt_event_info_frame_received_callback(*event); } @@ -351,7 +421,7 @@ void onAsyncTwtEventInfoFrameReceived(TwtInfoFrameReceived* event) { std::function on_twt_event_device_notify_callback; void onAsyncTwtEventDeviceNotify(TwtDeviceNotify* event) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_twt_event_device_notify_callback && event) { on_twt_event_device_notify_callback(*event); } @@ -360,15 +430,23 @@ void onAsyncTwtEventDeviceNotify(TwtDeviceNotify* event) { // Callback to report current CHRE NAN state std::function on_chre_nan_rtt_internal_callback; void onAsyncChreNanRttState(chre_nan_rtt_state state) { - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_chre_nan_rtt_internal_callback) { on_chre_nan_rtt_internal_callback(state); } } +// Callback to report cached scan results +std::function on_cached_scan_results_internal_callback; +void onSyncCachedScanResults(wifi_cached_scan_report* cache_report) { + if (on_cached_scan_results_internal_callback) { + on_cached_scan_results_internal_callback(cache_report); + } +} + // End of the free-standing "C" style callbacks. -WifiLegacyHal::WifiLegacyHal(const std::weak_ptr iface_tool, +WifiLegacyHal::WifiLegacyHal(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, const wifi_hal_fn& fn, bool is_primary) : global_func_table_(fn), global_handle_(nullptr), @@ -674,10 +752,44 @@ wifi_error WifiLegacyHal::disableLinkLayerStats(const std::string& iface_name) { &clear_mask_rsp, 1, &stop_rsp); } -std::pair WifiLegacyHal::getLinkLayerStats( - const std::string& iface_name) { - LinkLayerStats link_stats{}; +// Copies wifi_peer_info* to vector and returns poiner to next element. +wifi_peer_info* WifiLegacyHal::copyPeerInfo(wifi_peer_info* peer_ptr, + std::vector& peers) { + WifiPeerInfo peer; + peer.peer_info = *peer_ptr; + if (peer_ptr->num_rate > 0) { + // Copy the rate stats. + peer.rate_stats.assign(peer_ptr->rate_stats, peer_ptr->rate_stats + peer_ptr->num_rate); + } + peer.peer_info.num_rate = 0; + // Push peer info. + peers.push_back(peer); + // Return the address of next peer info. + return (wifi_peer_info*)((u8*)peer_ptr + sizeof(wifi_peer_info) + + (sizeof(wifi_rate_stat) * peer_ptr->num_rate)); +} +// Copies wifi_link_stat* to vector and returns poiner to next element. +wifi_link_stat* WifiLegacyHal::copyLinkStat(wifi_link_stat* stat_ptr, + std::vector& stats) { + LinkStats linkStat; + linkStat.stat = *stat_ptr; + wifi_peer_info* l_peer_info_stats_ptr = stat_ptr->peer_info; + for (uint32_t i = 0; i < linkStat.stat.num_peers; i++) { + l_peer_info_stats_ptr = copyPeerInfo(l_peer_info_stats_ptr, linkStat.peers); + } + // Copied all peers to linkStat.peers. + linkStat.stat.num_peers = 0; + // Push link stat. + stats.push_back(linkStat); + // Read all peers, return the address of next wifi_link_stat. + return (wifi_link_stat*)l_peer_info_stats_ptr; +} + +wifi_error WifiLegacyHal::getLinkLayerStats(const std::string& iface_name, + LinkLayerStats& link_stats, + LinkLayerMlStats& link_ml_stats) { LinkLayerStats* link_stats_ptr = &link_stats; + link_stats_ptr->valid = false; on_link_layer_stats_result_internal_callback = [&link_stats_ptr]( wifi_request_id /* id */, @@ -686,6 +798,7 @@ std::pair WifiLegacyHal::getLinkLayerStats( wifi_radio_stat* radio_stats_ptr) { wifi_radio_stat* l_radio_stats_ptr; wifi_peer_info* l_peer_info_stats_ptr; + link_stats_ptr->valid = true; if (iface_stats_ptr != nullptr) { link_stats_ptr->iface = *iface_stats_ptr; @@ -743,10 +856,69 @@ std::pair WifiLegacyHal::getLinkLayerStats( } }; - wifi_error status = global_func_table_.wifi_get_link_stats(0, getIfaceHandle(iface_name), - {onSyncLinkLayerStatsResult}); + LinkLayerMlStats* link_ml_stats_ptr = &link_ml_stats; + link_ml_stats_ptr->valid = false; + + on_link_layer_ml_stats_result_internal_callback = + [this, &link_ml_stats_ptr](wifi_request_id /* id */, + wifi_iface_ml_stat* iface_ml_stats_ptr, int num_radios, + wifi_radio_stat* radio_stats_ptr) { + wifi_radio_stat* l_radio_stats_ptr; + wifi_link_stat* l_link_stat_ptr; + link_ml_stats_ptr->valid = true; + + if (iface_ml_stats_ptr != nullptr && iface_ml_stats_ptr->num_links > 0) { + // Copy stats from wifi_iface_ml_stat to LinkLayerMlStats, + // - num_links * links[] to vector of links. + // - num_peers * peer_info[] to vector of links[i].peers. + link_ml_stats_ptr->iface = *iface_ml_stats_ptr; + l_link_stat_ptr = iface_ml_stats_ptr->links; + for (int l = 0; l < iface_ml_stats_ptr->num_links; ++l) { + l_link_stat_ptr = copyLinkStat(l_link_stat_ptr, link_ml_stats_ptr->links); + } + } else { + LOG(ERROR) << "Invalid iface stats in link layer stats"; + } + if (num_radios <= 0 || radio_stats_ptr == nullptr) { + LOG(ERROR) << "Invalid radio stats in link layer stats"; + return; + } + l_radio_stats_ptr = radio_stats_ptr; + for (int i = 0; i < num_radios; i++) { + LinkLayerRadioStats radio; + + radio.stats = *l_radio_stats_ptr; + // Copy over the tx level array to the separate vector. + if (l_radio_stats_ptr->num_tx_levels > 0 && + l_radio_stats_ptr->tx_time_per_levels != nullptr) { + radio.tx_time_per_levels.assign(l_radio_stats_ptr->tx_time_per_levels, + l_radio_stats_ptr->tx_time_per_levels + + l_radio_stats_ptr->num_tx_levels); + } + radio.stats.num_tx_levels = 0; + radio.stats.tx_time_per_levels = nullptr; + /* Copy over the channel stat to separate vector */ + if (l_radio_stats_ptr->num_channels > 0) { + /* Copy the channel stats */ + radio.channel_stats.assign( + l_radio_stats_ptr->channels, + l_radio_stats_ptr->channels + l_radio_stats_ptr->num_channels); + } + link_ml_stats_ptr->radios.push_back(radio); + l_radio_stats_ptr = + (wifi_radio_stat*)((u8*)l_radio_stats_ptr + sizeof(wifi_radio_stat) + + (sizeof(wifi_channel_stat) * + l_radio_stats_ptr->num_channels)); + } + }; + + wifi_error status = global_func_table_.wifi_get_link_stats( + 0, getIfaceHandle(iface_name), + {onSyncLinkLayerStatsResult, onSyncLinkLayerMlStatsResult}); on_link_layer_stats_result_internal_callback = nullptr; - return {status, link_stats}; + on_link_layer_ml_stats_result_internal_callback = nullptr; + + return status; } wifi_error WifiLegacyHal::startRssiMonitoring( @@ -761,7 +933,7 @@ wifi_error WifiLegacyHal::startRssiMonitoring( if (!bssid_ptr) { return; } - std::array bssid_arr; + std::array bssid_arr; // |bssid_ptr| pointer is assumed to have 6 bytes for the mac // address. std::copy(bssid_ptr, bssid_ptr + 6, std::begin(bssid_arr)); @@ -812,12 +984,12 @@ wifi_error WifiLegacyHal::configureNdOffload(const std::string& iface_name, bool return global_func_table_.wifi_configure_nd_offload(getIfaceHandle(iface_name), enable); } -wifi_error WifiLegacyHal::startSendingOffloadedPacket(const std::string& iface_name, - uint32_t cmd_id, uint16_t ether_type, +wifi_error WifiLegacyHal::startSendingOffloadedPacket(const std::string& iface_name, int32_t cmd_id, + uint16_t ether_type, const std::vector& ip_packet_data, const std::array& src_address, const std::array& dst_address, - uint32_t period_in_ms) { + int32_t period_in_ms) { std::vector ip_packet_data_internal(ip_packet_data); std::vector src_address_internal(src_address.data(), src_address.data() + src_address.size()); @@ -1082,8 +1254,9 @@ wifi_error WifiLegacyHal::registerSubsystemRestartCallbackHandler( wifi_error WifiLegacyHal::startRttRangeRequest( const std::string& iface_name, wifi_request_id id, const std::vector& rtt_configs, - const on_rtt_results_callback& on_results_user_callback) { - if (on_rtt_results_internal_callback) { + const on_rtt_results_callback& on_results_user_callback, + const on_rtt_results_callback_v2& on_results_user_callback_v2) { + if (on_rtt_results_internal_callback || on_rtt_results_internal_callback_v2) { return WIFI_ERROR_NOT_AVAILABLE; } @@ -1100,33 +1273,48 @@ wifi_error WifiLegacyHal::startRttRangeRequest( on_results_user_callback(id, rtt_results_vec); }; + on_rtt_results_internal_callback_v2 = [on_results_user_callback_v2]( + wifi_request_id id, unsigned num_results, + wifi_rtt_result_v2* rtt_results_v2[]) { + if (num_results > 0 && !rtt_results_v2) { + LOG(ERROR) << "Unexpected nullptr in RTT results"; + return; + } + std::vector rtt_results_vec_v2; + std::copy_if(rtt_results_v2, rtt_results_v2 + num_results, + back_inserter(rtt_results_vec_v2), + [](wifi_rtt_result_v2* rtt_result_v2) { return rtt_result_v2 != nullptr; }); + on_results_user_callback_v2(id, rtt_results_vec_v2); + }; + std::vector rtt_configs_internal(rtt_configs); wifi_error status = global_func_table_.wifi_rtt_range_request( id, getIfaceHandle(iface_name), rtt_configs.size(), rtt_configs_internal.data(), - {onAsyncRttResults}); + {onAsyncRttResults, onAsyncRttResultsV2}); if (status != WIFI_SUCCESS) { - on_rtt_results_internal_callback = nullptr; + invalidateRttResultsCallbacks(); } return status; } wifi_error WifiLegacyHal::cancelRttRangeRequest( const std::string& iface_name, wifi_request_id id, - const std::vector>& mac_addrs) { - if (!on_rtt_results_internal_callback) { + const std::vector>& mac_addrs) { + if (!on_rtt_results_internal_callback && !on_rtt_results_internal_callback_v2) { return WIFI_ERROR_NOT_AVAILABLE; } - static_assert(sizeof(mac_addr) == sizeof(std::array), "MAC address size mismatch"); + static_assert(sizeof(mac_addr) == sizeof(std::array), + "MAC address size mismatch"); // TODO: How do we handle partial cancels (i.e only a subset of enabled mac // addressed are cancelled). - std::vector> mac_addrs_internal(mac_addrs); + std::vector> mac_addrs_internal(mac_addrs); wifi_error status = global_func_table_.wifi_rtt_range_cancel( id, getIfaceHandle(iface_name), mac_addrs.size(), reinterpret_cast(mac_addrs_internal.data())); // If the request Id is wrong, don't stop the ongoing range request. Any // other error should be treated as the end of rtt ranging. if (status != WIFI_ERROR_INVALID_REQUEST_ID) { - on_rtt_results_internal_callback = nullptr; + invalidateRttResultsCallbacks(); } return status; } @@ -1185,23 +1373,45 @@ wifi_error WifiLegacyHal::nanRegisterCallbackHandlers(const std::string& iface_n on_nan_event_tca_user_callback = user_callbacks.on_event_tca; on_nan_event_beacon_sdf_payload_user_callback = user_callbacks.on_event_beacon_sdf_payload; on_nan_event_data_path_request_user_callback = user_callbacks.on_event_data_path_request; + on_nan_event_pairing_request_user_callback = user_callbacks.on_event_pairing_request; + on_nan_event_pairing_confirm_user_callback = user_callbacks.on_event_pairing_confirm; + on_nan_event_bootstrapping_request_user_callback = + user_callbacks.on_event_bootstrapping_request; + on_nan_event_bootstrapping_confirm_user_callback = + user_callbacks.on_event_bootstrapping_confirm; on_nan_event_data_path_confirm_user_callback = user_callbacks.on_event_data_path_confirm; on_nan_event_data_path_end_user_callback = user_callbacks.on_event_data_path_end; on_nan_event_transmit_follow_up_user_callback = user_callbacks.on_event_transmit_follow_up; on_nan_event_range_request_user_callback = user_callbacks.on_event_range_request; on_nan_event_range_report_user_callback = user_callbacks.on_event_range_report; 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; - return global_func_table_.wifi_nan_register_handler( - getIfaceHandle(iface_name), - {onAysncNanNotifyResponse, onAysncNanEventPublishReplied, - onAysncNanEventPublishTerminated, onAysncNanEventMatch, onAysncNanEventMatchExpired, - onAysncNanEventSubscribeTerminated, onAysncNanEventFollowup, - onAysncNanEventDiscEngEvent, onAysncNanEventDisabled, onAysncNanEventTca, - onAysncNanEventBeaconSdfPayload, onAysncNanEventDataPathRequest, - onAysncNanEventDataPathConfirm, onAysncNanEventDataPathEnd, - onAysncNanEventTransmitFollowUp, onAysncNanEventRangeRequest, - onAysncNanEventRangeReport, onAsyncNanEventScheduleUpdate}); + return global_func_table_.wifi_nan_register_handler(getIfaceHandle(iface_name), + {onAsyncNanNotifyResponse, + onAsyncNanEventPublishReplied, + onAsyncNanEventPublishTerminated, + onAsyncNanEventMatch, + onAsyncNanEventMatchExpired, + onAsyncNanEventSubscribeTerminated, + onAsyncNanEventFollowup, + onAsyncNanEventDiscEngEvent, + onAsyncNanEventDisabled, + onAsyncNanEventTca, + onAsyncNanEventBeaconSdfPayload, + onAsyncNanEventDataPathRequest, + onAsyncNanEventDataPathConfirm, + onAsyncNanEventDataPathEnd, + onAsyncNanEventTransmitFollowUp, + onAsyncNanEventRangeRequest, + onAsyncNanEventRangeReport, + onAsyncNanEventScheduleUpdate, + onAsyncNanEventPairingRequest, + onAsyncNanEventPairingConfirm, + onAsyncNanEventBootstrappingRequest, + onAsyncNanEventBootstrappingConfirm, + onAsyncNanEventSuspensionModeChange}); } wifi_error WifiLegacyHal::nanEnableRequest(const std::string& iface_name, transaction_id id, @@ -1316,6 +1526,36 @@ wifi_error WifiLegacyHal::nanDataIndicationResponse(const std::string& iface_nam &msg_internal); } +wifi_error WifiLegacyHal::nanPairingRequest(const std::string& iface_name, transaction_id id, + const NanPairingRequest& msg) { + NanPairingRequest msg_internal(msg); + return global_func_table_.wifi_nan_pairing_request(id, getIfaceHandle(iface_name), + &msg_internal); +} + +wifi_error WifiLegacyHal::nanPairingIndicationResponse(const std::string& iface_name, + transaction_id id, + const NanPairingIndicationResponse& msg) { + NanPairingIndicationResponse msg_internal(msg); + return global_func_table_.wifi_nan_pairing_indication_response(id, getIfaceHandle(iface_name), + &msg_internal); +} + +wifi_error WifiLegacyHal::nanBootstrappingRequest(const std::string& iface_name, transaction_id id, + const NanBootstrappingRequest& msg) { + NanBootstrappingRequest msg_internal(msg); + return global_func_table_.wifi_nan_bootstrapping_request(id, getIfaceHandle(iface_name), + &msg_internal); +} + +wifi_error WifiLegacyHal::nanBootstrappingIndicationResponse( + const std::string& iface_name, transaction_id id, + const NanBootstrappingIndicationResponse& msg) { + NanBootstrappingIndicationResponse msg_internal(msg); + return global_func_table_.wifi_nan_bootstrapping_indication_response( + id, getIfaceHandle(iface_name), &msg_internal); +} + typedef struct { u8 num_ndp_instances; NanDataPathId ndp_instance_id; @@ -1331,8 +1571,33 @@ wifi_error WifiLegacyHal::nanDataEnd(const std::string& iface_name, transaction_ return status; } +wifi_error WifiLegacyHal::nanPairingEnd(const std::string& iface_name, transaction_id id, + uint32_t pairingId) { + NanPairingEndRequest msg; + msg.pairing_instance_id = pairingId; + wifi_error status = + global_func_table_.wifi_nan_pairing_end(id, getIfaceHandle(iface_name), &msg); + return status; +} + +wifi_error WifiLegacyHal::nanSuspendRequest(const std::string& iface_name, transaction_id id, + const NanSuspendRequest& msg) { + NanSuspendRequest msg_internal(msg); + wifi_error status = global_func_table_.wifi_nan_suspend_request(id, getIfaceHandle(iface_name), + &msg_internal); + return status; +} + +wifi_error WifiLegacyHal::nanResumeRequest(const std::string& iface_name, transaction_id id, + const NanResumeRequest& msg) { + NanResumeRequest msg_internal(msg); + wifi_error status = global_func_table_.wifi_nan_resume_request(id, getIfaceHandle(iface_name), + &msg_internal); + return status; +} + wifi_error WifiLegacyHal::setCountryCode(const std::string& iface_name, - std::array code) { + const std::array code) { std::string code_str(code.data(), code.data() + code.size()); return global_func_table_.wifi_set_country_code(getIfaceHandle(iface_name), code_str.c_str()); } @@ -1376,7 +1641,7 @@ wifi_interface_handle WifiLegacyHal::getIfaceHandle(const std::string& iface_nam void WifiLegacyHal::runEventLoop() { LOG(DEBUG) << "Starting legacy HAL event loop"; global_func_table_.wifi_event_loop(global_handle_); - const auto lock = hidl_sync_util::acquireGlobalLock(); + const auto lock = aidl_sync_util::acquireGlobalLock(); if (!awaiting_event_loop_termination_) { LOG(FATAL) << "Legacy HAL event loop terminated, but HAL was not stopping"; } @@ -1522,6 +1787,10 @@ wifi_error WifiLegacyHal::twtClearStats(const std::string& iface_name, uint8_t c return global_func_table_.wifi_twt_clear_stats(getIfaceHandle(iface_name), configId); } +wifi_error WifiLegacyHal::setScanMode(const std::string& iface_name, bool enable) { + return global_func_table_.wifi_set_scan_mode(iface_name.c_str(), enable); +} + wifi_error WifiLegacyHal::setDtimConfig(const std::string& iface_name, uint32_t multiplier) { return global_func_table_.wifi_set_dtim_config(getIfaceHandle(iface_name), multiplier); } @@ -1589,6 +1858,41 @@ wifi_error WifiLegacyHal::enableWifiTxPowerLimits(const std::string& iface_name, return global_func_table_.wifi_enable_tx_power_limits(getIfaceHandle(iface_name), enable); } +wifi_error WifiLegacyHal::getWifiCachedScanResults( + const std::string& iface_name, const CachedScanResultsCallbackHandlers& handler) { + on_cached_scan_results_internal_callback = handler.on_cached_scan_results; + + wifi_error status = global_func_table_.wifi_get_cached_scan_results(getIfaceHandle(iface_name), + {onSyncCachedScanResults}); + + on_cached_scan_results_internal_callback = nullptr; + return status; +} + +std::pair WifiLegacyHal::getWifiChipCapabilities() { + wifi_chip_capabilities chip_capabilities; + wifi_error status = + global_func_table_.wifi_get_chip_capabilities(global_handle_, &chip_capabilities); + return {status, chip_capabilities}; +} + +wifi_error WifiLegacyHal::enableStaChannelForPeerNetwork(uint32_t channelCategoryEnableFlag) { + return global_func_table_.wifi_enable_sta_channel_for_peer_network(global_handle_, + channelCategoryEnableFlag); +} + +wifi_error WifiLegacyHal::setMloMode(wifi_mlo_mode mode) { + return global_func_table_.wifi_set_mlo_mode(global_handle_, mode); +} + +std::pair +WifiLegacyHal::getSupportedIfaceConcurrencyMatrix() { + wifi_iface_concurrency_matrix iface_concurrency_matrix; + wifi_error status = global_func_table_.wifi_get_supported_iface_concurrency_matrix( + global_handle_, &iface_concurrency_matrix); + return {status, iface_concurrency_matrix}; +} + void WifiLegacyHal::invalidate() { global_handle_ = nullptr; iface_name_to_handle_.clear(); @@ -1597,12 +1901,13 @@ void WifiLegacyHal::invalidate() { on_gscan_event_internal_callback = nullptr; on_gscan_full_result_internal_callback = nullptr; on_link_layer_stats_result_internal_callback = nullptr; + on_link_layer_ml_stats_result_internal_callback = nullptr; on_rssi_threshold_breached_internal_callback = nullptr; on_ring_buffer_data_internal_callback = nullptr; on_error_alert_internal_callback = nullptr; on_radio_mode_change_internal_callback = nullptr; on_subsystem_restart_internal_callback = nullptr; - on_rtt_results_internal_callback = nullptr; + invalidateRttResultsCallbacks(); on_nan_notify_response_user_callback = nullptr; on_nan_event_publish_terminated_user_callback = nullptr; on_nan_event_match_user_callback = nullptr; @@ -1614,6 +1919,10 @@ void WifiLegacyHal::invalidate() { on_nan_event_tca_user_callback = nullptr; on_nan_event_beacon_sdf_payload_user_callback = nullptr; on_nan_event_data_path_request_user_callback = nullptr; + on_nan_event_pairing_request_user_callback = nullptr; + on_nan_event_pairing_confirm_user_callback = nullptr; + on_nan_event_bootstrapping_request_user_callback = nullptr; + on_nan_event_bootstrapping_confirm_user_callback = nullptr; on_nan_event_data_path_confirm_user_callback = nullptr; on_nan_event_data_path_end_user_callback = nullptr; on_nan_event_transmit_follow_up_user_callback = nullptr; @@ -1628,8 +1937,7 @@ void WifiLegacyHal::invalidate() { } } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h similarity index 85% rename from wifi/1.6/default/wifi_legacy_hal.h rename to wifi/aidl/default/wifi_legacy_hal.h index 2b923b44a7..5168a8bccf 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/aidl/default/wifi_legacy_hal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,22 +17,22 @@ #ifndef WIFI_LEGACY_HAL_H_ #define WIFI_LEGACY_HAL_H_ -#include -#include -#include -#include -#include - #include #include +#include +#include +#include +#include +#include +#include + +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { // This is in a separate namespace to prevent typename conflicts between -// the legacy HAL types and the HIDL interface types. +// the legacy HAL types and the AIDL interface types. namespace legacy_hal { // Import all the types defined inside the legacy HAL header files into this // namespace. @@ -44,6 +44,8 @@ using ::FRAME_TYPE_ETHERNET_II; using ::FRAME_TYPE_UNKNOWN; using ::fw_roaming_state_t; using ::mac_addr; +using ::NAN_BOOTSTRAPPING_INITIATOR_RESPONSE; +using ::NAN_BOOTSTRAPPING_RESPONDER_RESPONSE; using ::NAN_CHANNEL_24G_BAND; using ::NAN_CHANNEL_5G_BAND_HIGH; using ::NAN_CHANNEL_5G_BAND_LOW; @@ -65,6 +67,11 @@ using ::NAN_GET_CAPABILITIES; using ::NAN_MATCH_ALG_MATCH_CONTINUOUS; using ::NAN_MATCH_ALG_MATCH_NEVER; using ::NAN_MATCH_ALG_MATCH_ONCE; +using ::NAN_PAIRING_END; +using ::NAN_PAIRING_INITIATOR_RESPONSE; +using ::NAN_PAIRING_RESPONDER_RESPONSE; +using ::NAN_PAIRING_SETUP; +using ::NAN_PAIRING_VERIFICATION; using ::NAN_PUBLISH_TYPE_SOLICITED; using ::NAN_PUBLISH_TYPE_UNSOLICITED; using ::NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED; @@ -84,6 +91,7 @@ using ::NAN_RESPONSE_SUBSCRIBE; using ::NAN_RESPONSE_SUBSCRIBE_CANCEL; using ::NAN_RESPONSE_TCA; using ::NAN_RESPONSE_TRANSMIT_FOLLOWUP; +using ::NAN_RESUME_REQUEST_RESPONSE; using ::NAN_SECURITY_KEY_INPUT_PASSPHRASE; using ::NAN_SECURITY_KEY_INPUT_PMK; using ::NAN_SERVICE_ACCEPT_POLICY_ALL; @@ -97,18 +105,24 @@ using ::NAN_SSI_REQUIRED_IN_MATCH_IND; using ::NAN_STATUS_ALREADY_ENABLED; using ::NAN_STATUS_FOLLOWUP_QUEUE_FULL; using ::NAN_STATUS_INTERNAL_FAILURE; +using ::NAN_STATUS_INVALID_BOOTSTRAPPING_ID; using ::NAN_STATUS_INVALID_NDP_ID; +using ::NAN_STATUS_INVALID_PAIRING_ID; using ::NAN_STATUS_INVALID_PARAM; using ::NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID; using ::NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID; using ::NAN_STATUS_NAN_NOT_ALLOWED; +using ::NAN_STATUS_NO_CONNECTION; using ::NAN_STATUS_NO_OTA_ACK; using ::NAN_STATUS_NO_RESOURCE_AVAILABLE; +using ::NAN_STATUS_NOT_SUPPORTED; using ::NAN_STATUS_PROTOCOL_FAILURE; +using ::NAN_STATUS_REDUNDANT_REQUEST; using ::NAN_STATUS_SUCCESS; using ::NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED; using ::NAN_SUBSCRIBE_TYPE_ACTIVE; using ::NAN_SUBSCRIBE_TYPE_PASSIVE; +using ::NAN_SUSPEND_REQUEST_RESPONSE; using ::NAN_TRANSMIT_IN_DW; using ::NAN_TRANSMIT_IN_FAW; using ::NAN_TX_PRIORITY_HIGH; @@ -116,7 +130,14 @@ using ::NAN_TX_PRIORITY_NORMAL; using ::NAN_TX_TYPE_BROADCAST; using ::NAN_TX_TYPE_UNICAST; using ::NAN_USE_SRF; +using ::NanAkm; using ::NanBeaconSdfPayloadInd; +using ::NanBootstrappingConfirmInd; +using ::NanBootstrappingIndicationResponse; +using ::NanBootstrappingRequest; +using ::NanBootstrappingRequestInd; +using ::NanBootstrappingRequestResponse; +using ::NanBootstrappingResponseCode; using ::NanCapabilities; using ::NanChannelInfo; using ::NanConfigRequest; @@ -131,9 +152,19 @@ using ::NanDisabledInd; using ::NanDiscEngEventInd; using ::NanEnableRequest; using ::NanFollowupInd; +using ::NanIdentityResolutionAttribute; using ::NanMatchAlg; using ::NanMatchExpiredInd; using ::NanMatchInd; +using ::NanPairingConfig; +using ::NanPairingConfirmInd; +using ::NanPairingEndRequest; +using ::NanPairingIndicationResponse; +using ::NanPairingRequest; +using ::NanPairingRequestInd; +using ::NanPairingRequestResponse; +using ::NanPairingRequestType; +using ::NanPairingResponseCode; using ::NanPublishCancelRequest; using ::NanPublishRequest; using ::NanPublishTerminatedInd; @@ -141,15 +172,20 @@ using ::NanPublishType; using ::NanRangeReportInd; using ::NanRangeRequestInd; using ::NanResponseMsg; +using ::NanResumeRequest; using ::NanSRFType; using ::NanStatusType; using ::NanSubscribeCancelRequest; using ::NanSubscribeRequest; using ::NanSubscribeTerminatedInd; using ::NanSubscribeType; +using ::NanSuspendRequest; +using ::NanSuspensionModeChangeInd; using ::NanTransmitFollowupInd; using ::NanTransmitFollowupRequest; using ::NanTxType; +using ::NpkSecurityAssociation; +using ::PASN; using ::ROAMING_DISABLE; using ::ROAMING_ENABLE; using ::RTT_PEER_AP; @@ -189,6 +225,7 @@ using ::RX_PKT_FATE_FW_DROP_NOBUFS; using ::RX_PKT_FATE_FW_DROP_OTHER; using ::RX_PKT_FATE_FW_QUEUED; using ::RX_PKT_FATE_SUCCESS; +using ::SAE; using ::ssid_t; using ::transaction_id; using ::TX_PKT_FATE_ACKED; @@ -218,6 +255,7 @@ using ::WIFI_BAND_ABG; using ::WIFI_BAND_ABG_WITH_DFS; using ::WIFI_BAND_BG; using ::WIFI_BAND_UNSPECIFIED; +using ::wifi_cached_scan_report; using ::wifi_cached_scan_results; using ::WIFI_CHAN_WIDTH_10; using ::WIFI_CHAN_WIDTH_160; @@ -228,11 +266,14 @@ using ::WIFI_CHAN_WIDTH_5; using ::WIFI_CHAN_WIDTH_80; using ::WIFI_CHAN_WIDTH_80P80; using ::WIFI_CHAN_WIDTH_INVALID; +using ::wifi_channel_category; using ::wifi_channel_info; using ::wifi_channel_stat; using ::wifi_channel_width; +using ::wifi_chip_capabilities; using ::wifi_coex_restriction; using ::wifi_coex_unsafe_channel; +using ::WIFI_DFS_CHANNEL; using ::WIFI_DUAL_STA_NON_TRANSIENT_UNBIASED; using ::WIFI_DUAL_STA_TRANSIENT_PREFER_PRIMARY; using ::wifi_error; @@ -249,6 +290,8 @@ using ::WIFI_ERROR_UNINITIALIZED; using ::WIFI_ERROR_UNKNOWN; using ::wifi_gscan_capabilities; using ::wifi_hal_fn; +using ::wifi_iface_concurrency_matrix; +using ::WIFI_INDOOR_CHANNEL; using ::wifi_information_element; using ::WIFI_INTERFACE_IBSS; using ::WIFI_INTERFACE_MESH; @@ -276,6 +319,7 @@ using ::WIFI_LOGGER_MEMORY_DUMP_SUPPORTED; using ::WIFI_LOGGER_PACKET_FATE_SUPPORTED; using ::WIFI_LOGGER_POWER_EVENT_SUPPORTED; using ::WIFI_LOGGER_WAKE_LOCK_SUPPORTED; +using ::wifi_mlo_mode; using ::WIFI_MOTION_EXPECTED; using ::WIFI_MOTION_NOT_EXPECTED; using ::wifi_motion_pattern; @@ -303,6 +347,7 @@ using ::WIFI_RTT_BW_320; using ::WIFI_RTT_BW_40; using ::WIFI_RTT_BW_5; using ::WIFI_RTT_BW_80; +using ::WIFI_RTT_BW_UNSPECIFIED; using ::wifi_rtt_capabilities; using ::wifi_rtt_config; using ::wifi_rtt_preamble; @@ -313,6 +358,7 @@ using ::WIFI_RTT_PREAMBLE_LEGACY; using ::WIFI_RTT_PREAMBLE_VHT; using ::wifi_rtt_responder; using ::wifi_rtt_result; +using ::wifi_rtt_result_v2; using ::wifi_rtt_status; using ::wifi_rtt_type; using ::wifi_rx_packet_fate; @@ -361,7 +407,21 @@ struct LinkLayerStats { wifi_iface_stat iface; std::vector radios; std::vector peers; + bool valid; }; + +struct LinkStats { + wifi_link_stat stat; + std::vector peers; +}; + +struct LinkLayerMlStats { + wifi_iface_ml_stat iface; + std::vector links; + std::vector radios; + bool valid; +}; + #pragma GCC diagnostic pop // The |WLAN_DRIVER_WAKE_REASON_CNT.cmd_event_wake_cnt| and @@ -396,6 +456,11 @@ struct NanCallbackHandlers { std::function on_event_range_request; std::function on_event_range_report; std::function on_event_schedule_update; + std::function on_event_pairing_request; + std::function on_event_pairing_confirm; + std::function on_event_bootstrapping_request; + std::function on_event_bootstrapping_confirm; + std::function on_event_suspension_mode_change; }; // Full scan results contain IE info and are hence passed by reference, to @@ -410,7 +475,7 @@ using on_gscan_results_callback = // Invoked when the rssi value breaches the thresholds set. using on_rssi_threshold_breached_callback = - std::function, int8_t)>; + std::function, int8_t)>; // Callback for RTT range request results. // Rtt results contain IE info and are hence passed by reference, to @@ -418,6 +483,8 @@ using on_rssi_threshold_breached_callback = // the pointer. using on_rtt_results_callback = std::function&)>; +using on_rtt_results_callback_v2 = + std::function&)>; // Callback for ring buffer data. using on_ring_buffer_data_callback = std::function on_wifi_chre_nan_rtt_state; }; +// Cached Scan Results response and event callbacks struct. +struct CachedScanResultsCallbackHandlers { + // Callback for Cached Scan Results + std::function on_cached_scan_results; +}; + /** * Class that encapsulates all legacy HAL interactions. * This class manages the lifetime of the event loop thread used by legacy HAL. @@ -474,8 +547,8 @@ struct ChreCallbackHandlers { */ class WifiLegacyHal { public: - WifiLegacyHal(const std::weak_ptr iface_tool, const wifi_hal_fn& fn, - bool is_primary); + WifiLegacyHal(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, + const wifi_hal_fn& fn, bool is_primary); virtual ~WifiLegacyHal() = default; // Initialize the legacy HAL function table. @@ -514,7 +587,7 @@ class WifiLegacyHal { // |on_results_user_callback| on success. // b) |WIFI_SCAN_FAILED| scan event or failure to retrieve cached scan // results - // triggers the externally provided |on_failure_user_callback|. + // Triggers the externally provided |on_failure_user_callback|. // c) Full scan result event triggers the externally provided // |on_full_result_user_callback|. wifi_error startGscan(const std::string& iface_name, wifi_request_id id, @@ -529,7 +602,9 @@ class WifiLegacyHal { // Link layer stats functions. wifi_error enableLinkLayerStats(const std::string& iface_name, bool debug); wifi_error disableLinkLayerStats(const std::string& iface_name); - std::pair getLinkLayerStats(const std::string& iface_name); + wifi_error getLinkLayerStats(const std::string& iface_name, + legacy_hal::LinkLayerStats& legacy_stats, + legacy_hal::LinkLayerMlStats& legacy_ml_stats); // RSSI monitor functions. wifi_error startRssiMonitoring( const std::string& iface_name, wifi_request_id id, int8_t max_rssi, int8_t min_rssi, @@ -540,12 +615,12 @@ class WifiLegacyHal { wifi_error configureRoaming(const std::string& iface_name, const wifi_roaming_config& config); wifi_error enableFirmwareRoaming(const std::string& iface_name, fw_roaming_state_t state); wifi_error configureNdOffload(const std::string& iface_name, bool enable); - wifi_error startSendingOffloadedPacket(const std::string& iface_name, uint32_t cmd_id, + wifi_error startSendingOffloadedPacket(const std::string& iface_name, int32_t cmd_id, uint16_t ether_type, const std::vector& ip_packet_data, const std::array& src_address, const std::array& dst_address, - uint32_t period_in_ms); + int32_t period_in_ms); wifi_error stopSendingOffloadedPacket(const std::string& iface_name, uint32_t cmd_id); virtual wifi_error selectTxPowerScenario(const std::string& iface_name, wifi_power_scenario scenario); @@ -582,9 +657,10 @@ class WifiLegacyHal { // RTT functions. wifi_error startRttRangeRequest(const std::string& iface_name, wifi_request_id id, const std::vector& rtt_configs, - const on_rtt_results_callback& on_results_callback); + const on_rtt_results_callback& on_results_callback, + const on_rtt_results_callback_v2& on_results_callback_v2); wifi_error cancelRttRangeRequest(const std::string& iface_name, wifi_request_id id, - const std::vector>& mac_addrs); + const std::vector>& mac_addrs); std::pair getRttCapabilities(const std::string& iface_name); std::pair getRttResponderInfo(const std::string& iface_name); wifi_error enableRttResponder(const std::string& iface_name, wifi_request_id id, @@ -629,11 +705,24 @@ class WifiLegacyHal { const NanDataPathInitiatorRequest& msg); wifi_error nanDataIndicationResponse(const std::string& iface_name, transaction_id id, const NanDataPathIndicationResponse& msg); + wifi_error nanPairingRequest(const std::string& iface_name, transaction_id id, + const NanPairingRequest& msg); + wifi_error nanPairingIndicationResponse(const std::string& iface_name, transaction_id id, + const NanPairingIndicationResponse& msg); + wifi_error nanBootstrappingRequest(const std::string& iface_name, transaction_id id, + const NanBootstrappingRequest& msg); + wifi_error nanBootstrappingIndicationResponse(const std::string& iface_name, transaction_id id, + const NanBootstrappingIndicationResponse& msg); wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId); + wifi_error nanPairingEnd(const std::string& iface_name, transaction_id id, uint32_t pairingId); + wifi_error nanSuspendRequest(const std::string& iface_name, transaction_id id, + const NanSuspendRequest& msg); + wifi_error nanResumeRequest(const std::string& iface_name, transaction_id id, + const NanResumeRequest& msg); // AP functions. - wifi_error setCountryCode(const std::string& iface_name, std::array code); + wifi_error setCountryCode(const std::string& iface_name, const std::array code); - // interface functions. + // Interface functions. virtual wifi_error createVirtualInterface(const std::string& ifname, wifi_interface_type iftype); virtual wifi_error deleteVirtualInterface(const std::string& ifname); @@ -664,6 +753,8 @@ class WifiLegacyHal { wifi_error twtClearStats(const std::string& iface_name, uint8_t configId); + wifi_error setScanMode(const std::string& iface_name, bool enable); + wifi_error setDtimConfig(const std::string& iface_name, uint32_t multiplier); // Retrieve the list of usable channels in the requested bands @@ -684,6 +775,12 @@ class WifiLegacyHal { const ChreCallbackHandlers& handler); wifi_error enableWifiTxPowerLimits(const std::string& iface_name, bool enable); + wifi_error getWifiCachedScanResults(const std::string& iface_name, + const CachedScanResultsCallbackHandlers& handler); + std::pair getWifiChipCapabilities(); + wifi_error enableStaChannelForPeerNetwork(uint32_t channelCategoryEnableFlag); + wifi_error setMloMode(wifi_mlo_mode mode); + std::pair getSupportedIfaceConcurrencyMatrix(); private: // Retrieve interface handles for all the available interfaces. @@ -699,6 +796,8 @@ class WifiLegacyHal { // Handles wifi (error) status of Virtual interface create/delete wifi_error handleVirtualInterfaceCreateOrDeleteStatus(const std::string& ifname, wifi_error status); + wifi_link_stat* copyLinkStat(wifi_link_stat* stat_ptr, std::vector& stats); + wifi_peer_info* copyPeerInfo(wifi_peer_info* peer_ptr, std::vector& peers); // Global function table of legacy HAL. wifi_hal_fn global_func_table_; @@ -712,8 +811,8 @@ class WifiLegacyHal { std::condition_variable_any stop_wait_cv_; // Flag to indicate if the legacy HAL has been started. bool is_started_; - std::weak_ptr iface_tool_; - // flag to indicate if this HAL is for the primary chip. This is used + std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool_; + // Flag to indicate if this HAL is for the primary chip. This is used // in order to avoid some hard-coded behavior used with older HALs, // such as bring wlan0 interface up/down on start/stop HAL. // it may be removed once vendor HALs are updated. @@ -721,10 +820,9 @@ class WifiLegacyHal { }; } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_LEGACY_HAL_H_ diff --git a/wifi/1.6/default/wifi_legacy_hal_factory.cpp b/wifi/aidl/default/wifi_legacy_hal_factory.cpp similarity index 96% rename from wifi/1.6/default/wifi_legacy_hal_factory.cpp rename to wifi/aidl/default/wifi_legacy_hal_factory.cpp index 147bf4d7cc..0359d6f13f 100644 --- a/wifi/1.6/default/wifi_legacy_hal_factory.cpp +++ b/wifi/aidl/default/wifi_legacy_hal_factory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,17 @@ * limitations under the License. */ -#include -#include -#include +#include "wifi_legacy_hal_factory.h" #include +#include #include #include #include #include +#include +#include -#include "wifi_legacy_hal_factory.h" #include "wifi_legacy_hal_stubs.h" namespace { @@ -59,15 +59,14 @@ bool isFileExtension(const char* name, const char* ext) { } }; // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace legacy_hal { WifiLegacyHalFactory::WifiLegacyHalFactory( - const std::weak_ptr iface_tool) + const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool) : iface_tool_(iface_tool) {} std::vector> WifiLegacyHalFactory::getHals() { @@ -129,7 +128,7 @@ bool WifiLegacyHalFactory::initLinkedHalFunctionTable(wifi_hal_fn* hal_fn) { void WifiLegacyHalFactory::initVendorHalsDescriptorList() { xmlDocPtr xml; xmlNodePtr node, cnode; - char* version; + char* version = NULL; std::string path; xmlChar* value; wifi_hal_lib_desc desc; @@ -201,6 +200,10 @@ void WifiLegacyHalFactory::initVendorHalsDescriptorList() { } skip: xmlFreeDoc(xml); + if (version) { + xmlFree(version); + version = NULL; + } } ::closedir(dirPtr); } @@ -247,8 +250,7 @@ out_err: } } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_legacy_hal_factory.h b/wifi/aidl/default/wifi_legacy_hal_factory.h similarity index 82% rename from wifi/1.6/default/wifi_legacy_hal_factory.h rename to wifi/aidl/default/wifi_legacy_hal_factory.h index 9f4423efb7..e7b287a6f5 100644 --- a/wifi/1.6/default/wifi_legacy_hal_factory.h +++ b/wifi/aidl/default/wifi_legacy_hal_factory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,20 +21,19 @@ #include "wifi_legacy_hal.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { // This is in a separate namespace to prevent typename conflicts between -// the legacy HAL types and the HIDL interface types. +// the legacy HAL types and the AIDL interface types. namespace legacy_hal { /** * Class that creates WifiLegacyHal objects for vendor HALs in the system. */ class WifiLegacyHalFactory { public: - WifiLegacyHalFactory(const std::weak_ptr iface_tool); + WifiLegacyHalFactory(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool); virtual ~WifiLegacyHalFactory() = default; std::vector> getHals(); @@ -51,16 +50,15 @@ class WifiLegacyHalFactory { bool initLinkedHalFunctionTable(wifi_hal_fn* hal_fn); bool loadVendorHalLib(const std::string& path, wifi_hal_lib_desc& desc); - std::weak_ptr iface_tool_; + std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool_; std::vector descs_; std::vector> legacy_hals_; }; } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_LEGACY_HAL_FACTORY_H_ diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp similarity index 90% rename from wifi/1.6/default/wifi_legacy_hal_stubs.cpp rename to wifi/aidl/default/wifi_legacy_hal_stubs.cpp index b3bd37389c..b5196c9af6 100644 --- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,10 @@ #include "wifi_legacy_hal_stubs.h" // TODO: Remove these stubs from HalTool in libwifi-system. +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace legacy_hal { template struct stubFunction; @@ -127,7 +126,12 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_nan_data_interface_delete); populateStubFor(&hal_fn->wifi_nan_data_request_initiator); populateStubFor(&hal_fn->wifi_nan_data_indication_response); + populateStubFor(&hal_fn->wifi_nan_pairing_request); + populateStubFor(&hal_fn->wifi_nan_pairing_indication_response); + populateStubFor(&hal_fn->wifi_nan_bootstrapping_request); + populateStubFor(&hal_fn->wifi_nan_bootstrapping_indication_response); populateStubFor(&hal_fn->wifi_nan_data_end); + populateStubFor(&hal_fn->wifi_nan_pairing_end); populateStubFor(&hal_fn->wifi_get_packet_filter_capabilities); populateStubFor(&hal_fn->wifi_set_packet_filter); populateStubFor(&hal_fn->wifi_read_packet_filter); @@ -167,11 +171,19 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_nan_rtt_chre_disable_request); populateStubFor(&hal_fn->wifi_chre_register_handler); populateStubFor(&hal_fn->wifi_enable_tx_power_limits); + populateStubFor(&hal_fn->wifi_get_cached_scan_results); + populateStubFor(&hal_fn->wifi_get_chip_capabilities); + populateStubFor(&hal_fn->wifi_enable_sta_channel_for_peer_network); + populateStubFor(&hal_fn->wifi_nan_suspend_request); + populateStubFor(&hal_fn->wifi_nan_resume_request); + populateStubFor(&hal_fn->wifi_set_scan_mode); + populateStubFor(&hal_fn->wifi_set_mlo_mode); + populateStubFor(&hal_fn->wifi_get_supported_iface_concurrency_matrix); return true; } + } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.h b/wifi/aidl/default/wifi_legacy_hal_stubs.h similarity index 86% rename from wifi/1.6/default/wifi_legacy_hal_stubs.h rename to wifi/aidl/default/wifi_legacy_hal_stubs.h index c9a03bf4c9..603ecf2eae 100644 --- a/wifi/1.6/default/wifi_legacy_hal_stubs.h +++ b/wifi/aidl/default/wifi_legacy_hal_stubs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,19 +19,17 @@ #include +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace legacy_hal { bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn); } // namespace legacy_hal -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_LEGACY_HAL_STUBS_H_ diff --git a/wifi/1.6/default/wifi_mode_controller.cpp b/wifi/aidl/default/wifi_mode_controller.cpp similarity index 91% rename from wifi/1.6/default/wifi_mode_controller.cpp rename to wifi/aidl/default/wifi_mode_controller.cpp index 4b8ac7dd1c..07cb072363 100644 --- a/wifi/1.6/default/wifi_mode_controller.cpp +++ b/wifi/aidl/default/wifi_mode_controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,16 @@ * limitations under the License. */ +#include "wifi_mode_controller.h" + #include #include #include -#include "wifi_mode_controller.h" - -using android::hardware::wifi::V1_0::IfaceType; +namespace { +using aidl::android::hardware::wifi::IfaceType; using android::wifi_hal::DriverTool; -namespace { int convertIfaceTypeToFirmwareMode(IfaceType type) { int mode; switch (type) { @@ -33,7 +33,7 @@ int convertIfaceTypeToFirmwareMode(IfaceType type) { case IfaceType::P2P: mode = DriverTool::kFirmwareModeP2p; break; - case IfaceType::NAN: + case IfaceType::NAN_IFACE: // NAN is exposed in STA mode currently. mode = DriverTool::kFirmwareModeSta; break; @@ -45,11 +45,10 @@ int convertIfaceTypeToFirmwareMode(IfaceType type) { } } // namespace +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace mode_controller { WifiModeController::WifiModeController() : driver_tool_(new DriverTool) {} @@ -81,9 +80,9 @@ bool WifiModeController::deinitialize() { } return true; } + } // namespace mode_controller -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_mode_controller.h b/wifi/aidl/default/wifi_mode_controller.h similarity index 84% rename from wifi/1.6/default/wifi_mode_controller.h rename to wifi/aidl/default/wifi_mode_controller.h index fee2b66d4e..1a9fb1a498 100644 --- a/wifi/1.6/default/wifi_mode_controller.h +++ b/wifi/aidl/default/wifi_mode_controller.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +17,14 @@ #ifndef WIFI_MODE_CONTROLLER_H_ #define WIFI_MODE_CONTROLLER_H_ +#include #include -#include - +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { namespace mode_controller { -using namespace android::hardware::wifi::V1_0; /** * Class that encapsulates all firmware mode configuration. @@ -50,14 +47,13 @@ class WifiModeController { virtual bool deinitialize(); private: - std::unique_ptr driver_tool_; + std::unique_ptr<::android::wifi_hal::DriverTool> driver_tool_; }; } // namespace mode_controller -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_MODE_CONTROLLER_H_ diff --git a/wifi/aidl/default/wifi_nan_iface.cpp b/wifi/aidl/default/wifi_nan_iface.cpp new file mode 100644 index 0000000000..cefe7f7695 --- /dev/null +++ b/wifi/aidl/default/wifi_nan_iface.cpp @@ -0,0 +1,1015 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "wifi_nan_iface.h" + +#include + +#include "aidl_return_util.h" +#include "aidl_struct_util.h" +#include "wifi_status_util.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +using aidl_return_util::validateAndCall; + +WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) + : ifname_(ifname), + is_dedicated_iface_(is_dedicated_iface), + legacy_hal_(legacy_hal), + iface_util_(iface_util), + is_valid_(true) {} + +std::shared_ptr WifiNanIface::create( + const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) { + std::shared_ptr ptr = ndk::SharedRefBase::make( + ifname, is_dedicated_iface, legacy_hal, iface_util); + if (is_dedicated_iface) { + // If using a dedicated iface, set the iface up first. + if (!iface_util.lock()->setUpState(ifname, true)) { + // Fatal failure, invalidate the iface object. + ptr->invalidate(); + return nullptr; + } + } + std::weak_ptr weak_ptr_this(ptr); + ptr->setWeakPtr(weak_ptr_this); + ptr->registerCallbackHandlers(); + return ptr; +} + +void WifiNanIface::registerCallbackHandlers() { + // Register all the callbacks here. These should be valid for the lifetime + // of the object. Whenever the mode changes legacy HAL will remove + // all of these callbacks. + legacy_hal::NanCallbackHandlers callback_handlers; + std::weak_ptr weak_ptr_this = weak_ptr_this_; + + // Callback for response. + callback_handlers.on_notify_response = [weak_ptr_this](legacy_hal::transaction_id id, + const legacy_hal::NanResponseMsg& msg) { + 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; + } + NanStatus nanStatus; + if (!aidl_struct_util::convertLegacyNanResponseHeaderToAidl(msg, &nanStatus)) { + LOG(ERROR) << "Failed to convert nan response header"; + return; + } + + switch (msg.response_type) { + case legacy_hal::NAN_RESPONSE_ENABLED: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyEnableResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_DISABLED: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyDisableResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_PUBLISH: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStartPublishResponse(id, nanStatus, + msg.body.publish_response.publish_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStopPublishResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyTransmitFollowupResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_SUBSCRIBE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStartSubscribeResponse( + id, nanStatus, msg.body.subscribe_response.subscribe_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStopSubscribeResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_CONFIG: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyConfigResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_GET_CAPABILITIES: { + NanCapabilities aidl_struct; + if (!aidl_struct_util::convertLegacyNanCapabilitiesResponseToAidl( + msg.body.nan_capabilities, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyCapabilitiesResponse(id, nanStatus, aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_INTERFACE_CREATE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyCreateDataInterfaceResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_INTERFACE_DELETE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyDeleteDataInterfaceResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_INITIATOR_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyInitiateDataPathResponse( + id, nanStatus, + msg.body.data_request_response.ndp_instance_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_RESPONDER_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyRespondToDataPathIndicationResponse(id, nanStatus) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_END: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyTerminateDataPathResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_PAIRING_INITIATOR_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyInitiatePairingResponse( + id, nanStatus, + msg.body.pairing_request_response.paring_instance_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_PAIRING_RESPONDER_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyRespondToPairingIndicationResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_PAIRING_END: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyTerminatePairingResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_BOOTSTRAPPING_INITIATOR_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyInitiateBootstrappingResponse( + id, nanStatus, + msg.body.bootstrapping_request_response + .bootstrapping_instance_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_BOOTSTRAPPING_RESPONDER_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyRespondToBootstrappingIndicationResponse(id, nanStatus) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_SUSPEND_REQUEST_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifySuspendResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESUME_REQUEST_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyResumeResponse(id, nanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: + /* fall through */ + case legacy_hal::NAN_RESPONSE_TCA: + /* fall through */ + case legacy_hal::NAN_RESPONSE_STATS: + /* fall through */ + case legacy_hal::NAN_RESPONSE_ERROR: + /* fall through */ + default: + LOG(ERROR) << "Unknown or unhandled response type: " << msg.response_type; + return; + } + }; + + callback_handlers.on_event_disc_eng_event = [weak_ptr_this]( + const legacy_hal::NanDiscEngEventInd& msg) { + 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; + } + NanClusterEventInd aidl_struct; + // event types defined identically - hence can be cast + aidl_struct.eventType = (NanClusterEventType)msg.event_type; + aidl_struct.addr = std::array(); + std::copy(msg.data.mac_addr.addr, msg.data.mac_addr.addr + 6, std::begin(aidl_struct.addr)); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventClusterEvent(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_disabled = [weak_ptr_this](const legacy_hal::NanDisabledInd& msg) { + 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; + } + NanStatus status; + aidl_struct_util::convertToNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason), + &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDisabled(status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_publish_terminated = + [weak_ptr_this](const legacy_hal::NanPublishTerminatedInd& msg) { + 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; + } + NanStatus status; + aidl_struct_util::convertToNanStatus(msg.reason, msg.nan_reason, + sizeof(msg.nan_reason), &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_subscribe_terminated = + [weak_ptr_this](const legacy_hal::NanSubscribeTerminatedInd& msg) { + 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; + } + NanStatus status; + aidl_struct_util::convertToNanStatus(msg.reason, msg.nan_reason, + sizeof(msg.nan_reason), &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_match = [weak_ptr_this](const legacy_hal::NanMatchInd& msg) { + 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; + } + NanMatchInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanMatchIndToAidl(msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventMatch(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_match_expired = [weak_ptr_this]( + const legacy_hal::NanMatchExpiredInd& msg) { + 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; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventMatchExpired(msg.publish_subscribe_id, msg.requestor_instance_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_followup = [weak_ptr_this](const legacy_hal::NanFollowupInd& msg) { + 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; + } + NanFollowupReceivedInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanFollowupIndToAidl(msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventFollowupReceived(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_transmit_follow_up = + [weak_ptr_this](const legacy_hal::NanTransmitFollowupInd& msg) { + 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; + } + NanStatus status; + aidl_struct_util::convertToNanStatus(msg.reason, msg.nan_reason, + sizeof(msg.nan_reason), &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventTransmitFollowup(msg.id, status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_data_path_request = + [weak_ptr_this](const legacy_hal::NanDataPathRequestInd& msg) { + 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; + } + NanDataPathRequestInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanDataPathRequestIndToAidl(msg, + &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDataPathRequest(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_data_path_confirm = + [weak_ptr_this](const legacy_hal::NanDataPathConfirmInd& msg) { + 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; + } + NanDataPathConfirmInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanDataPathConfirmIndToAidl(msg, + &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDataPathConfirm(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_data_path_end = + [weak_ptr_this](const legacy_hal::NanDataPathEndInd& msg) { + 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; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + for (int i = 0; i < msg.num_ndp_instances; ++i) { + if (!callback->eventDataPathTerminated(msg.ndp_instance_id[i]).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + } + }; + + callback_handlers.on_event_pairing_request = + [weak_ptr_this](const legacy_hal::NanPairingRequestInd& msg) { + 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; + } + NanPairingRequestInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanPairingRequestIndToAidl(msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventPairingRequest(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + callback_handlers.on_event_pairing_confirm = + [weak_ptr_this](const legacy_hal::NanPairingConfirmInd& msg) { + 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; + } + NanPairingConfirmInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanPairingConfirmIndToAidl(msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventPairingConfirm(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + callback_handlers.on_event_bootstrapping_request = + [weak_ptr_this](const legacy_hal::NanBootstrappingRequestInd& msg) { + 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; + } + NanBootstrappingRequestInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanBootstrappingRequestIndToAidl( + msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventBootstrappingRequest(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + callback_handlers.on_event_bootstrapping_confirm = + [weak_ptr_this](const legacy_hal::NanBootstrappingConfirmInd& msg) { + 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; + } + NanBootstrappingConfirmInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanBootstrappingConfirmIndToAidl( + msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventBootstrappingConfirm(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_beacon_sdf_payload = + [](const legacy_hal::NanBeaconSdfPayloadInd& /* msg */) { + LOG(ERROR) << "on_event_beacon_sdf_payload - should not be called"; + }; + + callback_handlers.on_event_range_request = [](const legacy_hal::NanRangeRequestInd& /* msg */) { + LOG(ERROR) << "on_event_range_request - should not be called"; + }; + + callback_handlers.on_event_range_report = [](const legacy_hal::NanRangeReportInd& /* msg */) { + LOG(ERROR) << "on_event_range_report - should not be called"; + }; + + callback_handlers.on_event_schedule_update = + [weak_ptr_this](const legacy_hal::NanDataPathScheduleUpdateInd& msg) { + 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; + } + NanDataPathScheduleUpdateInd aidl_struct; + if (!aidl_struct_util::convertLegacyNanDataPathScheduleUpdateIndToAidl( + msg, &aidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDataPathScheduleUpdate(aidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + callback_handlers.on_event_suspension_mode_change = + [weak_ptr_this](const legacy_hal::NanSuspensionModeChangeInd& msg) { + 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; + } + NanSuspensionModeChangeInd aidl_struct; + aidl_struct.isSuspended = msg.is_suspended; + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventSuspensionModeChanged(aidl_struct).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) { + LOG(ERROR) << "Failed to register nan callbacks. Invalidating object"; + invalidate(); + } + + // Register for iface state toggle events. + iface_util::IfaceEventHandlers event_handlers = {}; +#ifndef WIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN + event_handlers.on_state_toggle_off_on = [weak_ptr_this](const std::string& /* iface_name */) { + 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; + } + // Tell framework that NAN has been disabled. + NanStatus status = {NanStatusCode::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDisabled(status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; +#endif + iface_util_.lock()->registerIfaceEventHandlers(ifname_, event_handlers); +} + +void WifiNanIface::setWeakPtr(std::weak_ptr ptr) { + weak_ptr_this_ = ptr; +} + +void WifiNanIface::invalidate() { + if (!isValid()) { + return; + } + // send commands to HAL to actually disable and destroy interfaces + legacy_hal_.lock()->nanDisableRequest(ifname_, 0xFFFF); + legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFE, "aware_data0"); + legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFD, "aware_data1"); + iface_util_.lock()->unregisterIfaceEventHandlers(ifname_); + legacy_hal_.reset(); + event_cb_handler_.invalidate(); + is_valid_ = false; + if (is_dedicated_iface_) { + // If using a dedicated iface, set the iface down. + iface_util_.lock()->setUpState(ifname_, false); + } +} + +bool WifiNanIface::isValid() { + return is_valid_; +} + +std::string WifiNanIface::getName() { + return ifname_; +} + +std::set> WifiNanIface::getEventCallbacks() { + LOG(ERROR) << "Using original getEventCallbacks"; + return event_cb_handler_.getCallbacks(); +} + +ndk::ScopedAStatus WifiNanIface::getName(std::string* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getNameInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiNanIface::registerEventCallback( + const std::shared_ptr& callback) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::registerEventCallbackInternal, callback); +} + +ndk::ScopedAStatus WifiNanIface::getCapabilitiesRequest(char16_t in_cmdId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getCapabilitiesRequestInternal, in_cmdId); +} + +ndk::ScopedAStatus WifiNanIface::enableRequest(char16_t in_cmdId, const NanEnableRequest& in_msg1, + const NanConfigRequestSupplemental& in_msg2) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequestInternal, in_cmdId, in_msg1, in_msg2); +} + +ndk::ScopedAStatus WifiNanIface::configRequest(char16_t in_cmdId, const NanConfigRequest& in_msg1, + const NanConfigRequestSupplemental& in_msg2) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequestInternal, in_cmdId, in_msg1, in_msg2); +} + +ndk::ScopedAStatus WifiNanIface::disableRequest(char16_t in_cmdId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::disableRequestInternal, in_cmdId); +} + +ndk::ScopedAStatus WifiNanIface::startPublishRequest(char16_t in_cmdId, + const NanPublishRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::startPublishRequestInternal, in_cmdId, in_msg); +} + +ndk::ScopedAStatus WifiNanIface::stopPublishRequest(char16_t in_cmdId, int8_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::stopPublishRequestInternal, in_cmdId, in_sessionId); +} + +ndk::ScopedAStatus WifiNanIface::startSubscribeRequest(char16_t in_cmdId, + const NanSubscribeRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::startSubscribeRequestInternal, in_cmdId, in_msg); +} + +ndk::ScopedAStatus WifiNanIface::stopSubscribeRequest(char16_t in_cmdId, int8_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::stopSubscribeRequestInternal, in_cmdId, in_sessionId); +} + +ndk::ScopedAStatus WifiNanIface::transmitFollowupRequest(char16_t in_cmdId, + const NanTransmitFollowupRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::transmitFollowupRequestInternal, in_cmdId, in_msg); +} + +ndk::ScopedAStatus WifiNanIface::createDataInterfaceRequest(char16_t in_cmdId, + const std::string& in_ifaceName) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::createDataInterfaceRequestInternal, in_cmdId, + in_ifaceName); +} + +ndk::ScopedAStatus WifiNanIface::deleteDataInterfaceRequest(char16_t in_cmdId, + const std::string& in_ifaceName) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::deleteDataInterfaceRequestInternal, in_cmdId, + in_ifaceName); +} + +ndk::ScopedAStatus WifiNanIface::initiateDataPathRequest(char16_t in_cmdId, + const NanInitiateDataPathRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::initiateDataPathRequestInternal, in_cmdId, in_msg); +} + +ndk::ScopedAStatus WifiNanIface::respondToDataPathIndicationRequest( + char16_t in_cmdId, const NanRespondToDataPathIndicationRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::respondToDataPathIndicationRequestInternal, in_cmdId, + in_msg); +} + +ndk::ScopedAStatus WifiNanIface::terminateDataPathRequest(char16_t in_cmdId, + int32_t in_ndpInstanceId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::terminateDataPathRequestInternal, in_cmdId, + in_ndpInstanceId); +} + +ndk::ScopedAStatus WifiNanIface::initiatePairingRequest(char16_t in_cmdId, + const NanPairingRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::initiatePairingRequestInternal, in_cmdId, in_msg); +} + +ndk::ScopedAStatus WifiNanIface::respondToPairingIndicationRequest( + char16_t in_cmdId, const NanRespondToPairingIndicationRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::respondToPairingIndicationRequestInternal, in_cmdId, + in_msg); +} + +ndk::ScopedAStatus WifiNanIface::terminatePairingRequest(char16_t in_cmdId, + int32_t in_ndpInstanceId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::terminatePairingRequestInternal, in_cmdId, + in_ndpInstanceId); +} + +ndk::ScopedAStatus WifiNanIface::initiateBootstrappingRequest( + char16_t in_cmdId, const NanBootstrappingRequest& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::initiateBootstrappingRequestInternal, in_cmdId, in_msg); +} + +ndk::ScopedAStatus WifiNanIface::respondToBootstrappingIndicationRequest( + char16_t in_cmdId, const NanBootstrappingResponse& in_msg) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::respondToBootstrappingIndicationRequestInternal, in_cmdId, + in_msg); +} + +ndk::ScopedAStatus WifiNanIface::suspendRequest(char16_t in_cmdId, int8_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::suspendRequestInternal, in_cmdId, in_sessionId); +} + +ndk::ScopedAStatus WifiNanIface::resumeRequest(char16_t in_cmdId, int8_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::resumeRequestInternal, in_cmdId, in_sessionId); +} + +std::pair WifiNanIface::getNameInternal() { + return {ifname_, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiNanIface::registerEventCallbackInternal( + const std::shared_ptr& callback) { + if (!event_cb_handler_.addCallback(callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus WifiNanIface::getCapabilitiesRequestInternal(char16_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->nanGetCapabilities(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::enableRequestInternal(char16_t cmd_id, + const NanEnableRequest& msg1, + const NanConfigRequestSupplemental& msg2) { + legacy_hal::NanEnableRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanEnableRequestToLegacy(msg1, msg2, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanEnableRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::configRequestInternal(char16_t cmd_id, + const NanConfigRequest& msg1, + const NanConfigRequestSupplemental& msg2) { + legacy_hal::NanConfigRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanConfigRequestToLegacy(msg1, msg2, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanConfigRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::disableRequestInternal(char16_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->nanDisableRequest(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::startPublishRequestInternal(char16_t cmd_id, + const NanPublishRequest& msg) { + legacy_hal::NanPublishRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanPublishRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPublishRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::stopPublishRequestInternal(char16_t cmd_id, int8_t sessionId) { + legacy_hal::NanPublishCancelRequest legacy_msg; + legacy_msg.publish_id = sessionId; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPublishCancelRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::startSubscribeRequestInternal(char16_t cmd_id, + const NanSubscribeRequest& msg) { + legacy_hal::NanSubscribeRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanSubscribeRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanSubscribeRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::stopSubscribeRequestInternal(char16_t cmd_id, int8_t sessionId) { + legacy_hal::NanSubscribeCancelRequest legacy_msg; + legacy_msg.subscribe_id = sessionId; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanSubscribeCancelRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::transmitFollowupRequestInternal( + char16_t cmd_id, const NanTransmitFollowupRequest& msg) { + legacy_hal::NanTransmitFollowupRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanTransmitFollowupRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanTransmitFollowupRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiNanIface::createDataInterfaceRequestInternal(char16_t cmd_id, + const std::string& iface_name) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataInterfaceCreate(ifname_, cmd_id, iface_name); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::deleteDataInterfaceRequestInternal(char16_t cmd_id, + const std::string& iface_name) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, cmd_id, iface_name); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::initiateDataPathRequestInternal( + char16_t cmd_id, const NanInitiateDataPathRequest& msg) { + legacy_hal::NanDataPathInitiatorRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataRequestInitiator(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::respondToDataPathIndicationRequestInternal( + char16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) { + legacy_hal::NanDataPathIndicationResponse legacy_msg; + if (!aidl_struct_util::convertAidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataIndicationResponse(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::terminateDataPathRequestInternal(char16_t cmd_id, + int32_t ndpInstanceId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataEnd(ifname_, cmd_id, ndpInstanceId); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::initiatePairingRequestInternal(char16_t cmd_id, + const NanPairingRequest& msg) { + legacy_hal::NanPairingRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanPairingInitiatorRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPairingRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::respondToPairingIndicationRequestInternal( + char16_t cmd_id, const NanRespondToPairingIndicationRequest& msg) { + legacy_hal::NanPairingIndicationResponse legacy_msg; + if (!aidl_struct_util::convertAidlNanPairingIndicationResponseToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPairingIndicationResponse(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::terminatePairingRequestInternal(char16_t cmd_id, + int32_t ndpInstanceId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPairingEnd(ifname_, cmd_id, ndpInstanceId); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::initiateBootstrappingRequestInternal( + char16_t cmd_id, const NanBootstrappingRequest& msg) { + legacy_hal::NanBootstrappingRequest legacy_msg; + if (!aidl_struct_util::convertAidlNanBootstrappingInitiatorRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanBootstrappingRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::respondToBootstrappingIndicationRequestInternal( + char16_t cmd_id, const NanBootstrappingResponse& msg) { + legacy_hal::NanBootstrappingIndicationResponse legacy_msg; + if (!aidl_struct_util::convertAidlNanBootstrappingIndicationResponseToLegacy(msg, + &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanBootstrappingIndicationResponse(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::suspendRequestInternal(char16_t cmd_id, int8_t sessionId) { + legacy_hal::NanSuspendRequest legacy_msg; + legacy_msg.publish_subscribe_id = sessionId; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanSuspendRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +ndk::ScopedAStatus WifiNanIface::resumeRequestInternal(char16_t cmd_id, int8_t sessionId) { + legacy_hal::NanResumeRequest legacy_msg; + legacy_msg.publish_subscribe_id = sessionId; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanResumeRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/wifi_nan_iface.h b/wifi/aidl/default/wifi_nan_iface.h new file mode 100644 index 0000000000..a49ae8c8c3 --- /dev/null +++ b/wifi/aidl/default/wifi_nan_iface.h @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WIFI_NAN_IFACE_H_ +#define WIFI_NAN_IFACE_H_ + +#include +#include +#include + +#include "aidl_callback_util.h" +#include "wifi_iface_util.h" +#include "wifi_legacy_hal.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +/** + * AIDL interface object used to control a NAN Iface instance. + */ +class WifiNanIface : public BnWifiNanIface { + public: + WifiNanIface(const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + + // Factory method - use instead of default constructor. + static std::shared_ptr create( + const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + + // Refer to |WifiChip::invalidate()|. + void invalidate(); + bool isValid(); + std::string getName(); + + // AIDL methods exposed. + ndk::ScopedAStatus getName(std::string* _aidl_return) override; + ndk::ScopedAStatus registerEventCallback( + const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus getCapabilitiesRequest(char16_t in_cmdId) override; + ndk::ScopedAStatus enableRequest(char16_t in_cmdId, const NanEnableRequest& in_msg1, + const NanConfigRequestSupplemental& in_msg2) override; + ndk::ScopedAStatus configRequest(char16_t in_cmdId, const NanConfigRequest& in_msg1, + const NanConfigRequestSupplemental& in_msg2) override; + ndk::ScopedAStatus disableRequest(char16_t in_cmdId) override; + ndk::ScopedAStatus startPublishRequest(char16_t in_cmdId, + const NanPublishRequest& in_msg) override; + ndk::ScopedAStatus stopPublishRequest(char16_t in_cmdId, int8_t in_sessionId) override; + ndk::ScopedAStatus startSubscribeRequest(char16_t in_cmdId, + const NanSubscribeRequest& in_msg) override; + ndk::ScopedAStatus stopSubscribeRequest(char16_t in_cmdId, int8_t in_sessionId) override; + ndk::ScopedAStatus transmitFollowupRequest(char16_t in_cmdId, + const NanTransmitFollowupRequest& in_msg) override; + ndk::ScopedAStatus createDataInterfaceRequest(char16_t in_cmdId, + const std::string& in_ifaceName) override; + ndk::ScopedAStatus deleteDataInterfaceRequest(char16_t in_cmdId, + const std::string& in_ifaceName) override; + ndk::ScopedAStatus initiateDataPathRequest(char16_t in_cmdId, + const NanInitiateDataPathRequest& in_msg) override; + ndk::ScopedAStatus respondToDataPathIndicationRequest( + char16_t in_cmdId, const NanRespondToDataPathIndicationRequest& in_msg) override; + ndk::ScopedAStatus terminateDataPathRequest(char16_t in_cmdId, + int32_t in_ndpInstanceId) override; + ndk::ScopedAStatus initiatePairingRequest(char16_t in_cmdId, + const NanPairingRequest& in_msg) override; + ndk::ScopedAStatus respondToPairingIndicationRequest( + char16_t in_cmdId, const NanRespondToPairingIndicationRequest& in_msg) override; + ndk::ScopedAStatus terminatePairingRequest(char16_t in_cmdId, int32_t in_pairingId) override; + ndk::ScopedAStatus initiateBootstrappingRequest(char16_t in_cmdId, + const NanBootstrappingRequest& in_msg) override; + ndk::ScopedAStatus respondToBootstrappingIndicationRequest( + char16_t in_cmdId, const NanBootstrappingResponse& in_msg) override; + ndk::ScopedAStatus suspendRequest(char16_t in_cmdId, int8_t sessionId) override; + ndk::ScopedAStatus resumeRequest(char16_t in_cmdId, int8_t sessionId) override; + + protected: + // Accessible to child class in the gTest suite. + void setWeakPtr(std::weak_ptr ptr); + void registerCallbackHandlers(); + + private: + // Corresponding worker functions for the AIDL methods. + std::pair getNameInternal(); + ndk::ScopedAStatus registerEventCallbackInternal( + const std::shared_ptr& callback); + ndk::ScopedAStatus getCapabilitiesRequestInternal(char16_t cmd_id); + ndk::ScopedAStatus enableRequestInternal(char16_t cmd_id, const NanEnableRequest& msg1, + const NanConfigRequestSupplemental& msg2); + ndk::ScopedAStatus configRequestInternal(char16_t cmd_id, const NanConfigRequest& msg1, + const NanConfigRequestSupplemental& msg2); + ndk::ScopedAStatus disableRequestInternal(char16_t cmd_id); + ndk::ScopedAStatus startPublishRequestInternal(char16_t cmd_id, const NanPublishRequest& msg); + ndk::ScopedAStatus stopPublishRequestInternal(char16_t cmd_id, int8_t sessionId); + ndk::ScopedAStatus startSubscribeRequestInternal(char16_t cmd_id, + const NanSubscribeRequest& msg); + ndk::ScopedAStatus stopSubscribeRequestInternal(char16_t cmd_id, int8_t sessionId); + ndk::ScopedAStatus transmitFollowupRequestInternal(char16_t cmd_id, + const NanTransmitFollowupRequest& msg); + ndk::ScopedAStatus createDataInterfaceRequestInternal(char16_t cmd_id, + const std::string& iface_name); + ndk::ScopedAStatus deleteDataInterfaceRequestInternal(char16_t cmd_id, + const std::string& iface_name); + ndk::ScopedAStatus initiateDataPathRequestInternal(char16_t cmd_id, + const NanInitiateDataPathRequest& msg); + ndk::ScopedAStatus respondToDataPathIndicationRequestInternal( + char16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg); + ndk::ScopedAStatus terminateDataPathRequestInternal(char16_t cmd_id, int32_t ndpInstanceId); + ndk::ScopedAStatus initiatePairingRequestInternal(char16_t cmd_id, + const NanPairingRequest& msg); + ndk::ScopedAStatus respondToPairingIndicationRequestInternal( + char16_t cmd_id, const NanRespondToPairingIndicationRequest& msg); + ndk::ScopedAStatus terminatePairingRequestInternal(char16_t cmd_id, int32_t pairingId); + ndk::ScopedAStatus initiateBootstrappingRequestInternal(char16_t cmd_id, + const NanBootstrappingRequest& msg); + ndk::ScopedAStatus respondToBootstrappingIndicationRequestInternal( + char16_t cmd_id, const NanBootstrappingResponse& msg); + ndk::ScopedAStatus suspendRequestInternal(char16_t in_cmdId, int8_t sessionId); + ndk::ScopedAStatus resumeRequestInternal(char16_t in_cmdId, int8_t sessionId); + + // Overridden in the gTest suite. + virtual std::set> getEventCallbacks(); + + std::string ifname_; + bool is_dedicated_iface_; + std::weak_ptr legacy_hal_; + std::weak_ptr iface_util_; + bool is_valid_; + std::weak_ptr weak_ptr_this_; + aidl_callback_util::AidlCallbackHandler event_cb_handler_; + + DISALLOW_COPY_AND_ASSIGN(WifiNanIface); +}; + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // WIFI_NAN_IFACE_H_ diff --git a/wifi/1.6/default/wifi_p2p_iface.cpp b/wifi/aidl/default/wifi_p2p_iface.cpp similarity index 60% rename from wifi/1.6/default/wifi_p2p_iface.cpp rename to wifi/aidl/default/wifi_p2p_iface.cpp index d4b1fcabf1..48ec6d6d87 100644 --- a/wifi/1.6/default/wifi_p2p_iface.cpp +++ b/wifi/aidl/default/wifi_p2p_iface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +14,18 @@ * limitations under the License. */ +#include "wifi_p2p_iface.h" + #include -#include "hidl_return_util.h" -#include "wifi_p2p_iface.h" +#include "aidl_return_util.h" #include "wifi_status_util.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -using hidl_return_util::validateAndCall; +using aidl_return_util::validateAndCall; WifiP2pIface::WifiP2pIface(const std::string& ifname, const std::weak_ptr legacy_hal) @@ -44,26 +44,16 @@ std::string WifiP2pIface::getName() { return ifname_; } -Return WifiP2pIface::getName(getName_cb hidl_status_cb) { +ndk::ScopedAStatus WifiP2pIface::getName(std::string* _aidl_return) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiP2pIface::getNameInternal, hidl_status_cb); + &WifiP2pIface::getNameInternal, _aidl_return); } -Return WifiP2pIface::getType(getType_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiP2pIface::getTypeInternal, hidl_status_cb); +std::pair WifiP2pIface::getNameInternal() { + return {ifname_, ndk::ScopedAStatus::ok()}; } -std::pair WifiP2pIface::getNameInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; -} - -std::pair WifiP2pIface::getTypeInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::P2P}; -} - -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_p2p_iface.h b/wifi/aidl/default/wifi_p2p_iface.h similarity index 64% rename from wifi/1.6/default/wifi_p2p_iface.h rename to wifi/aidl/default/wifi_p2p_iface.h index 00894437cf..d17470ed23 100644 --- a/wifi/1.6/default/wifi_p2p_iface.h +++ b/wifi/aidl/default/wifi_p2p_iface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,22 +17,20 @@ #ifndef WIFI_P2P_IFACE_H_ #define WIFI_P2P_IFACE_H_ +#include #include -#include #include "wifi_legacy_hal.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; /** - * HIDL interface object used to control a P2P Iface instance. + * AIDL interface object used to control a P2P Iface instance. */ -class WifiP2pIface : public V1_0::IWifiP2pIface { +class WifiP2pIface : public BnWifiP2pIface { public: WifiP2pIface(const std::string& ifname, const std::weak_ptr legacy_hal); @@ -41,14 +39,12 @@ class WifiP2pIface : public V1_0::IWifiP2pIface { bool isValid(); std::string getName(); - // HIDL methods exposed. - Return getName(getName_cb hidl_status_cb) override; - Return getType(getType_cb hidl_status_cb) override; + // AIDL methods exposed. + ndk::ScopedAStatus getName(std::string* _aidl_return) override; private: - // Corresponding worker functions for the HIDL methods. - std::pair getNameInternal(); - std::pair getTypeInternal(); + // Corresponding worker functions for the AIDL methods. + std::pair getNameInternal(); std::string ifname_; std::weak_ptr legacy_hal_; @@ -57,10 +53,9 @@ class WifiP2pIface : public V1_0::IWifiP2pIface { DISALLOW_COPY_AND_ASSIGN(WifiP2pIface); }; -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_P2P_IFACE_H_ diff --git a/wifi/aidl/default/wifi_rtt_controller.cpp b/wifi/aidl/default/wifi_rtt_controller.cpp new file mode 100644 index 0000000000..a5f6768951 --- /dev/null +++ b/wifi/aidl/default/wifi_rtt_controller.cpp @@ -0,0 +1,275 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "wifi_rtt_controller.h" + +#include + +#include "aidl_return_util.h" +#include "aidl_struct_util.h" +#include "wifi_status_util.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +using aidl_return_util::validateAndCall; + +WifiRttController::WifiRttController(const std::string& iface_name, + const std::shared_ptr& bound_iface, + const std::weak_ptr legacy_hal) + : ifname_(iface_name), bound_iface_(bound_iface), legacy_hal_(legacy_hal), is_valid_(true) {} + +std::shared_ptr WifiRttController::create( + const std::string& iface_name, const std::shared_ptr& bound_iface, + const std::weak_ptr legacy_hal) { + std::shared_ptr ptr = + ndk::SharedRefBase::make(iface_name, bound_iface, legacy_hal); + std::weak_ptr weak_ptr_this(ptr); + ptr->setWeakPtr(weak_ptr_this); + return ptr; +} + +void WifiRttController::invalidate() { + legacy_hal_.reset(); + event_callbacks_.clear(); + is_valid_ = false; +}; + +bool WifiRttController::isValid() { + return is_valid_; +} + +void WifiRttController::setWeakPtr(std::weak_ptr ptr) { + weak_ptr_this_ = ptr; +} + +std::vector> +WifiRttController::getEventCallbacks() { + return event_callbacks_; +} + +std::string WifiRttController::getIfaceName() { + return ifname_; +} + +ndk::ScopedAStatus WifiRttController::getBoundIface(std::shared_ptr* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getBoundIfaceInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiRttController::registerEventCallback( + const std::shared_ptr& callback) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::registerEventCallbackInternal, callback); +} + +ndk::ScopedAStatus WifiRttController::rangeRequest(int32_t in_cmdId, + const std::vector& in_rttConfigs) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeRequestInternal, in_cmdId, in_rttConfigs); +} + +ndk::ScopedAStatus WifiRttController::rangeCancel(int32_t in_cmdId, + const std::vector& in_addrs) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeCancelInternal, in_cmdId, in_addrs); +} + +ndk::ScopedAStatus WifiRttController::getCapabilities(RttCapabilities* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getCapabilitiesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiRttController::setLci(int32_t in_cmdId, const RttLciInformation& in_lci) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setLciInternal, in_cmdId, in_lci); +} + +ndk::ScopedAStatus WifiRttController::setLcr(int32_t in_cmdId, const RttLcrInformation& in_lcr) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setLcrInternal, in_cmdId, in_lcr); +} + +ndk::ScopedAStatus WifiRttController::getResponderInfo(RttResponder* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getResponderInfoInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiRttController::enableResponder(int32_t in_cmdId, + const WifiChannelInfo& in_channelHint, + int32_t in_maxDurationInSeconds, + const RttResponder& in_info) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::enableResponderInternal, in_cmdId, in_channelHint, + in_maxDurationInSeconds, in_info); +} + +ndk::ScopedAStatus WifiRttController::disableResponder(int32_t in_cmdId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::disableResponderInternal, in_cmdId); +} + +std::pair, ndk::ScopedAStatus> +WifiRttController::getBoundIfaceInternal() { + return {bound_iface_, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiRttController::registerEventCallbackInternal( + const std::shared_ptr& callback) { + event_callbacks_.emplace_back(callback); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus WifiRttController::rangeRequestInternal( + int32_t cmd_id, const std::vector& rtt_configs) { + std::vector legacy_configs; + if (!aidl_struct_util::convertAidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + std::weak_ptr weak_ptr_this = weak_ptr_this_; + const auto& on_results_callback = + [weak_ptr_this](legacy_hal::wifi_request_id id, + const std::vector& results) { + 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; + } + std::vector aidl_results; + if (!aidl_struct_util::convertLegacyVectorOfRttResultToAidl(results, + &aidl_results)) { + LOG(ERROR) << "Failed to convert rtt results to AIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onResults(id, aidl_results).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + const auto& on_results_callback_v2 = + [weak_ptr_this](legacy_hal::wifi_request_id id, + const std::vector& results) { + const auto shared_ptr_this = weak_ptr_this.lock(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "v2 Callback invoked on an invalid object"; + return; + } + std::vector aidl_results; + if (!aidl_struct_util::convertLegacyVectorOfRttResultV2ToAidl(results, + &aidl_results)) { + LOG(ERROR) << "Failed to convert rtt results v2 to AIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onResults(id, aidl_results).isOk()) { + LOG(ERROR) << "Failed to invoke the v2 callback"; + } + } + }; + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest( + ifname_, cmd_id, legacy_configs, on_results_callback, on_results_callback_v2); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiRttController::rangeCancelInternal(int32_t cmd_id, + const std::vector& addrs) { + std::vector> legacy_addrs; + for (const auto& addr : addrs) { + std::array addr_array; + std::copy_n(addr.data.begin(), ETH_ALEN, addr_array.begin()); + legacy_addrs.push_back(addr_array); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->cancelRttRangeRequest(ifname_, cmd_id, legacy_addrs); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair WifiRttController::getCapabilitiesInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_rtt_capabilities legacy_caps; + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {RttCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; + } + RttCapabilities aidl_caps; + if (!aidl_struct_util::convertLegacyRttCapabilitiesToAidl(legacy_caps, &aidl_caps)) { + return {RttCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_caps, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiRttController::setLciInternal(int32_t cmd_id, const RttLciInformation& lci) { + legacy_hal::wifi_lci_information legacy_lci; + if (!aidl_struct_util::convertAidlRttLciInformationToLegacy(lci, &legacy_lci)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->setRttLci(ifname_, cmd_id, legacy_lci); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiRttController::setLcrInternal(int32_t cmd_id, const RttLcrInformation& lcr) { + legacy_hal::wifi_lcr_information legacy_lcr; + if (!aidl_struct_util::convertAidlRttLcrInformationToLegacy(lcr, &legacy_lcr)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->setRttLcr(ifname_, cmd_id, legacy_lcr); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair WifiRttController::getResponderInfoInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_rtt_responder legacy_responder; + std::tie(legacy_status, legacy_responder) = legacy_hal_.lock()->getRttResponderInfo(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {RttResponder{}, createWifiStatusFromLegacyError(legacy_status)}; + } + RttResponder aidl_responder; + if (!aidl_struct_util::convertLegacyRttResponderToAidl(legacy_responder, &aidl_responder)) { + return {RttResponder{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_responder, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiRttController::enableResponderInternal(int32_t cmd_id, + const WifiChannelInfo& channel_hint, + int32_t max_duration_seconds, + const RttResponder& info) { + legacy_hal::wifi_channel_info legacy_channel_info; + if (!aidl_struct_util::convertAidlWifiChannelInfoToLegacy(channel_hint, &legacy_channel_info)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_rtt_responder legacy_responder; + if (!aidl_struct_util::convertAidlRttResponderToLegacy(info, &legacy_responder)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableRttResponder( + ifname_, cmd_id, legacy_channel_info, max_duration_seconds, legacy_responder); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiRttController::disableResponderInternal(int32_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->disableRttResponder(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/wifi_rtt_controller.h b/wifi/aidl/default/wifi_rtt_controller.h new file mode 100644 index 0000000000..db690c3ad3 --- /dev/null +++ b/wifi/aidl/default/wifi_rtt_controller.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WIFI_RTT_CONTROLLER_H_ +#define WIFI_RTT_CONTROLLER_H_ + +#include +#include +#include +#include + +#include "wifi_legacy_hal.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +/** + * AIDL interface object used to control all RTT operations. + */ +class WifiRttController : public BnWifiRttController { + public: + WifiRttController(const std::string& iface_name, + const std::shared_ptr& bound_iface, + const std::weak_ptr legacy_hal); + // Factory method - use instead of default constructor. + static std::shared_ptr create( + const std::string& iface_name, const std::shared_ptr& bound_iface, + const std::weak_ptr legacy_hal); + + // Refer to |WifiChip::invalidate()|. + void invalidate(); + bool isValid(); + std::vector> getEventCallbacks(); + std::string getIfaceName(); + + // AIDL methods exposed. + ndk::ScopedAStatus getBoundIface(std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus registerEventCallback( + const std::shared_ptr& callback) override; + ndk::ScopedAStatus rangeRequest(int32_t in_cmdId, + const std::vector& in_rttConfigs) override; + ndk::ScopedAStatus rangeCancel(int32_t in_cmdId, + const std::vector& in_addrs) override; + ndk::ScopedAStatus getCapabilities(RttCapabilities* _aidl_return) override; + ndk::ScopedAStatus setLci(int32_t in_cmdId, const RttLciInformation& in_lci) override; + ndk::ScopedAStatus setLcr(int32_t in_cmdId, const RttLcrInformation& in_lcr) override; + ndk::ScopedAStatus getResponderInfo(RttResponder* _aidl_return) override; + ndk::ScopedAStatus enableResponder(int32_t in_cmdId, const WifiChannelInfo& in_channelHint, + int32_t in_maxDurationInSeconds, + const RttResponder& in_info) override; + ndk::ScopedAStatus disableResponder(int32_t in_cmdId) override; + + private: + // Corresponding worker functions for the AIDL methods. + std::pair, ndk::ScopedAStatus> getBoundIfaceInternal(); + ndk::ScopedAStatus registerEventCallbackInternal( + const std::shared_ptr& callback); + ndk::ScopedAStatus rangeRequestInternal(int32_t cmd_id, + const std::vector& rtt_configs); + ndk::ScopedAStatus rangeCancelInternal(int32_t cmd_id, const std::vector& addrs); + std::pair getCapabilitiesInternal(); + ndk::ScopedAStatus setLciInternal(int32_t cmd_id, const RttLciInformation& lci); + ndk::ScopedAStatus setLcrInternal(int32_t cmd_id, const RttLcrInformation& lcr); + std::pair getResponderInfoInternal(); + ndk::ScopedAStatus enableResponderInternal(int32_t cmd_id, const WifiChannelInfo& channel_hint, + int32_t max_duration_seconds, + const RttResponder& info); + ndk::ScopedAStatus disableResponderInternal(int32_t cmd_id); + + void setWeakPtr(std::weak_ptr ptr); + + std::string ifname_; + std::shared_ptr bound_iface_; + std::weak_ptr legacy_hal_; + std::vector> event_callbacks_; + std::weak_ptr weak_ptr_this_; + bool is_valid_; + + DISALLOW_COPY_AND_ASSIGN(WifiRttController); +}; + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // WIFI_RTT_CONTROLLER_H_ diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp new file mode 100644 index 0000000000..800813f166 --- /dev/null +++ b/wifi/aidl/default/wifi_sta_iface.cpp @@ -0,0 +1,546 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "wifi_sta_iface.h" + +#include + +#include "aidl_return_util.h" +#include "aidl_struct_util.h" +#include "wifi_status_util.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { +using aidl_return_util::validateAndCall; + +WifiStaIface::WifiStaIface(const std::string& ifname, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) + : ifname_(ifname), legacy_hal_(legacy_hal), iface_util_(iface_util), is_valid_(true) { + // Turn on DFS channel usage for STA iface. + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setDfsFlag(ifname_, true); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to set DFS flag; DFS channels may be unavailable."; + } +} + +std::shared_ptr WifiStaIface::create( + const std::string& ifname, const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) { + std::shared_ptr ptr = + ndk::SharedRefBase::make(ifname, legacy_hal, iface_util); + std::weak_ptr weak_ptr_this(ptr); + ptr->setWeakPtr(weak_ptr_this); + return ptr; +} + +void WifiStaIface::invalidate() { + legacy_hal_.reset(); + event_cb_handler_.invalidate(); + is_valid_ = false; +} + +void WifiStaIface::setWeakPtr(std::weak_ptr ptr) { + weak_ptr_this_ = ptr; +} + +bool WifiStaIface::isValid() { + return is_valid_; +} + +std::string WifiStaIface::getName() { + return ifname_; +} + +std::set> WifiStaIface::getEventCallbacks() { + return event_cb_handler_.getCallbacks(); +} + +ndk::ScopedAStatus WifiStaIface::getName(std::string* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getNameInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::registerEventCallback( + const std::shared_ptr& in_callback) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::registerEventCallbackInternal, in_callback); +} + +ndk::ScopedAStatus WifiStaIface::getFeatureSet(int32_t* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getFeatureSetInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::getApfPacketFilterCapabilities( + StaApfPacketFilterCapabilities* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getApfPacketFilterCapabilitiesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::installApfPacketFilter(const std::vector& in_program) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::installApfPacketFilterInternal, in_program); +} + +ndk::ScopedAStatus WifiStaIface::readApfPacketFilterData(std::vector* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::readApfPacketFilterDataInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::getBackgroundScanCapabilities( + StaBackgroundScanCapabilities* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getBackgroundScanCapabilitiesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::startBackgroundScan(int32_t in_cmdId, + const StaBackgroundScanParameters& in_params) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startBackgroundScanInternal, in_cmdId, in_params); +} + +ndk::ScopedAStatus WifiStaIface::stopBackgroundScan(int32_t in_cmdId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::stopBackgroundScanInternal, in_cmdId); +} + +ndk::ScopedAStatus WifiStaIface::enableLinkLayerStatsCollection(bool in_debug) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::enableLinkLayerStatsCollectionInternal, in_debug); +} + +ndk::ScopedAStatus WifiStaIface::disableLinkLayerStatsCollection() { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::disableLinkLayerStatsCollectionInternal); +} + +ndk::ScopedAStatus WifiStaIface::getLinkLayerStats(StaLinkLayerStats* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getLinkLayerStatsInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::startRssiMonitoring(int32_t in_cmdId, int32_t in_maxRssi, + int32_t in_minRssi) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startRssiMonitoringInternal, in_cmdId, in_maxRssi, + in_minRssi); +} + +ndk::ScopedAStatus WifiStaIface::stopRssiMonitoring(int32_t in_cmdId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::stopRssiMonitoringInternal, in_cmdId); +} + +ndk::ScopedAStatus WifiStaIface::getRoamingCapabilities(StaRoamingCapabilities* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getRoamingCapabilitiesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::configureRoaming(const StaRoamingConfig& in_config) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::configureRoamingInternal, in_config); +} + +ndk::ScopedAStatus WifiStaIface::setRoamingState(StaRoamingState in_state) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::setRoamingStateInternal, in_state); +} + +ndk::ScopedAStatus WifiStaIface::enableNdOffload(bool in_enable) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::enableNdOffloadInternal, in_enable); +} + +ndk::ScopedAStatus WifiStaIface::startSendingKeepAlivePackets( + int32_t in_cmdId, const std::vector& in_ipPacketData, char16_t in_etherType, + const std::array& in_srcAddress, const std::array& in_dstAddress, + int32_t in_periodInMs) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startSendingKeepAlivePacketsInternal, in_cmdId, + in_ipPacketData, in_etherType, in_srcAddress, in_dstAddress, + in_periodInMs); +} + +ndk::ScopedAStatus WifiStaIface::stopSendingKeepAlivePackets(int32_t in_cmdId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::stopSendingKeepAlivePacketsInternal, in_cmdId); +} + +ndk::ScopedAStatus WifiStaIface::startDebugPacketFateMonitoring() { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startDebugPacketFateMonitoringInternal); +} + +ndk::ScopedAStatus WifiStaIface::getDebugTxPacketFates( + std::vector* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getDebugTxPacketFatesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::getDebugRxPacketFates( + std::vector* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getDebugRxPacketFatesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::setMacAddress(const std::array& in_mac) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::setMacAddressInternal, in_mac); +} + +ndk::ScopedAStatus WifiStaIface::getFactoryMacAddress(std::array* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getFactoryMacAddressInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::setScanMode(bool in_enable) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::setScanModeInternal, in_enable); +} + +ndk::ScopedAStatus WifiStaIface::setDtimMultiplier(int32_t in_multiplier) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::setDtimMultiplierInternal, in_multiplier); +} + +std::pair WifiStaIface::getNameInternal() { + return {ifname_, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::registerEventCallbackInternal( + const std::shared_ptr& callback) { + if (!event_cb_handler_.addCallback(callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return ndk::ScopedAStatus::ok(); +} + +std::pair WifiStaIface::getFeatureSetInternal() { + legacy_hal::wifi_error legacy_status; + uint64_t legacy_feature_set; + std::tie(legacy_status, legacy_feature_set) = + legacy_hal_.lock()->getSupportedFeatureSet(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {0, createWifiStatusFromLegacyError(legacy_status)}; + } + uint32_t aidl_feature_set; + if (!aidl_struct_util::convertLegacyStaIfaceFeaturesToAidl(legacy_feature_set, + &aidl_feature_set)) { + return {0, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_feature_set, ndk::ScopedAStatus::ok()}; +} + +std::pair +WifiStaIface::getApfPacketFilterCapabilitiesInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::PacketFilterCapabilities legacy_caps; + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getPacketFilterCapabilities(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {StaApfPacketFilterCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; + } + StaApfPacketFilterCapabilities aidl_caps; + if (!aidl_struct_util::convertLegacyApfCapabilitiesToAidl(legacy_caps, &aidl_caps)) { + return {StaApfPacketFilterCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_caps, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::installApfPacketFilterInternal( + const std::vector& program) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setPacketFilter(ifname_, program); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair, ndk::ScopedAStatus> +WifiStaIface::readApfPacketFilterDataInternal() { + const std::pair> legacy_status_and_data = + legacy_hal_.lock()->readApfPacketFilterData(ifname_); + return {std::move(legacy_status_and_data.second), + createWifiStatusFromLegacyError(legacy_status_and_data.first)}; +} + +std::pair +WifiStaIface::getBackgroundScanCapabilitiesInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_gscan_capabilities legacy_caps; + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getGscanCapabilities(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {StaBackgroundScanCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; + } + StaBackgroundScanCapabilities aidl_caps; + if (!aidl_struct_util::convertLegacyGscanCapabilitiesToAidl(legacy_caps, &aidl_caps)) { + return {StaBackgroundScanCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_caps, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::startBackgroundScanInternal( + int32_t cmd_id, const StaBackgroundScanParameters& params) { + legacy_hal::wifi_scan_cmd_params legacy_params; + if (!aidl_struct_util::convertAidlGscanParamsToLegacy(params, &legacy_params)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + std::weak_ptr weak_ptr_this = weak_ptr_this_; + const auto& on_failure_callback = [weak_ptr_this](legacy_hal::wifi_request_id 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; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onBackgroundScanFailure(id).isOk()) { + LOG(ERROR) << "Failed to invoke onBackgroundScanFailure callback"; + } + } + }; + const auto& on_results_callback = + [weak_ptr_this](legacy_hal::wifi_request_id id, + const std::vector& results) { + 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; + } + std::vector aidl_scan_datas; + if (!aidl_struct_util::convertLegacyVectorOfCachedGscanResultsToAidl( + results, &aidl_scan_datas)) { + LOG(ERROR) << "Failed to convert scan results to AIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onBackgroundScanResults(id, aidl_scan_datas).isOk()) { + LOG(ERROR) << "Failed to invoke onBackgroundScanResults callback"; + } + } + }; + const auto& on_full_result_callback = [weak_ptr_this]( + legacy_hal::wifi_request_id id, + const legacy_hal::wifi_scan_result* result, + uint32_t buckets_scanned) { + 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; + } + StaScanResult aidl_scan_result; + if (!aidl_struct_util::convertLegacyGscanResultToAidl(*result, true, &aidl_scan_result)) { + LOG(ERROR) << "Failed to convert full scan results to AIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onBackgroundFullScanResult(id, buckets_scanned, aidl_scan_result) + .isOk()) { + LOG(ERROR) << "Failed to invoke onBackgroundFullScanResult callback"; + } + } + }; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->startGscan(ifname_, cmd_id, legacy_params, on_failure_callback, + on_results_callback, on_full_result_callback); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::stopBackgroundScanInternal(int32_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stopGscan(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::enableLinkLayerStatsCollectionInternal(bool debug) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableLinkLayerStats(ifname_, debug); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::disableLinkLayerStatsCollectionInternal() { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->disableLinkLayerStats(ifname_); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair WifiStaIface::getLinkLayerStatsInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::LinkLayerStats legacy_stats{}; + legacy_hal::LinkLayerMlStats legacy_ml_stats{}; + legacy_status = legacy_hal_.lock()->getLinkLayerStats(ifname_, legacy_stats, legacy_ml_stats); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {StaLinkLayerStats{}, createWifiStatusFromLegacyError(legacy_status)}; + } + StaLinkLayerStats aidl_stats; + if (legacy_stats.valid) { + if (!aidl_struct_util::convertLegacyLinkLayerStatsToAidl(legacy_stats, &aidl_stats)) { + return {StaLinkLayerStats{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + } else if (legacy_ml_stats.valid) { + if (!aidl_struct_util::convertLegacyLinkLayerMlStatsToAidl(legacy_ml_stats, &aidl_stats)) { + return {StaLinkLayerStats{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + } else { + return {StaLinkLayerStats{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_stats, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::startRssiMonitoringInternal(int32_t cmd_id, int32_t max_rssi, + int32_t min_rssi) { + std::weak_ptr weak_ptr_this = weak_ptr_this_; + const auto& on_threshold_breached_callback = + [weak_ptr_this](legacy_hal::wifi_request_id id, std::array bssid, + int8_t rssi) { + 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; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onRssiThresholdBreached(id, bssid, rssi).isOk()) { + LOG(ERROR) << "Failed to invoke onRssiThresholdBreached callback"; + } + } + }; + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRssiMonitoring( + ifname_, cmd_id, max_rssi, min_rssi, on_threshold_breached_callback); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::stopRssiMonitoringInternal(int32_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stopRssiMonitoring(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair +WifiStaIface::getRoamingCapabilitiesInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_roaming_capabilities legacy_caps; + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRoamingCapabilities(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {StaRoamingCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; + } + StaRoamingCapabilities aidl_caps; + if (!aidl_struct_util::convertLegacyRoamingCapabilitiesToAidl(legacy_caps, &aidl_caps)) { + return {StaRoamingCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_caps, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::configureRoamingInternal(const StaRoamingConfig& config) { + legacy_hal::wifi_roaming_config legacy_config; + if (!aidl_struct_util::convertAidlRoamingConfigToLegacy(config, &legacy_config)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->configureRoaming(ifname_, legacy_config); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::setRoamingStateInternal(StaRoamingState state) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableFirmwareRoaming( + ifname_, aidl_struct_util::convertAidlRoamingStateToLegacy(state)); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::enableNdOffloadInternal(bool enable) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->configureNdOffload(ifname_, enable); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::startSendingKeepAlivePacketsInternal( + int32_t cmd_id, const std::vector& ip_packet_data, char16_t ether_type, + const std::array& src_address, const std::array& dst_address, + int32_t period_in_ms) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startSendingOffloadedPacket( + ifname_, cmd_id, ether_type, ip_packet_data, src_address, dst_address, period_in_ms); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::stopSendingKeepAlivePacketsInternal(int32_t cmd_id) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->stopSendingOffloadedPacket(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::startDebugPacketFateMonitoringInternal() { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startPktFateMonitoring(ifname_); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair, ndk::ScopedAStatus> +WifiStaIface::getDebugTxPacketFatesInternal() { + legacy_hal::wifi_error legacy_status; + std::vector legacy_fates; + std::tie(legacy_status, legacy_fates) = legacy_hal_.lock()->getTxPktFates(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {std::vector(), + createWifiStatusFromLegacyError(legacy_status)}; + } + std::vector aidl_fates; + if (!aidl_struct_util::convertLegacyVectorOfDebugTxPacketFateToAidl(legacy_fates, + &aidl_fates)) { + return {std::vector(), + createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_fates, ndk::ScopedAStatus::ok()}; +} + +std::pair, ndk::ScopedAStatus> +WifiStaIface::getDebugRxPacketFatesInternal() { + legacy_hal::wifi_error legacy_status; + std::vector legacy_fates; + std::tie(legacy_status, legacy_fates) = legacy_hal_.lock()->getRxPktFates(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {std::vector(), + createWifiStatusFromLegacyError(legacy_status)}; + } + std::vector aidl_fates; + if (!aidl_struct_util::convertLegacyVectorOfDebugRxPacketFateToAidl(legacy_fates, + &aidl_fates)) { + return {std::vector(), + createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_fates, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::setMacAddressInternal(const std::array& mac) { + bool status = iface_util_.lock()->setMacAddress(ifname_, mac); + if (!status) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return ndk::ScopedAStatus::ok(); +} + +std::pair, ndk::ScopedAStatus> WifiStaIface::getFactoryMacAddressInternal() { + std::array mac = iface_util_.lock()->getFactoryMacAddress(ifname_); + if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && mac[4] == 0 && mac[5] == 0) { + return {mac, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {mac, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::setScanModeInternal(bool enable) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setScanMode(ifname_, enable); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::setDtimMultiplierInternal(const int multiplier) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setDtimConfig(ifname_, multiplier); + return createWifiStatusFromLegacyError(legacy_status); +} + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/wifi/aidl/default/wifi_sta_iface.h b/wifi/aidl/default/wifi_sta_iface.h new file mode 100644 index 0000000000..3d7ec4d4b2 --- /dev/null +++ b/wifi/aidl/default/wifi_sta_iface.h @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WIFI_STA_IFACE_H_ +#define WIFI_STA_IFACE_H_ + +#include +#include +#include + +#include "aidl_callback_util.h" +#include "wifi_iface_util.h" +#include "wifi_legacy_hal.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace wifi { + +/** + * AIDL interface object used to control a STA Iface instance. + */ +class WifiStaIface : public BnWifiStaIface { + public: + WifiStaIface(const std::string& ifname, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + + // Factory method - use instead of default constructor. + static std::shared_ptr create( + const std::string& ifname, const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + + // Refer to |WifiChip::invalidate()|. + void invalidate(); + bool isValid(); + std::set> getEventCallbacks(); + std::string getName(); + + // AIDL methods exposed. + ndk::ScopedAStatus getName(std::string* _aidl_return) override; + ndk::ScopedAStatus registerEventCallback( + const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus getFeatureSet(int32_t* _aidl_return) override; + ndk::ScopedAStatus getApfPacketFilterCapabilities( + StaApfPacketFilterCapabilities* _aidl_return) override; + ndk::ScopedAStatus installApfPacketFilter(const std::vector& in_program) override; + ndk::ScopedAStatus readApfPacketFilterData(std::vector* _aidl_return) override; + ndk::ScopedAStatus getBackgroundScanCapabilities( + StaBackgroundScanCapabilities* _aidl_return) override; + ndk::ScopedAStatus startBackgroundScan(int32_t in_cmdId, + const StaBackgroundScanParameters& in_params) override; + ndk::ScopedAStatus stopBackgroundScan(int32_t in_cmdId) override; + ndk::ScopedAStatus enableLinkLayerStatsCollection(bool in_debug) override; + ndk::ScopedAStatus disableLinkLayerStatsCollection() override; + ndk::ScopedAStatus getLinkLayerStats(StaLinkLayerStats* _aidl_return) override; + ndk::ScopedAStatus startRssiMonitoring(int32_t in_cmdId, int32_t in_maxRssi, + int32_t in_minRssi) override; + ndk::ScopedAStatus stopRssiMonitoring(int32_t in_cmdId) override; + ndk::ScopedAStatus getRoamingCapabilities(StaRoamingCapabilities* _aidl_return) override; + ndk::ScopedAStatus configureRoaming(const StaRoamingConfig& in_config) override; + ndk::ScopedAStatus setRoamingState(StaRoamingState in_state) override; + ndk::ScopedAStatus enableNdOffload(bool in_enable) override; + ndk::ScopedAStatus startSendingKeepAlivePackets(int32_t in_cmdId, + const std::vector& in_ipPacketData, + char16_t in_etherType, + const std::array& in_srcAddress, + const std::array& in_dstAddress, + int32_t in_periodInMs) override; + ndk::ScopedAStatus stopSendingKeepAlivePackets(int32_t in_cmdId) override; + ndk::ScopedAStatus startDebugPacketFateMonitoring() override; + ndk::ScopedAStatus getDebugTxPacketFates( + std::vector* _aidl_return) override; + ndk::ScopedAStatus getDebugRxPacketFates( + std::vector* _aidl_return) override; + ndk::ScopedAStatus setMacAddress(const std::array& in_mac) override; + ndk::ScopedAStatus getFactoryMacAddress(std::array* _aidl_return) override; + ndk::ScopedAStatus setScanMode(bool in_enable) override; + ndk::ScopedAStatus setDtimMultiplier(int32_t in_multiplier) override; + + private: + // Corresponding worker functions for the AIDL methods. + std::pair getNameInternal(); + ndk::ScopedAStatus registerEventCallbackInternal( + const std::shared_ptr& callback); + std::pair getFeatureSetInternal(); + std::pair + getApfPacketFilterCapabilitiesInternal(); + ndk::ScopedAStatus installApfPacketFilterInternal(const std::vector& program); + std::pair, ndk::ScopedAStatus> readApfPacketFilterDataInternal(); + std::pair + getBackgroundScanCapabilitiesInternal(); + ndk::ScopedAStatus startBackgroundScanInternal(int32_t cmd_id, + const StaBackgroundScanParameters& params); + ndk::ScopedAStatus stopBackgroundScanInternal(int32_t cmd_id); + ndk::ScopedAStatus enableLinkLayerStatsCollectionInternal(bool debug); + ndk::ScopedAStatus disableLinkLayerStatsCollectionInternal(); + std::pair getLinkLayerStatsInternal(); + ndk::ScopedAStatus startRssiMonitoringInternal(int32_t cmd_id, int32_t max_rssi, + int32_t min_rssi); + ndk::ScopedAStatus stopRssiMonitoringInternal(int32_t cmd_id); + std::pair getRoamingCapabilitiesInternal(); + ndk::ScopedAStatus configureRoamingInternal(const StaRoamingConfig& config); + ndk::ScopedAStatus setRoamingStateInternal(StaRoamingState state); + ndk::ScopedAStatus enableNdOffloadInternal(bool enable); + ndk::ScopedAStatus startSendingKeepAlivePacketsInternal( + int32_t cmd_id, const std::vector& ip_packet_data, char16_t ether_type, + const std::array& src_address, const std::array& dst_address, + int32_t period_in_ms); + ndk::ScopedAStatus stopSendingKeepAlivePacketsInternal(int32_t cmd_id); + ndk::ScopedAStatus startDebugPacketFateMonitoringInternal(); + std::pair, ndk::ScopedAStatus> + getDebugTxPacketFatesInternal(); + std::pair, ndk::ScopedAStatus> + getDebugRxPacketFatesInternal(); + ndk::ScopedAStatus setMacAddressInternal(const std::array& mac); + std::pair, ndk::ScopedAStatus> getFactoryMacAddressInternal(); + ndk::ScopedAStatus setScanModeInternal(bool enable); + ndk::ScopedAStatus setDtimMultiplierInternal(const int multiplier); + + void setWeakPtr(std::weak_ptr ptr); + + std::string ifname_; + std::weak_ptr legacy_hal_; + std::weak_ptr iface_util_; + std::weak_ptr weak_ptr_this_; + bool is_valid_; + aidl_callback_util::AidlCallbackHandler event_cb_handler_; + + DISALLOW_COPY_AND_ASSIGN(WifiStaIface); +}; + +} // namespace wifi +} // namespace hardware +} // namespace android +} // namespace aidl + +#endif // WIFI_STA_IFACE_H_ diff --git a/wifi/1.6/default/wifi_status_util.cpp b/wifi/aidl/default/wifi_status_util.cpp similarity index 80% rename from wifi/1.6/default/wifi_status_util.cpp rename to wifi/aidl/default/wifi_status_util.cpp index 3b18e537cd..25ecd716da 100644 --- a/wifi/1.6/default/wifi_status_util.cpp +++ b/wifi/aidl/default/wifi_status_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,10 @@ #include "wifi_status_util.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { std::string legacyErrorToString(legacy_hal::wifi_error error) { switch (error) { @@ -51,16 +50,21 @@ std::string legacyErrorToString(legacy_hal::wifi_error error) { } } -WifiStatus createWifiStatus(WifiStatusCode code, const std::string& description) { - return {code, description}; +ndk::ScopedAStatus createWifiStatus(WifiStatusCode code, const std::string& description) { + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(static_cast(code), + description.c_str()); } -WifiStatus createWifiStatus(WifiStatusCode code) { - return createWifiStatus(code, ""); +ndk::ScopedAStatus createWifiStatus(WifiStatusCode code) { + return ndk::ScopedAStatus::fromServiceSpecificError(static_cast(code)); } -WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, const std::string& desc) { +ndk::ScopedAStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, + const std::string& desc) { switch (error) { + case legacy_hal::WIFI_ERROR_NONE: + return ndk::ScopedAStatus::ok(); + case legacy_hal::WIFI_ERROR_UNINITIALIZED: case legacy_hal::WIFI_ERROR_NOT_AVAILABLE: return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, desc); @@ -84,9 +88,6 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, const s case legacy_hal::WIFI_ERROR_BUSY: return createWifiStatus(WifiStatusCode::ERROR_BUSY); - case legacy_hal::WIFI_ERROR_NONE: - return createWifiStatus(WifiStatusCode::SUCCESS, desc); - case legacy_hal::WIFI_ERROR_UNKNOWN: return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, "unknown"); @@ -95,12 +96,11 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, const s } } -WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error) { +ndk::ScopedAStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error) { return createWifiStatusFromLegacyError(error, ""); } -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl diff --git a/wifi/1.6/default/wifi_status_util.h b/wifi/aidl/default/wifi_status_util.h similarity index 59% rename from wifi/1.6/default/wifi_status_util.h rename to wifi/aidl/default/wifi_status_util.h index ea1c29486b..633811dbf6 100644 --- a/wifi/1.6/default/wifi_status_util.h +++ b/wifi/aidl/default/wifi_status_util.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,28 +17,26 @@ #ifndef WIFI_STATUS_UTIL_H_ #define WIFI_STATUS_UTIL_H_ -#include +#include #include "wifi_legacy_hal.h" +namespace aidl { namespace android { namespace hardware { namespace wifi { -namespace V1_6 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; +using ::aidl::android::hardware::wifi::WifiStatusCode; std::string legacyErrorToString(legacy_hal::wifi_error error); -WifiStatus createWifiStatus(WifiStatusCode code, const std::string& description); -WifiStatus createWifiStatus(WifiStatusCode code); -WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, - const std::string& description); -WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error); +ndk::ScopedAStatus createWifiStatus(WifiStatusCode code, const std::string& description); +ndk::ScopedAStatus createWifiStatus(WifiStatusCode code); +ndk::ScopedAStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, + const std::string& description); +ndk::ScopedAStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error); -} // namespace implementation -} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android +} // namespace aidl #endif // WIFI_STATUS_UTIL_H_ diff --git a/wifi/aidl/vts/functional/Android.bp b/wifi/aidl/vts/functional/Android.bp new file mode 100644 index 0000000000..1277182493 --- /dev/null +++ b/wifi/aidl/vts/functional/Android.bp @@ -0,0 +1,169 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_test { + name: "VtsHalWifiChipTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "wifi_chip_aidl_test.cpp", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libvndksupport", + ], + static_libs: [ + "VtsHalWifiTargetTestUtil", + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +cc_test { + name: "VtsHalWifiStaIfaceTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "wifi_sta_iface_aidl_test.cpp", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libvndksupport", + ], + static_libs: [ + "VtsHalWifiTargetTestUtil", + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +cc_test { + name: "VtsHalWifiApIfaceTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "wifi_ap_iface_aidl_test.cpp", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libvndksupport", + ], + static_libs: [ + "VtsHalWifiTargetTestUtil", + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +cc_test { + name: "VtsHalWifiNanIfaceTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "wifi_nan_iface_aidl_test.cpp", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libvndksupport", + ], + static_libs: [ + "VtsHalWifiTargetTestUtil", + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +cc_test { + name: "VtsHalWifiRttControllerTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "wifi_rtt_controller_aidl_test.cpp", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libvndksupport", + ], + static_libs: [ + "VtsHalWifiTargetTestUtil", + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +cc_library_static { + name: "VtsHalWifiTargetTestUtil", + defaults: ["VtsHalTargetTestDefaults"], + srcs: [ + "wifi_aidl_test_utils.cpp", + ], + export_include_dirs: [ + ".", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libnativehelper", + ], + static_libs: [ + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + ], +} diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp new file mode 100644 index 0000000000..ca3c4b74f1 --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp @@ -0,0 +1,220 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "wifi_aidl_test_utils.h" + +using ::android::wifi_system::InterfaceTool; + +namespace { +bool findAnyModeSupportingConcurrencyType(IfaceConcurrencyType desired_type, + const std::vector& modes, + int* mode_id) { + for (const auto& mode : modes) { + for (const auto& combination : mode.availableCombinations) { + for (const auto& iface_limit : combination.limits) { + const auto& iface_types = iface_limit.types; + if (std::find(iface_types.begin(), iface_types.end(), desired_type) != + iface_types.end()) { + *mode_id = mode.id; + return true; + } + } + } + } + return false; +} + +bool configureChipToSupportConcurrencyTypeInternal(const std::shared_ptr& wifi_chip, + IfaceConcurrencyType type, + int* configured_mode_id) { + if (!configured_mode_id) { + return false; + } + std::vector chip_modes; + auto status = wifi_chip->getAvailableModes(&chip_modes); + if (!status.isOk()) { + return false; + } + if (!findAnyModeSupportingConcurrencyType(type, chip_modes, configured_mode_id)) { + return false; + } + if (!wifi_chip->configureChip(*configured_mode_id).isOk()) { + return false; + } + return true; +} + +bool configureChipToSupportConcurrencyTypeInternal(const std::shared_ptr& wifi_chip, + IfaceConcurrencyType type) { + int mode_id; + return configureChipToSupportConcurrencyTypeInternal(wifi_chip, type, &mode_id); +} +} // namespace + +bool checkStatusCode(ndk::ScopedAStatus* status, WifiStatusCode expected_code) { + if (status == nullptr) { + return false; + } + return status->getServiceSpecificError() == static_cast(expected_code); +} + +std::shared_ptr getWifi(const char* instance_name) { + return IWifi::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService(instance_name))); +} + +std::shared_ptr getWifiChip(const char* instance_name) { + std::shared_ptr wifi = getWifi(instance_name); + if (!wifi.get()) { + return nullptr; + } + + const int retry_interval_ms = 2; + const int max_retries = 5; + int retry_count = 0; + auto status = wifi->start(); + while (retry_count < max_retries && !status.isOk()) { + retry_count++; + usleep(retry_interval_ms * 1000); + status = wifi->start(); + } + if (!status.isOk()) { + return nullptr; + } + + std::vector chip_ids = {}; + status = wifi->getChipIds(&chip_ids); + if (!status.isOk() || chip_ids.size() == 0) { + return nullptr; + } + std::shared_ptr chip; + status = wifi->getChip(chip_ids[0], &chip); + if (!status.isOk()) { + return nullptr; + } + return chip; +} + +void setupStaIface(const std::shared_ptr& iface) { + std::string iface_name; + auto status = iface->getName(&iface_name); + if (status.isOk()) { + InterfaceTool iface_tool; + iface_tool.SetUpState(iface_name.c_str(), true); + } +} + +void setupNanIface(const std::shared_ptr& iface) { + std::string iface_name; + auto status = iface->getName(&iface_name); + if (status.isOk()) { + InterfaceTool iface_tool; + iface_tool.SetUpState(iface_name.c_str(), true); + } +} + +std::shared_ptr getWifiStaIface(const char* instance_name) { + std::shared_ptr wifi_chip = getWifiChip(instance_name); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportConcurrencyTypeInternal(wifi_chip, IfaceConcurrencyType::STA)) { + return nullptr; + } + std::shared_ptr iface; + auto status = wifi_chip->createStaIface(&iface); + if (!status.isOk()) { + return nullptr; + } + setupStaIface(iface); + return iface; +} + +std::shared_ptr getWifiNanIface(const char* instance_name) { + std::shared_ptr wifi_chip = getWifiChip(instance_name); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportConcurrencyTypeInternal(wifi_chip, + IfaceConcurrencyType::NAN_IFACE)) { + return nullptr; + } + std::shared_ptr iface; + auto status = wifi_chip->createNanIface(&iface); + if (!status.isOk()) { + return nullptr; + } + setupNanIface(iface); + return iface; +} + +std::shared_ptr getWifiApIface(const char* instance_name) { + std::shared_ptr wifi_chip = getWifiChip(instance_name); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportConcurrencyTypeInternal(wifi_chip, IfaceConcurrencyType::AP)) { + return nullptr; + } + std::shared_ptr iface; + auto status = wifi_chip->createApIface(&iface); + if (!status.isOk()) { + return nullptr; + } + return iface; +} + +std::shared_ptr getBridgedWifiApIface(std::shared_ptr wifi_chip) { + if (!wifi_chip.get()) { + return nullptr; + } + int mode_id; + std::shared_ptr iface; + configureChipToSupportConcurrencyTypeInternal(wifi_chip, IfaceConcurrencyType::AP, &mode_id); + auto status = wifi_chip->createBridgedApIface(&iface); + if (!status.isOk()) { + return nullptr; + } + return iface; +} + +std::shared_ptr getBridgedWifiApIface(const char* instance_name) { + std::shared_ptr wifi_chip = getWifiChip(instance_name); + return getBridgedWifiApIface(wifi_chip); +} + +bool configureChipToSupportConcurrencyType(const std::shared_ptr& wifi_chip, + IfaceConcurrencyType type, int* configured_mode_id) { + return configureChipToSupportConcurrencyTypeInternal(wifi_chip, type, configured_mode_id); +} + +void stopWifiService(const char* instance_name) { + std::shared_ptr wifi = getWifi(instance_name); + if (wifi != nullptr) { + wifi->stop(); + } +} + +int32_t getChipFeatureSet(const std::shared_ptr& wifi_chip) { + int32_t features = 0; + if (wifi_chip->getFeatureSet(&features).isOk()) { + return features; + } + return 0; +} + +bool isAidlServiceAvailable(const char* instance_name) { + return AServiceManager_isDeclared(instance_name); +} diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.h b/wifi/aidl/vts/functional/wifi_aidl_test_utils.h new file mode 100644 index 0000000000..0d70c3b557 --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include +#include +#include + +using aidl::android::hardware::wifi::IfaceConcurrencyType; +using aidl::android::hardware::wifi::IWifi; +using aidl::android::hardware::wifi::IWifiApIface; +using aidl::android::hardware::wifi::IWifiChip; +using aidl::android::hardware::wifi::IWifiNanIface; +using aidl::android::hardware::wifi::IWifiStaIface; +using aidl::android::hardware::wifi::WifiStatusCode; + +// Helper functions to obtain references to the various AIDL interface objects. +std::shared_ptr getWifi(const char* instance_name); +std::shared_ptr getWifiChip(const char* instance_name); +std::shared_ptr getWifiStaIface(const char* instance_name); +std::shared_ptr getWifiNanIface(const char* instance_name); +std::shared_ptr getWifiApIface(const char* instance_name); +std::shared_ptr getBridgedWifiApIface(const char* instance_name); +std::shared_ptr getBridgedWifiApIface(std::shared_ptr wifi_chip); +// Configure the chip in a mode to support the creation of the provided iface type. +bool configureChipToSupportConcurrencyType(const std::shared_ptr& wifi_chip, + IfaceConcurrencyType type, int* configured_mode_id); +// Used to trigger IWifi.stop() at the end of every test. +void stopWifiService(const char* instance_name); +int32_t getChipFeatureSet(const std::shared_ptr& wifi_chip); +bool checkStatusCode(ndk::ScopedAStatus* status, WifiStatusCode expected_code); +bool isAidlServiceAvailable(const char* instance_name); diff --git a/wifi/aidl/vts/functional/wifi_ap_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_ap_iface_aidl_test.cpp new file mode 100644 index 0000000000..d39cfb4f93 --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_ap_iface_aidl_test.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_aidl_test_utils.h" + +using aidl::android::hardware::wifi::IWifiApIface; +using aidl::android::hardware::wifi::WifiBand; + +class WifiApIfaceAidlTest : public testing::TestWithParam { + public: + void SetUp() override { + isBridgedSupport_ = testing::checkSubstringInCommandOutput( + "/system/bin/cmd wifi get-softap-supported-features", + "wifi_softap_bridged_ap_supported"); + stopWifiService(getInstanceName()); + } + + void TearDown() override { stopWifiService(getInstanceName()); } + + protected: + bool isBridgedSupport_ = false; + const char* getInstanceName() { return GetParam().c_str(); } +}; + +/* + * SetMacAddress + */ +TEST_P(WifiApIfaceAidlTest, SetMacAddress) { + std::shared_ptr wifi_ap_iface = getWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + std::array mac = {0x12, 0x22, 0x33, 0x52, 0x10, 0x44}; + EXPECT_TRUE(wifi_ap_iface->setMacAddress(mac).isOk()); +} + +/* + * SetCountryCode + */ +TEST_P(WifiApIfaceAidlTest, SetCountryCode) { + std::shared_ptr wifi_ap_iface = getWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + + const std::array country_code = {0x55, 0x53}; + EXPECT_TRUE(wifi_ap_iface->setCountryCode(country_code).isOk()); +} + +/* + * GetFactoryMacAddress + */ +TEST_P(WifiApIfaceAidlTest, GetFactoryMacAddress) { + std::shared_ptr wifi_ap_iface = getWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + + std::array mac; + EXPECT_TRUE(wifi_ap_iface->getFactoryMacAddress(&mac).isOk()); + std::array all_zero_mac = {0, 0, 0, 0, 0, 0}; + EXPECT_NE(mac, all_zero_mac); +} + +/** + * GetBridgedInstances - non-bridged mode + */ +TEST_P(WifiApIfaceAidlTest, GetBridgedInstances) { + std::shared_ptr wifi_ap_iface = getWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + + std::vector instances; + EXPECT_TRUE(wifi_ap_iface->getBridgedInstances(&instances).isOk()); + EXPECT_EQ(instances.size(), 0); +} + +/** + * GetBridgedInstances - bridged AP mode. + */ +TEST_P(WifiApIfaceAidlTest, GetBridgedInstances_Bridged) { + if (!isBridgedSupport_) { + GTEST_SKIP() << "Missing Bridged AP support"; + } + std::shared_ptr wifi_ap_iface = getBridgedWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + + std::vector instances; + EXPECT_TRUE(wifi_ap_iface->getBridgedInstances(&instances).isOk()); + EXPECT_EQ(instances.size(), 2); +} + +/** + * ResetToFactoryMacAddress - non-bridged mode + */ +TEST_P(WifiApIfaceAidlTest, ResetToFactoryMacAddress) { + std::shared_ptr wifi_ap_iface = getWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + EXPECT_TRUE(wifi_ap_iface->resetToFactoryMacAddress().isOk()); +} + +/** + * ResetToFactoryMacAddress - bridged AP mode + */ +TEST_P(WifiApIfaceAidlTest, ResetToFactoryMacAddress_Bridged) { + if (!isBridgedSupport_) { + GTEST_SKIP() << "Missing Bridged AP support"; + } + std::shared_ptr wifi_ap_iface = getBridgedWifiApIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + EXPECT_TRUE(wifi_ap_iface->resetToFactoryMacAddress().isOk()); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiApIfaceAidlTest); +INSTANTIATE_TEST_SUITE_P(WifiTest, WifiApIfaceAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + android::ProcessState::self()->setThreadPoolMaxThreadCount(1); + android::ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp new file mode 100644 index 0000000000..bbd27f95e3 --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp @@ -0,0 +1,857 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_aidl_test_utils.h" + +using aidl::android::hardware::wifi::BnWifiChipEventCallback; +using aidl::android::hardware::wifi::IfaceType; +using aidl::android::hardware::wifi::IWifiApIface; +using aidl::android::hardware::wifi::IWifiChip; +using aidl::android::hardware::wifi::IWifiNanIface; +using aidl::android::hardware::wifi::IWifiP2pIface; +using aidl::android::hardware::wifi::IWifiRttController; +using aidl::android::hardware::wifi::WifiBand; +using aidl::android::hardware::wifi::WifiDebugHostWakeReasonStats; +using aidl::android::hardware::wifi::WifiDebugRingBufferStatus; +using aidl::android::hardware::wifi::WifiDebugRingBufferVerboseLevel; +using aidl::android::hardware::wifi::WifiIfaceMode; +using aidl::android::hardware::wifi::WifiRadioCombination; +using aidl::android::hardware::wifi::WifiStatusCode; +using aidl::android::hardware::wifi::WifiUsableChannel; + +class WifiChipAidlTest : public testing::TestWithParam { + public: + void SetUp() override { + stopWifiService(getInstanceName()); + wifi_chip_ = getWifiChip(getInstanceName()); + ASSERT_NE(nullptr, wifi_chip_.get()); + } + + void TearDown() override { stopWifiService(getInstanceName()); } + + protected: + int configureChipForConcurrencyType(IfaceConcurrencyType type) { + int mode_id; + EXPECT_TRUE(configureChipToSupportConcurrencyType(wifi_chip_, type, &mode_id)); + return mode_id; + } + + std::shared_ptr configureChipForStaAndGetIface() { + std::shared_ptr iface; + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + EXPECT_TRUE(wifi_chip_->createStaIface(&iface).isOk()); + EXPECT_NE(nullptr, iface.get()); + return iface; + } + + std::shared_ptr configureChipForP2pAndGetIface() { + std::shared_ptr iface; + configureChipForConcurrencyType(IfaceConcurrencyType::P2P); + EXPECT_TRUE(wifi_chip_->createP2pIface(&iface).isOk()); + EXPECT_NE(nullptr, iface.get()); + return iface; + } + + std::shared_ptr configureChipForApAndGetIface() { + std::shared_ptr iface; + configureChipForConcurrencyType(IfaceConcurrencyType::AP); + EXPECT_TRUE(wifi_chip_->createApIface(&iface).isOk()); + EXPECT_NE(nullptr, iface.get()); + return iface; + } + + std::shared_ptr configureChipForNanAndGetIface() { + std::shared_ptr iface; + configureChipForConcurrencyType(IfaceConcurrencyType::NAN_IFACE); + EXPECT_TRUE(wifi_chip_->createNanIface(&iface).isOk()); + EXPECT_NE(nullptr, iface.get()); + return iface; + } + + std::string getStaIfaceName(const std::shared_ptr& iface) { + std::string iface_name; + EXPECT_TRUE(iface->getName(&iface_name).isOk()); + return iface_name; + } + + std::string getP2pIfaceName(const std::shared_ptr& iface) { + std::string iface_name; + EXPECT_TRUE(iface->getName(&iface_name).isOk()); + return iface_name; + } + + std::string getApIfaceName(const std::shared_ptr& iface) { + std::string iface_name; + EXPECT_TRUE(iface->getName(&iface_name).isOk()); + return iface_name; + } + + std::string getNanIfaceName(const std::shared_ptr& iface) { + std::string iface_name; + EXPECT_TRUE(iface->getName(&iface_name).isOk()); + return iface_name; + } + + std::vector> create2StaIfacesIfPossible() { + std::shared_ptr iface1 = configureChipForStaAndGetIface(); + + // Try create a create second iface. + std::shared_ptr iface2; + bool add_second_success = wifi_chip_->createStaIface(&iface2).isOk(); + if (!add_second_success) { + return {iface1}; + } + EXPECT_NE(nullptr, iface2.get()); + return {iface1, iface2}; + } + + const char* getInstanceName() { return GetParam().c_str(); } + + std::shared_ptr wifi_chip_; +}; + +class WifiChipEventCallback : public BnWifiChipEventCallback { + public: + WifiChipEventCallback() = default; + + ::ndk::ScopedAStatus onChipReconfigureFailure(WifiStatusCode /* status */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onChipReconfigured(int /* modeId */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onDebugErrorAlert(int /* errorCode */, + const std::vector& /* debugData */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onDebugRingBufferDataAvailable( + const WifiDebugRingBufferStatus& /* status */, + const std::vector& /* data */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onIfaceAdded(IfaceType /* type */, + const std::string& /* name */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onIfaceRemoved(IfaceType /* type */, + const std::string& /* name */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onRadioModeChange( + const std::vector& /* radioModeInfos */) override { + return ndk::ScopedAStatus::ok(); + } +}; + +/* + * RegisterEventCallback + * + * Note: it is not feasible to test the invocation of the callback function, + * since events are triggered internally in the HAL implementation and cannot be + * triggered from the test case. + */ +TEST_P(WifiChipAidlTest, RegisterEventCallback) { + std::shared_ptr callback = + ndk::SharedRefBase::make(); + ASSERT_NE(nullptr, callback.get()); + EXPECT_TRUE(wifi_chip_->registerEventCallback(callback).isOk()); +} + +/* + * GetFeatureSet + */ +TEST_P(WifiChipAidlTest, GetFeatureSet) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features; + EXPECT_TRUE(wifi_chip_->getFeatureSet(&features).isOk()); +} + +/* + * GetId + */ +TEST_P(WifiChipAidlTest, GetId) { + int id; + EXPECT_TRUE(wifi_chip_->getId(&id).isOk()); +} + +/* + * GetAvailableModes + */ +TEST_P(WifiChipAidlTest, GetAvailableModes) { + std::vector modes; + EXPECT_TRUE(wifi_chip_->getAvailableModes(&modes).isOk()); + EXPECT_NE(modes.size(), 0); +} + +/* + * GetMode + */ +TEST_P(WifiChipAidlTest, GetMode) { + int expected_mode = configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int retrieved_mode; + EXPECT_TRUE(wifi_chip_->getMode(&retrieved_mode).isOk()); + EXPECT_EQ(retrieved_mode, expected_mode); +} + +/* + * GetUsableChannels + */ +TEST_P(WifiChipAidlTest, GetUsableChannels) { + WifiBand band = WifiBand::BAND_24GHZ_5GHZ_6GHZ; + uint32_t ifaceModeMask = static_cast(WifiIfaceMode::IFACE_MODE_P2P_CLIENT) | + static_cast(WifiIfaceMode::IFACE_MODE_P2P_GO); + uint32_t filterMask = + static_cast(IWifiChip::UsableChannelFilter::CELLULAR_COEXISTENCE) | + static_cast(IWifiChip::UsableChannelFilter::CONCURRENCY); + + std::vector channels; + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + auto status = wifi_chip_->getUsableChannels(band, ifaceModeMask, filterMask, &channels); + if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + GTEST_SKIP() << "getUsableChannels() is not supported by vendor."; + } + EXPECT_TRUE(status.isOk()); +} + +/* + * GetSupportedRadioCombinations + */ +TEST_P(WifiChipAidlTest, GetSupportedRadioCombinations) { + std::vector combinations; + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + auto status = wifi_chip_->getSupportedRadioCombinations(&combinations); + if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + GTEST_SKIP() << "Skipping this test since getSupportedRadioCombinations() " + "is not supported by vendor."; + } + EXPECT_TRUE(status.isOk()); +} + +/* + * SetCountryCode + */ +TEST_P(WifiChipAidlTest, SetCountryCode) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + std::array country_code = {0x55, 0x53}; + EXPECT_TRUE(wifi_chip_->setCountryCode(country_code).isOk()); +} + +/* + * SetLatencyMode_normal + * Tests the setLatencyMode() API with Latency mode NORMAL. + */ +TEST_P(WifiChipAidlTest, SetLatencyMode_normal) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + auto status = wifi_chip_->setLatencyMode(IWifiChip::LatencyMode::NORMAL); + if (features & static_cast(IWifiChip::FeatureSetMask::SET_LATENCY_MODE)) { + EXPECT_TRUE(status.isOk()); + } else { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * SetLatencyMode_low + * Tests the setLatencyMode() API with Latency mode LOW. + */ +TEST_P(WifiChipAidlTest, SetLatencyMode_low) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + auto status = wifi_chip_->setLatencyMode(IWifiChip::LatencyMode::LOW); + if (features & static_cast(IWifiChip::FeatureSetMask::SET_LATENCY_MODE)) { + EXPECT_TRUE(status.isOk()); + } else { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * SetMultiStaPrimaryConnection + * + * Only runs if the device supports 2 STA ifaces. + */ +TEST_P(WifiChipAidlTest, SetMultiStaPrimaryConnection) { + auto ifaces = create2StaIfacesIfPossible(); + if (ifaces.size() < 2) { + GTEST_SKIP() << "Device does not support more than 1 STA concurrently"; + } + + auto status = wifi_chip_->setMultiStaPrimaryConnection(getStaIfaceName(ifaces[0])); + if (!status.isOk()) { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * SetMultiStaUseCase + * + * Only runs if the device supports 2 STA ifaces. + */ +TEST_P(WifiChipAidlTest, setMultiStaUseCase) { + auto ifaces = create2StaIfacesIfPossible(); + if (ifaces.size() < 2) { + GTEST_SKIP() << "Device does not support more than 1 STA concurrently"; + } + + auto status = wifi_chip_->setMultiStaUseCase( + IWifiChip::MultiStaUseCase::DUAL_STA_TRANSIENT_PREFER_PRIMARY); + if (!status.isOk()) { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * SetCoexUnsafeChannels + */ +TEST_P(WifiChipAidlTest, SetCoexUnsafeChannels) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + + // Test with an empty vector of CoexUnsafeChannels. + std::vector vec; + int restrictions = 0; + auto status = wifi_chip_->setCoexUnsafeChannels(vec, restrictions); + if (!status.isOk()) { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } + + // Test with a non-empty vector of CoexUnsafeChannels. + IWifiChip::CoexUnsafeChannel unsafeChannel24Ghz; + unsafeChannel24Ghz.band = WifiBand::BAND_24GHZ; + unsafeChannel24Ghz.channel = 6; + vec.push_back(unsafeChannel24Ghz); + IWifiChip::CoexUnsafeChannel unsafeChannel5Ghz; + unsafeChannel5Ghz.band = WifiBand::BAND_5GHZ; + unsafeChannel5Ghz.channel = 36; + vec.push_back(unsafeChannel5Ghz); + restrictions = static_cast(IWifiChip::CoexRestriction::WIFI_AWARE) | + static_cast(IWifiChip::CoexRestriction::SOFTAP) | + static_cast(IWifiChip::CoexRestriction::WIFI_DIRECT); + + status = wifi_chip_->setCoexUnsafeChannels(vec, restrictions); + if (!status.isOk()) { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * SelectTxPowerScenario - Body + */ +TEST_P(WifiChipAidlTest, SelectTxPowerScenario_body) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + int32_t expected_features = + static_cast(IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT) | + static_cast(IWifiChip::FeatureSetMask::USE_BODY_HEAD_SAR); + auto status = wifi_chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::ON_BODY_CELL_OFF); + if (features & expected_features) { + EXPECT_TRUE(status.isOk()); + } else { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * SelectTxPowerScenario - Voice Call + */ +TEST_P(WifiChipAidlTest, SelectTxPowerScenario_voiceCall) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + auto status = wifi_chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::VOICE_CALL); + if (features & static_cast(IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT)) { + EXPECT_TRUE(status.isOk()); + } else { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * ResetTxPowerScenario + */ +TEST_P(WifiChipAidlTest, ResetTxPowerScenario) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + auto status = wifi_chip_->resetTxPowerScenario(); + if (features & static_cast(IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT)) { + EXPECT_TRUE(status.isOk()); + } else { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/* + * ConfigureChip + */ +TEST_P(WifiChipAidlTest, ConfigureChip) { + std::vector modes; + EXPECT_TRUE(wifi_chip_->getAvailableModes(&modes).isOk()); + EXPECT_NE(modes.size(), 0); + for (const auto& mode : modes) { + // configureChip() requires a fresh IWifiChip object. + wifi_chip_ = getWifiChip(getInstanceName()); + ASSERT_NE(nullptr, wifi_chip_.get()); + EXPECT_TRUE(wifi_chip_->configureChip(mode.id).isOk()); + stopWifiService(getInstanceName()); + // Sleep for 5 milliseconds between each wifi state toggle. + usleep(5000); + } +} + +/* + * RequestChipDebugInfo + */ +TEST_P(WifiChipAidlTest, RequestChipDebugInfo) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + IWifiChip::ChipDebugInfo debug_info = {}; + EXPECT_TRUE(wifi_chip_->requestChipDebugInfo(&debug_info).isOk()); + EXPECT_NE(debug_info.driverDescription.size(), 0); + EXPECT_NE(debug_info.firmwareDescription.size(), 0); +} + +/* + * RequestFirmwareDebugDump + */ +TEST_P(WifiChipAidlTest, RequestFirmwareDebugDump) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + std::vector debug_dump; + auto status = wifi_chip_->requestFirmwareDebugDump(&debug_dump); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); +} + +/* + * RequestDriverDebugDump + */ +TEST_P(WifiChipAidlTest, RequestDriverDebugDump) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + std::vector debug_dump; + auto status = wifi_chip_->requestDriverDebugDump(&debug_dump); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); +} + +/* + * GetDebugRingBuffersStatus + */ +TEST_P(WifiChipAidlTest, GetDebugRingBuffersStatus) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + std::vector ring_buffer_status; + auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + if (status.isOk()) { + ASSERT_NE(ring_buffer_status.size(), 0); + for (const auto& ring_buffer : ring_buffer_status) { + EXPECT_NE(ring_buffer.ringName.size(), 0); + } + } +} + +/* + * GetDebugHostWakeReasonStats + */ +TEST_P(WifiChipAidlTest, GetDebugHostWakeReasonStats) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + WifiDebugHostWakeReasonStats wake_reason_stats = {}; + auto status = wifi_chip_->getDebugHostWakeReasonStats(&wake_reason_stats); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); +} + +/* + * StartLoggingToDebugRingBuffer + */ +TEST_P(WifiChipAidlTest, StartLoggingToDebugRingBuffer) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + std::string ring_name; + std::vector ring_buffer_status; + + auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + if (status.isOk()) { + ASSERT_NE(ring_buffer_status.size(), 0); + ring_name = ring_buffer_status[0].ringName; + } + + status = wifi_chip_->startLoggingToDebugRingBuffer( + ring_name, WifiDebugRingBufferVerboseLevel::VERBOSE, 5, 1024); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); +} + +/* + * ForceDumpToDebugRingBuffer + */ +TEST_P(WifiChipAidlTest, ForceDumpToDebugRingBuffer) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + std::string ring_name; + std::vector ring_buffer_status; + + auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + if (status.isOk()) { + ASSERT_NE(ring_buffer_status.size(), 0); + ring_name = ring_buffer_status[0].ringName; + } + + status = wifi_chip_->forceDumpToDebugRingBuffer(ring_name); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); +} + +/* + * CreateStaIface + * Configures the chip in STA mode and creates an iface. + */ +TEST_P(WifiChipAidlTest, CreateStaIface) { + configureChipForStaAndGetIface(); +} + +/* + * CreateApIface + */ +TEST_P(WifiChipAidlTest, CreateApIface) { + configureChipForApAndGetIface(); +} + +/* + * CreateNanIface + */ +TEST_P(WifiChipAidlTest, CreateNanIface) { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) { + GTEST_SKIP() << "Skipping this test since NAN is not supported."; + } + configureChipForNanAndGetIface(); +} + +/* + * CreateP2pIface + */ +TEST_P(WifiChipAidlTest, CreateP2pIface) { + configureChipForP2pAndGetIface(); +} + +/* + * GetStaIfaceNames + * Configures the chip in STA mode and ensures that the iface name list is + * empty before creating the iface. Then create the iface and ensure that + * iface name is returned in the iface name list. + */ +TEST_P(WifiChipAidlTest, GetStaIfaceNames) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + + std::vector iface_names; + EXPECT_TRUE(wifi_chip_->getP2pIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); + + std::shared_ptr iface; + EXPECT_TRUE(wifi_chip_->createStaIface(&iface).isOk()); + ASSERT_NE(nullptr, iface.get()); + + std::string iface_name = getStaIfaceName(iface); + EXPECT_TRUE(wifi_chip_->getStaIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 1); + EXPECT_EQ(iface_name, iface_names[0]); + + EXPECT_TRUE(wifi_chip_->removeStaIface(iface_name).isOk()); + EXPECT_TRUE(wifi_chip_->getStaIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); +} + +/* + * GetP2pIfaceNames + */ +TEST_P(WifiChipAidlTest, GetP2pIfaceNames) { + configureChipForConcurrencyType(IfaceConcurrencyType::P2P); + + std::vector iface_names; + EXPECT_TRUE(wifi_chip_->getP2pIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); + + std::shared_ptr iface; + EXPECT_TRUE(wifi_chip_->createP2pIface(&iface).isOk()); + ASSERT_NE(nullptr, iface.get()); + + std::string iface_name = getP2pIfaceName(iface); + EXPECT_TRUE(wifi_chip_->getP2pIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 1); + EXPECT_EQ(iface_name, iface_names[0]); + + EXPECT_TRUE(wifi_chip_->removeP2pIface(iface_name).isOk()); + EXPECT_TRUE(wifi_chip_->getP2pIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); +} + +/* + * GetApIfaceNames + */ +TEST_P(WifiChipAidlTest, GetApIfaceNames) { + configureChipForConcurrencyType(IfaceConcurrencyType::AP); + + std::vector iface_names; + EXPECT_TRUE(wifi_chip_->getApIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); + + std::shared_ptr iface; + EXPECT_TRUE(wifi_chip_->createApIface(&iface).isOk()); + ASSERT_NE(nullptr, iface.get()); + + std::string iface_name = getApIfaceName(iface); + EXPECT_TRUE(wifi_chip_->getApIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 1); + EXPECT_EQ(iface_name, iface_names[0]); + + EXPECT_TRUE(wifi_chip_->removeApIface(iface_name).isOk()); + EXPECT_TRUE(wifi_chip_->getApIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); +} + +/* + * GetNanIfaceNames + */ +TEST_P(WifiChipAidlTest, GetNanIfaceNames) { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) { + GTEST_SKIP() << "Skipping this test since NAN is not supported."; + } + configureChipForConcurrencyType(IfaceConcurrencyType::NAN_IFACE); + + std::vector iface_names; + EXPECT_TRUE(wifi_chip_->getNanIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); + + std::shared_ptr iface; + EXPECT_TRUE(wifi_chip_->createNanIface(&iface).isOk()); + ASSERT_NE(nullptr, iface.get()); + + std::string iface_name = getNanIfaceName(iface); + EXPECT_TRUE(wifi_chip_->getNanIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 1); + EXPECT_EQ(iface_name, iface_names[0]); + + EXPECT_TRUE(wifi_chip_->removeNanIface(iface_name).isOk()); + EXPECT_TRUE(wifi_chip_->getNanIfaceNames(&iface_names).isOk()); + EXPECT_EQ(iface_names.size(), 0); +} + +/* + * GetStaIface + * Configures the chip in STA mode and creates an iface. Then retrieves + * the iface object using its name and ensures that any other name + * doesn't retrieve a valid iface object. + */ +TEST_P(WifiChipAidlTest, GetStaIface) { + std::shared_ptr iface = configureChipForStaAndGetIface(); + std::string iface_name = getStaIfaceName(iface); + + std::shared_ptr retrieved_iface; + EXPECT_TRUE(wifi_chip_->getStaIface(iface_name, &retrieved_iface).isOk()); + EXPECT_NE(nullptr, retrieved_iface.get()); + + std::string invalid_name = iface_name + "0"; + std::shared_ptr invalid_iface; + auto status = wifi_chip_->getStaIface(invalid_name, &invalid_iface); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_EQ(nullptr, invalid_iface.get()); +} + +/* + * GetP2pIface + */ +TEST_P(WifiChipAidlTest, GetP2pIface) { + std::shared_ptr iface = configureChipForP2pAndGetIface(); + std::string iface_name = getP2pIfaceName(iface); + + std::shared_ptr retrieved_iface; + EXPECT_TRUE(wifi_chip_->getP2pIface(iface_name, &retrieved_iface).isOk()); + EXPECT_NE(nullptr, retrieved_iface.get()); + + std::string invalid_name = iface_name + "0"; + std::shared_ptr invalid_iface; + auto status = wifi_chip_->getP2pIface(invalid_name, &invalid_iface); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_EQ(nullptr, invalid_iface.get()); +} + +/* + * GetApIface + */ +TEST_P(WifiChipAidlTest, GetApIface) { + std::shared_ptr iface = configureChipForApAndGetIface(); + std::string iface_name = getApIfaceName(iface); + + std::shared_ptr retrieved_iface; + EXPECT_TRUE(wifi_chip_->getApIface(iface_name, &retrieved_iface).isOk()); + EXPECT_NE(nullptr, retrieved_iface.get()); + + std::string invalid_name = iface_name + "0"; + std::shared_ptr invalid_iface; + auto status = wifi_chip_->getApIface(invalid_name, &invalid_iface); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_EQ(nullptr, invalid_iface.get()); +} + +/* + * GetNanIface + */ +TEST_P(WifiChipAidlTest, GetNanIface) { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) { + GTEST_SKIP() << "Skipping this test since NAN is not supported."; + } + std::shared_ptr iface = configureChipForNanAndGetIface(); + std::string iface_name = getNanIfaceName(iface); + + std::shared_ptr retrieved_iface; + EXPECT_TRUE(wifi_chip_->getNanIface(iface_name, &retrieved_iface).isOk()); + EXPECT_NE(nullptr, retrieved_iface.get()); + + std::string invalid_name = iface_name + "0"; + std::shared_ptr invalid_iface; + auto status = wifi_chip_->getNanIface(invalid_name, &invalid_iface); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_EQ(nullptr, invalid_iface.get()); +} + +/* + * RemoveStaIface + * Configures the chip in STA mode and creates an iface. Then removes + * the iface object using the correct name and ensures that any other + * name doesn't remove the iface. + */ +TEST_P(WifiChipAidlTest, RemoveStaIface) { + std::shared_ptr iface = configureChipForStaAndGetIface(); + std::string iface_name = getStaIfaceName(iface); + + std::string invalid_name = iface_name + "0"; + auto status = wifi_chip_->removeStaIface(invalid_name); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_TRUE(wifi_chip_->removeStaIface(iface_name).isOk()); + + // No such iface exists now, so this should return failure. + EXPECT_FALSE(wifi_chip_->removeStaIface(iface_name).isOk()); +} + +/* + * RemoveP2pIface + */ +TEST_P(WifiChipAidlTest, RemoveP2pIface) { + std::shared_ptr iface = configureChipForP2pAndGetIface(); + std::string iface_name = getP2pIfaceName(iface); + + std::string invalid_name = iface_name + "0"; + auto status = wifi_chip_->removeP2pIface(invalid_name); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_TRUE(wifi_chip_->removeP2pIface(iface_name).isOk()); + + // No such iface exists now, so this should return failure. + EXPECT_FALSE(wifi_chip_->removeP2pIface(iface_name).isOk()); +} + +/* + * RemoveApIface + */ +TEST_P(WifiChipAidlTest, RemoveApIface) { + std::shared_ptr iface = configureChipForApAndGetIface(); + std::string iface_name = getApIfaceName(iface); + + std::string invalid_name = iface_name + "0"; + auto status = wifi_chip_->removeApIface(invalid_name); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_TRUE(wifi_chip_->removeApIface(iface_name).isOk()); + + // No such iface exists now, so this should return failure. + EXPECT_FALSE(wifi_chip_->removeApIface(iface_name).isOk()); +} + +/* + * RemoveNanIface + */ +TEST_P(WifiChipAidlTest, RemoveNanIface) { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) { + GTEST_SKIP() << "Skipping this test since NAN is not supported."; + } + std::shared_ptr iface = configureChipForNanAndGetIface(); + std::string iface_name = getNanIfaceName(iface); + + std::string invalid_name = iface_name + "0"; + auto status = wifi_chip_->removeNanIface(invalid_name); + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + EXPECT_TRUE(wifi_chip_->removeNanIface(iface_name).isOk()); + + // No such iface exists now, so this should return failure. + EXPECT_FALSE(wifi_chip_->removeNanIface(iface_name).isOk()); +} + +/* + * CreateRttController + */ +TEST_P(WifiChipAidlTest, CreateRttController) { + std::shared_ptr iface = configureChipForStaAndGetIface(); + std::shared_ptr rtt_controller; + auto status = wifi_chip_->createRttController(iface, &rtt_controller); + if (status.isOk()) { + EXPECT_NE(nullptr, rtt_controller.get()); + } else { + EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + } +} + +/** + * CreateBridgedApIface & RemoveIfaceInstanceFromBridgedApIface + */ +TEST_P(WifiChipAidlTest, CreateBridgedApIfaceAndremoveIfaceInstanceFromBridgedApIfaceTest) { + bool isBridgedSupport = testing::checkSubstringInCommandOutput( + "/system/bin/cmd wifi get-softap-supported-features", + "wifi_softap_bridged_ap_supported"); + if (!isBridgedSupport) { + GTEST_SKIP() << "Missing Bridged AP support"; + } + + std::shared_ptr wifi_chip = getWifiChip(getInstanceName()); + ASSERT_NE(nullptr, wifi_chip.get()); + std::shared_ptr wifi_ap_iface = getBridgedWifiApIface(wifi_chip); + ASSERT_NE(nullptr, wifi_ap_iface.get()); + + std::string br_name; + std::vector instances; + EXPECT_TRUE(wifi_ap_iface->getName(&br_name).isOk()); + EXPECT_TRUE(wifi_ap_iface->getBridgedInstances(&instances).isOk()); + EXPECT_EQ(instances.size(), 2); + + std::vector instances_after_remove; + EXPECT_TRUE(wifi_chip->removeIfaceInstanceFromBridgedApIface(br_name, instances[0]).isOk()); + EXPECT_TRUE(wifi_ap_iface->getBridgedInstances(&instances_after_remove).isOk()); + EXPECT_EQ(instances_after_remove.size(), 1); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipAidlTest); +INSTANTIATE_TEST_SUITE_P(WifiTest, WifiChipAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + android::ProcessState::self()->setThreadPoolMaxThreadCount(1); + android::ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp new file mode 100644 index 0000000000..bebad7ca08 --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp @@ -0,0 +1,740 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_aidl_test_utils.h" + +using aidl::android::hardware::wifi::BnWifiNanIfaceEventCallback; +using aidl::android::hardware::wifi::IWifiNanIface; +using aidl::android::hardware::wifi::NanBandIndex; +using aidl::android::hardware::wifi::NanBandSpecificConfig; +using aidl::android::hardware::wifi::NanBootstrappingConfirmInd; +using aidl::android::hardware::wifi::NanBootstrappingRequestInd; +using aidl::android::hardware::wifi::NanCapabilities; +using aidl::android::hardware::wifi::NanClusterEventInd; +using aidl::android::hardware::wifi::NanConfigRequest; +using aidl::android::hardware::wifi::NanConfigRequestSupplemental; +using aidl::android::hardware::wifi::NanDataPathConfirmInd; +using aidl::android::hardware::wifi::NanDataPathRequestInd; +using aidl::android::hardware::wifi::NanDataPathScheduleUpdateInd; +using aidl::android::hardware::wifi::NanDataPathSecurityType; +using aidl::android::hardware::wifi::NanEnableRequest; +using aidl::android::hardware::wifi::NanFollowupReceivedInd; +using aidl::android::hardware::wifi::NanInitiateDataPathRequest; +using aidl::android::hardware::wifi::NanMatchAlg; +using aidl::android::hardware::wifi::NanMatchInd; +using aidl::android::hardware::wifi::NanPairingConfirmInd; +using aidl::android::hardware::wifi::NanPairingRequestInd; +using aidl::android::hardware::wifi::NanPublishRequest; +using aidl::android::hardware::wifi::NanPublishType; +using aidl::android::hardware::wifi::NanRespondToDataPathIndicationRequest; +using aidl::android::hardware::wifi::NanStatus; +using aidl::android::hardware::wifi::NanStatusCode; +using aidl::android::hardware::wifi::NanSuspensionModeChangeInd; +using aidl::android::hardware::wifi::NanTxType; + +#define TIMEOUT_PERIOD 10 + +class WifiNanIfaceAidlTest : public testing::TestWithParam { + public: + void SetUp() override { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) + GTEST_SKIP() << "Skipping this test since NAN is not supported."; + stopWifiService(getInstanceName()); + + wifi_nan_iface_ = getWifiNanIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_nan_iface_.get()); + std::shared_ptr callback = + ndk::SharedRefBase::make(*this); + EXPECT_TRUE(wifi_nan_iface_->registerEventCallback(callback).isOk()); + } + + void TearDown() override { stopWifiService(getInstanceName()); } + + // Used as a mechanism to inform the test about data/event callbacks. + inline void notify() { + std::unique_lock lock(mtx_); + count_++; + cv_.notify_one(); + } + + enum CallbackType { + INVALID = -2, + ANY_CALLBACK = -1, + + NOTIFY_CAPABILITIES_RESPONSE = 0, + NOTIFY_ENABLE_RESPONSE, + NOTIFY_CONFIG_RESPONSE, + NOTIFY_DISABLE_RESPONSE, + NOTIFY_START_PUBLISH_RESPONSE, + NOTIFY_STOP_PUBLISH_RESPONSE, + NOTIFY_START_SUBSCRIBE_RESPONSE, + NOTIFY_STOP_SUBSCRIBE_RESPONSE, + NOTIFY_TRANSMIT_FOLLOWUP_RESPONSE, + NOTIFY_CREATE_DATA_INTERFACE_RESPONSE, + NOTIFY_DELETE_DATA_INTERFACE_RESPONSE, + NOTIFY_INITIATE_DATA_PATH_RESPONSE, + NOTIFY_RESPOND_TO_DATA_PATH_INDICATION_RESPONSE, + NOTIFY_TERMINATE_DATA_PATH_RESPONSE, + NOTIFY_INITIATE_PAIRING_RESPONSE, + NOTIFY_RESPOND_TO_PAIRING_INDICATION_RESPONSE, + NOTIFY_INITIATE_BOOTSTRAPPING_RESPONSE, + NOTIFY_RESPOND_TO_BOOTSTRAPPING_INDICATION_RESPONSE, + NOTIFY_SUSPEND_RESPONSE, + NOTIFY_RESUME_RESPONSE, + NOTIFY_TERMINATE_PAIRING_RESPONSE, + + EVENT_CLUSTER_EVENT, + EVENT_DISABLED, + EVENT_PUBLISH_TERMINATED, + EVENT_SUBSCRIBE_TERMINATED, + EVENT_MATCH, + EVENT_MATCH_EXPIRED, + EVENT_FOLLOWUP_RECEIVED, + EVENT_TRANSMIT_FOLLOWUP, + EVENT_DATA_PATH_REQUEST, + EVENT_DATA_PATH_CONFIRM, + EVENT_DATA_PATH_TERMINATED, + EVENT_DATA_PATH_SCHEDULE_UPDATE, + EVENT_PAIRING_REQUEST, + EVENT_PAIRING_CONFIRM, + EVENT_BOOTSTRAPPING_REQUEST, + EVENT_BOOTSTRAPPING_CONFIRM, + EVENT_SUSPENSION_MODE_CHANGE, + }; + + // Test code calls this function to wait for data/event callback. + // Must set callbackType = INVALID before calling this function. + inline std::cv_status wait(CallbackType waitForCallbackType) { + std::unique_lock lock(mtx_); + EXPECT_NE(INVALID, waitForCallbackType); + + std::cv_status status = std::cv_status::no_timeout; + auto now = std::chrono::system_clock::now(); + while (count_ == 0) { + status = cv_.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); + if (status == std::cv_status::timeout) return status; + if (waitForCallbackType != ANY_CALLBACK && callback_type_ != INVALID && + callback_type_ != waitForCallbackType) { + count_--; + } + } + count_--; + return status; + } + + class WifiNanIfaceEventCallback : public BnWifiNanIfaceEventCallback { + public: + WifiNanIfaceEventCallback(WifiNanIfaceAidlTest& parent) : parent_(parent){}; + + ::ndk::ScopedAStatus eventClusterEvent(const NanClusterEventInd& event) override { + parent_.callback_type_ = EVENT_CLUSTER_EVENT; + parent_.nan_cluster_event_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventDataPathConfirm(const NanDataPathConfirmInd& event) override { + parent_.callback_type_ = EVENT_DATA_PATH_CONFIRM; + parent_.nan_data_path_confirm_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventDataPathRequest(const NanDataPathRequestInd& event) override { + parent_.callback_type_ = EVENT_DATA_PATH_REQUEST; + parent_.nan_data_path_request_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventDataPathScheduleUpdate( + const NanDataPathScheduleUpdateInd& event) override { + parent_.callback_type_ = EVENT_DATA_PATH_SCHEDULE_UPDATE; + parent_.nan_data_path_schedule_update_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventDataPathTerminated(int32_t ndpInstanceId) override { + parent_.callback_type_ = EVENT_DATA_PATH_TERMINATED; + parent_.ndp_instance_id_ = ndpInstanceId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventDisabled(const NanStatus& status) override { + parent_.callback_type_ = EVENT_DISABLED; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventFollowupReceived(const NanFollowupReceivedInd& event) override { + parent_.callback_type_ = EVENT_FOLLOWUP_RECEIVED; + parent_.nan_followup_received_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventMatch(const NanMatchInd& event) override { + parent_.callback_type_ = EVENT_MATCH; + parent_.nan_match_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventMatchExpired(int8_t discoverySessionId, int32_t peerId) override { + parent_.callback_type_ = EVENT_MATCH_EXPIRED; + parent_.session_id_ = discoverySessionId; + parent_.peer_id_ = peerId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventPublishTerminated(int8_t sessionId, + const NanStatus& status) override { + parent_.callback_type_ = EVENT_PUBLISH_TERMINATED; + parent_.session_id_ = sessionId; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventSubscribeTerminated(int8_t sessionId, + const NanStatus& status) override { + parent_.callback_type_ = EVENT_SUBSCRIBE_TERMINATED; + parent_.session_id_ = sessionId; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventTransmitFollowup(char16_t id, const NanStatus& status) override { + parent_.callback_type_ = EVENT_TRANSMIT_FOLLOWUP; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventPairingConfirm(const NanPairingConfirmInd& event) override { + parent_.callback_type_ = EVENT_PAIRING_CONFIRM; + parent_.nan_pairing_confirm_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventPairingRequest(const NanPairingRequestInd& event) override { + parent_.callback_type_ = EVENT_PAIRING_REQUEST; + parent_.nan_pairing_request_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventBootstrappingConfirm( + const NanBootstrappingConfirmInd& event) override { + parent_.callback_type_ = EVENT_BOOTSTRAPPING_CONFIRM; + parent_.nan_bootstrapping_confirm_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventBootstrappingRequest( + const NanBootstrappingRequestInd& event) override { + parent_.callback_type_ = EVENT_BOOTSTRAPPING_REQUEST; + parent_.nan_bootstrapping_request_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus eventSuspensionModeChanged( + const NanSuspensionModeChangeInd& event) override { + parent_.callback_type_ = EVENT_SUSPENSION_MODE_CHANGE; + parent_.nan_suspension_mode_change_ind_ = event; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyCapabilitiesResponse( + char16_t id, const NanStatus& status, + const NanCapabilities& capabilities) override { + parent_.callback_type_ = NOTIFY_CAPABILITIES_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.capabilities_ = capabilities; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyConfigResponse(char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_CONFIG_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyCreateDataInterfaceResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_CREATE_DATA_INTERFACE_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyDeleteDataInterfaceResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_DELETE_DATA_INTERFACE_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyDisableResponse(char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_DISABLE_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyEnableResponse(char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_ENABLE_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyInitiateDataPathResponse(char16_t id, const NanStatus& status, + int32_t ndpInstanceId) override { + parent_.callback_type_ = NOTIFY_INITIATE_DATA_PATH_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.ndp_instance_id_ = ndpInstanceId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyRespondToDataPathIndicationResponse( + char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_RESPOND_TO_DATA_PATH_INDICATION_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyStartPublishResponse(char16_t id, const NanStatus& status, + int8_t sessionId) override { + parent_.callback_type_ = NOTIFY_START_PUBLISH_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.session_id_ = sessionId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyStartSubscribeResponse(char16_t id, const NanStatus& status, + int8_t sessionId) override { + parent_.callback_type_ = NOTIFY_START_SUBSCRIBE_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.session_id_ = sessionId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyStopPublishResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_STOP_PUBLISH_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyStopSubscribeResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_STOP_SUBSCRIBE_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyTerminateDataPathResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_TERMINATE_DATA_PATH_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifySuspendResponse(char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_SUSPEND_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyResumeResponse(char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_RESUME_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyTransmitFollowupResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_TRANSMIT_FOLLOWUP_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyInitiatePairingResponse(char16_t id, const NanStatus& status, + int32_t pairingInstanceId) override { + parent_.callback_type_ = NOTIFY_INITIATE_PAIRING_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.pairing_instance_id_ = pairingInstanceId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyRespondToPairingIndicationResponse( + char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_RESPOND_TO_PAIRING_INDICATION_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyInitiateBootstrappingResponse( + char16_t id, const NanStatus& status, int32_t bootstrapppingInstanceId) override { + parent_.callback_type_ = NOTIFY_INITIATE_BOOTSTRAPPING_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.bootstrappping_instance_id_ = bootstrapppingInstanceId; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyRespondToBootstrappingIndicationResponse( + char16_t id, const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_RESPOND_TO_BOOTSTRAPPING_INDICATION_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus notifyTerminatePairingResponse(char16_t id, + const NanStatus& status) override { + parent_.callback_type_ = NOTIFY_TERMINATE_PAIRING_RESPONSE; + parent_.id_ = id; + parent_.status_ = status; + parent_.notify(); + return ndk::ScopedAStatus::ok(); + } + + private: + WifiNanIfaceAidlTest& parent_; + }; + + protected: + std::shared_ptr wifi_nan_iface_; + CallbackType callback_type_; + uint16_t id_; + uint8_t session_id_; + uint32_t ndp_instance_id_; + uint32_t pairing_instance_id_; + uint32_t bootstrappping_instance_id_; + uint32_t peer_id_; + NanCapabilities capabilities_; + NanClusterEventInd nan_cluster_event_ind_; + NanDataPathConfirmInd nan_data_path_confirm_ind_; + NanDataPathRequestInd nan_data_path_request_ind_; + NanDataPathScheduleUpdateInd nan_data_path_schedule_update_ind_; + NanFollowupReceivedInd nan_followup_received_ind_; + NanMatchInd nan_match_ind_; + NanStatus status_; + NanPairingRequestInd nan_pairing_request_ind_; + NanPairingConfirmInd nan_pairing_confirm_ind_; + NanBootstrappingRequestInd nan_bootstrapping_request_ind_; + NanBootstrappingConfirmInd nan_bootstrapping_confirm_ind_; + NanSuspensionModeChangeInd nan_suspension_mode_change_ind_; + + const char* getInstanceName() { return GetParam().c_str(); } + + private: + // synchronization objects + std::mutex mtx_; + std::condition_variable cv_; + int count_ = 0; +}; + +/* + * FailOnIfaceInvalid + * Ensure that API calls to an interface fail with code ERROR_WIFI_IFACE_INVALID + * after wifi is disabled. + */ +TEST_P(WifiNanIfaceAidlTest, FailOnIfaceInvalid) { + stopWifiService(getInstanceName()); + sleep(5); // Ensure that all chips/interfaces are invalidated. + auto status = wifi_nan_iface_->getCapabilitiesRequest(0); + ASSERT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_WIFI_IFACE_INVALID)); +} + +/* + * EnableRequest - Invalid Args + */ +TEST_P(WifiNanIfaceAidlTest, EnableRequest_InvalidArgs) { + uint16_t inputCmdId = 10; + callback_type_ = INVALID; + NanEnableRequest nanEnableRequest = {}; + NanConfigRequestSupplemental nanConfigRequestSupp = {}; + auto status = + wifi_nan_iface_->enableRequest(inputCmdId, nanEnableRequest, nanConfigRequestSupp); + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_TRUE(status.isOk()); + + // Wait for a callback. + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_ENABLE_RESPONSE)); + ASSERT_EQ(NOTIFY_ENABLE_RESPONSE, callback_type_); + ASSERT_EQ(id_, inputCmdId); + ASSERT_EQ(status_.status, NanStatusCode::INVALID_ARGS); + } +} + +/* + * ConfigRequest - Invalid Args + */ +TEST_P(WifiNanIfaceAidlTest, ConfigRequest_InvalidArgs) { + uint16_t inputCmdId = 10; + callback_type_ = INVALID; + NanConfigRequest nanConfigRequest = {}; + NanConfigRequestSupplemental nanConfigRequestSupp = {}; + auto status = + wifi_nan_iface_->configRequest(inputCmdId, nanConfigRequest, nanConfigRequestSupp); + + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_TRUE(status.isOk()); + + // Wait for a callback. + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_CONFIG_RESPONSE)); + ASSERT_EQ(NOTIFY_CONFIG_RESPONSE, callback_type_); + ASSERT_EQ(id_, inputCmdId); + ASSERT_EQ(status_.status, NanStatusCode::INVALID_ARGS); + } +} + +/* + * EnableRequest - Invalid Args in Shim Conversion + */ +TEST_P(WifiNanIfaceAidlTest, EnableRequest_InvalidShimArgs) { + uint16_t inputCmdId = 10; + NanEnableRequest nanEnableRequest = {}; + nanEnableRequest.configParams.numberOfPublishServiceIdsInBeacon = -15; // must be > 0 + NanConfigRequestSupplemental nanConfigRequestSupp = {}; + auto status = + wifi_nan_iface_->enableRequest(inputCmdId, nanEnableRequest, nanConfigRequestSupp); + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + } +} + +/* + * ConfigRequest - Invalid Args in Shim Conversion + */ +TEST_P(WifiNanIfaceAidlTest, ConfigRequest_InvalidShimArgs) { + uint16_t inputCmdId = 10; + NanConfigRequest nanConfigRequest = {}; + nanConfigRequest.numberOfPublishServiceIdsInBeacon = -15; // must be > 0 + NanConfigRequestSupplemental nanConfigRequestSupp = {}; + auto status = + wifi_nan_iface_->configRequest(inputCmdId, nanConfigRequest, nanConfigRequestSupp); + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_INVALID_ARGS)); + } +} + +/* + * NotifyCapabilitiesResponse + */ +TEST_P(WifiNanIfaceAidlTest, NotifyCapabilitiesResponse) { + uint16_t inputCmdId = 10; + callback_type_ = INVALID; + EXPECT_TRUE(wifi_nan_iface_->getCapabilitiesRequest(inputCmdId).isOk()); + + // Wait for a callback. + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_CAPABILITIES_RESPONSE)); + ASSERT_EQ(NOTIFY_CAPABILITIES_RESPONSE, callback_type_); + ASSERT_EQ(id_, inputCmdId); + ASSERT_EQ(status_.status, NanStatusCode::SUCCESS); + + // Check for reasonable capability values. + EXPECT_GT(capabilities_.maxConcurrentClusters, 0); + EXPECT_GT(capabilities_.maxPublishes, 0); + EXPECT_GT(capabilities_.maxSubscribes, 0); + EXPECT_EQ(capabilities_.maxServiceNameLen, 255); + EXPECT_EQ(capabilities_.maxMatchFilterLen, 255); + EXPECT_GT(capabilities_.maxTotalMatchFilterLen, 255); + EXPECT_EQ(capabilities_.maxServiceSpecificInfoLen, 255); + EXPECT_GE(capabilities_.maxExtendedServiceSpecificInfoLen, 255); + EXPECT_GT(capabilities_.maxNdiInterfaces, 0); + EXPECT_GT(capabilities_.maxNdpSessions, 0); + EXPECT_GT(capabilities_.maxAppInfoLen, 0); + EXPECT_GT(capabilities_.maxQueuedTransmitFollowupMsgs, 0); + EXPECT_GT(capabilities_.maxSubscribeInterfaceAddresses, 0); + EXPECT_NE(static_cast(capabilities_.supportedCipherSuites), 0); +} + +/* + * StartPublishRequest + */ +TEST_P(WifiNanIfaceAidlTest, StartPublishRequest) { + uint16_t inputCmdId = 10; + NanBandSpecificConfig config24 = {}; + config24.rssiClose = 60; + config24.rssiMiddle = 70; + config24.rssiCloseProximity = 60; + config24.dwellTimeMs = 200; + config24.scanPeriodSec = 20; + config24.validDiscoveryWindowIntervalVal = false; + config24.discoveryWindowIntervalVal = 0; + + NanBandSpecificConfig config5 = {}; + config5.rssiClose = 60; + config5.rssiMiddle = 75; + config5.rssiCloseProximity = 60; + config5.dwellTimeMs = 200; + config5.scanPeriodSec = 20; + config5.validDiscoveryWindowIntervalVal = false; + config5.discoveryWindowIntervalVal = 0; + + NanEnableRequest req = {}; + req.operateInBand[static_cast(NanBandIndex::NAN_BAND_24GHZ)] = true; + req.operateInBand[static_cast(NanBandIndex::NAN_BAND_5GHZ)] = false; + req.hopCountMax = 2; + req.configParams.masterPref = 0; + req.configParams.disableDiscoveryAddressChangeIndication = true; + req.configParams.disableStartedClusterIndication = true; + req.configParams.disableJoinedClusterIndication = true; + req.configParams.includePublishServiceIdsInBeacon = true; + req.configParams.numberOfPublishServiceIdsInBeacon = 0; + req.configParams.includeSubscribeServiceIdsInBeacon = true; + req.configParams.numberOfSubscribeServiceIdsInBeacon = 0; + req.configParams.rssiWindowSize = 8; + req.configParams.macAddressRandomizationIntervalSec = 1800; + req.configParams.bandSpecificConfig[static_cast(NanBandIndex::NAN_BAND_24GHZ)] = + config24; + req.configParams.bandSpecificConfig[static_cast(NanBandIndex::NAN_BAND_5GHZ)] = + config5; + + req.debugConfigs.validClusterIdVals = true; + req.debugConfigs.clusterIdTopRangeVal = 65535; + req.debugConfigs.clusterIdBottomRangeVal = 0; + req.debugConfigs.validIntfAddrVal = false; + req.debugConfigs.validOuiVal = false; + req.debugConfigs.ouiVal = 0; + req.debugConfigs.validRandomFactorForceVal = false; + req.debugConfigs.randomFactorForceVal = 0; + req.debugConfigs.validHopCountForceVal = false; + req.debugConfigs.hopCountForceVal = 0; + req.debugConfigs.validDiscoveryChannelVal = false; + req.debugConfigs.discoveryChannelMhzVal[static_cast(NanBandIndex::NAN_BAND_24GHZ)] = 0; + req.debugConfigs.discoveryChannelMhzVal[static_cast(NanBandIndex::NAN_BAND_5GHZ)] = 0; + req.debugConfigs.validUseBeaconsInBandVal = false; + req.debugConfigs.useBeaconsInBandVal[static_cast(NanBandIndex::NAN_BAND_24GHZ)] = true; + req.debugConfigs.useBeaconsInBandVal[static_cast(NanBandIndex::NAN_BAND_5GHZ)] = true; + req.debugConfigs.validUseSdfInBandVal = false; + req.debugConfigs.useSdfInBandVal[static_cast(NanBandIndex::NAN_BAND_24GHZ)] = true; + req.debugConfigs.useSdfInBandVal[static_cast(NanBandIndex::NAN_BAND_5GHZ)] = true; + + NanConfigRequestSupplemental nanConfigRequestSupp = {}; + nanConfigRequestSupp.discoveryBeaconIntervalMs = 20; + nanConfigRequestSupp.numberOfSpatialStreamsInDiscovery = 0; + nanConfigRequestSupp.enableDiscoveryWindowEarlyTermination = false; + + callback_type_ = INVALID; + auto status = wifi_nan_iface_->enableRequest(inputCmdId, req, nanConfigRequestSupp); + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_TRUE(status.isOk()); + + // Wait for a callback. + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_ENABLE_RESPONSE)); + ASSERT_EQ(NOTIFY_ENABLE_RESPONSE, callback_type_); + ASSERT_EQ(id_, inputCmdId); + ASSERT_EQ(status_.status, NanStatusCode::SUCCESS); + } + + NanPublishRequest nanPublishRequest = {}; + nanPublishRequest.baseConfigs.sessionId = 0; + nanPublishRequest.baseConfigs.ttlSec = 0; + nanPublishRequest.baseConfigs.discoveryWindowPeriod = 1; + nanPublishRequest.baseConfigs.discoveryCount = 0; + nanPublishRequest.baseConfigs.serviceName = {97}; + nanPublishRequest.baseConfigs.discoveryMatchIndicator = NanMatchAlg::MATCH_NEVER; + nanPublishRequest.baseConfigs.useRssiThreshold = false; + nanPublishRequest.baseConfigs.disableDiscoveryTerminationIndication = false; + nanPublishRequest.baseConfigs.disableMatchExpirationIndication = true; + nanPublishRequest.baseConfigs.disableFollowupReceivedIndication = false; + nanPublishRequest.baseConfigs.securityConfig.securityType = NanDataPathSecurityType::OPEN; + nanPublishRequest.autoAcceptDataPathRequests = false; + nanPublishRequest.publishType = NanPublishType::UNSOLICITED; + nanPublishRequest.txType = NanTxType::BROADCAST; + + status = wifi_nan_iface_->startPublishRequest(inputCmdId + 1, nanPublishRequest); + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_TRUE(status.isOk()); + + // Wait for a callback. + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_START_PUBLISH_RESPONSE)); + ASSERT_EQ(NOTIFY_START_PUBLISH_RESPONSE, callback_type_); + ASSERT_EQ(id_, inputCmdId + 1); + ASSERT_EQ(status_.status, NanStatusCode::SUCCESS); + } +} + +/* + * RespondToDataPathIndicationRequest - Invalid Args + */ +TEST_P(WifiNanIfaceAidlTest, RespondToDataPathIndicationRequest_InvalidArgs) { + uint16_t inputCmdId = 10; + callback_type_ = INVALID; + NanRespondToDataPathIndicationRequest nanRespondToDataPathIndicationRequest = {}; + nanRespondToDataPathIndicationRequest.ifaceName = "AwareInterfaceNameTooLong"; + auto status = wifi_nan_iface_->respondToDataPathIndicationRequest( + inputCmdId, nanRespondToDataPathIndicationRequest); + + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_EQ(status.getServiceSpecificError(), + static_cast(WifiStatusCode::ERROR_INVALID_ARGS)); + } +} + +/* + * InitiateDataPathRequest - Invalid Args + */ +TEST_P(WifiNanIfaceAidlTest, InitiateDataPathRequest_InvalidArgs) { + uint16_t inputCmdId = 10; + callback_type_ = INVALID; + NanInitiateDataPathRequest nanInitiateDataPathRequest = {}; + nanInitiateDataPathRequest.ifaceName = "AwareInterfaceNameTooLong"; + auto status = wifi_nan_iface_->initiateDataPathRequest(inputCmdId, nanInitiateDataPathRequest); + + if (!checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + ASSERT_EQ(status.getServiceSpecificError(), + static_cast(WifiStatusCode::ERROR_INVALID_ARGS)); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiNanIfaceAidlTest); +INSTANTIATE_TEST_SUITE_P(WifiTest, WifiNanIfaceAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + android::ProcessState::self()->setThreadPoolMaxThreadCount(1); + android::ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/wifi/aidl/vts/functional/wifi_rtt_controller_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_rtt_controller_aidl_test.cpp new file mode 100644 index 0000000000..4aedc0ef6f --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_rtt_controller_aidl_test.cpp @@ -0,0 +1,248 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_aidl_test_utils.h" + +using aidl::android::hardware::wifi::BnWifiRttControllerEventCallback; +using aidl::android::hardware::wifi::IWifiRttController; +using aidl::android::hardware::wifi::RttBw; +using aidl::android::hardware::wifi::RttCapabilities; +using aidl::android::hardware::wifi::RttConfig; +using aidl::android::hardware::wifi::RttPeerType; +using aidl::android::hardware::wifi::RttPreamble; +using aidl::android::hardware::wifi::RttResponder; +using aidl::android::hardware::wifi::RttResult; +using aidl::android::hardware::wifi::RttType; +using aidl::android::hardware::wifi::WifiChannelInfo; +using aidl::android::hardware::wifi::WifiChannelWidthInMhz; +using aidl::android::hardware::wifi::WifiStatusCode; + +class WifiRttControllerAidlTest : public testing::TestWithParam { + public: + void SetUp() override { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.rtt")) + GTEST_SKIP() << "Skipping this test since RTT is not supported."; + stopWifiService(getInstanceName()); + wifi_rtt_controller_ = getWifiRttController(); + ASSERT_NE(nullptr, wifi_rtt_controller_.get()); + + // Check RTT support before we run the test. + RttCapabilities caps = {}; + auto status = wifi_rtt_controller_->getCapabilities(&caps); + if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) { + GTEST_SKIP() << "Skipping this test since RTT is not supported."; + } + } + + void TearDown() override { stopWifiService(getInstanceName()); } + + protected: + std::shared_ptr getWifiRttController() { + std::shared_ptr wifi_chip = getWifiChip(getInstanceName()); + EXPECT_NE(nullptr, wifi_chip.get()); + + std::shared_ptr wifi_sta_iface = getWifiStaIface(getInstanceName()); + EXPECT_NE(nullptr, wifi_sta_iface.get()); + + std::shared_ptr rtt_controller; + EXPECT_TRUE(wifi_chip->createRttController(wifi_sta_iface, &rtt_controller).isOk()); + EXPECT_NE(nullptr, rtt_controller.get()); + return rtt_controller; + } + + RttCapabilities getCapabilities() { + RttCapabilities caps = {}; + EXPECT_TRUE(wifi_rtt_controller_->getCapabilities(&caps).isOk()); + return caps; + } + + std::shared_ptr wifi_rtt_controller_; + + private: + const char* getInstanceName() { return GetParam().c_str(); } +}; + +class WifiRttControllerEventCallback : public BnWifiRttControllerEventCallback { + public: + WifiRttControllerEventCallback() = default; + + ::ndk::ScopedAStatus onResults(int /* cmdId */, + const std::vector& /* results */) override { + return ndk::ScopedAStatus::ok(); + } +}; + +/* + * RegisterEventCallback + * + * Note: it is not feasible to test the invocation of the callback function, + * since events are triggered internally in the HAL implementation and cannot be + * triggered from the test case. + */ +TEST_P(WifiRttControllerAidlTest, RegisterEventCallback) { + std::shared_ptr callback = + ndk::SharedRefBase::make(); + ASSERT_NE(nullptr, callback.get()); + EXPECT_TRUE(wifi_rtt_controller_->registerEventCallback(callback).isOk()); +} + +/* + * GetCapabilities + */ +TEST_P(WifiRttControllerAidlTest, GetCapabilities) { + RttCapabilities caps = {}; + EXPECT_TRUE(wifi_rtt_controller_->getCapabilities(&caps).isOk()); +} + +/* + * GetResponderInfo + */ +TEST_P(WifiRttControllerAidlTest, GetResponderInfo) { + RttCapabilities caps = getCapabilities(); + if (!caps.responderSupported) { + GTEST_SKIP() << "Skipping because responder is not supported"; + } + + RttResponder responder = {}; + EXPECT_TRUE(wifi_rtt_controller_->getResponderInfo(&responder).isOk()); +} + +/* + * EnableResponder + */ +TEST_P(WifiRttControllerAidlTest, EnableResponder) { + RttCapabilities caps = getCapabilities(); + if (!caps.responderSupported) { + GTEST_SKIP() << "Skipping because responder is not supported"; + } + + int cmdId = 55; + WifiChannelInfo channelInfo; + channelInfo.width = WifiChannelWidthInMhz::WIDTH_80; + channelInfo.centerFreq = 5660; + channelInfo.centerFreq0 = 5660; + channelInfo.centerFreq1 = 0; + + RttResponder responder = {}; + EXPECT_TRUE(wifi_rtt_controller_->getResponderInfo(&responder).isOk()); + EXPECT_TRUE(wifi_rtt_controller_->enableResponder(cmdId, channelInfo, 10, responder).isOk()); +} + +/* + * Request2SidedRangeMeasurement + * Tests the two sided ranging - 802.11mc FTM protocol. + */ +TEST_P(WifiRttControllerAidlTest, Request2SidedRangeMeasurement) { + RttCapabilities caps = getCapabilities(); + if (!caps.rttFtmSupported) { + GTEST_SKIP() << "Skipping two sided RTT since driver/fw does not support"; + } + + RttConfig config; + config.addr = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05}}; + config.type = RttType::TWO_SIDED; + config.peer = RttPeerType::AP; + config.channel.width = WifiChannelWidthInMhz::WIDTH_80; + config.channel.centerFreq = 5180; + config.channel.centerFreq0 = 5210; + config.channel.centerFreq1 = 0; + config.bw = RttBw::BW_20MHZ; + config.preamble = RttPreamble::HT; + config.mustRequestLci = false; + config.mustRequestLcr = false; + config.burstPeriod = 0; + config.numBurst = 0; + config.numFramesPerBurst = 8; + config.numRetriesPerRttFrame = 0; + config.numRetriesPerFtmr = 0; + config.burstDuration = 9; + + int cmdId = 55; + std::vector configs = {config}; + EXPECT_TRUE(wifi_rtt_controller_->rangeRequest(cmdId, configs).isOk()); + + // Sleep for 2 seconds to wait for driver/firmware to complete RTT. + sleep(2); +} + +/* + * RangeRequest + */ +TEST_P(WifiRttControllerAidlTest, RangeRequest) { + RttCapabilities caps = getCapabilities(); + if (!caps.rttOneSidedSupported) { + GTEST_SKIP() << "Skipping one sided RTT since driver/fw does not support"; + } + + // Get the highest supported preamble. + int preamble = 1; + int caps_preamble_support = static_cast(caps.preambleSupport); + caps_preamble_support >>= 1; + while (caps_preamble_support != 0) { + caps_preamble_support >>= 1; + preamble <<= 1; + } + + RttConfig config; + config.addr = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05}}; + config.type = RttType::ONE_SIDED; + config.peer = RttPeerType::AP; + config.channel.width = WifiChannelWidthInMhz::WIDTH_80; + config.channel.centerFreq = 5765; + config.channel.centerFreq0 = 5775; + config.channel.centerFreq1 = 0; + config.bw = RttBw::BW_80MHZ; + config.preamble = static_cast(preamble); + config.mustRequestLci = false; + config.mustRequestLcr = false; + config.burstPeriod = 0; + config.numBurst = 0; + config.numFramesPerBurst = 8; + config.numRetriesPerRttFrame = 3; + config.numRetriesPerFtmr = 3; + config.burstDuration = 9; + + int cmdId = 55; + std::vector configs = {config}; + EXPECT_TRUE(wifi_rtt_controller_->rangeRequest(cmdId, configs).isOk()); + + // Sleep for 2 seconds to wait for driver/firmware to complete RTT. + sleep(2); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiRttControllerAidlTest); +INSTANTIATE_TEST_SUITE_P(WifiTest, WifiRttControllerAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + android::ProcessState::self()->setThreadPoolMaxThreadCount(1); + android::ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp new file mode 100644 index 0000000000..f12d873f0c --- /dev/null +++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp @@ -0,0 +1,287 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_aidl_test_utils.h" + +using aidl::android::hardware::wifi::IWifi; +using aidl::android::hardware::wifi::IWifiStaIface; +using aidl::android::hardware::wifi::MacAddress; +using aidl::android::hardware::wifi::Ssid; +using aidl::android::hardware::wifi::StaApfPacketFilterCapabilities; +using aidl::android::hardware::wifi::StaBackgroundScanCapabilities; +using aidl::android::hardware::wifi::StaLinkLayerStats; +using aidl::android::hardware::wifi::StaRoamingCapabilities; +using aidl::android::hardware::wifi::StaRoamingConfig; +using aidl::android::hardware::wifi::StaRoamingState; +using aidl::android::hardware::wifi::WifiBand; +using aidl::android::hardware::wifi::WifiDebugRxPacketFateReport; +using aidl::android::hardware::wifi::WifiDebugTxPacketFateReport; +using aidl::android::hardware::wifi::WifiStatusCode; + +class WifiStaIfaceAidlTest : public testing::TestWithParam { + public: + void SetUp() override { + stopWifiService(getInstanceName()); + wifi_sta_iface_ = getWifiStaIface(getInstanceName()); + ASSERT_NE(nullptr, wifi_sta_iface_.get()); + } + + void TearDown() override { stopWifiService(getInstanceName()); } + + protected: + bool isFeatureSupported(IWifiStaIface::FeatureSetMask expected) { + int32_t features = 0; + EXPECT_TRUE(wifi_sta_iface_->getFeatureSet(&features).isOk()); + return features & static_cast(expected); + } + + ndk::ScopedAStatus createStaIface(std::shared_ptr* sta_iface) { + std::shared_ptr wifi_chip = getWifiChip(getInstanceName()); + EXPECT_NE(nullptr, wifi_chip.get()); + return wifi_chip->createStaIface(sta_iface); + } + + std::shared_ptr wifi_sta_iface_; + + private: + const char* getInstanceName() { return GetParam().c_str(); } +}; + +/* + * GetFactoryMacAddress + * Ensures that calls to getFactoryMacAddress will retrieve a non-zero MAC. + */ +TEST_P(WifiStaIfaceAidlTest, GetFactoryMacAddress) { + std::array mac; + EXPECT_TRUE(wifi_sta_iface_->getFactoryMacAddress(&mac).isOk()); + std::array all_zero_mac = {0, 0, 0, 0, 0, 0}; + EXPECT_NE(mac, all_zero_mac); +} + +/* + * GetFeatureSet + */ +TEST_P(WifiStaIfaceAidlTest, GetFeatureSet) { + int32_t features = 0; + EXPECT_TRUE(wifi_sta_iface_->getFeatureSet(&features).isOk()); + EXPECT_NE(features, 0); +} + +/* + * CheckApfIsSupported: + * Ensures the APF packet filter is fully supported as required in VSR 14: + * https://docs.partner.android.com/gms/policies/vsr/vsr-14 + */ +// @VsrTest = 5.3.12 +TEST_P(WifiStaIfaceAidlTest, CheckApfIsSupported) { + int vendor_api_level = property_get_int32("ro.vendor.api_level", 0); + // Before VSR 14, APF support is optional. + if (vendor_api_level < __ANDROID_API_U__) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::APF)) { + GTEST_SKIP() << "APF packet filter capabilities are not supported."; + } + StaApfPacketFilterCapabilities apf_caps = {}; + EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk()); + } else { + EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF)); + StaApfPacketFilterCapabilities apf_caps = {}; + EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk()); + // The APF version must be 4 and the usable memory must be at least + // 1024 bytes. + EXPECT_EQ(apf_caps.version, 4); + EXPECT_GE(apf_caps.maxLength, 1024); + } +} + +/* + * GetBackgroundScanCapabilities + */ +TEST_P(WifiStaIfaceAidlTest, GetBackgroundScanCapabilities) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::BACKGROUND_SCAN)) { + GTEST_SKIP() << "Background scan capabilities are not supported."; + } + StaBackgroundScanCapabilities caps = {}; + EXPECT_TRUE(wifi_sta_iface_->getBackgroundScanCapabilities(&caps).isOk()); +} + +/* + * GetLinkLayerStats + * Ensures that calls to getLinkLayerStats will retrieve a non-empty + * StaLinkLayerStats after link layer stats collection is enabled. + */ +TEST_P(WifiStaIfaceAidlTest, GetLinkLayerStats) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::LINK_LAYER_STATS)) { + GTEST_SKIP() << "Skipping this test since link layer stats are not supported."; + } + + // Enable link layer stats collection. + EXPECT_TRUE(wifi_sta_iface_->enableLinkLayerStatsCollection(true).isOk()); + + // Retrieve link layer stats. + StaLinkLayerStats link_layer_stats = {}; + EXPECT_TRUE(wifi_sta_iface_->getLinkLayerStats(&link_layer_stats).isOk()); + EXPECT_GT(link_layer_stats.timeStampInMs, 0); + + // Try to create a 2nd iface. If successful, it should fill the duty cycle field. + std::shared_ptr iface; + auto status = createStaIface(&iface); + if (status.isOk()) { + EXPECT_GT(link_layer_stats.iface.links[0].timeSliceDutyCycleInPercent, 0); + } + + // Disable link layer stats collection. + EXPECT_TRUE(wifi_sta_iface_->disableLinkLayerStatsCollection().isOk()); +} + +/* + * SetMacAddress + * Ensures that calls to setMacAddress will return successfully. + */ +TEST_P(WifiStaIfaceAidlTest, SetMacAddress) { + std::array mac = {0x12, 0x22, 0x33, 0x52, 0x10, 0x41}; + EXPECT_TRUE(wifi_sta_iface_->setMacAddress(mac).isOk()); +} + +/* + * SetScanMode + */ +TEST_P(WifiStaIfaceAidlTest, SetScanMode) { + auto status = wifi_sta_iface_->setScanMode(true); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + + status = wifi_sta_iface_->setScanMode(false); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); +} + +/* + * LinkLayerStatsCollection + */ +TEST_P(WifiStaIfaceAidlTest, LinkLayerStatsCollection) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::LINK_LAYER_STATS)) { + GTEST_SKIP() << "Link layer stats collection is not supported."; + } + + // Enable link layer stats collection. + EXPECT_TRUE(wifi_sta_iface_->enableLinkLayerStatsCollection(true).isOk()); + + // Retrieve link layer stats. + StaLinkLayerStats link_layer_stats = {}; + EXPECT_TRUE(wifi_sta_iface_->getLinkLayerStats(&link_layer_stats).isOk()); + + // Disable link layer stats collection. + EXPECT_TRUE(wifi_sta_iface_->disableLinkLayerStatsCollection().isOk()); +} + +/* + * RSSIMonitoring + * Ensures that calls to startRssiMonitoring and stopRssiMonitoring will fail + * if the device is not connected to an AP. + */ +TEST_P(WifiStaIfaceAidlTest, RSSIMonitoring) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::RSSI_MONITOR)) { + GTEST_SKIP() << "RSSI monitoring is not supported."; + } + + const int cmd = 1; + const int maxRssi = -50; + const int minRssi = -90; + // Expected to fail because device is not connected to an AP. + EXPECT_FALSE(wifi_sta_iface_->startRssiMonitoring(cmd, maxRssi, minRssi).isOk()); + EXPECT_FALSE(wifi_sta_iface_->stopRssiMonitoring(cmd).isOk()); +} + +/* + * RoamingControl + */ +TEST_P(WifiStaIfaceAidlTest, RoamingControl) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::CONTROL_ROAMING)) { + GTEST_SKIP() << "Roaming control is not supported."; + } + + // Retrieve roaming capabilities. + StaRoamingCapabilities caps = {}; + EXPECT_TRUE(wifi_sta_iface_->getRoamingCapabilities(&caps).isOk()); + + // Set up roaming configuration based on roaming capabilities. + StaRoamingConfig roaming_config = {}; + if (caps.maxBlocklistSize > 0) { + MacAddress block_list_entry; + block_list_entry.data = std::array{{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}}; + roaming_config.bssidBlocklist = {block_list_entry}; + } + if (caps.maxAllowlistSize > 0) { + Ssid allow_list_entry = {}; + allow_list_entry.data = std::array{{0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC}}; + roaming_config.ssidAllowlist = {allow_list_entry}; + } + + // Configure roaming. + EXPECT_TRUE(wifi_sta_iface_->configureRoaming(roaming_config).isOk()); + + // Enable roaming. + EXPECT_TRUE(wifi_sta_iface_->setRoamingState(StaRoamingState::ENABLED).isOk()); +} + +/* + * EnableNDOffload + */ +TEST_P(WifiStaIfaceAidlTest, EnableNDOffload) { + if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::ND_OFFLOAD)) { + GTEST_SKIP() << "ND offload is not supported."; + } + EXPECT_TRUE(wifi_sta_iface_->enableNdOffload(true).isOk()); +} + +/* + * PacketFateMonitoring + */ +TEST_P(WifiStaIfaceAidlTest, PacketFateMonitoring) { + // Start packet fate monitoring. + auto status = wifi_sta_iface_->startDebugPacketFateMonitoring(); + EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)); + + // Retrieve packets. + if (status.isOk()) { + std::vector rx_reports; + std::vector tx_reports; + EXPECT_TRUE(wifi_sta_iface_->getDebugRxPacketFates(&rx_reports).isOk()); + EXPECT_TRUE(wifi_sta_iface_->getDebugTxPacketFates(&tx_reports).isOk()); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiStaIfaceAidlTest); +INSTANTIATE_TEST_SUITE_P(WifiTest, WifiStaIfaceAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + android::ProcessState::self()->setThreadPoolMaxThreadCount(1); + android::ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/wifi/apex/Android.bp b/wifi/apex/Android.bp index 45f17a638d..f8ba5c472b 100644 --- a/wifi/apex/Android.bp +++ b/wifi/apex/Android.bp @@ -15,7 +15,7 @@ android_app_certificate { genrule { name: "gen-android.hardware.wifi.rc", - srcs: [":default-android.hardware.wifi@1.0-service.rc"], + srcs: [":default-android.hardware.wifi-service.rc"], out: ["com.android.hardware.wifi-service.rc"], cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.wifi/bin/@' $(in) > $(out)", } @@ -28,7 +28,7 @@ prebuilt_etc { prebuilt_etc { name: "com.android.hardware.wifi.xml", - src: ":default-android.hardware.wifi@1.0-service.xml", + src: ":default-android.hardware.wifi-service.xml", installable: false, sub_dir: "vintf", } @@ -43,13 +43,13 @@ apex { updatable: false, soc_specific: true, binaries: [ - "android.hardware.wifi@1.0-service", + "android.hardware.wifi-service", ], prebuilts: [ "com.android.hardware.wifi.rc", "com.android.hardware.wifi.xml", ], overrides: [ - "android.hardware.wifi@1.0-service", + "android.hardware.wifi-service", ], } diff --git a/wifi/apex/file_contexts b/wifi/apex/file_contexts index 04e8a62fd6..d932facd1e 100644 --- a/wifi/apex/file_contexts +++ b/wifi/apex/file_contexts @@ -1,3 +1,3 @@ (/.*)? u:object_r:vendor_file:s0 /etc(/.*)? u:object_r:vendor_configs_file:s0 -/bin/hw/android\.hardware\.wifi@1.0-service u:object_r:hal_wifi_default_exec:s0 +/bin/hw/android\.hardware\.wifi-service u:object_r:hal_wifi_default_exec:s0 diff --git a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp index 5c59819e82..b4840a6942 100644 --- a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp +++ b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp @@ -69,6 +69,7 @@ class HostapdHidlTest hostapd_instance_name_); hostapd_ = IHostapd::getService(hostapd_instance_name_); ASSERT_NE(hostapd_.get(), nullptr); + setupApIfaceIfNeeded(); isAcsSupport_ = testing::checkSubstringInCommandOutput( "/system/bin/cmd wifi get-softap-supported-features", "wifi_softap_acs_supported"); @@ -86,14 +87,21 @@ class HostapdHidlTest bool isWpa3SaeSupport_ = false; bool isAcsSupport_ = false; - std::string setupApIfaceIfNeededAndGetName() { + void setupApIfaceIfNeeded() { sp wifi_ap_iface; wifi_ap_iface = getWifiApIface_1_4(wifi_instance_name_); EXPECT_NE(nullptr, wifi_ap_iface.get()); const auto& status_and_name = HIDL_INVOKE(wifi_ap_iface, getName); EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_name.first.code); - return status_and_name.second; + } + + std::string getPrimaryWlanIfaceName() { + std::array buffer; + auto res = property_get("ro.vendor.wifi.sap.interface", buffer.data(), nullptr); + if (res > 0) return buffer.data(); + property_get("wifi.interface", buffer.data(), "wlan0"); + return buffer.data(); } IHostapd::IfaceParams getIfaceParamsWithoutAcs(std::string iface_name) { @@ -243,7 +251,7 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(ifname), getPskNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); @@ -257,7 +265,7 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcsAndFreqRange(ifname), getPskNwParams()); @@ -272,7 +280,7 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcsAndInvalidFreqRange(ifname), getPskNwParams()); @@ -287,7 +295,7 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(ifname), getOpenNwParams()); EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); @@ -300,7 +308,7 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithAcs) { TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getPskNwParams()); @@ -314,7 +322,7 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithoutAcs) { TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getOpenNwParams()); @@ -329,7 +337,7 @@ TEST_P(HostapdHidlTest, AddSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getSaeTransitionNwParams()); @@ -344,7 +352,7 @@ TEST_P(HostapdHidlTest, AddSAEAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getSaeNwParams()); @@ -359,7 +367,7 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { if (!isAcsSupport_) GTEST_SKIP() << "Missing ACS support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithAcs(ifname), getPskNwParams()); @@ -377,7 +385,7 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getPskNwParams()); @@ -395,7 +403,7 @@ TEST_P(HostapdHidlTest, RemoveAccessPointWithoutAcs) { TEST_P(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithInvalidChannel(ifname), getPskNwParams()); @@ -409,7 +417,7 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithInvalidChannel) { TEST_P(HostapdHidlTest, AddInvalidPskAccessPointWithoutAcs) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getInvalidPskNwParams()); @@ -424,7 +432,7 @@ TEST_P(HostapdHidlTest, AddInvalidSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getInvalidSaeTransitionNwParams()); @@ -439,7 +447,7 @@ TEST_P(HostapdHidlTest, AddInvalidSaeAccessPointWithoutAcs) { if (!isWpa3SaeSupport_) GTEST_SKIP() << "Missing SAE support"; if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getInvalidSaeNwParams()); @@ -451,7 +459,7 @@ TEST_P(HostapdHidlTest, AddInvalidSaeAccessPointWithoutAcs) { * when hotspot interface doesn't init.. */ TEST_P(HostapdHidlTest, DisconnectClientWhenIfaceNotAvailable) { - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status = HIDL_INVOKE(hostapd_, forceClientDisconnect, ifname, kTestZeroMacAddr, kTestDisconnectReasonCode); EXPECT_EQ(HostapdStatusCode::FAILURE_IFACE_UNKNOWN, status.code); @@ -464,7 +472,7 @@ TEST_P(HostapdHidlTest, DisconnectClientWhenIfaceNotAvailable) { TEST_P(HostapdHidlTest, DisconnectClientWhenIfacAvailable) { if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore addAccessPoint_1_2 on hostapd 1_3"; - std::string ifname = setupApIfaceIfNeededAndGetName(); + std::string ifname = getPrimaryWlanIfaceName(); auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, getIfaceParamsWithoutAcs(ifname), getOpenNwParams()); diff --git a/wifi/hostapd/aidl/lint-baseline.xml b/wifi/hostapd/aidl/lint-baseline.xml new file mode 100644 index 0000000000..657622e674 --- /dev/null +++ b/wifi/hostapd/aidl/lint-baseline.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp index a24bcc0684..33318a4520 100644 --- a/wifi/hostapd/aidl/vts/functional/Android.bp +++ b/wifi/hostapd/aidl/vts/functional/Android.bp @@ -36,6 +36,9 @@ cc_test { "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", "android.hardware.wifi@1.6", + "android.hardware.wifi-V1-ndk", + "libwifi-system-iface", + "VtsHalWifiTargetTestUtil", ], test_suites: [ "general-tests", diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp index 1b9c0b08f6..efd1538c7b 100644 --- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp +++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include #include #include @@ -31,6 +32,8 @@ #include #include +#include "wifi_aidl_test_utils.h" + using aidl::android::hardware::wifi::hostapd::BandMask; using aidl::android::hardware::wifi::hostapd::BnHostapdCallback; using aidl::android::hardware::wifi::hostapd::ChannelBandwidth; @@ -55,6 +58,8 @@ const int kIfaceInvalidChannel = 567; const std::vector kTestZeroMacAddr(6, 0x0); const Ieee80211ReasonCode kTestDisconnectReasonCode = Ieee80211ReasonCode::WLAN_REASON_UNSPECIFIED; +const std::string kWifiAidlInstanceNameStr = std::string() + IWifi::descriptor + "/default"; +const char* kWifiAidlInstanceName = kWifiAidlInstanceNameStr.c_str(); inline BandMask operator|(BandMask a, BandMask b) { return static_cast(static_cast(a) | @@ -78,33 +83,70 @@ class HostapdAidl : public testing::TestWithParam { isBridgedSupport = testing::checkSubstringInCommandOutput( "/system/bin/cmd wifi get-softap-supported-features", "wifi_softap_bridged_ap_supported"); - const std::vector instances = android::hardware::getAllHalInstanceNames( - ::android::hardware::wifi::V1_0::IWifi::descriptor); - EXPECT_NE(0, instances.size()); - wifiInstanceName = instances[0]; + if (!isAidlServiceAvailable(kWifiAidlInstanceName)) { + const std::vector instances = android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_0::IWifi::descriptor); + EXPECT_NE(0, instances.size()); + wifiHidlInstanceName = instances[0]; + } } virtual void TearDown() override { - if (getWifi(wifiInstanceName) != nullptr) { - stopWifi(wifiInstanceName); - } + stopVendorHal(); hostapd->terminate(); // Wait 3 seconds to allow terminate to complete sleep(3); } std::shared_ptr hostapd; - std::string wifiInstanceName; + std::string wifiHidlInstanceName; bool isAcsSupport; bool isWpa3SaeSupport; bool isBridgedSupport; + void stopVendorHal() { + if (isAidlServiceAvailable(kWifiAidlInstanceName)) { + // HIDL and AIDL versions of getWifi() take different arguments + // i.e. const char* vs string + if (getWifi(kWifiAidlInstanceName) != nullptr) { + stopWifiService(kWifiAidlInstanceName); + } + } else { + if (getWifi(wifiHidlInstanceName) != nullptr) { + stopWifi(wifiHidlInstanceName); + } + } + } + std::string setupApIfaceAndGetName(bool isBridged) { + if (isAidlServiceAvailable(kWifiAidlInstanceName)) { + return setupApIfaceAndGetNameAidl(isBridged); + } else { + return setupApIfaceAndGetNameHidl(isBridged); + } + } + + std::string setupApIfaceAndGetNameAidl(bool isBridged) { + std::shared_ptr wifi_ap_iface; + if (isBridged) { + wifi_ap_iface = getBridgedWifiApIface(kWifiAidlInstanceName); + } else { + wifi_ap_iface = getWifiApIface(kWifiAidlInstanceName); + } + EXPECT_NE(nullptr, wifi_ap_iface.get()); + + std::string ap_iface_name; + auto status = wifi_ap_iface->getName(&ap_iface_name); + EXPECT_TRUE(status.isOk()); + return ap_iface_name; + } + + std::string setupApIfaceAndGetNameHidl(bool isBridged) { android::sp<::android::hardware::wifi::V1_0::IWifiApIface> wifi_ap_iface; if (isBridged) { - wifi_ap_iface = getBridgedWifiApIface_1_6(wifiInstanceName); + wifi_ap_iface = getBridgedWifiApIface_1_6(wifiHidlInstanceName); } else { - wifi_ap_iface = getWifiApIface_1_5(wifiInstanceName); + wifi_ap_iface = getWifiApIface_1_5(wifiHidlInstanceName); } EXPECT_NE(nullptr, wifi_ap_iface.get()); diff --git a/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h b/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h index ac8653ebe4..32e5a6e47c 100644 --- a/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h +++ b/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h @@ -117,14 +117,13 @@ bool android_nlinterceptor_createSocket( int clientSocketFd, const char* clientName, struct android_nlinterceptor_InterceptedSocket* interceptedSocket); -void android_nlinterceptor_closeSocket( - const struct android_nlinterceptor_InterceptedSocket* sock); +void android_nlinterceptor_closeSocket(struct android_nlinterceptor_InterceptedSocket sock); -bool android_nlinterceptor_subscribe( - const struct android_nlinterceptor_InterceptedSocket* sock, uint32_t group); +bool android_nlinterceptor_subscribe(struct android_nlinterceptor_InterceptedSocket sock, + uint32_t group); -bool android_nlinterceptor_unsubscribe( - const struct android_nlinterceptor_InterceptedSocket* sock, uint32_t group); +bool android_nlinterceptor_unsubscribe(struct android_nlinterceptor_InterceptedSocket sock, + uint32_t group); #ifdef __cplusplus } diff --git a/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp b/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp index 575f90031a..aae7a3a415 100644 --- a/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp +++ b/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp @@ -150,25 +150,18 @@ extern "C" bool android_nlinterceptor_createSocket( return true; } -extern "C" void android_nlinterceptor_closeSocket( - const android_nlinterceptor_InterceptedSocket* sock) { - if (!sock) { - LOG(ERROR) << "Can't close socket identified by a null pointer!"; - return; - } - closeSocket({sock->nlFamily, sock->portId}); +extern "C" void android_nlinterceptor_closeSocket(android_nlinterceptor_InterceptedSocket sock) { + closeSocket({sock.nlFamily, sock.portId}); } -extern "C" bool android_nlinterceptor_subscribe( - const android_nlinterceptor_InterceptedSocket* sock, uint32_t group) { - if (!sock) return false; - return subscribe({sock->nlFamily, sock->portId}, group); +extern "C" bool android_nlinterceptor_subscribe(android_nlinterceptor_InterceptedSocket sock, + uint32_t group) { + return subscribe({sock.nlFamily, sock.portId}, group); } -extern "C" bool android_nlinterceptor_unsubscribe( - const android_nlinterceptor_InterceptedSocket* sock, uint32_t group) { - if (!sock) return false; - return unsubscribe({sock->nlFamily, sock->portId}, group); +extern "C" bool android_nlinterceptor_unsubscribe(android_nlinterceptor_InterceptedSocket sock, + uint32_t group) { + return unsubscribe({sock.nlFamily, sock.portId}, group); } } // namespace android::nlinterceptor diff --git a/wifi/offload/1.0/Android.bp b/wifi/offload/1.0/Android.bp deleted file mode 100644 index 8fd602de1f..0000000000 --- a/wifi/offload/1.0/Android.bp +++ /dev/null @@ -1,24 +0,0 @@ -// This file is autogenerated by hidl-gen -Landroidbp. - -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -hidl_interface { - name: "android.hardware.wifi.offload@1.0", - root: "android.hardware", - srcs: [ - "types.hal", - "IOffload.hal", - "IOffloadCallback.hal", - ], - interfaces: [ - "android.hidl.base@1.0", - ], - gen_java: false, -} diff --git a/wifi/offload/1.0/IOffload.hal b/wifi/offload/1.0/IOffload.hal deleted file mode 100644 index 48195195fb..0000000000 --- a/wifi/offload/1.0/IOffload.hal +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.wifi.offload@1.0; - -import IOffloadCallback; - -interface IOffload { - /** - * Configure the offload module to perform scans and filter results - * Scans must not be triggered due to configuration of the module. - * - * @param ScanParam paramters for scanning - * @param ScanFilter settings to filter scan result - * @return OffloadStatus indicating status of operation provided by this API - * If OffloadStatusCode::OK is returned, the operation was successful - * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost - * If OffloadStatusCode::ERROR is returned, requested operation could not be completed - */ - @entry - @callflow(next={"setEventCallback", "subscribeScanResults"}) - configureScans(ScanParam param, ScanFilter filter) generates (OffloadStatus status); - - /** - * Get scan statistics - * - * @return OffloadStatus indicating status of operation provided by this API - * @return ScanStats statistics of scans performed - * If OffloadStatusCode::OK is returned, the operation was successful - * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost - * If OffloadStatusCode::ERROR is returned, requested operation could not be completed - * If OffloadStatusCode::TIMEOUT is returned, time out waiting for the requested data - */ - @exit - @callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"}) - getScanStats() generates (OffloadStatus status, ScanStats scanStats); - - /** - * Subscribe to asynchronous scan events sent by offload module. This enables - * offload scans to be performed as per scan parameters, filtering the scan - * results based on configured scan filter and delivering the results after - * at least delayMs milliseconds from this call. If the client is already - * subscribed to the scan results, a call to this API must be a no-op. - * - * @param delayMs an integer expressing the minimum delay in mS after - * subscribing when scan results must be delivered to the client - * @return OffloadStatus indicating status of operation provided by this API - * If OffloadStatusCode::OK is returned, the operation was successful - * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost - * If OffloadStatusCode::ERROR is returned, requested operation could not be completed - */ - @callflow(next={"unsubscribeScanResults", "getScanStats"}) - subscribeScanResults(uint32_t delayMs) generates (OffloadStatus status); - - /** - * Unsubscribe to scan events sent by the offload module, hence disabling scans. - * If the client is already unsubscribed, a call to this API will be a no-op. - */ - @exit - @callflow(next={"*"}) - unsubscribeScanResults(); - - /** - * Setup the HIDL interface for reporting asynchronous scan events. A maximum - * of one callback interface is supported. Only one callback must be registered - * at any given time. If two consecutive calls are made with different callback - * interface objects, the latest one must be used to deliver events to client. - * - * @param cb An instance of the |IOffloadCallback| HIDL interface object - */ - @entry - @callflow(next={"subscribeScanStats", "configureScans"}) - setEventCallback(IOffloadCallback cb); -}; diff --git a/wifi/offload/1.0/types.hal b/wifi/offload/1.0/types.hal deleted file mode 100644 index 234f3fc433..0000000000 --- a/wifi/offload/1.0/types.hal +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package android.hardware.wifi.offload@1.0; - -/** - * Defines a bitmap of security modes - */ -enum SecurityMode : uint8_t { - OPEN = 0x1 << 1, - WEP = 0x1 << 2, - PSK = 0x1 << 3, - EAP = 0x1 << 4, -}; - -/** - * SSID of the Access Point, maximum 32 characters - */ -typedef vec Ssid; - -/** - * Preferred network information - * SSID and associated security mode(s) - */ -struct NetworkInfo { - Ssid ssid; - /* SecurityMode flags that are associated with this SSID - * More than one security mode can be supported, see SecurityMode */ - bitfield flags; -}; - -/** - * This is a bit mask describing the capabilities of a BSS. - * See IEEE Std 802.11: 8.4.1.4 - */ -enum Capability : uint16_t { - ESS = 1 << 0, - IBSS = 1 << 1, - CF_POLLABLE = 1 << 2, - CF_PLL_REQ = 1 << 3, - PRIVACY = 1 << 4, - SHORT_PREAMBLE = 1 << 5, - PBCC = 1 << 6, - CHANNEL_AGILITY = 1 << 7, - SPECTURM_MGMT = 1 << 8, - QOS = 1 << 9, - SHORT_SLOT_TIME = 1 << 10, - APSD = 1 << 11, - RADIO_MEASUREMENT = 1 << 12, - DSSS_OFDM = 1 << 13, - DELAYED_BLOCK_ACK = 1 << 14, - IMMEDIATE_BLOCK_ACK = 1 << 15, -}; - -/** - * Scan Results returned by the offload Hal - */ -struct ScanResult { - /* Information about this BSS - * SSID and security modes supported */ - NetworkInfo networkInfo; - /* BSSID of the BSS */ - uint8_t[6] bssid; - /* Can have multiple bits set, see Capability */ - bitfield capability; - /* Frequency scanned, in mHz */ - uint32_t frequency; - /* Signal strength in dBm */ - int8_t rssi; - /* TSF found in beacon/probe response */ - uint64_t tsf; -}; - - -/** - * Parameters for performing offload scans - */ -struct ScanParam { - /* Specify a list of SSIDs to scan, an empty list implies no preferred - * networks to scan */ - vec ssidList; - /* Frequencies to scan, in mHz, an empty frequency list implies a full scan */ - vec frequencyList; - /* Periodicity of the scans to be performed by the offload module - * A value of zero indicates disable periodic scans. For this revision, - * where offload module is performing scans in disconnected mode, this value - * should not be zero. In future versions, periodic scans can be eliminated */ - uint32_t disconnectedModeScanIntervalMs; -}; - -/** - * Instruction on how to filter the scan result before performing network - * selection and waking up the AP to connect - */ -struct ScanFilter { - /* Preferred network List of SSIDs and their security mode of interest - * The filter will drop the remaining scan results in the scan event. - * An empty list implies no filtering of scan result based on SSID and - * security mode. */ - vec preferredNetworkInfoList; - /* Minimum qualifying RSSI to be considered for network selection (dBm) */ - int8_t rssiThreshold; -}; - -struct ScanRecord { - /* Amount of time spent scanning */ - uint64_t durationMs; - /* Number of channels scanned */ - uint32_t numChannelsScanned; - /* Number of entries aggregated into this record */ - uint32_t numEntriesAggregated; -}; - -/** - * Enumerates the type of log that is recorded - */ -enum RecordName : uint32_t { - CMD_BASE = 0x00001000, - /* Record name corresponding to initialization */ - CMD_INT = CMD_BASE + 0, - /* Record name corresponding to configureScans() API */ - CMD_CONFIG_SCANS = CMD_BASE + 1, - /* Record name corresponding to subscribeScanResults() API */ - CMD_SUBSCRIBE_SCAN_RESULTS = CMD_BASE + 2, - /* Record name corresponding to unsubscribeScanResults() API */ - CMD_UNSUBSCRIBE_SCAN_RESULTS = CMD_BASE + 3, - /* Record name corresponding to getScanStats() API */ - CMD_GET_SCAN_STATS = CMD_BASE + 4, - /* Record name corresponding to a reset*/ - CMD_RESET = CMD_BASE + 5, - /* Add new commands here */ - EVENT_RECVD_BASE = 0x00002000, - /* Record name corresponding to scan monitor event*/ - EVENT_RECVD_SCAN_RESULT_ASYNC = EVENT_RECVD_BASE + 0, - /* Record name corresponding to scan response event */ - EVENT_RECVD_SCAN_RESULT = EVENT_RECVD_BASE + 1, - /* Add new events received here */ - EVENT_SENT_BASE = 0x00003000, - /* Record name corresponding to scan event sent */ - EVENT_SENT_SCAN_RESULT = EVENT_SENT_BASE + 0, - /* Record name corresponding to abort event sent */ - EVENT_SENT_ABORT = EVENT_SENT_BASE + 1, - /* Record name corresponding to error event sent */ - EVENT_SENT_ERROR = EVENT_SENT_BASE + 2, - /* Add new events sent here */ - REQ_BASE = 0x00004000, - /* Record name corresponding to scan request sent*/ - REQ_SCAN = REQ_BASE + 0, - /* Add new requests here */ -}; - -/** - * Defines the structure of each log record - */ -struct LogRecord { - /* Indicates the log recorded */ - RecordName recordName; - /* Platform reference time in milliseconds when the log is recorded */ - uint64_t logTimeMs; -}; - -/** - * Defines the scan statistics to be returned to the framework - */ -struct ScanStats { - /* Incremented everytime a new scan is requested */ - uint32_t numScansRequestedByWifi; - /* Incremented everytime the scan is serviced by performing a scan*/ - uint32_t numScansServicedByWifi; - /* Incremented everytime the scan is serviced by the scan cache */ - uint32_t numScansServicedbyCache; - /* The last (CHRE reference) time this data structure is updated */ - uint64_t lastUpdated; - /* The last (CHRE reference) time this data structure is read */ - uint64_t lastRead; - /* The total time when the Offload module could be performing scans (T2 - T1) - * T1 - time when the framework subscribes for scan result (includes delayMs) - * T2 - min (time when the framework unsubscribes for scan result, - * currentTime) */ - uint64_t subscriptionDurationMs; - /* Histograms of the channels scanned, 802.11 and with an 8 bit - * representation, only 256 channels are available */ - uint8_t[256] histogramChannelsScanned; - /* Scan Record for this subscribe duration */ - vec scanRecord; - /* Vector of the logRecord entries */ - vec logRecord; -}; - -/** - * Defines a list of return codes to indicate status of Offload HAL - */ -enum OffloadStatusCode : uint32_t { - /* No error */ - OK, - /* No Connection to underlying implementation */ - NO_CONNECTION, - /* Operation timeout */ - TIMEOUT, - /* Other errors */ - ERROR -}; - -/** - * Generic structures to return the status of an operation - */ -struct OffloadStatus { - OffloadStatusCode code; - /* Error message */ - string description; -}; - - - diff --git a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp b/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp deleted file mode 100644 index ffd5149d58..0000000000 --- a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "wifi_offload_hidl_hal_test" - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include "hidl_call_util.h" - -using ::android::hardware::wifi::offload::V1_0::IOffload; -using ::android::hardware::wifi::offload::V1_0::IOffloadCallback; -using ::android::hardware::wifi::offload::V1_0::ScanResult; -using ::android::hardware::wifi::offload::V1_0::ScanParam; -using ::android::hardware::wifi::offload::V1_0::Ssid; -using ::android::hardware::wifi::offload::V1_0::NetworkInfo; -using ::android::hardware::wifi::offload::V1_0::ScanFilter; -using ::android::hardware::wifi::offload::V1_0::ScanStats; -using ::android::hardware::wifi::offload::V1_0::OffloadStatus; -using ::android::hardware::wifi::offload::V1_0::OffloadStatusCode; -using ::android::hardware::Return; -using ::android::hardware::Void; -using ::android::hardware::hidl_vec; -using ::android::sp; - -constexpr char kOffloadCallbackSendScanResult[] = "onScanResult"; -constexpr char kOffloadCallbackSendError[] = "onError"; - -namespace { -const uint8_t kSsid1[] = {'G', 'o', 'o', 'g', 'l', 'e'}; -const uint8_t kSsid2[] = {'X', 'f', 'i', 'n', 'i', 't', 'y'}; -const uint8_t kBssid[6] = {0x12, 0xef, 0xa1, 0x2c, 0x97, 0x8b}; -const int16_t kRssi = -60; -const uint32_t kFrequency = 2412; -const uint8_t kBssidSize = 6; -const uint64_t kTsf = 0; -const uint16_t kCapability = 0; -const uint8_t kNetworkFlags = 0; -const uint32_t kFrequency1 = 2412; -const uint32_t kFrequency2 = 2437; -const uint32_t kDisconnectedModeScanIntervalMs = 5000; -const int16_t kRssiThreshold = -76; -} - -class OffloadCallbackArgs { - public: - hidl_vec scan_results_; - OffloadStatus error_code_; -}; - -// The main test class for WifiOffload HIDL HAL. -class WifiOffloadHidlTest : public ::testing::TestWithParam { - public: - virtual void SetUp() override { - wifi_offload_ = IOffload::getService(GetParam()); - ASSERT_NE(wifi_offload_, nullptr); - - wifi_offload_cb_ = new OffloadCallback(); - ASSERT_NE(wifi_offload_cb_, nullptr); - } - - virtual void TearDown() override {} - - /* Callback class for Offload HAL. */ - class OffloadCallback - : public ::testing::VtsHalHidlTargetCallbackBase, - public IOffloadCallback { - public: - OffloadCallback(){}; - - virtual ~OffloadCallback() = default; - - Return onScanResult( - const hidl_vec& scan_result) override { - OffloadCallbackArgs args; - args.scan_results_ = scan_result; - NotifyFromCallback(kOffloadCallbackSendScanResult, args); - return Void(); - }; - - Return onError(const OffloadStatus& status) override { - OffloadCallbackArgs args; - args.error_code_ = status; - NotifyFromCallback(kOffloadCallbackSendError, args); - return Void(); - } - }; - - sp wifi_offload_; - sp wifi_offload_cb_; -}; - -/* - * Verify that setEventCallback method returns without errors - */ -TEST_P(WifiOffloadHidlTest, setEventCallback) { - auto returnObject = wifi_offload_->setEventCallback(wifi_offload_cb_); - ASSERT_EQ(true, returnObject.isOk()); -} - -/* - * Verify that subscribeScanResults method returns without errors - */ -TEST_P(WifiOffloadHidlTest, subscribeScanResults) { - const auto& result = HIDL_INVOKE(wifi_offload_, subscribeScanResults, 0); - ASSERT_EQ(OffloadStatusCode::OK, result.code); -} - -/* - * Verify that unsubscribeScanResults method returns without errors - */ -TEST_P(WifiOffloadHidlTest, unsubscribeScanResults) { - auto returnObject = wifi_offload_->unsubscribeScanResults(); - ASSERT_EQ(true, returnObject.isOk()); -} - -/* - * Verify that configureScans method returns without errors - */ -TEST_P(WifiOffloadHidlTest, configureScans) { - ScanParam* pScanParam = new ScanParam(); - std::vector frequencyList = {kFrequency1, kFrequency2}; - pScanParam->disconnectedModeScanIntervalMs = - kDisconnectedModeScanIntervalMs; - pScanParam->frequencyList = frequencyList; - std::vector ssidList; - std::vector> ssids{kSsid1, kSsid2}; - for (const auto& ssid : ssids) { - Ssid tmp = ssid; - ssidList.push_back(tmp); - } - pScanParam->ssidList = ssidList; - ScanFilter* pScanFilter = new ScanFilter(); - pScanFilter->rssiThreshold = kRssiThreshold; - std::vector> match_ssids{kSsid1, kSsid2}; - std::vector security_flags{kNetworkFlags, kNetworkFlags}; - std::vector preferredNetworksList; - for (size_t i = 0; i < security_flags.size(); i++) { - NetworkInfo nwInfo; - nwInfo.ssid = match_ssids[i]; - nwInfo.flags = security_flags[i]; - preferredNetworksList.push_back(nwInfo); - } - const auto& result = - HIDL_INVOKE(wifi_offload_, configureScans, *pScanParam, *pScanFilter); - ASSERT_EQ(OffloadStatusCode::OK, result.code); -} - -/* - * Verify that getScanStats returns without any errors - */ -TEST_P(WifiOffloadHidlTest, getScanStats) { - const auto& result = HIDL_INVOKE(wifi_offload_, getScanStats); - OffloadStatus status = result.first; - ASSERT_EQ(OffloadStatusCode::OK, status.code); -} - -/* - * Verify that onScanResult callback is invoked - */ -TEST_P(WifiOffloadHidlTest, getScanResults) { - wifi_offload_->setEventCallback(wifi_offload_cb_); - std::vector scan_results; - std::vector ssid(kSsid1, kSsid1 + sizeof(kSsid1)); - ScanResult scan_result; - scan_result.tsf = kTsf; - scan_result.rssi = kRssi; - scan_result.frequency = kFrequency; - scan_result.capability = kCapability; - memcpy(&scan_result.bssid[0], &kBssid[0], kBssidSize); - scan_result.networkInfo.ssid = ssid; - scan_result.networkInfo.flags = kNetworkFlags; - scan_results.push_back(scan_result); - wifi_offload_cb_->onScanResult(scan_results); - auto res = - wifi_offload_cb_->WaitForCallback(kOffloadCallbackSendScanResult); - ASSERT_EQ(true, res.no_timeout); -} - -/* - * Verify that onError callback is invoked - */ -TEST_P(WifiOffloadHidlTest, getError) { - wifi_offload_->setEventCallback(wifi_offload_cb_); - OffloadStatus status = {OffloadStatusCode::ERROR, ""}; - wifi_offload_cb_->onError(status); - auto res = wifi_offload_cb_->WaitForCallback(kOffloadCallbackSendError); - ASSERT_EQ(true, res.no_timeout); -} - -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiOffloadHidlTest); -INSTANTIATE_TEST_SUITE_P( - PerInstance, WifiOffloadHidlTest, - testing::ValuesIn( - android::hardware::getAllHalInstanceNames(IOffload::descriptor)), - android::hardware::PrintInstanceNameToString); \ No newline at end of file diff --git a/wifi/offload/1.0/vts/functional/hidl_call_util.h b/wifi/offload/1.0/vts/functional/hidl_call_util.h deleted file mode 100644 index 99868e8b7d..0000000000 --- a/wifi/offload/1.0/vts/functional/hidl_call_util.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include - -namespace { -namespace detail { -template -struct functionArgSaver; - -// Provides a std::function that takes one argument, and a buffer -// wherein the function will store its argument. The buffer has -// the same type as the argument, but with const and reference -// modifiers removed. -template -struct functionArgSaver> final { - using StorageT = typename std::remove_const< - typename std::remove_reference::type>::type; - - std::function saveArgs = [this](ArgT arg) { - this->saved_values = arg; - }; - - StorageT saved_values; -}; - -// Provides a std::function that takes two arguments, and a buffer -// wherein the function will store its arguments. The buffer is a -// std::pair, whose elements have the same types as the arguments -// (but with const and reference modifiers removed). -template -struct functionArgSaver> final { - using StorageT = - std::pair::type>::type, - typename std::remove_const< - typename std::remove_reference::type>::type>; - - std::function saveArgs = [this](Arg1T arg1, - Arg2T arg2) { - this->saved_values = {arg1, arg2}; - }; - - StorageT saved_values; -}; - -// Provides a std::function that takes three or more arguments, and a -// buffer wherein the function will store its arguments. The buffer is a -// std::tuple whose elements have the same types as the arguments (but -// with const and reference modifiers removed). -template -struct functionArgSaver> final { - using StorageT = std::tuple::type>::type...>; - - std::function saveArgs = [this](ArgT... arg) { - this->saved_values = {arg...}; - }; - - StorageT saved_values; -}; - -// Invokes |method| on |object|, providing |method| a CallbackT as the -// final argument. Returns a copy of the parameters that |method| provided -// to CallbackT. (The parameters are returned by value.) -template -typename functionArgSaver::StorageT invokeMethod( - MethodT method, ObjectT object, ArgT&&... methodArg) { - functionArgSaver result_buffer; - const auto& res = ((*object).*method)(std::forward(methodArg)..., - result_buffer.saveArgs); - EXPECT_TRUE(res.isOk()); - return result_buffer.saved_values; -} -} // namespace detail -} // namespace - -// Invokes |method| on |strong_pointer|, passing provided arguments through to -// |method|. -// -// Returns either: -// - A copy of the result callback parameter (for callbacks with a single -// parameter), OR -// - A pair containing a copy of the result callback parameters (for callbacks -// with two parameters), OR -// - A tuple containing a copy of the result callback paramters (for callbacks -// with three or more parameters). -// -// Example usage: -// EXPECT_EQ(WifiStatusCode::SUCCESS, -// HIDL_INVOKE(strong_pointer, methodReturningWifiStatus).code); -// EXPECT_EQ(WifiStatusCode::SUCCESS, -// HIDL_INVOKE(strong_pointer, methodReturningWifiStatusAndOneMore) -// .first.code); -// EXPECT_EQ(WifiStatusCode::SUCCESS, std::get<0>( -// HIDL_INVOKE(strong_pointer, methodReturningWifiStatusAndTwoMore)) -// .code); -#define HIDL_INVOKE(strong_pointer, method, ...) \ - (detail::invokeMethod< \ - std::remove_reference::type::method##_cb>( \ - &std::remove_reference::type::method, \ - strong_pointer, ##__VA_ARGS__)) diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp index 9cb4e51651..ac5a952add 100644 --- a/wifi/supplicant/aidl/Android.bp +++ b/wifi/supplicant/aidl/Android.bp @@ -36,6 +36,11 @@ aidl_interface { "com.android.wifi", ], min_sdk_version: "30", + lint: { + // Disable linter to avoid error about fixed size arrays. + // Interface will only be accessed on devices >= T. + enabled: false, + }, }, ndk: { gen_trace: true, @@ -46,6 +51,12 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], + frozen: true, } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/.hash b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/.hash new file mode 100644 index 0000000000..e691512244 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/.hash @@ -0,0 +1 @@ +5e5c6d9e5565999f73fa7f797f5b94616174745b diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AnqpData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AnqpData.aidl new file mode 100644 index 0000000000..d8e49d70f3 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AnqpData.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable AnqpData { + byte[] venueName; + byte[] roamingConsortium; + byte[] ipAddrTypeAvailability; + byte[] naiRealm; + byte[] anqp3gppCellularNetwork; + byte[] domainName; + byte[] venueUrl; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AnqpInfoId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AnqpInfoId.aidl new file mode 100644 index 0000000000..cc323608f9 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AnqpInfoId.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum AnqpInfoId { + VENUE_NAME = 258, + ROAMING_CONSORTIUM = 261, + IP_ADDR_TYPE_AVAILABILITY = 262, + NAI_REALM = 263, + ANQP_3GPP_CELLULAR_NETWORK = 264, + DOMAIN_NAME = 268, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AssociationRejectionData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AssociationRejectionData.aidl new file mode 100644 index 0000000000..f6830dc8be --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AssociationRejectionData.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable AssociationRejectionData { + byte[] ssid; + byte[] bssid; + android.hardware.wifi.supplicant.StaIfaceStatusCode statusCode; + boolean timedOut; + boolean isMboAssocDisallowedReasonCodePresent; + android.hardware.wifi.supplicant.MboAssocDisallowedReasonCode mboAssocDisallowedReason; + boolean isOceRssiBasedAssocRejectAttrPresent; + android.hardware.wifi.supplicant.OceRssiBasedAssocRejectAttr oceRssiBasedAssocRejectData; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AuthAlgMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AuthAlgMask.aidl new file mode 100644 index 0000000000..44210185cf --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AuthAlgMask.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum AuthAlgMask { + OPEN = (1 << 0) /* 1 */, + SHARED = (1 << 1) /* 2 */, + LEAP = (1 << 2) /* 4 */, + SAE = (1 << 4) /* 16 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl new file mode 100644 index 0000000000..a339a9272f --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum AuxiliarySupplicantEventCode { + EAP_METHOD_SELECTED, + SSID_TEMP_DISABLED, + OPEN_SSL_FAILURE, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmData.aidl new file mode 100644 index 0000000000..34d894d6fa --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmData.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable BssTmData { + android.hardware.wifi.supplicant.BssTmStatusCode status; + android.hardware.wifi.supplicant.BssTmDataFlagsMask flags; + int assocRetryDelayMs; + android.hardware.wifi.supplicant.MboTransitionReasonCode mboTransitionReason; + android.hardware.wifi.supplicant.MboCellularDataConnectionPrefValue mboCellPreference; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl new file mode 100644 index 0000000000..6f0045c82c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum BssTmDataFlagsMask { + WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = (1 << 0) /* 1 */, + WNM_MODE_ABRIDGED = (1 << 1) /* 2 */, + WNM_MODE_DISASSOCIATION_IMMINENT = (1 << 2) /* 4 */, + WNM_MODE_BSS_TERMINATION_INCLUDED = (1 << 3) /* 8 */, + WNM_MODE_ESS_DISASSOCIATION_IMMINENT = (1 << 4) /* 16 */, + MBO_TRANSITION_REASON_CODE_INCLUDED = (1 << 5) /* 32 */, + MBO_ASSOC_RETRY_DELAY_INCLUDED = (1 << 6) /* 64 */, + MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = (1 << 7) /* 128 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmStatusCode.aidl new file mode 100644 index 0000000000..c95825fe3c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssTmStatusCode.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum BssTmStatusCode { + ACCEPT = 0, + REJECT_UNSPECIFIED = 1, + REJECT_INSUFFICIENT_BEACON = 2, + REJECT_INSUFFICIENT_CAPABITY = 3, + REJECT_BSS_TERMINATION_UNDESIRED = 4, + REJECT_BSS_TERMINATION_DELAY_REQUEST = 5, + REJECT_STA_CANDIDATE_LIST_PROVIDED = 6, + REJECT_NO_SUITABLE_CANDIDATES = 7, + REJECT_LEAVING_ESS = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssidChangeReason.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssidChangeReason.aidl new file mode 100644 index 0000000000..1d24579201 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BssidChangeReason.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum BssidChangeReason { + ASSOC_START = 0, + ASSOC_COMPLETE = 1, + DISASSOC = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl new file mode 100644 index 0000000000..bdc1b4a991 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum BtCoexistenceMode { + ENABLED = 0, + DISABLED = 1, + SENSE = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl new file mode 100644 index 0000000000..553cbc8e25 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable ConnectionCapabilities { + android.hardware.wifi.supplicant.WifiTechnology technology; + int channelBandwidth; + int maxNumberTxSpatialStreams; + int maxNumberRxSpatialStreams; + android.hardware.wifi.supplicant.LegacyMode legacyMode; + boolean apTidToLinkMapNegotiationSupported; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DebugLevel.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DebugLevel.aidl new file mode 100644 index 0000000000..fbfb5b3468 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DebugLevel.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DebugLevel { + EXCESSIVE = 0, + MSGDUMP = 1, + DEBUG = 2, + INFO = 3, + WARNING = 4, + ERROR = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppAkm.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppAkm.aidl new file mode 100644 index 0000000000..730843d2ec --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppAkm.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppAkm { + PSK, + PSK_SAE, + SAE, + DPP, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppConfigurationData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppConfigurationData.aidl new file mode 100644 index 0000000000..2225330538 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppConfigurationData.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable DppConfigurationData { + byte[] ssid; + String password; + byte[] psk; + android.hardware.wifi.supplicant.DppAkm securityAkm; + android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys; + boolean connStatusRequested; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppConnectionKeys.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppConnectionKeys.aidl new file mode 100644 index 0000000000..559d1c94ce --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppConnectionKeys.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable DppConnectionKeys { + byte[] connector; + byte[] cSign; + byte[] netAccessKey; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppCurve.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppCurve.aidl new file mode 100644 index 0000000000..14cb49f681 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppCurve.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppCurve { + PRIME256V1, + SECP384R1, + SECP521R1, + BRAINPOOLP256R1, + BRAINPOOLP384R1, + BRAINPOOLP512R1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppEventType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppEventType.aidl new file mode 100644 index 0000000000..47c8cc0e35 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppEventType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppEventType { + CONFIGURATION_SENT, + CONFIGURATION_APPLIED, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppFailureCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppFailureCode.aidl new file mode 100644 index 0000000000..89fbc4bab1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppFailureCode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppFailureCode { + INVALID_URI, + AUTHENTICATION, + NOT_COMPATIBLE, + CONFIGURATION, + BUSY, + TIMEOUT, + FAILURE, + NOT_SUPPORTED, + CONFIGURATION_REJECTED, + CANNOT_FIND_NETWORK, + ENROLLEE_AUTHENTICATION, + URI_GENERATION, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppNetRole.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppNetRole.aidl new file mode 100644 index 0000000000..77a910b251 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppNetRole.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppNetRole { + STA, + AP, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppProgressCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppProgressCode.aidl new file mode 100644 index 0000000000..ea244de3c2 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppProgressCode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppProgressCode { + AUTHENTICATION_SUCCESS, + RESPONSE_PENDING, + CONFIGURATION_SENT_WAITING_RESPONSE, + CONFIGURATION_ACCEPTED, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl new file mode 100644 index 0000000000..8b6492b4f3 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable DppResponderBootstrapInfo { + int bootstrapId; + int listenChannel; + String uri; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl new file mode 100644 index 0000000000..21f07dded5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppStatusErrorCode { + UNKNOWN = (-1) /* -1 */, + SUCCESS = 0, + NOT_COMPATIBLE = 1, + AUTH_FAILURE = 2, + UNWRAP_FAILURE = 3, + BAD_GROUP = 4, + CONFIGURE_FAILURE = 5, + RESPONSE_PENDING = 6, + INVALID_CONNECTOR = 7, + NO_MATCH = 8, + CONFIG_REJECTED = 9, + NO_AP = 10, + CONFIGURE_PENDING = 11, + CSR_NEEDED = 12, + CSR_BAD = 13, + NEW_KEY_NEEDED = 14, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapErrorCode.aidl similarity index 87% rename from automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl rename to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapErrorCode.aidl index 73d4a143b7..2cf81d9ca2 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapErrorCode.aidl @@ -31,13 +31,12 @@ // with such a backward incompatible change, it has a high risk of breaking // later when a module using the interface is updated, e.g., Mainline modules. -package android.hardware.automotive.vehicle; +package android.hardware.wifi.supplicant; @Backing(type="int") @VintfStability -enum Obd2CommonIgnitionMonitors { - COMPONENTS_AVAILABLE = 1, - COMPONENTS_INCOMPLETE = 2, - FUEL_SYSTEM_AVAILABLE = 4, - FUEL_SYSTEM_INCOMPLETE = 8, - MISFIRE_AVAILABLE = 16, - MISFIRE_INCOMPLETE = 32, +enum EapErrorCode { + SIM_GENERAL_FAILURE_AFTER_AUTH = 0, + SIM_TEMPORARILY_DENIED = 1026, + SIM_NOT_SUBSCRIBED = 1031, + SIM_GENERAL_FAILURE_BEFORE_AUTH = 16384, + SIM_VENDOR_SPECIFIC_EXPIRED_CERT = 16385, } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapMethod.aidl new file mode 100644 index 0000000000..4ab23afefd --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapMethod.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum EapMethod { + PEAP = 0, + TLS = 1, + TTLS = 2, + PWD = 3, + SIM = 4, + AKA = 5, + AKA_PRIME = 6, + WFA_UNAUTH_TLS = 7, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapPhase2Method.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapPhase2Method.aidl new file mode 100644 index 0000000000..4bd93a08da --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/EapPhase2Method.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum EapPhase2Method { + NONE = 0, + PAP = 1, + MSPAP = 2, + MSPAPV2 = 3, + GTC = 4, + SIM = 5, + AKA = 6, + AKA_PRIME = 7, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl new file mode 100644 index 0000000000..cbf1a3ee37 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum ExtRadioWorkDefaults { + TIMEOUT_IN_SECS = 10, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/FreqRange.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/FreqRange.aidl new file mode 100644 index 0000000000..0971d517f6 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/FreqRange.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable FreqRange { + int min; + int max; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GroupCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GroupCipherMask.aidl new file mode 100644 index 0000000000..d22d3d0582 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GroupCipherMask.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum GroupCipherMask { + WEP40 = (1 << 1) /* 2 */, + WEP104 = (1 << 2) /* 4 */, + TKIP = (1 << 3) /* 8 */, + CCMP = (1 << 4) /* 16 */, + GTK_NOT_USED = (1 << 14) /* 16384 */, + GCMP_256 = (1 << 8) /* 256 */, + SMS4 = (1 << 7) /* 128 */, + GCMP_128 = (1 << 6) /* 64 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl new file mode 100644 index 0000000000..23bb04fe2f --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum GroupMgmtCipherMask { + BIP_GMAC_128 = (1 << 11) /* 2048 */, + BIP_GMAC_256 = (1 << 12) /* 4096 */, + BIP_CMAC_256 = (1 << 13) /* 8192 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GsmRand.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GsmRand.aidl new file mode 100644 index 0000000000..599a68339a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/GsmRand.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable GsmRand { + byte[] data; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/Hs20AnqpData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/Hs20AnqpData.aidl new file mode 100644 index 0000000000..43b182a24a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/Hs20AnqpData.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable Hs20AnqpData { + byte[] operatorFriendlyName; + byte[] wanMetrics; + byte[] connectionCapability; + byte[] osuProvidersList; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl new file mode 100644 index 0000000000..270d43b073 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum Hs20AnqpSubtypes { + OPERATOR_FRIENDLY_NAME = 3, + WAN_METRICS = 4, + CONNECTION_CAPABILITY = 5, + OSU_PROVIDERS_LIST = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl new file mode 100644 index 0000000000..bcf0ea8cb6 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface INonStandardCertCallback { + byte[] getBlob(in String alias); + String[] listAliases(in String prefix); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicant.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicant.aidl new file mode 100644 index 0000000000..dd62167907 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicant.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicant { + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pIface addP2pInterface(in String ifName); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaIface addStaInterface(in String ifName); + android.hardware.wifi.supplicant.DebugLevel getDebugLevel(); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pIface getP2pInterface(in String ifName); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaIface getStaInterface(in String ifName); + boolean isDebugShowKeysEnabled(); + boolean isDebugShowTimestampEnabled(); + android.hardware.wifi.supplicant.IfaceInfo[] listInterfaces(); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantCallback callback); + void removeInterface(in android.hardware.wifi.supplicant.IfaceInfo ifaceInfo); + void setConcurrencyPriority(in android.hardware.wifi.supplicant.IfaceType type); + void setDebugParams(in android.hardware.wifi.supplicant.DebugLevel level, in boolean showTimestamp, in boolean showKeys); + oneway void terminate(); + void registerNonStandardCertCallback(in android.hardware.wifi.supplicant.INonStandardCertCallback callback); + const int EXT_RADIO_WORK_TIMEOUT_IN_SECS = 10; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantCallback.aidl new file mode 100644 index 0000000000..7281053cdb --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantCallback { + oneway void onInterfaceCreated(in String ifaceName); + oneway void onInterfaceRemoved(in String ifaceName); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl new file mode 100644 index 0000000000..19e6728420 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantP2pIface { + void addBonjourService(in byte[] query, in byte[] response); + void addGroup(in boolean persistent, in int persistentNetworkId); + void addGroupWithConfig(in byte[] ssid, in String pskPassphrase, in boolean persistent, in int freq, in byte[] peerAddress, in boolean joinExistingGroup); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pNetwork addNetwork(); + void addUpnpService(in int version, in String serviceName); + void cancelConnect(); + void cancelServiceDiscovery(in long identifier); + void cancelWps(in String groupIfName); + void configureExtListen(in int periodInMillis, in int intervalInMillis); + String connect(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod, in String preSelectedPin, in boolean joinExistingGroup, in boolean persistent, in int goIntent); + byte[] createNfcHandoverRequestMessage(); + byte[] createNfcHandoverSelectMessage(); + void enableWfd(in boolean enable); + void find(in int timeoutInSec); + void flush(); + void flushServices(); + byte[] getDeviceAddress(); + boolean getEdmg(); + android.hardware.wifi.supplicant.P2pGroupCapabilityMask getGroupCapability(in byte[] peerAddress); + String getName(); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pNetwork getNetwork(in int id); + byte[] getSsid(in byte[] peerAddress); + android.hardware.wifi.supplicant.IfaceType getType(); + void invite(in String groupIfName, in byte[] goDeviceAddress, in byte[] peerAddress); + int[] listNetworks(); + void provisionDiscovery(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback callback); + void reinvoke(in int persistentNetworkId, in byte[] peerAddress); + void reject(in byte[] peerAddress); + void removeBonjourService(in byte[] query); + void removeGroup(in String groupIfName); + void removeNetwork(in int id); + void removeUpnpService(in int version, in String serviceName); + void reportNfcHandoverInitiation(in byte[] select); + void reportNfcHandoverResponse(in byte[] request); + long requestServiceDiscovery(in byte[] peerAddress, in byte[] query); + void saveConfig(); + void setDisallowedFrequencies(in android.hardware.wifi.supplicant.FreqRange[] ranges); + void setEdmg(in boolean enable); + void setGroupIdle(in String groupIfName, in int timeoutInSec); + void setListenChannel(in int channel, in int operatingClass); + void setMacRandomization(in boolean enable); + void setMiracastMode(in android.hardware.wifi.supplicant.MiracastMode mode); + void setPowerSave(in String groupIfName, in boolean enable); + void setSsidPostfix(in byte[] postfix); + void setWfdDeviceInfo(in byte[] info); + void setWfdR2DeviceInfo(in byte[] info); + void removeClient(in byte[] peerAddress, in boolean isLegacyClient); + void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods); + void setWpsDeviceName(in String name); + void setWpsDeviceType(in byte[] type); + void setWpsManufacturer(in String manufacturer); + void setWpsModelName(in String modelName); + void setWpsModelNumber(in String modelNumber); + void setWpsSerialNumber(in String serialNumber); + void startWpsPbc(in String groupIfName, in byte[] bssid); + String startWpsPinDisplay(in String groupIfName, in byte[] bssid); + void startWpsPinKeypad(in String groupIfName, in String pin); + void stopFind(); + void findOnSocialChannels(in int timeoutInSec); + void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); + void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); + void configureEapolIpAddressAllocationParams(in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl new file mode 100644 index 0000000000..da3ca52897 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantP2pIfaceCallback { + oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo); + oneway void onDeviceLost(in byte[] p2pDeviceAddress); + oneway void onFindStopped(); + oneway void onGoNegotiationCompleted(in android.hardware.wifi.supplicant.P2pStatusCode status); + oneway void onGoNegotiationRequest(in byte[] srcAddress, in android.hardware.wifi.supplicant.WpsDevPasswordId passwordId); + oneway void onGroupFormationFailure(in String failureReason); + oneway void onGroupFormationSuccess(); + oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner); + oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid, in int frequency, in byte[] psk, in String passphrase, in byte[] goDeviceAddress, in boolean isPersistent); + oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, in int persistentNetworkId, in int operatingFrequency); + oneway void onInvitationResult(in byte[] bssid, in android.hardware.wifi.supplicant.P2pStatusCode status); + oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, in android.hardware.wifi.supplicant.P2pProvDiscStatusCode status, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in String generatedPin); + oneway void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo); + oneway void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs); + oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); + oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); + oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); + oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes); + oneway void onGroupStartedWithParams(in android.hardware.wifi.supplicant.P2pGroupStartedEventParams groupStartedEventParams); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl new file mode 100644 index 0000000000..ef72724642 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantP2pNetwork { + byte[] getBssid(); + android.hardware.wifi.supplicant.MacAddress[] getClientList(); + int getId(); + String getInterfaceName(); + byte[] getSsid(); + android.hardware.wifi.supplicant.IfaceType getType(); + boolean isCurrent(); + boolean isGroupOwner(); + boolean isPersistent(); + void setClientList(in android.hardware.wifi.supplicant.MacAddress[] clients); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl new file mode 100644 index 0000000000..1616b26003 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantStaIface { + int addDppPeerUri(in String uri); + int addExtRadioWork(in String name, in int freqInMhz, in int timeoutInSec); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaNetwork addNetwork(); + void addRxFilter(in android.hardware.wifi.supplicant.RxFilterType type); + void cancelWps(); + void disconnect(); + void enableAutoReconnect(in boolean enable); + void filsHlpAddRequest(in byte[] dst_mac, in byte[] pkt); + void filsHlpFlushRequest(); + android.hardware.wifi.supplicant.DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(in byte[] macAddress, in String deviceInfo, in android.hardware.wifi.supplicant.DppCurve curve); + void generateSelfDppConfiguration(in String ssid, in byte[] privEcKey); + android.hardware.wifi.supplicant.ConnectionCapabilities getConnectionCapabilities(); + android.hardware.wifi.supplicant.MloLinksInfo getConnectionMloLinksInfo(); + android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmtCapabilities(); + byte[] getMacAddress(); + String getName(); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaNetwork getNetwork(in int id); + android.hardware.wifi.supplicant.IfaceType getType(); + android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask getWpaDriverCapabilities(); + void initiateAnqpQuery(in byte[] macAddress, in android.hardware.wifi.supplicant.AnqpInfoId[] infoElements, in android.hardware.wifi.supplicant.Hs20AnqpSubtypes[] subTypes); + void initiateHs20IconQuery(in byte[] macAddress, in String fileName); + void initiateTdlsDiscover(in byte[] macAddress); + void initiateTdlsSetup(in byte[] macAddress); + void initiateTdlsTeardown(in byte[] macAddress); + void initiateVenueUrlAnqpQuery(in byte[] macAddress); + int[] listNetworks(); + void reassociate(); + void reconnect(); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback callback); + void setQosPolicyFeatureEnabled(in boolean enable); + void sendQosPolicyResponse(in int qosPolicyRequestId, in boolean morePolicies, in android.hardware.wifi.supplicant.QosPolicyStatus[] qosPolicyStatusList); + void removeAllQosPolicies(); + void removeDppUri(in int id); + void removeExtRadioWork(in int id); + void removeNetwork(in int id); + void removeRxFilter(in android.hardware.wifi.supplicant.RxFilterType type); + void setBtCoexistenceMode(in android.hardware.wifi.supplicant.BtCoexistenceMode mode); + void setBtCoexistenceScanModeEnabled(in boolean enable); + void setCountryCode(in byte[] code); + void setExternalSim(in boolean useExternalSim); + void setMboCellularDataStatus(in boolean available); + void setPowerSave(in boolean enable); + void setSuspendModeEnabled(in boolean enable); + void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods); + void setWpsDeviceName(in String name); + void setWpsDeviceType(in byte[] type); + void setWpsManufacturer(in String manufacturer); + void setWpsModelName(in String modelName); + void setWpsModelNumber(in String modelNumber); + void setWpsSerialNumber(in String serialNumber); + byte[] startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, in String ssid, in String password, in String psk, in android.hardware.wifi.supplicant.DppNetRole netRole, in android.hardware.wifi.supplicant.DppAkm securityAkm, in byte[] privEcKey); + void startDppEnrolleeInitiator(in int peerBootstrapId, in int ownBootstrapId); + void startDppEnrolleeResponder(in int listenChannel); + void startRxFilter(); + void startWpsPbc(in byte[] bssid); + String startWpsPinDisplay(in byte[] bssid); + void startWpsPinKeypad(in String pin); + void startWpsRegistrar(in byte[] bssid, in String pin); + void stopDppInitiator(); + void stopDppResponder(in int ownBootstrapId); + void stopRxFilter(); + android.hardware.wifi.supplicant.SignalPollResult[] getSignalPollResults(); + android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in android.hardware.wifi.supplicant.QosPolicyScsData[] qosPolicyData); + android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds); + const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl new file mode 100644 index 0000000000..1c232237ea --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantStaIfaceCallback { + oneway void onAnqpQueryDone(in byte[] bssid, in android.hardware.wifi.supplicant.AnqpData data, in android.hardware.wifi.supplicant.Hs20AnqpData hs20Data); + oneway void onAssociationRejected(in android.hardware.wifi.supplicant.AssociationRejectionData assocRejectData); + oneway void onAuthenticationTimeout(in byte[] bssid); + oneway void onAuxiliarySupplicantEvent(in android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode eventCode, in byte[] bssid, in String reasonString); + oneway void onBssTmHandlingDone(in android.hardware.wifi.supplicant.BssTmData tmData); + oneway void onBssidChanged(in android.hardware.wifi.supplicant.BssidChangeReason reason, in byte[] bssid); + oneway void onDisconnected(in byte[] bssid, in boolean locallyGenerated, in android.hardware.wifi.supplicant.StaIfaceReasonCode reasonCode); + oneway void onDppFailure(in android.hardware.wifi.supplicant.DppFailureCode code, in String ssid, in String channelList, in char[] bandList); + oneway void onDppProgress(in android.hardware.wifi.supplicant.DppProgressCode code); + oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); + /** + * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onDppConfigReceived. + */ + oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); + oneway void onDppSuccessConfigSent(); + oneway void onEapFailure(in byte[] bssid, in int errorCode); + oneway void onExtRadioWorkStart(in int id); + oneway void onExtRadioWorkTimeout(in int id); + oneway void onHs20DeauthImminentNotice(in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url); + oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data); + oneway void onHs20SubscriptionRemediation(in byte[] bssid, in android.hardware.wifi.supplicant.OsuMethod osuMethod, in String url); + oneway void onHs20TermsAndConditionsAcceptanceRequestedNotification(in byte[] bssid, in String url); + oneway void onNetworkAdded(in int id); + oneway void onNetworkNotFound(in byte[] ssid); + oneway void onNetworkRemoved(in int id); + /** + * @deprecated use onPmkSaCacheAdded() instead. + */ + oneway void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry); + /** + * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onSupplicantStateChanged() + */ + oneway void onStateChanged(in android.hardware.wifi.supplicant.StaIfaceCallbackState newState, in byte[] bssid, in int id, in byte[] ssid, in boolean filsHlpSent); + oneway void onWpsEventFail(in byte[] bssid, in android.hardware.wifi.supplicant.WpsConfigError configError, in android.hardware.wifi.supplicant.WpsErrorIndication errorInd); + oneway void onWpsEventPbcOverlap(); + oneway void onWpsEventSuccess(); + oneway void onQosPolicyReset(); + oneway void onQosPolicyRequest(in int qosPolicyRequestId, in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); + oneway void onMloLinksInfoChanged(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback.MloLinkInfoChangeReason reason); + oneway void onDppConfigReceived(in android.hardware.wifi.supplicant.DppConfigurationData configData); + oneway void onDppConnectionStatusResultSent(in android.hardware.wifi.supplicant.DppStatusErrorCode code); + oneway void onBssFrequencyChanged(in int frequencyMhz); + oneway void onSupplicantStateChanged(in android.hardware.wifi.supplicant.SupplicantStateChangeData stateChangeData); + oneway void onQosPolicyResponseForScs(in android.hardware.wifi.supplicant.QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus); + oneway void onPmkSaCacheAdded(in android.hardware.wifi.supplicant.PmkSaCacheData pmkSaData); + @Backing(type="int") @VintfStability + enum MloLinkInfoChangeReason { + TID_TO_LINK_MAP = 0, + MULTI_LINK_RECONFIG_AP_REMOVAL = 1, + } +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl new file mode 100644 index 0000000000..bfc05a4ad8 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantStaNetwork { + void disable(); + void enable(in boolean noConnect); + void enableSaePkOnlyMode(in boolean enable); + void enableSuiteBEapOpenSslCiphers(); + void enableTlsSuiteBEapPhase1Param(in boolean enable); + android.hardware.wifi.supplicant.AuthAlgMask getAuthAlg(); + byte[] getBssid(); + String getEapAltSubjectMatch(); + byte[] getEapAnonymousIdentity(); + String getEapCACert(); + String getEapCAPath(); + String getEapClientCert(); + String getEapDomainSuffixMatch(); + boolean getEapEngine(); + String getEapEngineId(); + byte[] getEapIdentity(); + android.hardware.wifi.supplicant.EapMethod getEapMethod(); + byte[] getEapPassword(); + android.hardware.wifi.supplicant.EapPhase2Method getEapPhase2Method(); + String getEapPrivateKeyId(); + String getEapSubjectMatch(); + boolean getEdmg(); + android.hardware.wifi.supplicant.GroupCipherMask getGroupCipher(); + android.hardware.wifi.supplicant.GroupMgmtCipherMask getGroupMgmtCipher(); + int getId(); + String getIdStr(); + String getInterfaceName(); + android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmt(); + android.hardware.wifi.supplicant.OcspType getOcsp(); + android.hardware.wifi.supplicant.PairwiseCipherMask getPairwiseCipher(); + android.hardware.wifi.supplicant.ProtoMask getProto(); + byte[] getPsk(); + String getPskPassphrase(); + boolean getRequirePmf(); + String getSaePassword(); + String getSaePasswordId(); + boolean getScanSsid(); + byte[] getSsid(); + android.hardware.wifi.supplicant.IfaceType getType(); + String getWapiCertSuite(); + byte[] getWepKey(in int keyIdx); + int getWepTxKeyIdx(); + byte[] getWpsNfcConfigurationToken(); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaNetworkCallback callback); + void select(); + void sendNetworkEapIdentityResponse(in byte[] identity, in byte[] encryptedIdentity); + void sendNetworkEapSimGsmAuthFailure(); + void sendNetworkEapSimGsmAuthResponse(in android.hardware.wifi.supplicant.NetworkResponseEapSimGsmAuthParams[] params); + void sendNetworkEapSimUmtsAuthFailure(); + void sendNetworkEapSimUmtsAuthResponse(in android.hardware.wifi.supplicant.NetworkResponseEapSimUmtsAuthParams params); + void sendNetworkEapSimUmtsAutsResponse(in byte[] auts); + void setAuthAlg(in android.hardware.wifi.supplicant.AuthAlgMask authAlgMask); + void setBssid(in byte[] bssid); + void setDppKeys(in android.hardware.wifi.supplicant.DppConnectionKeys keys); + void setEapAltSubjectMatch(in String match); + void setEapAnonymousIdentity(in byte[] identity); + void setEapCACert(in String path); + void setEapCAPath(in String path); + void setEapClientCert(in String path); + void setEapDomainSuffixMatch(in String match); + void setEapEncryptedImsiIdentity(in byte[] identity); + void setEapEngine(in boolean enable); + void setEapEngineID(in String id); + void setEapErp(in boolean enable); + void setEapIdentity(in byte[] identity); + void setEapMethod(in android.hardware.wifi.supplicant.EapMethod method); + void setEapPassword(in byte[] password); + void setEapPhase2Method(in android.hardware.wifi.supplicant.EapPhase2Method method); + void setEapPrivateKeyId(in String id); + void setEapSubjectMatch(in String match); + void setEdmg(in boolean enable); + void setGroupCipher(in android.hardware.wifi.supplicant.GroupCipherMask groupCipherMask); + void setGroupMgmtCipher(in android.hardware.wifi.supplicant.GroupMgmtCipherMask groupMgmtCipherMask); + void setIdStr(in String idStr); + void setKeyMgmt(in android.hardware.wifi.supplicant.KeyMgmtMask keyMgmtMask); + void setOcsp(in android.hardware.wifi.supplicant.OcspType ocspType); + void setPairwiseCipher(in android.hardware.wifi.supplicant.PairwiseCipherMask pairwiseCipherMask); + void setPmkCache(in byte[] serializedEntry); + void setProactiveKeyCaching(in boolean enable); + void setProto(in android.hardware.wifi.supplicant.ProtoMask protoMask); + void setPsk(in byte[] psk); + void setPskPassphrase(in String psk); + void setRequirePmf(in boolean enable); + void setSaeH2eMode(in android.hardware.wifi.supplicant.SaeH2eMode mode); + void setSaePassword(in String saePassword); + void setSaePasswordId(in String saePasswordId); + void setScanSsid(in boolean enable); + void setSsid(in byte[] ssid); + void setUpdateIdentifier(in int id); + void setWapiCertSuite(in String suite); + void setWepKey(in int keyIdx, in byte[] wepKey); + void setWepTxKeyIdx(in int keyIdx); + void setRoamingConsortiumSelection(in byte[] selectedRcoi); + void setMinimumTlsVersionEapPhase1Param(android.hardware.wifi.supplicant.TlsVersion tlsVersion); + void setStrictConservativePeerMode(in boolean enable); + const int SSID_MAX_LEN_IN_BYTES = 32; + const int PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8; + const int PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63; + const int WEP_KEYS_MAX_NUM = 4; + const int WEP40_KEY_LEN_IN_BYTES = 5; + const int WEP104_KEY_LEN_IN_BYTES = 13; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl new file mode 100644 index 0000000000..f9a078be4d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface ISupplicantStaNetworkCallback { + oneway void onNetworkEapIdentityRequest(); + oneway void onNetworkEapSimGsmAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimGsmAuthParams params); + oneway void onNetworkEapSimUmtsAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimUmtsAuthParams params); + oneway void onTransitionDisable(in android.hardware.wifi.supplicant.TransitionDisableIndication ind); + oneway void onServerCertificateAvailable(in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); + oneway void onPermanentIdReqDenied(); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IfaceInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IfaceInfo.aidl new file mode 100644 index 0000000000..6706c8c6ef --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IfaceInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable IfaceInfo { + android.hardware.wifi.supplicant.IfaceType type; + String name; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IfaceType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IfaceType.aidl new file mode 100644 index 0000000000..e11c2f7ec6 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IfaceType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum IfaceType { + STA, + P2P, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IpVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IpVersion.aidl new file mode 100644 index 0000000000..958031437c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/IpVersion.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum IpVersion { + VERSION_4, + VERSION_6, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/KeyMgmtMask.aidl new file mode 100644 index 0000000000..35d51bc566 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/KeyMgmtMask.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum KeyMgmtMask { + WPA_EAP = (1 << 0) /* 1 */, + WPA_PSK = (1 << 1) /* 2 */, + NONE = (1 << 2) /* 4 */, + IEEE8021X = (1 << 3) /* 8 */, + FT_EAP = (1 << 5) /* 32 */, + FT_PSK = (1 << 6) /* 64 */, + OSEN = (1 << 15) /* 32768 */, + WPA_EAP_SHA256 = (1 << 7) /* 128 */, + WPA_PSK_SHA256 = (1 << 8) /* 256 */, + SAE = (1 << 10) /* 1024 */, + SUITE_B_192 = (1 << 17) /* 131072 */, + OWE = (1 << 22) /* 4194304 */, + DPP = (1 << 23) /* 8388608 */, + WAPI_PSK = (1 << 12) /* 4096 */, + WAPI_CERT = (1 << 13) /* 8192 */, + FILS_SHA256 = (1 << 18) /* 262144 */, + FILS_SHA384 = (1 << 19) /* 524288 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/LegacyMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/LegacyMode.aidl new file mode 100644 index 0000000000..6896d75f7f --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/LegacyMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum LegacyMode { + UNKNOWN = 0, + A_MODE = 1, + B_MODE = 2, + G_MODE = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MacAddress.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MacAddress.aidl new file mode 100644 index 0000000000..d17930a649 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MacAddress.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable MacAddress { + byte[] data; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl new file mode 100644 index 0000000000..661165d062 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum MboAssocDisallowedReasonCode { + RESERVED = 0, + UNSPECIFIED = 1, + MAX_NUM_STA_ASSOCIATED = 2, + AIR_INTERFACE_OVERLOADED = 3, + AUTH_SERVER_OVERLOADED = 4, + INSUFFICIENT_RSSI = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl new file mode 100644 index 0000000000..c4024d097b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum MboCellularDataConnectionPrefValue { + EXCLUDED = 0, + NOT_PREFERRED = 1, + PREFERRED = 255, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl new file mode 100644 index 0000000000..caed0950ee --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum MboTransitionReasonCode { + UNSPECIFIED = 0, + EXCESSIVE_FRAME_LOSS = 1, + EXCESSIVE_TRAFFIC_DELAY = 2, + INSUFFICIENT_BANDWIDTH = 3, + LOAD_BALANCING = 4, + LOW_RSSI = 5, + RX_EXCESSIVE_RETRIES = 6, + HIGH_INTERFERENCE = 7, + GRAY_ZONE = 8, + TRANSITION_TO_PREMIUM_AP = 9, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MiracastMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MiracastMode.aidl new file mode 100644 index 0000000000..6bc9e4d629 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MiracastMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum MiracastMode { + DISABLED = 0, + SOURCE = 1, + SINK = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MloLink.aidl new file mode 100644 index 0000000000..8bda3242b3 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MloLink.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable MloLink { + byte linkId; + byte[] staLinkMacAddress; + byte tidsUplinkMap; + byte tidsDownlinkMap; + @nullable byte[6] apLinkMacAddress; + int frequencyMHz; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MloLinksInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MloLinksInfo.aidl new file mode 100644 index 0000000000..3dac2d6694 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/MloLinksInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable MloLinksInfo { + android.hardware.wifi.supplicant.MloLink[] links; + int apMloLinkId; + @nullable byte[6] apMldMacAddress; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl new file mode 100644 index 0000000000..1f03bb84c7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable NetworkRequestEapSimGsmAuthParams { + android.hardware.wifi.supplicant.GsmRand[] rands; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl new file mode 100644 index 0000000000..956a799b7d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable NetworkRequestEapSimUmtsAuthParams { + byte[] rand; + byte[] autn; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl new file mode 100644 index 0000000000..29415b739d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable NetworkResponseEapSimGsmAuthParams { + byte[] kc; + byte[] sres; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl new file mode 100644 index 0000000000..4e58dd8261 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable NetworkResponseEapSimUmtsAuthParams { + byte[] res; + byte[] ik; + byte[] ck; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl new file mode 100644 index 0000000000..95a95bc543 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable OceRssiBasedAssocRejectAttr { + int deltaRssi; + int retryDelayS; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OcspType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OcspType.aidl new file mode 100644 index 0000000000..d5ed084537 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OcspType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum OcspType { + NONE, + REQUEST_CERT_STATUS, + REQUIRE_CERT_STATUS, + REQUIRE_ALL_CERTS_STATUS, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OsuMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OsuMethod.aidl new file mode 100644 index 0000000000..1b99e2f157 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/OsuMethod.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum OsuMethod { + OMA_DM = 0, + SOAP_XML_SPP = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl new file mode 100644 index 0000000000..db31ca1d48 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pClientEapolIpAddressInfo { + int ipAddressClient; + int ipAddressMask; + int ipAddressGo; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl new file mode 100644 index 0000000000..3c6f8ed5ed --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum P2pFrameTypeMask { + P2P_FRAME_PROBE_REQ_P2P = (1 << 0) /* 1 */, + P2P_FRAME_PROBE_RESP_P2P = (1 << 1) /* 2 */, + P2P_FRAME_PROBE_RESP_P2P_GO = (1 << 2) /* 4 */, + P2P_FRAME_BEACON_P2P_GO = (1 << 3) /* 8 */, + P2P_FRAME_P2P_PD_REQ = (1 << 4) /* 16 */, + P2P_FRAME_P2P_PD_RESP = (1 << 5) /* 32 */, + P2P_FRAME_P2P_GO_NEG_REQ = (1 << 6) /* 64 */, + P2P_FRAME_P2P_GO_NEG_RESP = (1 << 7) /* 128 */, + P2P_FRAME_P2P_GO_NEG_CONF = (1 << 8) /* 256 */, + P2P_FRAME_P2P_INV_REQ = (1 << 9) /* 512 */, + P2P_FRAME_P2P_INV_RESP = (1 << 10) /* 1024 */, + P2P_FRAME_P2P_ASSOC_REQ = (1 << 11) /* 2048 */, + P2P_FRAME_P2P_ASSOC_RESP = (1 << 12) /* 4096 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl new file mode 100644 index 0000000000..e47713182e --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum P2pGroupCapabilityMask { + GROUP_OWNER = (1 << 0) /* 1 */, + PERSISTENT_GROUP = (1 << 1) /* 2 */, + GROUP_LIMIT = (1 << 2) /* 4 */, + INTRA_BSS_DIST = (1 << 3) /* 8 */, + CROSS_CONN = (1 << 4) /* 16 */, + PERSISTENT_RECONN = (1 << 5) /* 32 */, + GROUP_FORMATION = (1 << 6) /* 64 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl new file mode 100644 index 0000000000..5465a86b13 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pGroupStartedEventParams { + String groupInterfaceName; + boolean isGroupOwner; + byte[] ssid; + int frequencyMHz; + byte[] psk; + String passphrase; + boolean isPersistent; + byte[6] goDeviceAddress; + byte[6] goInterfaceAddress; + boolean isP2pClientEapolIpAddressInfoPresent; + android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo p2pClientIpInfo; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl new file mode 100644 index 0000000000..c8e53b93c1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum P2pProvDiscStatusCode { + SUCCESS = 0, + TIMEOUT = 1, + REJECTED = 2, + TIMEOUT_JOIN = 3, + INFO_UNAVAILABLE = 4, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pStatusCode.aidl new file mode 100644 index 0000000000..c7ad3832c7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/P2pStatusCode.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum P2pStatusCode { + SUCCESS = 0, + FAIL_INFO_CURRENTLY_UNAVAILABLE = 1, + FAIL_INCOMPATIBLE_PARAMS = 2, + FAIL_LIMIT_REACHED = 3, + FAIL_INVALID_PARAMS = 4, + FAIL_UNABLE_TO_ACCOMMODATE = 5, + FAIL_PREV_PROTOCOL_ERROR = 6, + FAIL_NO_COMMON_CHANNELS = 7, + FAIL_UNKNOWN_GROUP = 8, + FAIL_BOTH_GO_INTENT_15 = 9, + FAIL_INCOMPATIBLE_PROV_METHOD = 10, + FAIL_REJECTED_BY_USER = 11, + SUCCESS_DEFERRED = 12, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl new file mode 100644 index 0000000000..a4c7b6065b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum PairwiseCipherMask { + NONE = (1 << 0) /* 1 */, + TKIP = (1 << 3) /* 8 */, + CCMP = (1 << 4) /* 16 */, + GCMP_128 = (1 << 6) /* 64 */, + SMS4 = (1 << 7) /* 128 */, + GCMP_256 = (1 << 8) /* 256 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PmkSaCacheData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PmkSaCacheData.aidl new file mode 100644 index 0000000000..c31b16756c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PmkSaCacheData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable PmkSaCacheData { + byte[6] bssid; + long expirationTimeInSec; + byte[] serializedEntry; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PortRange.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PortRange.aidl new file mode 100644 index 0000000000..b2004f242b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/PortRange.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable PortRange { + int startPort; + int endPort; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ProtoMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ProtoMask.aidl new file mode 100644 index 0000000000..ba79025fa1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ProtoMask.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum ProtoMask { + WPA = (1 << 0) /* 1 */, + RSN = (1 << 1) /* 2 */, + WAPI = (1 << 2) /* 4 */, + OSEN = (1 << 3) /* 8 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl new file mode 100644 index 0000000000..8fb91d0511 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum ProtocolNextHeader { + TCP = 6, + UDP = 17, + ESP = 50, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl new file mode 100644 index 0000000000..156d57ac0c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyClassifierParams { + android.hardware.wifi.supplicant.IpVersion ipVersion; + android.hardware.wifi.supplicant.QosPolicyClassifierParamsMask classifierParamMask; + byte[] srcIp; + byte[] dstIp; + int srcPort; + android.hardware.wifi.supplicant.PortRange dstPortRange; + android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr; + byte[] flowLabelIpv6; + String domainName; + byte dscp; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl new file mode 100644 index 0000000000..fda5e3ef67 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum QosPolicyClassifierParamsMask { + SRC_IP = (1 << 0) /* 1 */, + DST_IP = (1 << 1) /* 2 */, + SRC_PORT = (1 << 2) /* 4 */, + DST_PORT_RANGE = (1 << 3) /* 8 */, + PROTOCOL_NEXT_HEADER = (1 << 4) /* 16 */, + FLOW_LABEL = (1 << 5) /* 32 */, + DOMAIN_NAME = (1 << 6) /* 64 */, + DSCP = (1 << 7) /* 128 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyData.aidl new file mode 100644 index 0000000000..1719565a81 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyData.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyData { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyRequestType requestType; + byte dscp; + android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl new file mode 100644 index 0000000000..fd4e787d9e --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum QosPolicyRequestType { + QOS_POLICY_ADD, + QOS_POLICY_REMOVE, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsData.aidl new file mode 100644 index 0000000000..4e5e8ae961 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyScsData { + byte policyId; + byte userPriority; + android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl new file mode 100644 index 0000000000..d5573af593 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyScsRequestStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl new file mode 100644 index 0000000000..8e0467f75a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl @@ -0,0 +1,26 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum QosPolicyScsRequestStatusCode { + SENT, + ALREADY_ACTIVE, + NOT_EXIST, + INVALID, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl new file mode 100644 index 0000000000..2737f1a5a8 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyScsResponseStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl new file mode 100644 index 0000000000..5d460c69c5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum QosPolicyScsResponseStatusCode { + SUCCESS, + TCLAS_REQUEST_DECLINED, + TCLAS_NOT_SUPPORTED_BY_AP, + TCLAS_INSUFFICIENT_RESOURCES, + TCLAS_RESOURCES_EXHAUSTED, + TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS, + TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT, + TCLAS_PROCESSING_TERMINATED, + TIMEOUT, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyStatus.aidl new file mode 100644 index 0000000000..61278c5fe5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyStatus.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyStatusCode status; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl new file mode 100644 index 0000000000..92286325c8 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum QosPolicyStatusCode { + QOS_POLICY_SUCCESS, + QOS_POLICY_REQUEST_DECLINED, + QOS_POLICY_CLASSIFIER_NOT_SUPPORTED, + QOS_POLICY_INSUFFICIENT_RESOURCES, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/RxFilterType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/RxFilterType.aidl new file mode 100644 index 0000000000..63f5bf2c45 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/RxFilterType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum RxFilterType { + V4_MULTICAST = 0, + V6_MULTICAST = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SaeH2eMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SaeH2eMode.aidl new file mode 100644 index 0000000000..4730d72c04 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SaeH2eMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="byte") @VintfStability +enum SaeH2eMode { + DISABLED, + H2E_OPTIONAL, + H2E_MANDATORY, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SignalPollResult.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SignalPollResult.aidl new file mode 100644 index 0000000000..52d3f2447d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SignalPollResult.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable SignalPollResult { + int linkId; + int currentRssiDbm; + int txBitrateMbps; + int rxBitrateMbps; + int frequencyMhz; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl new file mode 100644 index 0000000000..d78cfa2f28 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum StaIfaceCallbackState { + DISCONNECTED = 0, + IFACE_DISABLED = 1, + INACTIVE = 2, + SCANNING = 3, + AUTHENTICATING = 4, + ASSOCIATING = 5, + ASSOCIATED = 6, + FOURWAY_HANDSHAKE = 7, + GROUP_HANDSHAKE = 8, + COMPLETED = 9, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl new file mode 100644 index 0000000000..f26e7c5393 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum StaIfaceReasonCode { + UNSPECIFIED = 1, + PREV_AUTH_NOT_VALID = 2, + DEAUTH_LEAVING = 3, + DISASSOC_DUE_TO_INACTIVITY = 4, + DISASSOC_AP_BUSY = 5, + CLASS2_FRAME_FROM_NONAUTH_STA = 6, + CLASS3_FRAME_FROM_NONASSOC_STA = 7, + DISASSOC_STA_HAS_LEFT = 8, + STA_REQ_ASSOC_WITHOUT_AUTH = 9, + PWR_CAPABILITY_NOT_VALID = 10, + SUPPORTED_CHANNEL_NOT_VALID = 11, + BSS_TRANSITION_DISASSOC = 12, + INVALID_IE = 13, + MICHAEL_MIC_FAILURE = 14, + FOURWAY_HANDSHAKE_TIMEOUT = 15, + GROUP_KEY_UPDATE_TIMEOUT = 16, + IE_IN_4WAY_DIFFERS = 17, + GROUP_CIPHER_NOT_VALID = 18, + PAIRWISE_CIPHER_NOT_VALID = 19, + AKMP_NOT_VALID = 20, + UNSUPPORTED_RSN_IE_VERSION = 21, + INVALID_RSN_IE_CAPAB = 22, + IEEE_802_1X_AUTH_FAILED = 23, + CIPHER_SUITE_REJECTED = 24, + TDLS_TEARDOWN_UNREACHABLE = 25, + TDLS_TEARDOWN_UNSPECIFIED = 26, + SSP_REQUESTED_DISASSOC = 27, + NO_SSP_ROAMING_AGREEMENT = 28, + BAD_CIPHER_OR_AKM = 29, + NOT_AUTHORIZED_THIS_LOCATION = 30, + SERVICE_CHANGE_PRECLUDES_TS = 31, + UNSPECIFIED_QOS_REASON = 32, + NOT_ENOUGH_BANDWIDTH = 33, + DISASSOC_LOW_ACK = 34, + EXCEEDED_TXOP = 35, + STA_LEAVING = 36, + END_TS_BA_DLS = 37, + UNKNOWN_TS_BA = 38, + TIMEOUT = 39, + PEERKEY_MISMATCH = 45, + AUTHORIZED_ACCESS_LIMIT_REACHED = 46, + EXTERNAL_SERVICE_REQUIREMENTS = 47, + INVALID_FT_ACTION_FRAME_COUNT = 48, + INVALID_PMKID = 49, + INVALID_MDE = 50, + INVALID_FTE = 51, + MESH_PEERING_CANCELLED = 52, + MESH_MAX_PEERS = 53, + MESH_CONFIG_POLICY_VIOLATION = 54, + MESH_CLOSE_RCVD = 55, + MESH_MAX_RETRIES = 56, + MESH_CONFIRM_TIMEOUT = 57, + MESH_INVALID_GTK = 58, + MESH_INCONSISTENT_PARAMS = 59, + MESH_INVALID_SECURITY_CAP = 60, + MESH_PATH_ERROR_NO_PROXY_INFO = 61, + MESH_PATH_ERROR_NO_FORWARDING_INFO = 62, + MESH_PATH_ERROR_DEST_UNREACHABLE = 63, + MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64, + MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65, + MESH_CHANNEL_SWITCH_UNSPECIFIED = 66, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl new file mode 100644 index 0000000000..13529a5be1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum StaIfaceStatusCode { + SUCCESS = 0, + UNSPECIFIED_FAILURE = 1, + TDLS_WAKEUP_ALTERNATE = 2, + TDLS_WAKEUP_REJECT = 3, + SECURITY_DISABLED = 5, + UNACCEPTABLE_LIFETIME = 6, + NOT_IN_SAME_BSS = 7, + CAPS_UNSUPPORTED = 10, + REASSOC_NO_ASSOC = 11, + ASSOC_DENIED_UNSPEC = 12, + NOT_SUPPORTED_AUTH_ALG = 13, + UNKNOWN_AUTH_TRANSACTION = 14, + CHALLENGE_FAIL = 15, + AUTH_TIMEOUT = 16, + AP_UNABLE_TO_HANDLE_NEW_STA = 17, + ASSOC_DENIED_RATES = 18, + ASSOC_DENIED_NOSHORT = 19, + SPEC_MGMT_REQUIRED = 22, + PWR_CAPABILITY_NOT_VALID = 23, + SUPPORTED_CHANNEL_NOT_VALID = 24, + ASSOC_DENIED_NO_SHORT_SLOT_TIME = 25, + ASSOC_DENIED_NO_HT = 27, + R0KH_UNREACHABLE = 28, + ASSOC_DENIED_NO_PCO = 29, + ASSOC_REJECTED_TEMPORARILY = 30, + ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31, + UNSPECIFIED_QOS_FAILURE = 32, + DENIED_INSUFFICIENT_BANDWIDTH = 33, + DENIED_POOR_CHANNEL_CONDITIONS = 34, + DENIED_QOS_NOT_SUPPORTED = 35, + REQUEST_DECLINED = 37, + INVALID_PARAMETERS = 38, + REJECTED_WITH_SUGGESTED_CHANGES = 39, + INVALID_IE = 40, + GROUP_CIPHER_NOT_VALID = 41, + PAIRWISE_CIPHER_NOT_VALID = 42, + AKMP_NOT_VALID = 43, + UNSUPPORTED_RSN_IE_VERSION = 44, + INVALID_RSN_IE_CAPAB = 45, + CIPHER_REJECTED_PER_POLICY = 46, + TS_NOT_CREATED = 47, + DIRECT_LINK_NOT_ALLOWED = 48, + DEST_STA_NOT_PRESENT = 49, + DEST_STA_NOT_QOS_STA = 50, + ASSOC_DENIED_LISTEN_INT_TOO_LARGE = 51, + INVALID_FT_ACTION_FRAME_COUNT = 52, + INVALID_PMKID = 53, + INVALID_MDIE = 54, + INVALID_FTIE = 55, + REQUESTED_TCLAS_NOT_SUPPORTED = 56, + INSUFFICIENT_TCLAS_PROCESSING_RESOURCES = 57, + TRY_ANOTHER_BSS = 58, + GAS_ADV_PROTO_NOT_SUPPORTED = 59, + NO_OUTSTANDING_GAS_REQ = 60, + GAS_RESP_NOT_RECEIVED = 61, + STA_TIMED_OUT_WAITING_FOR_GAS_RESP = 62, + GAS_RESP_LARGER_THAN_LIMIT = 63, + REQ_REFUSED_HOME = 64, + ADV_SRV_UNREACHABLE = 65, + REQ_REFUSED_SSPN = 67, + REQ_REFUSED_UNAUTH_ACCESS = 68, + INVALID_RSNIE = 72, + U_APSD_COEX_NOT_SUPPORTED = 73, + U_APSD_COEX_MODE_NOT_SUPPORTED = 74, + BAD_INTERVAL_WITH_U_APSD_COEX = 75, + ANTI_CLOGGING_TOKEN_REQ = 76, + FINITE_CYCLIC_GROUP_NOT_SUPPORTED = 77, + CANNOT_FIND_ALT_TBTT = 78, + TRANSMISSION_FAILURE = 79, + REQ_TCLAS_NOT_SUPPORTED = 80, + TCLAS_RESOURCES_EXCHAUSTED = 81, + REJECTED_WITH_SUGGESTED_BSS_TRANSITION = 82, + REJECT_WITH_SCHEDULE = 83, + REJECT_NO_WAKEUP_SPECIFIED = 84, + SUCCESS_POWER_SAVE_MODE = 85, + PENDING_ADMITTING_FST_SESSION = 86, + PERFORMING_FST_NOW = 87, + PENDING_GAP_IN_BA_WINDOW = 88, + REJECT_U_PID_SETTING = 89, + REFUSED_EXTERNAL_REASON = 92, + REFUSED_AP_OUT_OF_MEMORY = 93, + REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED = 94, + QUERY_RESP_OUTSTANDING = 95, + REJECT_DSE_BAND = 96, + TCLAS_PROCESSING_TERMINATED = 97, + TS_SCHEDULE_CONFLICT = 98, + DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99, + MCCAOP_RESERVATION_CONFLICT = 100, + MAF_LIMIT_EXCEEDED = 101, + MCCA_TRACK_LIMIT_EXCEEDED = 102, + DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103, + ASSOC_DENIED_NO_VHT = 104, + ENABLEMENT_DENIED = 105, + RESTRICTION_FROM_AUTHORIZED_GDB = 106, + AUTHORIZATION_DEENABLED = 107, + FILS_AUTHENTICATION_FAILURE = 112, + UNKNOWN_AUTHENTICATION_SERVER = 113, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl new file mode 100644 index 0000000000..1d37635a29 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable SupplicantStateChangeData { + android.hardware.wifi.supplicant.StaIfaceCallbackState newState; + int id; + byte[] ssid; + byte[6] bssid; + android.hardware.wifi.supplicant.KeyMgmtMask keyMgmtMask; + int frequencyMhz; + boolean filsHlpSent; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl new file mode 100644 index 0000000000..d7ff7982b5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum SupplicantStatusCode { + SUCCESS, + FAILURE_UNKNOWN, + FAILURE_ARGS_INVALID, + FAILURE_IFACE_INVALID, + FAILURE_IFACE_UNKNOWN, + FAILURE_IFACE_EXISTS, + FAILURE_IFACE_DISABLED, + FAILURE_IFACE_NOT_DISCONNECTED, + FAILURE_NETWORK_INVALID, + FAILURE_NETWORK_UNKNOWN, + FAILURE_UNSUPPORTED, + FAILURE_ONGOING_REQUEST, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/TlsVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/TlsVersion.aidl new file mode 100644 index 0000000000..b31826a198 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/TlsVersion.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum TlsVersion { + TLS_V1_0, + TLS_V1_1, + TLS_V1_2, + TLS_V1_3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl new file mode 100644 index 0000000000..f1d7370c76 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum TransitionDisableIndication { + USE_WPA3_PERSONAL = (1 << 0) /* 1 */, + USE_SAE_PK = (1 << 1) /* 2 */, + USE_WPA3_ENTERPRISE = (1 << 2) /* 4 */, + USE_ENHANCED_OPEN = (1 << 3) /* 8 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WifiTechnology.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WifiTechnology.aidl new file mode 100644 index 0000000000..bf5081ea70 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WifiTechnology.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WifiTechnology { + UNKNOWN = 0, + LEGACY = 1, + HT = 2, + VHT = 3, + HE = 4, + EHT = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl new file mode 100644 index 0000000000..330f2aa267 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WpaDriverCapabilitiesMask { + MBO = (1 << 0) /* 1 */, + OCE = (1 << 1) /* 2 */, + SAE_PK = (1 << 2) /* 4 */, + WFD_R2 = (1 << 3) /* 8 */, + TRUST_ON_FIRST_USE = (1 << 4) /* 16 */, + SET_TLS_MINIMUM_VERSION = (1 << 5) /* 32 */, + TLS_V1_3 = (1 << 6) /* 64 */, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsConfigError.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsConfigError.aidl new file mode 100644 index 0000000000..c48b282e35 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsConfigError.aidl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WpsConfigError { + NO_ERROR = 0, + OOB_IFACE_READ_ERROR = 1, + DECRYPTION_CRC_FAILURE = 2, + CHAN_24_NOT_SUPPORTED = 3, + CHAN_50_NOT_SUPPORTED = 4, + SIGNAL_TOO_WEAK = 5, + NETWORK_AUTH_FAILURE = 6, + NETWORK_ASSOC_FAILURE = 7, + NO_DHCP_RESPONSE = 8, + FAILED_DHCP_CONFIG = 9, + IP_ADDR_CONFLICT = 10, + NO_CONN_TO_REGISTRAR = 11, + MULTIPLE_PBC_DETECTED = 12, + ROGUE_SUSPECTED = 13, + DEVICE_BUSY = 14, + SETUP_LOCKED = 15, + MSG_TIMEOUT = 16, + REG_SESS_TIMEOUT = 17, + DEV_PASSWORD_AUTH_FAILURE = 18, + CHAN_60G_NOT_SUPPORTED = 19, + PUBLIC_KEY_HASH_MISMATCH = 20, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsConfigMethods.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsConfigMethods.aidl new file mode 100644 index 0000000000..b9ea211bb4 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsConfigMethods.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WpsConfigMethods { + USBA = 0x0001, + ETHERNET = 0x0002, + LABEL = 0x0004, + DISPLAY = 0x0008, + EXT_NFC_TOKEN = 0x0010, + INT_NFC_TOKEN = 0x0020, + NFC_INTERFACE = 0x0040, + PUSHBUTTON = 0x0080, + KEYPAD = 0x0100, + VIRT_PUSHBUTTON = 0x0280, + PHY_PUSHBUTTON = 0x0480, + P2PS = 0x1000, + VIRT_DISPLAY = 0x2008, + PHY_DISPLAY = 0x4008, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl new file mode 100644 index 0000000000..9a20187b6e --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WpsDevPasswordId { + DEFAULT = 0x0000, + USER_SPECIFIED = 0x0001, + MACHINE_SPECIFIED = 0x0002, + REKEY = 0x0003, + PUSHBUTTON = 0x0004, + REGISTRAR_SPECIFIED = 0x0005, + NFC_CONNECTION_HANDOVER = 0x0007, + P2PS_DEFAULT = 0x0008, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsErrorIndication.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsErrorIndication.aidl new file mode 100644 index 0000000000..50e69ff03b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsErrorIndication.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WpsErrorIndication { + NO_ERROR = 0, + SECURITY_TKIP_ONLY_PROHIBITED = 1, + SECURITY_WEP_PROHIBITED = 2, + AUTH_FAILURE = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl new file mode 100644 index 0000000000..177d218db3 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/2/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum WpsProvisionMethod { + PBC, + DISPLAY, + KEYPAD, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl index 433b3d8018..553cbc8e25 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl @@ -39,4 +39,5 @@ parcelable ConnectionCapabilities { int maxNumberTxSpatialStreams; int maxNumberRxSpatialStreams; android.hardware.wifi.supplicant.LegacyMode legacyMode; + boolean apTidToLinkMapNegotiationSupported; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConfigurationData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConfigurationData.aidl new file mode 100644 index 0000000000..2225330538 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConfigurationData.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable DppConfigurationData { + byte[] ssid; + String password; + byte[] psk; + android.hardware.wifi.supplicant.DppAkm securityAkm; + android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys; + boolean connStatusRequested; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl new file mode 100644 index 0000000000..d72633b569 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum DppStatusErrorCode { + UNKNOWN = -1, + SUCCESS = 0, + NOT_COMPATIBLE = 1, + AUTH_FAILURE = 2, + UNWRAP_FAILURE = 3, + BAD_GROUP = 4, + CONFIGURE_FAILURE = 5, + RESPONSE_PENDING = 6, + INVALID_CONNECTOR = 7, + NO_MATCH = 8, + CONFIG_REJECTED = 9, + NO_AP = 10, + CONFIGURE_PENDING = 11, + CSR_NEEDED = 12, + CSR_BAD = 13, + NEW_KEY_NEEDED = 14, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl new file mode 100644 index 0000000000..bcf0ea8cb6 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +interface INonStandardCertCallback { + byte[] getBlob(in String alias); + String[] listAliases(in String prefix); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl index 4b26ac3013..dd62167907 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl @@ -47,5 +47,6 @@ interface ISupplicant { void setConcurrencyPriority(in android.hardware.wifi.supplicant.IfaceType type); void setDebugParams(in android.hardware.wifi.supplicant.DebugLevel level, in boolean showTimestamp, in boolean showKeys); oneway void terminate(); + void registerNonStandardCertCallback(in android.hardware.wifi.supplicant.INonStandardCertCallback callback); const int EXT_RADIO_WORK_TIMEOUT_IN_SECS = 10; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index e204184a98..19e6728420 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -96,4 +96,5 @@ interface ISupplicantP2pIface { void findOnSocialChannels(in int timeoutInSec); void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); + void configureEapolIpAddressAllocationParams(in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd); } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 8d9f498abb..da3ca52897 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -52,4 +52,5 @@ interface ISupplicantP2pIfaceCallback { oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes); + oneway void onGroupStartedWithParams(in android.hardware.wifi.supplicant.P2pGroupStartedEventParams groupStartedEventParams); } 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 53d5770e7f..1616b26003 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 @@ -95,4 +95,8 @@ interface ISupplicantStaIface { void stopDppInitiator(); void stopDppResponder(in int ownBootstrapId); void stopRxFilter(); + android.hardware.wifi.supplicant.SignalPollResult[] getSignalPollResults(); + android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in android.hardware.wifi.supplicant.QosPolicyScsData[] qosPolicyData); + android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds); + const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 25a09b435e..1c232237ea 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -44,6 +44,9 @@ interface ISupplicantStaIfaceCallback { oneway void onDppFailure(in android.hardware.wifi.supplicant.DppFailureCode code, in String ssid, in String channelList, in char[] bandList); oneway void onDppProgress(in android.hardware.wifi.supplicant.DppProgressCode code); oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); + /** + * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onDppConfigReceived. + */ oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); oneway void onDppSuccessConfigSent(); oneway void onEapFailure(in byte[] bssid, in int errorCode); @@ -56,11 +59,29 @@ interface ISupplicantStaIfaceCallback { oneway void onNetworkAdded(in int id); oneway void onNetworkNotFound(in byte[] ssid); oneway void onNetworkRemoved(in int id); + /** + * @deprecated use onPmkSaCacheAdded() instead. + */ oneway void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry); + /** + * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onSupplicantStateChanged() + */ oneway void onStateChanged(in android.hardware.wifi.supplicant.StaIfaceCallbackState newState, in byte[] bssid, in int id, in byte[] ssid, in boolean filsHlpSent); oneway void onWpsEventFail(in byte[] bssid, in android.hardware.wifi.supplicant.WpsConfigError configError, in android.hardware.wifi.supplicant.WpsErrorIndication errorInd); oneway void onWpsEventPbcOverlap(); oneway void onWpsEventSuccess(); oneway void onQosPolicyReset(); oneway void onQosPolicyRequest(in int qosPolicyRequestId, in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); + oneway void onMloLinksInfoChanged(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback.MloLinkInfoChangeReason reason); + oneway void onDppConfigReceived(in android.hardware.wifi.supplicant.DppConfigurationData configData); + oneway void onDppConnectionStatusResultSent(in android.hardware.wifi.supplicant.DppStatusErrorCode code); + oneway void onBssFrequencyChanged(in int frequencyMhz); + oneway void onSupplicantStateChanged(in android.hardware.wifi.supplicant.SupplicantStateChangeData stateChangeData); + oneway void onQosPolicyResponseForScs(in android.hardware.wifi.supplicant.QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus); + oneway void onPmkSaCacheAdded(in android.hardware.wifi.supplicant.PmkSaCacheData pmkSaData); + @Backing(type="int") @VintfStability + enum MloLinkInfoChangeReason { + TID_TO_LINK_MAP = 0, + MULTI_LINK_RECONFIG_AP_REMOVAL = 1, + } } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl index 0b3cb8156e..bfc05a4ad8 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -127,6 +127,8 @@ interface ISupplicantStaNetwork { void setWepKey(in int keyIdx, in byte[] wepKey); void setWepTxKeyIdx(in int keyIdx); void setRoamingConsortiumSelection(in byte[] selectedRcoi); + void setMinimumTlsVersionEapPhase1Param(android.hardware.wifi.supplicant.TlsVersion tlsVersion); + void setStrictConservativePeerMode(in boolean enable); const int SSID_MAX_LEN_IN_BYTES = 32; const int PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8; const int PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63; diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl index 6276a3521b..f9a078be4d 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl @@ -39,4 +39,5 @@ interface ISupplicantStaNetworkCallback { oneway void onNetworkEapSimUmtsAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimUmtsAuthParams params); oneway void onTransitionDisable(in android.hardware.wifi.supplicant.TransitionDisableIndication ind); oneway void onServerCertificateAvailable(in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); + oneway void onPermanentIdReqDenied(); } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl index 5e2c47bdb5..8bda3242b3 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl @@ -36,4 +36,8 @@ package android.hardware.wifi.supplicant; parcelable MloLink { byte linkId; byte[] staLinkMacAddress; + byte tidsUplinkMap; + byte tidsDownlinkMap; + @nullable byte[6] apLinkMacAddress; + int frequencyMHz; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl index 14fcb9178d..3dac2d6694 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl @@ -35,4 +35,6 @@ package android.hardware.wifi.supplicant; @VintfStability parcelable MloLinksInfo { android.hardware.wifi.supplicant.MloLink[] links; + int apMloLinkId; + @nullable byte[6] apMldMacAddress; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl new file mode 100644 index 0000000000..db31ca1d48 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pClientEapolIpAddressInfo { + int ipAddressClient; + int ipAddressMask; + int ipAddressGo; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl new file mode 100644 index 0000000000..5465a86b13 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pGroupStartedEventParams { + String groupInterfaceName; + boolean isGroupOwner; + byte[] ssid; + int frequencyMHz; + byte[] psk; + String passphrase; + boolean isPersistent; + byte[6] goDeviceAddress; + byte[6] goInterfaceAddress; + boolean isP2pClientEapolIpAddressInfoPresent; + android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo p2pClientIpInfo; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PmkSaCacheData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PmkSaCacheData.aidl new file mode 100644 index 0000000000..c31b16756c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PmkSaCacheData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable PmkSaCacheData { + byte[6] bssid; + long expirationTimeInSec; + byte[] serializedEntry; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl index 8bf5fd836d..156d57ac0c 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -43,4 +43,5 @@ parcelable QosPolicyClassifierParams { android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr; byte[] flowLabelIpv6; String domainName; + byte dscp; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl index 280ddbe3b2..9c0c0b65fb 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl @@ -41,4 +41,5 @@ enum QosPolicyClassifierParamsMask { PROTOCOL_NEXT_HEADER = 16, FLOW_LABEL = 32, DOMAIN_NAME = 64, + DSCP = 128, } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl new file mode 100644 index 0000000000..4e5e8ae961 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyScsData { + byte policyId; + byte userPriority; + android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl new file mode 100644 index 0000000000..d5573af593 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyScsRequestStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl new file mode 100644 index 0000000000..4d815665d7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl @@ -0,0 +1,26 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum QosPolicyScsRequestStatusCode { + SENT = 0, + ALREADY_ACTIVE = 1, + NOT_EXIST = 2, + INVALID = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl new file mode 100644 index 0000000000..2737f1a5a8 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosPolicyScsResponseStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl new file mode 100644 index 0000000000..693d3e0ac0 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum QosPolicyScsResponseStatusCode { + SUCCESS = 0, + TCLAS_REQUEST_DECLINED = 1, + TCLAS_NOT_SUPPORTED_BY_AP = 2, + TCLAS_INSUFFICIENT_RESOURCES = 3, + TCLAS_RESOURCES_EXHAUSTED = 4, + TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS = 5, + TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT = 6, + TCLAS_PROCESSING_TERMINATED = 7, + TIMEOUT = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SignalPollResult.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SignalPollResult.aidl new file mode 100644 index 0000000000..52d3f2447d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SignalPollResult.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable SignalPollResult { + int linkId; + int currentRssiDbm; + int txBitrateMbps; + int rxBitrateMbps; + int frequencyMhz; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl new file mode 100644 index 0000000000..1d37635a29 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable SupplicantStateChangeData { + android.hardware.wifi.supplicant.StaIfaceCallbackState newState; + int id; + byte[] ssid; + byte[6] bssid; + android.hardware.wifi.supplicant.KeyMgmtMask keyMgmtMask; + int frequencyMhz; + boolean filsHlpSent; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl index 32d71a3a8c..d84ff95300 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl @@ -45,4 +45,5 @@ enum SupplicantStatusCode { FAILURE_NETWORK_INVALID = 8, FAILURE_NETWORK_UNKNOWN = 9, FAILURE_UNSUPPORTED = 10, + FAILURE_ONGOING_REQUEST = 11, } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl new file mode 100644 index 0000000000..22a374fece --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum TlsVersion { + TLS_V1_0 = 0, + TLS_V1_1 = 1, + TLS_V1_2 = 2, + TLS_V1_3 = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl index 9a0a924c66..32e1510487 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl @@ -39,4 +39,6 @@ enum WpaDriverCapabilitiesMask { SAE_PK = 4, WFD_R2 = 8, TRUST_ON_FIRST_USE = 16, + SET_TLS_MINIMUM_VERSION = 32, + TLS_V1_3 = 64, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl index 1718413a13..4921a672b3 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl @@ -44,4 +44,8 @@ parcelable ConnectionCapabilities { * detailed network mode for legacy network */ LegacyMode legacyMode; + /** + * Indicates the AP support for TID-to-link mapping negotiation. + */ + boolean apTidToLinkMapNegotiationSupported; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConfigurationData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConfigurationData.aidl new file mode 100644 index 0000000000..b25bc402c8 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConfigurationData.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.DppAkm; +import android.hardware.wifi.supplicant.DppConnectionKeys; + +/** + * DPP configuration related information. + */ +@VintfStability +parcelable DppConfigurationData { + /* + * SSID of the network. + */ + byte[] ssid; + /* + * WPA2 or SAE passphrase. + */ + String password; + /* + * Pre-shared key encoded in hex. + */ + byte[] psk; + /* + * AKM that can be provisioned using DPP. + */ + DppAkm securityAkm; + /* + * Connection keys that are used for DPP network connection. + */ + DppConnectionKeys dppConnectionKeys; + /* + * Optional flag to indicate that the configurator requested connection status + * result. + * This flag is set to true if the enrollee receives the configuration response + * frame with sendConnStatus attribute. + */ + boolean connStatusRequested; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl new file mode 100644 index 0000000000..30965d6978 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * DppStatusErrorCode: The possible values for the DPP status and error codes + * in the DPP protocol. + * See Easy Connect specification V2.0 section 8.3.4 for details. + */ +@VintfStability +@Backing(type="int") +enum DppStatusErrorCode { + UNKNOWN = -1, + SUCCESS = 0, + NOT_COMPATIBLE = 1, + AUTH_FAILURE = 2, + UNWRAP_FAILURE = 3, + BAD_GROUP = 4, + CONFIGURE_FAILURE = 5, + RESPONSE_PENDING = 6, + INVALID_CONNECTOR = 7, + NO_MATCH = 8, + CONFIG_REJECTED = 9, + NO_AP = 10, + CONFIGURE_PENDING = 11, + CSR_NEEDED = 12, + CSR_BAD = 13, + NEW_KEY_NEEDED = 14, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl new file mode 100644 index 0000000000..2e11c76e92 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/INonStandardCertCallback.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Callback to allow supplicant to retrieve non-standard certificate types + * from the framework. Certificates can be stored in the framework using + * the WifiKeystore#put system API. + * + * Must be registered by the client at initialization, so that + * supplicant can call into the client to retrieve any values. + */ +@VintfStability +interface INonStandardCertCallback { + /** + * Requests a binary blob from the certificate key-value store. + * + * @param alias Key into the key-value mapping. + * @return Value associated with |alias| in the certificate store. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + byte[] getBlob(in String alias); + + /** + * List the aliases currently stored in the database. + * + * @param prefix Prefix to filter the aliases by. + * @return List of alias strings in the certificate store. + The resulting strings will each exclude the prefix. + */ + String[] listAliases(in String prefix); +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl index c17289d932..b187c2f963 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl @@ -17,6 +17,7 @@ package android.hardware.wifi.supplicant; import android.hardware.wifi.supplicant.DebugLevel; +import android.hardware.wifi.supplicant.INonStandardCertCallback; import android.hardware.wifi.supplicant.ISupplicantCallback; import android.hardware.wifi.supplicant.ISupplicantP2pIface; import android.hardware.wifi.supplicant.ISupplicantStaIface; @@ -158,4 +159,14 @@ interface ISupplicant { * wait to be restarted. */ oneway void terminate(); + + /** + * Register a Non-Standard Certificate callback with supplicant. + * + * @param callback An instance of the |INonStandardCertCallback| AIDL interface + * object. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + void registerNonStandardCertCallback(in INonStandardCertCallback callback); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 313ee8b1ac..e58422c8ea 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -827,4 +827,22 @@ interface ISupplicantP2pIface { * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ void setVendorElements(in P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); + + /** + * Configure the IP addresses in supplicant for P2P GO to provide the IP address to + * client in EAPOL handshake. Refer Wi-Fi P2P Technical Specification v1.7 - Section 4.2.8 + * "IP Address Allocation in EAPOL-Key Frames (4-Way Handshake)" for more details. + * The IP addresses are IPV4 addresses and higher-order address bytes are in the lower-order + * int bytes (e.g. 1.2.3.4 is represented as 0x04030201) + * + * @param ipAddressGo The P2P Group Owner IP address. + * @param ipAddressMask The P2P Group owner subnet mask. + * @param ipAddressStart The starting address in the IP address pool. + * @param ipAddressEnd The ending address in the IP address pool. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + */ + void configureEapolIpAddressAllocationParams( + in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 7c8c1f28ae..9d6fa678b8 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -17,6 +17,7 @@ package android.hardware.wifi.supplicant; import android.hardware.wifi.supplicant.P2pGroupCapabilityMask; +import android.hardware.wifi.supplicant.P2pGroupStartedEventParams; import android.hardware.wifi.supplicant.P2pProvDiscStatusCode; import android.hardware.wifi.supplicant.P2pStatusCode; import android.hardware.wifi.supplicant.WpsConfigMethods; @@ -243,4 +244,11 @@ oneway interface ISupplicantP2pIfaceCallback { in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods, in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes); + + /** + * Used to indicate the start of a P2P group, with some parameters describing the group. + * + * @param groupStartedEventParams Parameters describing the P2P group. + */ + void onGroupStartedWithParams(in P2pGroupStartedEventParams groupStartedEventParams); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index 9edf210be8..06ab8fb218 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -29,8 +29,11 @@ import android.hardware.wifi.supplicant.ISupplicantStaNetwork; import android.hardware.wifi.supplicant.IfaceType; import android.hardware.wifi.supplicant.KeyMgmtMask; import android.hardware.wifi.supplicant.MloLinksInfo; +import android.hardware.wifi.supplicant.QosPolicyScsData; +import android.hardware.wifi.supplicant.QosPolicyScsRequestStatus; import android.hardware.wifi.supplicant.QosPolicyStatus; import android.hardware.wifi.supplicant.RxFilterType; +import android.hardware.wifi.supplicant.SignalPollResult; import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask; import android.hardware.wifi.supplicant.WpsConfigMethods; @@ -781,4 +784,70 @@ interface ISupplicantStaIface { * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ void stopRxFilter(); + + /** + * This method returns the signal poll results. Results will be for each + * link in case of Multiple Link Operation (MLO). + * + * @return Signal Poll Results per link. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + * |SupplicantStatusCode.FAILURE_UNSUPPORTED| + */ + SignalPollResult[] getSignalPollResults(); + + /** + * Maximum number of policies that can be included in a QoS SCS add/remove request. + */ + const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16; + + /** + * Send a set of QoS SCS policy add requests to the AP. + * + * This is a request to the AP (if it supports the feature) to apply the QoS policies + * on traffic in the downlink. + * + * Synchronous response will indicate which policies were sent to the AP, and which + * were rejected immediately by supplicant. Caller will also receive an asynchronous + * response in |ISupplicantStaIfaceCallback.onQosPolicyResponseForScs| indicating + * the response from the AP for each policy that was sent. + * + * @param qosPolicyScsData QoS policies info provided by STA. + * @return QosPolicyScsRequestStatus[] synchronously corresponding to all + * the scs policies. Size of the result array will be the same as + * the size of the input array. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| if the number of policies in the + * request is greater than |MAX_POLICIES_PER_QOS_SCS_REQUEST| + * + * |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support + * the feature. + * + * |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently + * being processed. Supplicant will only handle one request at a time. + */ + QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in QosPolicyScsData[] qosPolicyData); + + /** + * Request the removal of specific QoS policies for SCS configured by the STA. + * + * Synchronous response will indicate which policies were sent to the AP, and which + * were rejected immediately by supplicant. Caller will also receive an asynchronous + * response in |ISupplicantStaIfaceCallback.onQosPolicyResponseForScs| indicating + * the response from the AP for each policy that was sent. + * + * @param scsPolicyIds policy id's to be removed. + * @return QosPolicyScsRequestStatus[] synchronously corresponding to all + * the scs policies. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| if the number of policies in the + * request is greater than |MAX_POLICIES_PER_QOS_SCS_REQUEST| + * + * |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support + * the feature. + * + * |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently + * being processed. Supplicant will only handle one request at a time. + */ + QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 0730a8cf54..17a220ddf5 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -22,15 +22,20 @@ import android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode; import android.hardware.wifi.supplicant.BssTmData; import android.hardware.wifi.supplicant.BssidChangeReason; import android.hardware.wifi.supplicant.DppAkm; +import android.hardware.wifi.supplicant.DppConfigurationData; import android.hardware.wifi.supplicant.DppConnectionKeys; import android.hardware.wifi.supplicant.DppEventType; import android.hardware.wifi.supplicant.DppFailureCode; import android.hardware.wifi.supplicant.DppProgressCode; +import android.hardware.wifi.supplicant.DppStatusErrorCode; import android.hardware.wifi.supplicant.Hs20AnqpData; import android.hardware.wifi.supplicant.OsuMethod; +import android.hardware.wifi.supplicant.PmkSaCacheData; import android.hardware.wifi.supplicant.QosPolicyData; +import android.hardware.wifi.supplicant.QosPolicyScsResponseStatus; import android.hardware.wifi.supplicant.StaIfaceCallbackState; import android.hardware.wifi.supplicant.StaIfaceReasonCode; +import android.hardware.wifi.supplicant.SupplicantStateChangeData; import android.hardware.wifi.supplicant.WpsConfigError; import android.hardware.wifi.supplicant.WpsErrorIndication; @@ -143,6 +148,9 @@ oneway interface ISupplicantStaIfaceCallback { * Indicates DPP configuration received success event in Enrolee mode. * This is also triggered when Configurator generates credentials for itself * using generateSelfDppConfiguration() API + *

+ * @deprecated This callback is deprecated from AIDL v2, newer HAL should call + * onDppConfigReceived. */ void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in DppAkm securityAkm, in DppConnectionKeys dppConnectionKeys); @@ -241,6 +249,8 @@ oneway interface ISupplicantStaIfaceCallback { /** * Indicates pairwise master key (PMK) cache added event. * + * @deprecated use onPmkSaCacheAdded() instead. + * * @param expirationTimeInSec expiration time in seconds * @param serializedEntry is serialized PMK cache entry, the content is * opaque for the framework and depends on the native implementation. @@ -252,6 +262,9 @@ oneway interface ISupplicantStaIfaceCallback { * event is triggered by a particular network, the |SupplicantNetworkId|, * |ssid|, |bssid| parameters must indicate the parameters of the network/AP * which caused this state transition. + *

+ * @deprecated This callback is deprecated from AIDL v2, newer HAL should call + * onSupplicantStateChanged() * * @param newState New State of the interface. This must be one of the |State| * values above. @@ -303,4 +316,91 @@ oneway interface ISupplicantStaIfaceCallback { * @param qosPolicyData QoS policies info requested by the AP. */ void onQosPolicyRequest(in int qosPolicyRequestId, in QosPolicyData[] qosPolicyData); + + /** + * Reason codes to be used with the callback |ISupplicantStaIfaceCallback.onMloLinksInfoChanged| + */ + @VintfStability + @Backing(type="int") + enum MloLinkInfoChangeReason { + /** + * TID-to-link mapping has changed. Updated mappings will be set in + * |MloLinksInfo.MloLink[].tids_downlink_map| and + * |MloLinksInfo.MloLink[].tids_uplink_map| for each of the links. + * + * STA MLD will operate in default mode if a TID-to-link mapping is not + * indicated by the callback. In default mode, all TIDs are mapped to + * all setup links in downlink and uplink directions. + */ + TID_TO_LINK_MAP = 0, + /** + * Multi-link reconfiguration - AP removal as described in + * IEEE 802.11be spec, section 35.3.6. This is a mandatory feature for + * station. + * + * Removed link will not be present in |ISupplicantStaIface.getConnectionMloLinksInfo|. + */ + MULTI_LINK_RECONFIG_AP_REMOVAL = 1, + } + + /** + * Used to indicate that Multi Link status has changed due to the provided + * reason. Upadted MLO link status can be fetched using + * |ISupplicantStaIface.getConnectionMloLinksInfo| + * + * |MloLink.linkId| and |MloLink.staLinkMacAddress| are not expected + * to change. + * + * @param reason Reason as given in MloLinkInfoChangeReason. + */ + void onMloLinksInfoChanged(in MloLinkInfoChangeReason reason); + + /** + * Indicates DPP configuration received success event in Enrollee mode. + * This is also triggered when Configurator generates credentials for itself + * using generateSelfDppConfiguration() API + */ + void onDppConfigReceived(in DppConfigurationData configData); + + /** + * Indicates that DPP connection status result frame is sent. + */ + void onDppConnectionStatusResultSent(in DppStatusErrorCode code); + + /** + * Used to indicate that the operating frequency has changed for this BSS. + * This event is triggered when STA switches the channel due to channel + * switch announcement from the connected access point. + * + * @param frequencyMhz New operating frequency in MHz. + */ + void onBssFrequencyChanged(in int frequencyMhz); + + /** + * Used to indicate a state change event on this particular iface. + * + * @param stateChangeData Supplicant state change related information. + */ + void onSupplicantStateChanged(in SupplicantStateChangeData stateChangeData); + + /** + * Indicates an SCS response from the AP. + * + * If the AP does not send a response within the timeout period (1 sec), + * supplicant will call this API with the TIMEOUT status for each policy. + * + * The AP can trigger an unsolicited scs response to indicate the removal of + * previously requested policies. + * + * @param qosPolicyScsResponseStatus[] status for each SCS id. + */ + void onQosPolicyResponseForScs(in QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus); + + /** + * Indicates pairwise master key (PMK) cache added event. + * + * @param pmkSaData PMKSA cache entry added details. + * + */ + void onPmkSaCacheAdded(in PmkSaCacheData pmkSaData); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl index 267f1e876a..750cf721e4 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -31,6 +31,7 @@ import android.hardware.wifi.supplicant.OcspType; import android.hardware.wifi.supplicant.PairwiseCipherMask; import android.hardware.wifi.supplicant.ProtoMask; import android.hardware.wifi.supplicant.SaeH2eMode; +import android.hardware.wifi.supplicant.TlsVersion; /** * Interface exposed by the supplicant for each station mode network @@ -1118,4 +1119,26 @@ interface ISupplicantStaNetwork { * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| */ void setRoamingConsortiumSelection(in byte[] selectedRcoi); + + /** + * Set the minimum TLS version for EAP phase1 param. + * + * @param tlsVersion the TLS version + * + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| + */ + void setMinimumTlsVersionEapPhase1Param(TlsVersion tlsVersion); + + /** + * Enable the strict conservative peer mode for EAP-SIM/AKA/AKA' + * + * @param enable true to enable, false to disable. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| + */ + void setStrictConservativePeerMode(in boolean enable); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl index de7b675036..4f892be36f 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl @@ -71,4 +71,11 @@ oneway interface ISupplicantStaNetworkCallback { */ void onServerCertificateAvailable( in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); + + /** + * Used to notify the AT_PERMANENT_ID_REQ denied event. + * + * In strict conservative mode, AT_PERMANENT_ID_REQ is denied from eap_peer side. + */ + void onPermanentIdReqDenied(); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl index 0e23728168..0b4d66ed50 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl @@ -30,4 +30,40 @@ parcelable MloLink { * STA Link MAC Address */ byte[/* 6 */] staLinkMacAddress; + /** + * Bitset where each bit indicates TID mapped to this link in uplink and + * downlink direction. + * + * Traffic Identifier (TID) is an identifier used to classify a packet. It + * is represented as a four bit number identifying the QoS traffic within + * MAC data service. There are 16 possible values for TID, out of only 8 are + * practically used to identify differentiated services. + * + * A TID-to-link mapping indicates links on which frames belonging to each + * TID can be exchanged. IEEE 802.11be draft 2.0 defines the mapping for TID + * values between 0 to 7 only. Once associated, an MLO link state is + * considered as active if at least one TID is mapped to the link. Link + * state is considered as idle if no TID is mapped to the link. + * + * TIDs can be mapped to uplink, downlink or both directions. + * e.g. + * - TID 4 is mapped to this link in uplink direction, if bit 4 in + * MloLink#tids_uplink_map is set. + * - TID 2 is mapped to both directions for this link, if bit 2 of both + * MloLink#tids_uplink_map and MloLink#tids_downlink_map are set. + * + * In case of default link mapping, tids_uplink_map and tids_downlink_map + * is set to 0xFF for all the links. + * + */ + byte tidsUplinkMap; + byte tidsDownlinkMap; + /** + * AP Link MAC Address + */ + @nullable byte[6] apLinkMacAddress; + /** + * Frequency on which the link operates in MHz. + */ + int frequencyMHz; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl index 2f14717209..3b81df8a6c 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl @@ -28,4 +28,12 @@ parcelable MloLinksInfo { * List of MLO links */ MloLink[] links; + /** + * The MLO link-id for the access point. It is the link-id used for association. + */ + int apMloLinkId; + /** + * AP MLD MAC address. + */ + @nullable byte[6] apMldMacAddress; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl new file mode 100644 index 0000000000..148e4a4db0 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pClientEapolIpAddressInfo.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * P2P Client IPV4 address allocated via EAPOL exchange. + * The IP addresses are IPV4 addresses and higher-order address bytes are in the lower-order + * int bytes (e.g. 1.2.3.4 is represented as 0x04030201) + */ +@VintfStability +parcelable P2pClientEapolIpAddressInfo { + /** + * The P2P Client IP address. + */ + int ipAddressClient; + /** + * The subnet that the P2P Group Owner is using. + */ + int ipAddressMask; + /** + * The P2P Group Owner IP address. + */ + int ipAddressGo; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl new file mode 100644 index 0000000000..96f1e16793 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo; + +/** + * Parameters passed as part of Wifi P2P group start event. + */ +@VintfStability +parcelable P2pGroupStartedEventParams { + /** Interface name of the group (For ex: p2p-p2p0-1). */ + String groupInterfaceName; + + /** Whether this device is owner of the group. */ + boolean isGroupOwner; + + /** SSID of the group. */ + byte[] ssid; + + /** Frequency in MHz on which this group is created. */ + int frequencyMHz; + + /** PSK used to secure the group. */ + byte[] psk; + + /** PSK passphrase used to secure the group. */ + String passphrase; + + /** Whether this group is persisted or not. */ + boolean isPersistent; + + /** MAC Address of the owner of this group. */ + byte[6] goDeviceAddress; + + /** MAC Address of the P2P interface of the owner of this group. */ + byte[6] goInterfaceAddress; + + /** + * Flag to indicate that the P2P Client IP address is allocated via EAPOL exchange. + */ + boolean isP2pClientEapolIpAddressInfoPresent; + + /** + * The P2P Client IP Address allocated by the P2P Group Owner in EAPOL + * key exchange. + * Refer Wi-Fi P2P Technical Specification v1.7 - Section 4.2.8 + * "IP Address Allocation in EAPOL-Key Frames (4-Way Handshake)" for more details. + * The value is undefined if isP2pClientEapolIpAddressInfoPresent is false. + */ + P2pClientEapolIpAddressInfo p2pClientIpInfo; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PmkSaCacheData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PmkSaCacheData.aidl new file mode 100644 index 0000000000..e0f1d319d6 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PmkSaCacheData.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Details of the PMKSA cache entry that was added in supplicant. + */ +@VintfStability +parcelable PmkSaCacheData { + /** + * BSSID of the access point to which the station is associated. + */ + byte[6] bssid; + /** + * PMK expiration time in seconds. + */ + long expirationTimeInSec; + /** + * Serialized PMK cache entry. + * The content is opaque for the framework and depends on the native implementation. + */ + byte[] serializedEntry; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl index d95d18dd27..478b09d717 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -62,4 +62,10 @@ parcelable QosPolicyClassifierParams { * "reg-name" in RFC 3986. */ String domainName; + + /** + * Differentiated Services Code Point (DSCP) value. + * Used by AP for mapping the data streams to apply the user priority. + */ + byte dscp; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl index 51bc14c25e..c15fec050b 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl @@ -29,4 +29,5 @@ enum QosPolicyClassifierParamsMask { PROTOCOL_NEXT_HEADER = 1 << 4, FLOW_LABEL = 1 << 5, DOMAIN_NAME = 1 << 6, + DSCP = 1 << 7, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl new file mode 100644 index 0000000000..86a4dac216 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -0,0 +1,24 @@ +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.QosPolicyClassifierParams; + +/** + * QoS policy information in SCS request. + * TCLAS Processing element is always set to 0. + */ +@VintfStability +parcelable QosPolicyScsData { + /** SCS QoS Policy identifier. */ + byte policyId; + + /** + * User Priority (UP) which the AP should apply to streams that match + * the classifier parameters. + */ + byte userPriority; + + /** + * QoS policy SCS classifier type information. + */ + QosPolicyClassifierParams classifierParams; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl new file mode 100644 index 0000000000..e233f32260 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl @@ -0,0 +1,13 @@ +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode; + +/** + * QoS policy status info per scsId. Returned immediately by supplicant + * upon SCS request. + */ +@VintfStability +parcelable QosPolicyScsRequestStatus { + byte policyId; + QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl new file mode 100644 index 0000000000..daf1578bb4 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl @@ -0,0 +1,25 @@ +package android.hardware.wifi.supplicant; + +/** + * Enum values for QoS policy request status. + */ +@VintfStability +@Backing(type="int") +enum QosPolicyScsRequestStatusCode { + /** + * SCS request was sent to the AP. + */ + SENT, + /** + * Add request conflicts with an existing policy ID. + */ + ALREADY_ACTIVE, + /** + * Remove request is for a policy ID that does not exist. + */ + NOT_EXIST, + /** + * QoS policy params are invalid. + */ + INVALID, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl new file mode 100644 index 0000000000..846a0e2da5 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl @@ -0,0 +1,13 @@ +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode; + +/** + * QoS policy status info per scsId. Returned in a callback once replies are + * received from the AP. + */ +@VintfStability +parcelable QosPolicyScsResponseStatus { + byte policyId; + QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl new file mode 100644 index 0000000000..f4ecd2a0ba --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl @@ -0,0 +1,46 @@ +package android.hardware.wifi.supplicant; + +/** + * Enum values for QoS policy response status. + */ +@VintfStability +@Backing(type="int") +enum QosPolicyScsResponseStatusCode { + SUCCESS, + /** + * Network policy does not permit the stream to be assigned the requested + * user priority (UP), but the AP might accept another request from the STA + * with the same TCLAS classifier(s) but a different user priority (UP). + */ + TCLAS_REQUEST_DECLINED, + /** + * Requested TCLAS processing is not supported by the AP. + */ + TCLAS_NOT_SUPPORTED_BY_AP, + /** + * The AP has insufficient TCLAS processing resources to satisfy the request + * (i.e. to classify and process the traffic). + */ + TCLAS_INSUFFICIENT_RESOURCES, + /** + * Sufficient TCLAS processing resources were available when the SCS + * stream was created, but are no longer available. + */ + TCLAS_RESOURCES_EXHAUSTED, + /** + * Insufficient capacity to sustain the current QoS treatment. + */ + TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS, + /** + * Conflict with a (new or dynamic) network policy. + */ + TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT, + /** + * Other reason for decline. + */ + TCLAS_PROCESSING_TERMINATED, + /** + * AP did not send a response within the timeout period (1 sec). + */ + TIMEOUT, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SignalPollResult.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SignalPollResult.aidl new file mode 100644 index 0000000000..a3b11a033a --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SignalPollResult.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Signal polling results. + */ +@VintfStability +parcelable SignalPollResult { + /** + * Link identifier. + */ + int linkId; + /** + * RSSI value in dBM. + */ + int currentRssiDbm; + /** + * Last transmitted packet bit rate in Mbps. + */ + int txBitrateMbps; + /** + * Last received packet bit rate in Mbps. + */ + int rxBitrateMbps; + /** + * Frequency in MHz. + */ + int frequencyMhz; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl new file mode 100644 index 0000000000..f7c66e0ba3 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStateChangeData.aidl @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.KeyMgmtMask; +import android.hardware.wifi.supplicant.StaIfaceCallbackState; + +/** + * Supplicant state change related information. + */ +@VintfStability +parcelable SupplicantStateChangeData { + /** + * New State of the interface. This must be one of the + * |StaIfaceCallbackState| values. + */ + StaIfaceCallbackState newState; + /** + * ID of the corresponding network which caused this + * state change event. This must be invalid (-1) if this + * event is not specific to a particular network. + */ + int id; + /** + * SSID of the corresponding network which caused this state + * change event. This must be empty if this event is not specific + * to a particular network. + */ + byte[] ssid; + /** + * BSSID of the corresponding AP which caused this state + * change event. This must be zero'ed if this event is not + * specific to a particular network. + */ + byte[6] bssid; + + /** + * Currently used key mgmt mask. + */ + KeyMgmtMask keyMgmtMask; + /* + * Frequency of the connected channel in MHz. This must be zero if this + * event is not specific to a particular network. + */ + int frequencyMhz; + /* + * Flag to indicate that FILS HLP IEs were included in this association. + * This flag is valid only for WPA_COMPLETED state change. + */ + boolean filsHlpSent; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl index c7b7ffdcf1..e97d6eed21 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl @@ -63,4 +63,8 @@ enum SupplicantStatusCode { */ FAILURE_NETWORK_UNKNOWN, FAILURE_UNSUPPORTED, + /** + * A different request is currently being processed. + */ + FAILURE_ONGOING_REQUEST, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/TlsVersion.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/TlsVersion.aidl new file mode 100644 index 0000000000..316e881f08 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/TlsVersion.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * TlsVersion: TLS version. + */ +@VintfStability +@Backing(type="int") +enum TlsVersion { + TLS_V1_0, + TLS_V1_1, + TLS_V1_2, + TLS_V1_3, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl index 08006cffba..a9434c4f11 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl @@ -42,4 +42,12 @@ enum WpaDriverCapabilitiesMask { * Trust On First Use */ TRUST_ON_FIRST_USE = 1 << 4, + /** + * TLS minimum version + */ + SET_TLS_MINIMUM_VERSION = 1 << 5, + /** + * TLS V1.3 + */ + TLS_V1_3 = 1 << 6, } diff --git a/wifi/supplicant/aidl/lint-baseline.xml b/wifi/supplicant/aidl/lint-baseline.xml new file mode 100644 index 0000000000..0631223f52 --- /dev/null +++ b/wifi/supplicant/aidl/lint-baseline.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp index 8e142ec2c0..f7c619ab51 100644 --- a/wifi/supplicant/aidl/vts/functional/Android.bp +++ b/wifi/supplicant/aidl/vts/functional/Android.bp @@ -44,12 +44,14 @@ cc_test { "android.hardware.wifi@1.5", "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", - "android.hardware.wifi.supplicant-V1-ndk", + "android.hardware.wifi.supplicant-V2-ndk", "libwifi-system", "libwifi-system-iface", "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiV1_5TargetTestUtil", "VtsHalWifiSupplicantV1_0TargetTestUtil", + "android.hardware.wifi-V1-ndk", + "VtsHalWifiTargetTestUtil", ], test_suites: [ "general-tests", @@ -78,12 +80,14 @@ cc_test { "android.hardware.wifi@1.5", "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", - "android.hardware.wifi.supplicant-V1-ndk", + "android.hardware.wifi.supplicant-V2-ndk", "libwifi-system", "libwifi-system-iface", "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiV1_5TargetTestUtil", "VtsHalWifiSupplicantV1_0TargetTestUtil", + "android.hardware.wifi-V1-ndk", + "VtsHalWifiTargetTestUtil", ], test_suites: [ "general-tests", @@ -112,12 +116,14 @@ cc_test { "android.hardware.wifi@1.5", "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", - "android.hardware.wifi.supplicant-V1-ndk", + "android.hardware.wifi.supplicant-V2-ndk", "libwifi-system", "libwifi-system-iface", "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiV1_5TargetTestUtil", "VtsHalWifiSupplicantV1_0TargetTestUtil", + "android.hardware.wifi-V1-ndk", + "VtsHalWifiTargetTestUtil", ], test_suites: [ "general-tests", diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_aidl_test_utils.h b/wifi/supplicant/aidl/vts/functional/supplicant_aidl_test_utils.h new file mode 100644 index 0000000000..a850e507f0 --- /dev/null +++ b/wifi/supplicant/aidl/vts/functional/supplicant_aidl_test_utils.h @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include "wifi_aidl_test_utils.h" + +using android::wifi_system::SupplicantManager; + +// Helper methods to interact with wifi_aidl_test_utils +namespace SupplicantAidlTestUtils { +const std::string kWifiInstanceNameStr = std::string() + IWifi::descriptor + "/default"; +const char* kWifiInstanceName = kWifiInstanceNameStr.c_str(); + +// Initialize the driver and firmware to STA mode using the vendor HAL. +void initializeDriverAndFirmware(const std::string& wifi_instance_name) { + // Skip if wifi instance is not set. + if (wifi_instance_name == "") { + return; + } + if (getWifi(wifi_instance_name.c_str()) != nullptr) { + std::shared_ptr wifi_chip = getWifiChip(wifi_instance_name.c_str()); + int mode_id; + EXPECT_TRUE(configureChipToSupportConcurrencyType(wifi_chip, IfaceConcurrencyType::STA, + &mode_id)); + } else { + LOG(WARNING) << __func__ << ": Vendor HAL not supported"; + } +} + +// Deinitialize the driver and firmware using the vendor HAL. +void deInitializeDriverAndFirmware(const std::string& wifi_instance_name) { + // Skip if wifi instance is not set. + if (wifi_instance_name == "") { + return; + } + if (getWifi(wifi_instance_name.c_str()) != nullptr) { + stopWifiService(wifi_instance_name.c_str()); + } else { + LOG(WARNING) << __func__ << ": Vendor HAL not supported"; + } +} + +bool waitForSupplicantState(bool is_running) { + SupplicantManager supplicant_manager; + int count = 50; /* wait at most 5 seconds for completion */ + while (count-- > 0) { + if (supplicant_manager.IsSupplicantRunning() == is_running) { + return true; + } + usleep(100000); + } + LOG(ERROR) << "Unable to " << (is_running ? "start" : "stop") << " supplicant"; + return false; +} + +bool waitForSupplicantStart() { + return waitForSupplicantState(true); +} + +bool waitForSupplicantStop() { + return waitForSupplicantState(false); +} + +bool waitForWifiHalStop(const std::string& wifi_instance_name) { + std::shared_ptr wifi = getWifi(wifi_instance_name.c_str()); + int count = 50; /* wait at most 5 seconds for completion */ + while (count-- > 0) { + if (wifi != nullptr) { + bool started = false; + auto status = wifi->isStarted(&started); + if (status.isOk() && !started) { + return true; + } + } + usleep(100000); + wifi = getWifi(wifi_instance_name.c_str()); + } + LOG(ERROR) << "Wifi HAL was not stopped"; + return false; +} + +bool waitForFrameworkReady() { + int waitCount = 15; + do { + // Check whether package service is ready or not. + if (!testing::checkSubstringInCommandOutput("/system/bin/service check package", + ": not found")) { + return true; + } + LOG(INFO) << "Framework is not ready"; + sleep(1); + } while (waitCount-- > 0); + return false; +} + +bool useAidlService() { + return isAidlServiceAvailable(kWifiInstanceName); +} + +void startSupplicant() { + initializeDriverAndFirmware(kWifiInstanceName); + SupplicantManager supplicant_manager; + ASSERT_TRUE(supplicant_manager.StartSupplicant()); + ASSERT_TRUE(supplicant_manager.IsSupplicantRunning()); +} + +void stopSupplicantService() { + SupplicantManager supplicant_manager; + ASSERT_TRUE(supplicant_manager.StopSupplicant()); + deInitializeDriverAndFirmware(kWifiInstanceName); + ASSERT_FALSE(supplicant_manager.IsSupplicantRunning()); +} + +bool stopWifiFramework(const std::string& wifi_instance_name) { + std::system("svc wifi disable"); + std::system("cmd wifi set-scan-always-available disabled"); + return waitForSupplicantStop() && waitForWifiHalStop(wifi_instance_name); +} + +void initializeService() { + ASSERT_TRUE(stopWifiFramework(kWifiInstanceName)); + std::system("/system/bin/start"); + ASSERT_TRUE(waitForFrameworkReady()); + stopSupplicantService(); + startSupplicant(); +} +} // namespace SupplicantAidlTestUtils diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_legacy_test_utils.h b/wifi/supplicant/aidl/vts/functional/supplicant_legacy_test_utils.h new file mode 100644 index 0000000000..a20a45846b --- /dev/null +++ b/wifi/supplicant/aidl/vts/functional/supplicant_legacy_test_utils.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +using android::wifi_system::SupplicantManager; + +// Helper methods to interact with supplicant_hidl_test_utils +namespace SupplicantLegacyTestUtils { +std::string getWifiInstanceName() { + const std::vector instances = android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_0::IWifi::descriptor); + EXPECT_NE(0, instances.size()); + return instances.size() != 0 ? instances[0] : ""; +} + +void stopSupplicantService() { + stopSupplicant(getWifiInstanceName()); +} + +void startSupplicant() { + initializeDriverAndFirmware(getWifiInstanceName()); + SupplicantManager supplicant_manager; + ASSERT_TRUE(supplicant_manager.StartSupplicant()); + ASSERT_TRUE(supplicant_manager.IsSupplicantRunning()); +} + +void initializeService() { + ASSERT_TRUE(stopWifiFramework(getWifiInstanceName())); + std::system("/system/bin/start"); + ASSERT_TRUE(waitForFrameworkReady()); + stopSupplicantService(); + startSupplicant(); +} +} // namespace SupplicantLegacyTestUtils diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp index d95bd038ce..a260408c8c 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -36,8 +37,10 @@ using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface; using aidl::android::hardware::wifi::supplicant::MiracastMode; using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask; using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask; +using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams; using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode; using aidl::android::hardware::wifi::supplicant::P2pStatusCode; +using aidl::android::hardware::wifi::supplicant::SupplicantStatusCode; using aidl::android::hardware::wifi::supplicant::WpsConfigMethods; using aidl::android::hardware::wifi::supplicant::WpsDevPasswordId; using aidl::android::hardware::wifi::supplicant::WpsProvisionMethod; @@ -175,6 +178,10 @@ class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback { const std::vector& /* vendorElemBytes */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onGroupStartedWithParams( + const P2pGroupStartedEventParams& /* groupStartedEventParams */) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantP2pIfaceAidlTest : public testing::TestWithParam { @@ -413,7 +420,12 @@ TEST_P(SupplicantP2pIfaceAidlTest, SetListenChannel) { */ TEST_P(SupplicantP2pIfaceAidlTest, EnableMacRandomization) { // Enable twice - EXPECT_TRUE(p2p_iface_->setMacRandomization(true).isOk()); + auto status = p2p_iface_->setMacRandomization(true); + if (!status.isOk() && status.getServiceSpecificError() == + static_cast(SupplicantStatusCode::FAILURE_UNSUPPORTED)) { + GTEST_SKIP() << "Mac randomization is not supported."; + } + EXPECT_TRUE(status.isOk()); EXPECT_TRUE(p2p_iface_->setMacRandomization(true).isOk()); // Disable twice @@ -524,16 +536,11 @@ TEST_P(SupplicantP2pIfaceAidlTest, Flush) { * Connect */ TEST_P(SupplicantP2pIfaceAidlTest, Connect) { - /* - * Auto-join is not enabled before R. After enabling auto-join, - * this should always succeed. - */ std::string pin; EXPECT_TRUE(p2p_iface_ - ->connect(kTestMacAddr, WpsProvisionMethod::PBC, - kTestConnectPin, false, false, - kTestConnectGoIntent, &pin) - .isOk()); + ->connect(kTestMacAddr, WpsProvisionMethod::PBC, kTestConnectPin, true, + false, kTestConnectGoIntent, &pin) + .isOk()); } /* @@ -542,10 +549,9 @@ TEST_P(SupplicantP2pIfaceAidlTest, Connect) { TEST_P(SupplicantP2pIfaceAidlTest, CancelConnect) { std::string pin; EXPECT_TRUE(p2p_iface_ - ->connect(kTestMacAddr, WpsProvisionMethod::PBC, - kTestConnectPin, false, false, - kTestConnectGoIntent, &pin) - .isOk()); + ->connect(kTestMacAddr, WpsProvisionMethod::PBC, kTestConnectPin, true, + false, kTestConnectGoIntent, &pin) + .isOk()); EXPECT_TRUE(p2p_iface_->cancelConnect().isOk()); } diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp index 272a427e77..5d00485d57 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp @@ -206,6 +206,39 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { QosPolicyData /* qosPolicyData */>&) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onSupplicantStateChanged( + const ::aidl::android::hardware::wifi::supplicant:: + SupplicantStateChangeData& /* stateChangeData */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onMloLinksInfoChanged( + ::aidl::android::hardware::wifi::supplicant::ISupplicantStaIfaceCallback:: + MloLinkInfoChangeReason /* reason */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onDppConfigReceived( + const ::aidl::android::hardware::wifi::supplicant:: + DppConfigurationData& /* configData */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onDppConnectionStatusResultSent( + ::aidl::android::hardware::wifi::supplicant::DppStatusErrorCode /* code */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onBssFrequencyChanged(int32_t /* frequencyMhz */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onQosPolicyResponseForScs( + const std::vector<::aidl::android::hardware::wifi::supplicant:: + QosPolicyScsResponseStatus>& /* qosPolicyScsResponseStatus */) + override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onPmkSaCacheAdded( + const ::aidl::android::hardware::wifi::supplicant::PmkSaCacheData& /* pmkSaData */) + override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantStaIfaceAidlTest : public testing::TestWithParam { diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp index b3f70da5c4..973b56a98d 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ using aidl::android::hardware::wifi::supplicant::OcspType; using aidl::android::hardware::wifi::supplicant::PairwiseCipherMask; using aidl::android::hardware::wifi::supplicant::ProtoMask; using aidl::android::hardware::wifi::supplicant::SaeH2eMode; +using aidl::android::hardware::wifi::supplicant::TlsVersion; using aidl::android::hardware::wifi::supplicant::TransitionDisableIndication; using aidl::android::hardware::wifi::supplicant::WpaDriverCapabilitiesMask; using android::ProcessState; @@ -98,6 +100,7 @@ class SupplicantStaNetworkCallback : public BnSupplicantStaNetworkCallback { const std::vector& /* certBlob */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onPermanentIdReqDenied() override { return ndk::ScopedAStatus::ok(); } }; class SupplicantStaNetworkAidlTest @@ -647,6 +650,19 @@ TEST_P(SupplicantStaNetworkAidlTest, SetEapEncryptedImsiIdentity) { .isOk()); } +/* + * SetStrictConservativePeerMode + */ +TEST_P(SupplicantStaNetworkAidlTest, SetStrictConversativePeerMode) { + int32_t version = 0; + sta_network_->getInterfaceVersion(&version); + if (version < 2) { + GTEST_SKIP() << "Skipping test since it is not supported on this interface version"; + } + EXPECT_TRUE(sta_network_->setStrictConservativePeerMode(true).isOk()); + EXPECT_TRUE(sta_network_->setStrictConservativePeerMode(false).isOk()); +} + /* * SendNetworkEapIdentityResponse */ @@ -791,6 +807,21 @@ TEST_P(SupplicantStaNetworkAidlTest, SetRoamingConsortiumSelection) { EXPECT_TRUE(sta_network_->setRoamingConsortiumSelection(testSelection).isOk()); } +/* + * SetMinimumTlsVersionEapPhase1Param + */ +TEST_P(SupplicantStaNetworkAidlTest, SetMinimumTlsVersionEapPhase1Param) { + WpaDriverCapabilitiesMask caps; + EXPECT_TRUE(sta_iface_->getWpaDriverCapabilities(&caps).isOk()); + const bool tlsV13Supported = !!(static_cast(caps) & + static_cast(WpaDriverCapabilitiesMask::TLS_V1_3)); + LOG(INFO) << "TLS_V1_3 Supported: " << tlsV13Supported; + + // Operation will succeed if TLS_V1_3 is supported, or fail otherwise. + EXPECT_EQ(sta_network_->setMinimumTlsVersionEapPhase1Param(TlsVersion::TLS_V1_3).isOk(), + tlsV13Supported); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantStaNetworkAidlTest); INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaNetworkAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames( diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h index 31042a2b7c..f2cb3f665c 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h +++ b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h @@ -14,22 +14,16 @@ * limitations under the License. */ -#ifndef SUPPLICANT_TEST_UTILS_H -#define SUPPLICANT_TEST_UTILS_H +#pragma once -#include -#include -#include -#include -#include -#include +#include "supplicant_aidl_test_utils.h" +#include "supplicant_legacy_test_utils.h" using aidl::android::hardware::wifi::supplicant::IfaceInfo; using aidl::android::hardware::wifi::supplicant::ISupplicant; using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface; using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface; using aidl::android::hardware::wifi::supplicant::KeyMgmtMask; -using android::wifi_system::SupplicantManager; std::string getStaIfaceName() { std::array buffer; @@ -43,16 +37,7 @@ std::string getP2pIfaceName() { return std::string(buffer.data()); } -std::string getWifiInstanceName() { - const std::vector instances = - android::hardware::getAllHalInstanceNames( - ::android::hardware::wifi::V1_0::IWifi::descriptor); - EXPECT_NE(0, instances.size()); - return instances.size() != 0 ? instances[0] : ""; -} - -bool keyMgmtSupported(std::shared_ptr iface, - KeyMgmtMask expected) { +bool keyMgmtSupported(std::shared_ptr iface, KeyMgmtMask expected) { KeyMgmtMask caps; if (!iface->getKeyMgmtCapabilities(&caps).isOk()) { return false; @@ -67,22 +52,22 @@ bool isFilsSupported(std::shared_ptr iface) { return keyMgmtSupported(iface, filsMask); } -void startSupplicant() { - initializeDriverAndFirmware(getWifiInstanceName()); - SupplicantManager supplicant_manager; - ASSERT_TRUE(supplicant_manager.StartSupplicant()); - ASSERT_TRUE(supplicant_manager.IsSupplicantRunning()); +void stopSupplicantService() { + // Select method based on whether the HIDL or AIDL + // Vendor HAL is available. + if (SupplicantAidlTestUtils::useAidlService()) { + SupplicantAidlTestUtils::stopSupplicantService(); + } else { + SupplicantLegacyTestUtils::stopSupplicantService(); + } } -// Wrapper around the implementation in supplicant_hidl_test_util. -void stopSupplicantService() { stopSupplicant(getWifiInstanceName()); } - void initializeService() { - ASSERT_TRUE(stopWifiFramework(getWifiInstanceName())); - std::system("/system/bin/start"); - ASSERT_TRUE(waitForFrameworkReady()); - stopSupplicantService(); - startSupplicant(); + if (SupplicantAidlTestUtils::useAidlService()) { + SupplicantAidlTestUtils::initializeService(); + } else { + SupplicantLegacyTestUtils::initializeService(); + } } void addStaIface(const std::shared_ptr supplicant) { @@ -106,5 +91,3 @@ std::shared_ptr getSupplicant(const char* supplicant_name) { } return supplicant; } - -#endif // SUPPLICANT_TEST_UTILS_H \ No newline at end of file