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

Commit 0c0e4138 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Flush events before stopping filter."

parents 547b761f 3d17d7d5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -60,6 +60,12 @@ void FilterCallbackScheduler::onFilterStatus(const DemuxFilterStatus& status) {
    }
}

void FilterCallbackScheduler::flushEvents() {
    std::unique_lock<std::mutex> lock(mLock);
    mCallbackBuffer.clear();
    mDataLength = 0;
}

void FilterCallbackScheduler::setTimeDelayHint(int timeDelay) {
    // updating the setTimeDelay does not go into effect until the condition
    // variable times out or is notified.
@@ -335,6 +341,8 @@ Filter::~Filter() {
        mFilterThread.join();
    }

    mCallbackScheduler.flushEvents();

    return ::ndk::ScopedAStatus::ok();
}

+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ class FilterCallbackScheduler final {

    bool hasCallbackRegistered() const;

    void flushEvents();

  private:
    void start();
    void stop();