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

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

Merge "Protect AudioRecord against double set" into tm-dev

parents 2c904e3a c2f0db7b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -307,6 +307,8 @@ status_t AudioRecord::set(
        int32_t maxSharedAudioHistoryMs)
{
    status_t status = NO_ERROR;
    LOG_ALWAYS_FATAL_IF(mInitialized, "%s: should not be called twice", __func__);
    mInitialized = true;
    // Note mPortId is not valid until the track is created, so omit mPortId in ALOG for set.
    ALOGV("%s(): inputSource %d, sampleRate %u, format %#x, channelMask %#x, frameCount %zu, "
          "notificationFrames %u, sessionId %d, transferType %d, flags %#x, attributionSource %s"
+1 −0
Original line number Diff line number Diff line
@@ -740,6 +740,7 @@ private:
    wp<IAudioRecordCallback> mCallback;
    sp<IAudioRecordCallback> mLegacyCallbackWrapper;

    bool                    mInitialized = false;   // Protect against double set
    // for notification APIs
    uint32_t                mNotificationFramesReq; // requested number of frames between each
                                                    // notification callback