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

Commit 5815d5ee authored by jiabin's avatar jiabin Committed by Android Build Cherrypicker Worker
Browse files

Move RunningTees singleton to cpp file.

If the singleton is in the header file, the fast mixers will get a
different instance from audio flinger. That will result in not able to
dump from fast mixers.

Bug: 329301856
Test: dump wav file
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ad945932ed39b6249a681f16e12d7ea1e5e1d213)
Merged-In: Ic067f36efd84bd4f1da566b7db673c9a33bf5141
Change-Id: Ic067f36efd84bd4f1da566b7db673c9a33bf5141
parent 29479777
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -514,6 +514,12 @@ status_t AudioFileHandler::createInternal(
    return NO_ERROR; // return full path
}

/* static */
NBAIO_Tee::RunningTees& NBAIO_Tee::getRunningTees() {
    [[clang::no_destroy]] static RunningTees runningTees;
    return runningTees;
}

} // namespace android

#endif // TEE_SINK
+1 −4
Original line number Diff line number Diff line
@@ -310,10 +310,7 @@ private:
    };

    // singleton
    static RunningTees &getRunningTees() {
        static RunningTees runningTees;
        return runningTees;
    }
    static RunningTees& getRunningTees();

    // The NBAIO TeeImpl may have lifetime longer than NBAIO_Tee if
    // RunningTees::dump() is being called simultaneous to ~NBAIO_Tee().