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

Commit 82f4923d authored by Ray Chin's avatar Ray Chin
Browse files

Add setStatusCheckIntervalHint method

Bug: 232426514
Test: atest android.media.tv.tuner.cts with cf_x86_tv-userdebug AVD
Change-Id: Id2932c304b8256058e31ed619e7154ab6209921f
parent c4f2b411
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ aidl_interface {
    imports: [
        "android.hardware.common-V2",
        "android.hardware.common.fmq-V1",
        "android.hardware.tv.tuner-V1",
        "android.hardware.tv.tuner-V2",
    ],
    backend: {
        java: {
@@ -41,7 +41,7 @@ cc_library {
    shared_libs: [
        "android.hardware.tv.tuner@1.0",
        "android.hardware.tv.tuner@1.1",
        "android.hardware.tv.tuner-V1-ndk",
        "android.hardware.tv.tuner-V2-ndk",
        "libbase",
        "libbinder",
        "libbinder_ndk",
@@ -84,7 +84,7 @@ cc_binary {
    shared_libs: [
        "android.hardware.tv.tuner@1.0",
        "android.hardware.tv.tuner@1.1",
        "android.hardware.tv.tuner-V1-ndk",
        "android.hardware.tv.tuner-V2-ndk",
        "libbase",
        "libbinder",
        "libfmq",
+15 −0
Original line number Diff line number Diff line
@@ -94,6 +94,21 @@ TunerDvr::~TunerDvr() {
    return mDvr->close();
}

::ndk::ScopedAStatus TunerDvr::setStatusCheckIntervalHint(const int64_t milliseconds) {
    if (milliseconds < 0L) {
        return ::ndk::ScopedAStatus::fromServiceSpecificError(
                static_cast<int32_t>(Result::INVALID_ARGUMENT));
    }

    ::ndk::ScopedAStatus s = mDvr->setStatusCheckIntervalHint(milliseconds);
    if (s.getStatus() == STATUS_UNKNOWN_TRANSACTION) {
        return ::ndk::ScopedAStatus::fromServiceSpecificError(
                static_cast<int32_t>(Result::UNAVAILABLE));
    }

    return s;
}

/////////////// IDvrCallback ///////////////////////
::ndk::ScopedAStatus TunerDvr::DvrCallback::onRecordStatus(const RecordStatus status) {
    if (mTunerDvrCallback != nullptr) {
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public:
    ::ndk::ScopedAStatus stop() override;
    ::ndk::ScopedAStatus flush() override;
    ::ndk::ScopedAStatus close() override;
    ::ndk::ScopedAStatus setStatusCheckIntervalHint(int64_t in_milliseconds) override;

    struct DvrCallback : public BnDvrCallback {
        DvrCallback(const shared_ptr<ITunerDvrCallback> tunerDvrCallback)
+5 −0
Original line number Diff line number Diff line
@@ -66,4 +66,9 @@ interface ITunerDvr {
     * close the DVR instance to release resource for DVR.
     */
    void close();

    /**
     * Set status check time interval.
     */
    void setStatusCheckIntervalHint(in long milliseconds);
}
+5 −0
Original line number Diff line number Diff line
@@ -148,6 +148,11 @@ TunerHidlDvr::~TunerHidlDvr() {
    return ::ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus TunerHidlDvr::setStatusCheckIntervalHint(int64_t /* in_milliseconds */) {
    HidlResult res = HidlResult::UNAVAILABLE;
    return ::ndk::ScopedAStatus::fromServiceSpecificError(static_cast<int32_t>(res));
}

HidlDvrSettings TunerHidlDvr::getHidlDvrSettings(const DvrSettings& settings) {
    HidlDvrSettings s;
    switch (mType) {
Loading