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

Commit 4d416da5 authored by Andy Hung's avatar Andy Hung
Browse files

AudioTrack: Enable playerIId tracking for OpenSLES

Test: oboetester (using OpenSLES)
Test: adb shell dumpsys media.metrics
Bug: 180541541
Change-Id: I00f0192bbc50eded0272f47f589109ea1307f317
parent 6f451f04
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ void TrackPlayerBase::init(AudioTrack* pat, player_type_t playerType, audio_usag
    if (mAudioTrack != 0) {
        mSelfAudioDeviceCallback = new SelfAudioDeviceCallback(*this);
        mAudioTrack->addAudioDeviceCallback(mSelfAudioDeviceCallback);
        mAudioTrack->setPlayerIId(mPIId); // set in PlayerBase::init().
    }
}

+4 −3
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ protected:
    float mPanMultiplierL, mPanMultiplierR;
    float mVolumeMultiplierL, mVolumeMultiplierR;

    // player interface ID, uniquely identifies the player in the system
    // effectively const after PlayerBase::init().
    audio_unique_id_t mPIId;

private:
            // report events to AudioService
            void servicePlayerEvent(player_state_t event, audio_port_handle_t deviceId);
@@ -79,9 +83,6 @@ private:
    // native interface to AudioService
    android::sp<android::IAudioManager> mAudioManager;

    // player interface ID, uniquely identifies the player in the system
    audio_unique_id_t mPIId;

    // Mutex for state reporting
    Mutex mPlayerStateLock;
    player_state_t mLastReportedEvent;