summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2018-11-28 15:19:38 -0500
committerNicoleYarroch <nicole@livio.io>2018-11-28 15:19:38 -0500
commitcda5e8f1fa4400930a514896f7eabc982fd78412 (patch)
treee94e5d4a638b0e8e16779841bcd2c6112af49310
parent1a9249d20114fb038842e393116660339db63933 (diff)
downloadsdl_ios-feature/issue_1058_video_streaming_backgrounded_string.tar.gz
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m2
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.h3
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.m10
-rw-r--r--SmartDeviceLink/SDLStreamingVideoLifecycleManager.h2
-rw-r--r--SmartDeviceLink/SDLStreamingVideoLifecycleManager.m9
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m16
6 files changed, 21 insertions, 21 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index e9085024d..d521244d0 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -134,7 +134,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
[configuration.lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection] ||
[configuration.lifecycleConfig.additionalAppTypes containsObject:SDLAppHMITypeNavigation] ||
[configuration.lifecycleConfig.additionalAppTypes containsObject:SDLAppHMITypeProjection]) {
- _streamManager = [[SDLStreamingMediaManager alloc] initWithConnectionManager:self config:configuration];
+ _streamManager = [[SDLStreamingMediaManager alloc] initWithConnectionManager:self configuration:configuration];
} else {
SDLLogV(@"Skipping StreamingMediaManager setup due to app type");
}
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.h b/SmartDeviceLink/SDLStreamingMediaManager.h
index b7da8647b..c306f8550 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.h
+++ b/SmartDeviceLink/SDLStreamingMediaManager.h
@@ -15,7 +15,6 @@
@class SDLAudioStreamManager;
@class SDLConfiguration;
@class SDLProtocol;
-@class SDLStreamingMediaConfiguration;
@class SDLTouchManager;
@class SDLVideoStreamingFormat;
@@ -119,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN
@param configuration This session's configuration
@return A new streaming manager
*/
-- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager config:(SDLConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
/**
* Start the manager with a completion block that will be called when startup completes. This is used internally. To use an SDLStreamingMediaManager, you should use the manager found on `SDLManager`.
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m
index 316e351c1..d666a6254 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.m
+++ b/SmartDeviceLink/SDLStreamingMediaManager.m
@@ -11,12 +11,6 @@
#import "SDLAudioStreamManager.h"
#import "SDLConfiguration.h"
#import "SDLConnectionManagerType.h"
-#import "SDLFileManagerConfiguration.h"
-#import "SDLLifecycleConfiguration.h"
-#import "SDLLockScreenConfiguration.h"
-#import "SDLLogConfiguration.h"
-#import "SDLStreamingMediaConfiguration.h"
-#import "SDLStreamingMediaManagerDataSource.h"
#import "SDLStreamingAudioLifecycleManager.h"
#import "SDLStreamingVideoLifecycleManager.h"
#import "SDLTouchManager.h"
@@ -39,14 +33,14 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Public
#pragma mark Lifecycle
-- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager config:(SDLConfiguration *)configuration {
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLConfiguration *)configuration {
self = [super init];
if (!self) {
return nil;
}
_audioLifecycleManager = [[SDLStreamingAudioLifecycleManager alloc] initWithConnectionManager:connectionManager configuration:configuration.streamingMediaConfig];
- _videoLifecycleManager = [[SDLStreamingVideoLifecycleManager alloc] initWithConnectionManager:connectionManager config:configuration];
+ _videoLifecycleManager = [[SDLStreamingVideoLifecycleManager alloc] initWithConnectionManager:connectionManager configuration:configuration];
return self;
}
diff --git a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.h b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.h
index d21602411..1d1350469 100644
--- a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.h
+++ b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.h
@@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN
@param configuration This session's configuration
@return A new streaming manager
*/
-- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager config:(SDLConfiguration *)configuration;
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLConfiguration *)configuration;
/**
* Start the manager with a completion block that will be called when startup completes. This is used internally. To use an SDLStreamingMediaManager, you should use the manager found on `SDLManager`.
diff --git a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
index 64f2c7293..669fc6154 100644
--- a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
+++ b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
@@ -17,7 +17,6 @@
#import "SDLControlFramePayloadVideoStartService.h"
#import "SDLControlFramePayloadVideoStartServiceAck.h"
#import "SDLDisplayCapabilities.h"
-#import "SDLFileManagerConfiguration.h"
#import "SDLFocusableItemLocator.h"
#import "SDLGenericResponse.h"
#import "SDLGetSystemCapability.h"
@@ -28,8 +27,6 @@
#import "SDLHMILevel.h"
#import "SDLImageResolution.h"
#import "SDLLifecycleConfiguration.h"
-#import "SDLLockScreenConfiguration.h"
-#import "SDLLogConfiguration.h"
#import "SDLLogMacros.h"
#import "SDLOnHMIStatus.h"
#import "SDLProtocol.h"
@@ -79,13 +76,13 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
@property (assign, nonatomic) CMTime lastPresentationTimestamp;
-@property (copy, nonatomic, getter=getVideoStreamBackgroundString) NSString *videoStreamBackgroundString;
+@property (copy, nonatomic) NSString *videoStreamBackgroundString;
@end
@implementation SDLStreamingVideoLifecycleManager
-- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager config:(SDLConfiguration *)configuration {
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLConfiguration *)configuration {
self = [super init];
if (!self) {
return nil;
@@ -783,7 +780,7 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
return @[h264raw, h264rtp];
}
-- (NSString *)getVideoStreamBackgroundString {
+- (NSString *)videoStreamBackgroundString {
return [NSString stringWithFormat:@"When it is safe to do so, open %@ on your phone", self.appName];
}
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m
index cf778e9c0..db6b9ec0a 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m
@@ -3,12 +3,14 @@
#import <OCMock/OCMock.h>
#import "SDLCarWindowViewController.h"
+#import "SDLConfiguration.h"
#import "SDLControlFramePayloadConstants.h"
#import "SDLControlFramePayloadNak.h"
#import "SDLControlFramePayloadVideoStartService.h"
#import "SDLControlFramePayloadVideoStartServiceAck.h"
#import "SDLDisplayCapabilities.h"
#import "SDLFakeStreamingManagerDataSource.h"
+#import "SDLFileManagerConfiguration.h"
#import "SDLFocusableItemLocator.h"
#import "SDLGetSystemCapability.h"
#import "SDLGetSystemCapabilityResponse.h"
@@ -17,6 +19,8 @@
#import "SDLHMILevel.h"
#import "SDLImageResolution.h"
#import "SDLLifecycleConfiguration.h"
+#import "SDLLockScreenConfiguration.h"
+#import "SDLLogConfiguration.h"
#import "SDLOnHMIStatus.h"
#import "SDLProtocol.h"
#import "SDLRegisterAppInterfaceResponse.h"
@@ -49,6 +53,8 @@ describe(@"the streaming video manager", ^{
__block NSString *testAppName = @"Test App";
__block SDLLifecycleConfiguration * testLifecycleConfiguration = [SDLLifecycleConfiguration defaultConfigurationWithAppName:testAppName fullAppId:@""];
+ __block SDLConfiguration *testConfig = nil;
+
__block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStreamingState streamState) = ^(SDLHMILevel hmiLevel, SDLVideoStreamingState streamState) {
SDLOnHMIStatus *hmiStatus = [[SDLOnHMIStatus alloc] init];
hmiStatus.hmiLevel = hmiLevel;
@@ -67,7 +73,11 @@ describe(@"the streaming video manager", ^{
testConfiguration.rootViewController = testViewController;
testConnectionManager = [[TestConnectionManager alloc] init];
- streamingLifecycleManager = [[SDLStreamingVideoLifecycleManager alloc] initWithConnectionManager:testConnectionManager streamingMediaConfiguration:testConfiguration lifecycleConfiguration:testLifecycleConfiguration];
+ testLifecycleConfiguration.appType = SDLAppHMITypeNavigation;
+
+ testConfig = [SDLConfiguration configurationWithLifecycle:testLifecycleConfiguration lockScreen:SDLLockScreenConfiguration.enabledConfiguration logging:SDLLogConfiguration.debugConfiguration streamingMedia:testConfiguration fileManager:SDLFileManagerConfiguration.defaultConfiguration];
+
+ streamingLifecycleManager = [[SDLStreamingVideoLifecycleManager alloc] initWithConnectionManager:testConnectionManager configuration:testConfig];
});
it(@"should initialize properties", ^{
@@ -659,10 +669,10 @@ describe(@"the streaming video manager", ^{
});
describe(@"Creating a background video stream string", ^{
- __block NSString *expectedVideoStreamBackgroundString = [NSString stringWithFormat:@"When it is safe to do so, open %@ on phone", testAppName];
+ __block NSString *expectedVideoStreamBackgroundString = [NSString stringWithFormat:@"When it is safe to do so, open %@ on your phone", testAppName];
it(@"Should return the correct video stream background string for the screen size", ^{
- expect([streamingLifecycleManager videoStreamBackgroundString]).to(match(expectedVideoStreamBackgroundString));
+ expect(streamingLifecycleManager.videoStreamBackgroundString).to(match(expectedVideoStreamBackgroundString));
});
});
});