summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakamitsu Yoshii <tyoshii@xevo.com>2017-11-30 15:52:08 +0900
committerTakamitsu Yoshii <tyoshii@xevo.com>2018-02-16 17:14:44 +0900
commit6768df82955499b0133f2fd0c93b5d659ce7c9ac (patch)
tree9f509c8ab4d8103e477b67e2d5ce32e405f73dfe
parent198f1615c20aedb4efe312efd80fce170ed88c9a (diff)
downloadsdl_ios-6768df82955499b0133f2fd0c93b5d659ce7c9ac.tar.gz
fix to stop audio streaming at HMI level none and background
-rw-r--r--SmartDeviceLink/SDLStreamingMediaLifecycleManager.m2
-rw-r--r--SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m12
2 files changed, 7 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m
index 080157de8..3478257f5 100644
--- a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m
+++ b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m
@@ -840,7 +840,7 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
}
- (BOOL)isHmiStateAudioStreamCapable {
- return ![self.hmiLevel isEqualToEnum:SDLHMILevelNone];
+ return [self.hmiLevel isEqualToEnum:SDLHMILevelLimited] || [self.hmiLevel isEqualToEnum:SDLHMILevelFull];
}
- (BOOL)isHmiStateVideoStreamCapable {
diff --git a/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m b/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m
index e1487076a..911a44436 100644
--- a/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m
@@ -220,8 +220,8 @@ describe(@"the streaming media manager", ^{
sendNotificationForHMILevel(SDLHMILevelBackground);
});
- it(@"should close only the video stream", ^{
- expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamStateReady));
+ it(@"should close both stream", ^{
+ expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamStateShuttingDown));
expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamStateShuttingDown));
});
});
@@ -285,8 +285,8 @@ describe(@"the streaming media manager", ^{
sendNotificationForHMILevel(SDLHMILevelBackground);
});
- it(@"should close only the video stream", ^{
- expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamStateReady));
+ it(@"should close both stream", ^{
+ expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamStateShuttingDown));
expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamStateShuttingDown));
});
});
@@ -342,8 +342,8 @@ describe(@"the streaming media manager", ^{
sendNotificationForHMILevel(SDLHMILevelBackground);
});
- it(@"should only start the audio stream", ^{
- expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamStateStarting));
+ it(@"should not start either stream", ^{
+ expect(streamingLifecycleManager.currentAudioStreamState).to(equal(SDLAudioStreamStateStopped));
expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamStateStopped));
});
});