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

Commit f59db5cb authored by Atneya Nair's avatar Atneya Nair
Browse files

Correct attribution source for MMAP thread

Ensure that the package name, which is used for listening for appops
below getInputForAttr, is corrected for MMAP threads.

Bug: 268724205
Test: AudioRecordTest
Test: Oboetester MMAP record silenced when backgrounded - 6s
Change-Id: Ia6fc1bff815bbbb2fee8bc1a60569a663a713e4b
parent 7370c844
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -9985,6 +9985,9 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client,
    audio_port_handle_t portId = AUDIO_PORT_HANDLE_NONE;

    audio_io_handle_t io = mId;
    AttributionSourceState adjAttributionSource = AudioFlinger::checkAttributionSourcePackage(
            client.attributionSource);

    if (isOutput()) {
        audio_config_t config = AUDIO_CONFIG_INITIALIZER;
        config.sample_rate = mSampleRate;
@@ -10000,7 +10003,7 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client,
        ret = AudioSystem::getOutputForAttr(&mAttr, &io,
                                            mSessionId,
                                            &stream,
                                            client.attributionSource,
                                            adjAttributionSource,
                                            &config,
                                            flags,
                                            &deviceId,
@@ -10019,7 +10022,7 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client,
        ret = AudioSystem::getInputForAttr(&mAttr, &io,
                                              RECORD_RIID_INVALID,
                                              mSessionId,
                                              client.attributionSource,
                                              adjAttributionSource,
                                              &config,
                                              AUDIO_INPUT_FLAG_MMAP_NOIRQ,
                                              &deviceId,