summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SmartDeviceLink/private/SDLStreamingAudioLifecycleManager.m1
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLStreamingAudioLifecycleManagerSpec.m14
2 files changed, 15 insertions, 0 deletions
diff --git a/SmartDeviceLink/private/SDLStreamingAudioLifecycleManager.m b/SmartDeviceLink/private/SDLStreamingAudioLifecycleManager.m
index 4a3195613..ceebe7bd6 100644
--- a/SmartDeviceLink/private/SDLStreamingAudioLifecycleManager.m
+++ b/SmartDeviceLink/private/SDLStreamingAudioLifecycleManager.m
@@ -101,6 +101,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)secondaryTransportDidDisconnect {
+ [self.audioTranscodingManager stop];
[self.audioStreamStateMachine transitionToState:SDLAudioStreamManagerStateStopped];
}
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingAudioLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingAudioLifecycleManagerSpec.m
index cca65997b..5a6c58e4f 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingAudioLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingAudioLifecycleManagerSpec.m
@@ -408,6 +408,20 @@ describe(@"the streaming audio manager", ^{
});
});
+ describe(@"when secondary transport disconnects", ^{
+ beforeEach(^{
+ [streamingLifecycleManager.audioStreamStateMachine setToState:SDLAudioStreamManagerStateReady fromOldState:nil callEnterTransition:NO];
+ [streamingLifecycleManager secondaryTransportDidDisconnect];
+ });
+
+ it(@"should transition to the stopped state and stop transcoding", ^{
+ expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamManagerStateStopped));
+
+ expect(streamingLifecycleManager.protocol).to(beNil());
+ OCMVerify([mockAudioStreamManager stop]);
+ });
+ });
+
describe(@"starting the manager when it's STOPPED", ^{
__block SDLProtocol *protocolMock = OCMClassMock([SDLProtocol class]);