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

Commit 802e22b9 authored by Yamit Mehta's avatar Yamit Mehta Committed by Ethan Chen
Browse files

frameworks/av: Enable subsystem re-start for LPA/Tunnel

-Audio Daemon in Audio HAL intimates AudioFlinger
 of ADSP status (online/offline) using set_paramaters.
-AudioFlinger send set_parameters to its clients
 which is DirectTrack used for LPA/Tunnel playback.
-In case of ADSP crash during LPA/Tunnel playback
 clean up of DirectTrack is initiated.

Change-Id: I87f720f305765e00e12032eed3e018aeff952390
(cherry picked from commit 02861e0f092c46640576bb8c700418ed82c266c3)
(cherry picked from commit 5abe97aa9e103420813b87e7abb2b676ffe8d097)
(cherry picked from commit 9a27f1e6c449585095e518f0d2f44e621ef18f52)
parent e936b383
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1159,6 +1159,18 @@ status_t AudioFlinger::setParameters(audio_io_handle_t ioHandle, const String8&
                ALOGV("ONLINE detected - what should I do?");
           }
        }
        key = String8(AudioParameter::keyADSPStatus);
        if (param.get(key, value) == NO_ERROR) {
            ALOGV("Set keyADSPStatus:%s", value.string());
            if (value == "ONLINE" || value == "OFFLINE") {
               if (!mDirectAudioTracks.isEmpty()) {
                   for (size_t i=0; i < mDirectAudioTracks.size(); i++) {
                       mDirectAudioTracks.valueAt(i)->stream->common.set_parameters(
                          &mDirectAudioTracks.valueAt(i)->stream->common, keyValuePairs.string());
                   }
               }
           }
        } 

        // disable AEC and NS if the device is a BT SCO headset supporting those pre processings
        if (param.get(String8(AUDIO_PARAMETER_KEY_BT_NREC), value) == NO_ERROR) {