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

Commit 799ca48f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Protect AudioRecord against double set" into tm-dev am: a8f3727d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/17035655

Change-Id: I037512aef9dd9e51e27dab39217fbeb6c70a48b3
parents cb7b3b7e a8f3727d
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