Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add callback for audio output status in LCM
Closes LCM if audio outpput is required and no longer available. Properly clears apps off IVI.
  • Loading branch information
joeygrover committed Sep 1, 2022
commit ee1466841aa4960b2847fb151dc71d117b746fa4
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import com.smartdevicelink.transport.utl.TransportRecord;
import com.smartdevicelink.util.AndroidTools;
import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.MediaStreamingStatus;

import java.lang.ref.WeakReference;
import java.util.List;
Expand All @@ -80,7 +81,17 @@ void initialize() {

synchronized (SESSION_LOCK) {
if (_transportConfig != null && _transportConfig.getTransportType().equals(TransportType.MULTIPLEX)) {
this.session = new SdlSession(sdlSessionListener, (MultiplexTransportConfig) _transportConfig);
MultiplexTransportConfig multiplexTransportConfig = (MultiplexTransportConfig) _transportConfig;
this.session = new SdlSession(sdlSessionListener, multiplexTransportConfig);
if (multiplexTransportConfig.requiresAudioSupport()) {
this.session.setMediaStreamingStatusCallback(new MediaStreamingStatus.Callback() {
@Override
public void onAudioNoLongerAvailable() {
clean(true);
onClose("Audio output no longer available", null, SdlDisconnectedReason.DEFAULT);
}
});
}
} else if (_transportConfig != null && _transportConfig.getTransportType().equals(TransportType.TCP)) {
this.session = new SdlSession(sdlSessionListener, (TCPTransportConfig) _transportConfig);
} else {
Expand Down