Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix to stop audio streaming at HMI level none and background (resubmission of #804) #871

Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion SmartDeviceLink/SDLStreamingMediaLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ - (BOOL)isAppStateVideoStreamCapable {
}

- (BOOL)isHmiStateAudioStreamCapable {
return ![self.hmiLevel isEqualToEnum:SDLHMILevelNone];
return [self.hmiLevel isEqualToEnum:SDLHMILevelLimited] || [self.hmiLevel isEqualToEnum:SDLHMILevelFull];
}

- (BOOL)isHmiStateVideoStreamCapable {
Expand Down
12 changes: 6 additions & 6 deletions SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel) = ^(SDLHMILeve
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));
});
});
Expand Down Expand Up @@ -285,8 +285,8 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel) = ^(SDLHMILeve
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));
});
});
Expand Down Expand Up @@ -342,8 +342,8 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel) = ^(SDLHMILeve
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));
});
});
Expand Down