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

Commit be4392d1 authored by Divya Narayanan Poojary's avatar Divya Narayanan Poojary Committed by Fred Oh
Browse files

audio_policyhal: SSR support for compress offload

- reject offload request based on sound
  card state

Change-Id: Idc8f6690d7c06883dbfcf55b073d4456a8c27e5c
parent 04b735af
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2596,6 +2596,17 @@ bool AudioPolicyManager::isOffloadSupported(const audio_offload_info_t& offloadI
        return false;
    }

    // Check for soundcard status
    String8 valueStr = mpClientInterface->getParameters((audio_io_handle_t)0,
                                String8("SND_CARD_STATUS"));
    AudioParameter result = AudioParameter(valueStr);
    int isonline = 0;
    if ((result.getInt(String8("SND_CARD_STATUS"), isonline) == NO_ERROR)
           && !isonline) {
        ALOGD("copl: soundcard is offline rejecting offload request");
        return false;
    }

    // See if there is a profile to support this.
    // AUDIO_DEVICE_NONE
    sp<IOProfile> profile = getProfileForDirectOutput(AUDIO_DEVICE_NONE /*ignore device */,