diff options
Diffstat (limited to 'ir/aidl')
-rw-r--r-- | ir/aidl/Android.bp | 12 | ||||
-rw-r--r-- | ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl | 2 | ||||
-rw-r--r-- | ir/aidl/android/hardware/ir/IConsumerIr.aidl | 16 | ||||
-rw-r--r-- | ir/aidl/default/Android.bp | 9 | ||||
-rw-r--r-- | ir/aidl/default/main.cpp | 6 |
5 files changed, 30 insertions, 15 deletions
diff --git a/ir/aidl/Android.bp b/ir/aidl/Android.bp index 6dacb858d2..5dbf68fdbe 100644 --- a/ir/aidl/Android.bp +++ b/ir/aidl/Android.bp @@ -12,6 +12,15 @@ // 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.ir", vendor_available: true, @@ -26,8 +35,7 @@ aidl_interface { }, ndk: { vndk: { - // TODO(b/206116595) enable this - enabled: false, + enabled: true, }, }, }, diff --git a/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl index 056a8b1235..07bf4b4af2 100644 --- a/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl +++ b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl @@ -35,5 +35,5 @@ package android.hardware.ir; @VintfStability interface IConsumerIr { android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs(); - void transmit(in int carrierFreq, in int[] pattern); + void transmit(in int carrierFreqHz, in int[] pattern); } diff --git a/ir/aidl/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/android/hardware/ir/IConsumerIr.aidl index d14fa566bc..f6f9742fdb 100644 --- a/ir/aidl/android/hardware/ir/IConsumerIr.aidl +++ b/ir/aidl/android/hardware/ir/IConsumerIr.aidl @@ -23,23 +23,21 @@ interface IConsumerIr { /** * Enumerates which frequencies the IR transmitter supports. * - * Status OK (EX_NONE) on success. - * * @return - an array of all supported frequency ranges. */ ConsumerIrFreqRange[] getCarrierFreqs(); /** * Sends an IR pattern at a given frequency in HZ. + * This call must return when the transmit is complete or encounters an error. * - * The pattern is alternating series of carrier on and off periods measured in - * microseconds. The carrier should be turned off at the end of a transmit - * even if there are and odd number of entries in the pattern array. + * @param carrierFreq - Frequency of the transmission in HZ. * - * This call must return when the transmit is complete or encounters an error. + * @param pattern - Alternating series of on and off periods measured in + * microseconds. The carrier should be turned off at the end of a transmit + * even if there are an odd number of entries in the pattern array. * - * Status OK (EX_NONE) on success. - * EX_UNSUPPORTED_OPERATION when the frequency is not supported. + * @throws EX_UNSUPPORTED_OPERATION when the frequency is not supported. */ - void transmit(in int carrierFreq, in int[] pattern); + void transmit(in int carrierFreqHz, in int[] pattern); } diff --git a/ir/aidl/default/Android.bp b/ir/aidl/default/Android.bp index 6519664dec..a4fb439566 100644 --- a/ir/aidl/default/Android.bp +++ b/ir/aidl/default/Android.bp @@ -13,6 +13,15 @@ // limitations under the License. // Example binder service of the ir HAL. +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.ir-service.example", relative_install_path: "hw", diff --git a/ir/aidl/default/main.cpp b/ir/aidl/default/main.cpp index 764aeaf641..7c4a8169c8 100644 --- a/ir/aidl/default/main.cpp +++ b/ir/aidl/default/main.cpp @@ -30,7 +30,7 @@ const std::vector<ConsumerIrFreqRange> kSupportedFreqs = { class ConsumerIr : public BnConsumerIr { ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override; - ::ndk::ScopedAStatus transmit(int32_t in_carrierFreq, + ::ndk::ScopedAStatus transmit(int32_t in_carrierFreqHz, const std::vector<int32_t>& in_pattern) override; }; @@ -46,9 +46,9 @@ bool isSupportedFreq(int32_t freq) { return false; } -::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreq, +::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreqHz, const std::vector<int32_t>& in_pattern) { - if (isSupportedFreq(in_carrierFreq)) { + if (isSupportedFreq(in_carrierFreqHz)) { // trasmit the pattern, each integer is number of microseconds in an // alternating on/off state. usleep(std::accumulate(in_pattern.begin(), in_pattern.end(), 0)); |