Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19d780b8 authored by Steven Moreland's avatar Steven Moreland
Browse files

ir impl point fixes

Removing UB.

Change-Id: I34b488329facbbcc760b01e72f2cb58945aa040b
parent 94f68788
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ class ConsumerIr : public BnConsumerIr {
    ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override;
    ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override;
    ::ndk::ScopedAStatus transmit(int32_t in_carrierFreqHz,
    ::ndk::ScopedAStatus transmit(int32_t in_carrierFreqHz,
                                  const std::vector<int32_t>& in_pattern) override;
                                  const std::vector<int32_t>& in_pattern) override;
    consumerir_device_t *mDevice;
    consumerir_device_t *mDevice = nullptr;
};
};


ConsumerIr::ConsumerIr() {
ConsumerIr::ConsumerIr() {
@@ -49,7 +49,10 @@ ConsumerIr::ConsumerIr() {
    }
    }
    ret = hw_module->methods->open(hw_module, CONSUMERIR_TRANSMITTER, (hw_device_t **) &mDevice);
    ret = hw_module->methods->open(hw_module, CONSUMERIR_TRANSMITTER, (hw_device_t **) &mDevice);
    if (ret < 0) {
    if (ret < 0) {
        // note - may want to make this a fatal error - otherwise the service will crash when it's used
        ALOGE("Can't open consumer IR transmitter, error: %d", ret);
        ALOGE("Can't open consumer IR transmitter, error: %d", ret);
        // in case it's modified
        mDevice = nullptr;
    }
    }
}
}