diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-02-20 15:44:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-20 15:44:41 -0500 |
commit | 6054bf74fde28dc7c59114e83c743d3590987be7 (patch) | |
tree | 72440ae71080b9798ed4a674e92da9cbe1d77718 | |
parent | 34c4821c1157d1f595920b767b234bde93b2f6d3 (diff) | |
parent | 6768df82955499b0133f2fd0c93b5d659ce7c9ac (diff) | |
download | sdl_ios-6054bf74fde28dc7c59114e83c743d3590987be7.tar.gz |
Merge pull request #871 from t-yoshii/fix/stop-audio-stream-at-hmilevel-none-and-background
fix to stop audio streaming at HMI level none and background (resubmission of #804)
-rw-r--r-- | SmartDeviceLink/SDLStreamingMediaLifecycleManager.m | 2 | ||||
-rw-r--r-- | SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m | 12 |
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)); }); }); |