summaryrefslogtreecommitdiff
path: root/SmartDeviceLink
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-08-07 16:13:04 -0400
committerNicoleYarroch <nicole@livio.io>2019-08-07 16:13:04 -0400
commit64bc688c783ad61e962dd8690641cb9211461b10 (patch)
tree85993183ab28878face9140f15e6539266e16c37 /SmartDeviceLink
parent9477e591f8c386793fa6e06ab570c4efce157a5a (diff)
parentf43c7f46c0e535a322afbd76afb312bfa1fdeedc (diff)
downloadsdl_ios-64bc688c783ad61e962dd8690641cb9211461b10.tar.gz
Merge branch 'develop' into feature/issue_1055_cancel_interaction_RPC
# Conflicts: # Example Apps/Example ObjC/AlertManager.m # Example Apps/Example Swift/AlertManager.swift # SmartDeviceLink/SDLAlert.h # SmartDeviceLink/SDLAlert.m # SmartDeviceLink/SDLScreenManager.h # SmartDeviceLink/SDLScreenManager.m # SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m
Diffstat (limited to 'SmartDeviceLink')
-rw-r--r--SmartDeviceLink/SDLAlert.h39
-rw-r--r--SmartDeviceLink/SDLAlert.m33
-rw-r--r--SmartDeviceLink/SDLFunctionID.m1
-rw-r--r--SmartDeviceLink/SDLImageFieldName.h5
-rw-r--r--SmartDeviceLink/SDLImageFieldName.m1
-rw-r--r--SmartDeviceLink/SDLLockScreenManager.h5
-rw-r--r--SmartDeviceLink/SDLLockScreenManager.m72
-rw-r--r--SmartDeviceLink/SDLLockScreenStatus.h2
-rw-r--r--SmartDeviceLink/SDLLockScreenStatusManager.h3
-rw-r--r--SmartDeviceLink/SDLLockScreenStatusManager.m3
-rw-r--r--SmartDeviceLink/SDLLockScreenViewController.h19
-rw-r--r--SmartDeviceLink/SDLLockScreenViewController.m37
-rw-r--r--SmartDeviceLink/SDLMenuManager.h5
-rw-r--r--SmartDeviceLink/SDLMenuManager.m43
-rw-r--r--SmartDeviceLink/SDLNotificationConstants.h2
-rw-r--r--SmartDeviceLink/SDLNotificationConstants.m3
-rw-r--r--SmartDeviceLink/SDLNotificationDispatcher.m8
-rw-r--r--SmartDeviceLink/SDLOnDriverDistraction.h14
-rw-r--r--SmartDeviceLink/SDLOnDriverDistraction.m18
-rw-r--r--SmartDeviceLink/SDLOnLockScreenStatus.h1
-rw-r--r--SmartDeviceLink/SDLOnLockScreenStatus.m3
-rw-r--r--SmartDeviceLink/SDLProxyListener.h19
-rw-r--r--SmartDeviceLink/SDLRPCFunctionNames.h1
-rw-r--r--SmartDeviceLink/SDLRPCFunctionNames.m1
-rw-r--r--SmartDeviceLink/SDLRPCParameterNames.h4
-rw-r--r--SmartDeviceLink/SDLRPCParameterNames.m4
-rw-r--r--SmartDeviceLink/SDLScreenManager.h21
-rw-r--r--SmartDeviceLink/SDLScreenManager.m15
-rw-r--r--SmartDeviceLink/SDLShow.h9
-rw-r--r--SmartDeviceLink/SDLShow.m8
-rw-r--r--SmartDeviceLink/SDLShowAppMenu.h35
-rw-r--r--SmartDeviceLink/SDLShowAppMenu.m48
-rw-r--r--SmartDeviceLink/SDLShowAppMenuResponse.h20
-rw-r--r--SmartDeviceLink/SDLShowAppMenuResponse.m23
-rw-r--r--SmartDeviceLink/SDLTextAndGraphicManager.h1
-rw-r--r--SmartDeviceLink/SDLTextAndGraphicManager.m17
-rw-r--r--SmartDeviceLink/SDLTextFieldName.h7
-rw-r--r--SmartDeviceLink/SDLTextFieldName.m1
-rw-r--r--SmartDeviceLink/SmartDeviceLink.h2
39 files changed, 517 insertions, 36 deletions
diff --git a/SmartDeviceLink/SDLAlert.h b/SmartDeviceLink/SDLAlert.h
index 3fb619ea3..a0b3b3811 100644
--- a/SmartDeviceLink/SDLAlert.h
+++ b/SmartDeviceLink/SDLAlert.h
@@ -4,6 +4,7 @@
#import "SDLRPCRequest.h"
+@class SDLImage;
@class SDLSoftButton;
@class SDLTTSChunk;
@@ -25,10 +26,11 @@ NS_ASSUME_NONNULL_BEGIN
* @param softButtons Soft buttons to be displayed
* @param playTone Whether the alert tone should be played before the TTS (if any) is spoken
* @param ttsChunks Speech or a sound file to be played when the alert shows
+ * @param alertIcon Image to be displayed in the alert
* @param cancelID An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC
* @return An SDLAlert object
*/
-- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks cancelID:(UInt32)cancelID;
+- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID;
/**
* Convenience init for creating a sound-only alert.
@@ -50,10 +52,11 @@ NS_ASSUME_NONNULL_BEGIN
* @param ttsChunks An array of text chunks to be spoken or a prerecorded sound file
* @param duration The duration of the displayed portion of the alert, in milliseconds
* @param progressIndicator Whether an animation indicating that loading of a feature is progressing should be shown
+ * @param alertIcon Image to be displayed in the alert
* @param cancelID An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC
* @return An SDLAlert object
*/
-- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(UInt16)duration progressIndicator:(BOOL)progressIndicator cancelID:(UInt32)cancelID;
+- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(UInt16)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID;
/**
* Convenience init for creating an alert with two lines of text and a timeout.
@@ -63,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param duration The duration of the displayed portion of the alert, in milliseconds
* @return An SDLAlert object
*/
-- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating an alert with three lines of text.
@@ -73,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param alertText3 The third line of the alert
* @return An SDLAlert object
*/
-- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating an alert with three lines of text and a timeout.
@@ -84,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param duration The duration of the displayed portion of the alert, in milliseconds
* @return An SDLAlert object
*/
-- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating an alert with three lines of text and a timeout.
@@ -96,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param softButtons Buttons for the alert
* @return An SDLAlert object
*/
-- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating a speech-only alert.
@@ -105,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param playTone Whether the alert tone should be played before the TTS is spoken
* @return An SDLAlert object
*/
-- (instancetype)initWithTTS:(nullable NSString *)ttsText playTone:(BOOL)playTone __deprecated_msg("Use initWithTTS:playTone:cancelID: instead");
+- (instancetype)initWithTTS:(nullable NSString *)ttsText playTone:(BOOL)playTone __deprecated_msg("Use initWithTTS:playTone: instead");
/**
* Convenience init for creating an alert with two lines of text, optional sound cues, and a timout.
@@ -117,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param duration The duration of the displayed portion of the alert, in milliseconds
* @return An SDLAlert object
*/
-- (instancetype)initWithTTS:(nullable NSString *)ttsText alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 playTone:(BOOL)playTone duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithTTS:(nullable NSString *)ttsText alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 playTone:(BOOL)playTone duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating an alert with three lines of text, optional sound cues, and a timout.
@@ -130,7 +133,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param duration The duration of the displayed portion of the alert, in milliseconds
* @return An SDLAlert object
*/
-- (instancetype)initWithTTS:(nullable NSString *)ttsText alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithTTS:(nullable NSString *)ttsText alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating an alert with three lines of text, soft buttons, and optional sound cues.
@@ -143,7 +146,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param softButtons Buttons for the alert
* @return An SDLAlert object
*/
-- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* Convenience init for creating an alert with three lines of text, soft buttons, optional sound cues, and a timout.
@@ -157,7 +160,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param softButtons Buttons for the alert
* @return An SDLAlert object
*/
-- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:cancelID: instead");
+- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:softButtons:playTone:ttsChunks:duration:progressIndicator:alertIcon:cancelID: instead");
/**
* The first line of the alert text field.
@@ -184,7 +187,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* The optional third line of the alert text field.
*
- * @discussion If supported, the `displayCapabilities` will have a `TextField` with a `name` of `alertText3`
+ * @discussion If supported, the `displayCapabilities` will have a `TextField` with a `name` of `alertText3`
*
* String, Optional, Max length 500 chars
* @since SDL 2.0
@@ -194,9 +197,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
* An array of text chunks to be spoken or a prerecorded sound file.
*
+ * @discussion At least either `alertText1`, `alertText2` or `ttsChunks` need to be provided.
+ *
* Optional, Array of SDLTTSChunk, Array length 1 - 100
*
- * @see SDLTTSChunk
* @since SDL 1.0
*/
@property (nullable, strong, nonatomic) NSArray<SDLTTSChunk *> *ttsChunks;
@@ -233,7 +237,6 @@ NS_ASSUME_NONNULL_BEGIN
*
* Optional, Array of SDLSoftButton, Array size 0 - 4
*
- * @see SDLSoftButton
* @since SDL 2.0
*/
@property (nullable, strong, nonatomic) NSArray<SDLSoftButton *> *softButtons;
@@ -248,6 +251,14 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSNumber<SDLInt> *cancelID;
+/**
+ * Image to be displayed in the alert. If omitted on supported displays, no (or the default if applicable) icon should be displayed.
+ *
+ * SDLImage, Optional
+ * @since SDL 6.0
+ */
+@property (nullable, strong, nonatomic) SDLImage *alertIcon;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLAlert.m b/SmartDeviceLink/SDLAlert.m
index 136052cc4..b17a01abb 100644
--- a/SmartDeviceLink/SDLAlert.m
+++ b/SmartDeviceLink/SDLAlert.m
@@ -3,12 +3,13 @@
#import "SDLAlert.h"
#import "NSMutableDictionary+Store.h"
+#import "SDLImage.h"
#import "SDLRPCParameterNames.h"
#import "SDLRPCFunctionNames.h"
#import "SDLSoftButton.h"
#import "SDLTTSChunk.h"
-static UInt16 const SDLDefaultDuration = 5000;
+static UInt16 const DefaultAlertDuration = 5000;
NS_ASSUME_NONNULL_BEGIN
@@ -23,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
}
#pragma clang diagnostic pop
-- (instancetype)initWithAlertText:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(nullable NSNumber *)duration progressIndicator:(BOOL)progressIndicator cancelID:(nullable NSNumber *)cancelID {
+- (instancetype)initWithAlertText:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(nullable NSNumber *)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(nullable NSNumber *)cancelID {
self = [self init];
if (!self) {
return nil;
@@ -36,25 +37,26 @@ NS_ASSUME_NONNULL_BEGIN
self.playTone = @(playTone);
self.progressIndicator = @(progressIndicator);
self.softButtons = [softButtons mutableCopy];
+ self.alertIcon = icon;
self.cancelID = cancelID;
return self;
}
-- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(UInt16)duration progressIndicator:(BOOL)progressIndicator cancelID:(UInt32)cancelID {
- return [self initWithAlertText:alertText1 alertText2:alertText2 alertText3:alertText3 softButtons:softButtons playTone:playTone ttsChunks:ttsChunks duration:@(duration) progressIndicator:progressIndicator cancelID:@(cancelID)];
+- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(UInt16)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID {
+ return [self initWithAlertText:alertText1 alertText2:alertText2 alertText3:alertText3 softButtons:softButtons playTone:playTone ttsChunks:ttsChunks duration:@(duration) progressIndicator:progressIndicator alertIcon:icon cancelID:@(cancelID)];
}
- (instancetype)initWithTTS:(nullable NSString *)ttsText playTone:(BOOL)playTone {
- return [self initWithTTS:ttsText alertText1:nil alertText2:nil playTone:playTone duration:SDLDefaultDuration];
+ return [self initWithTTS:ttsText alertText1:nil alertText2:nil playTone:playTone duration:DefaultAlertDuration];
}
-- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks cancelID:(UInt32)cancelID {
- return [self initWithAlertText:alertText alertText2:nil alertText3:nil softButtons:softButtons playTone:playTone ttsChunks:ttsChunks duration:nil progressIndicator:false cancelID:@(cancelID)];
+- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID {
+ return [self initWithAlertText:alertText alertText2:nil alertText3:nil softButtons:softButtons playTone:playTone ttsChunks:ttsChunks duration:nil progressIndicator:false alertIcon:icon cancelID:@(cancelID)];
}
- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 {
- return [self initWithAlertText1:alertText1 alertText2:alertText2 alertText3:alertText3 duration:SDLDefaultDuration];
+ return [self initWithAlertText1:alertText1 alertText2:alertText2 alertText3:alertText3 duration:DefaultAlertDuration];
}
- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 duration:(UInt16)duration {
@@ -79,18 +81,17 @@ NS_ASSUME_NONNULL_BEGIN
}
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone {
- return [self initWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:SDLDefaultDuration softButtons:nil];
+ return [self initWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:DefaultAlertDuration softButtons:nil];
}
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
- return [self initWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:SDLDefaultDuration softButtons:softButtons];
+ return [self initWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:DefaultAlertDuration softButtons:softButtons];
}
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
- return [self initWithAlertText:alertText1 alertText2:alertText2 alertText3:alertText3 softButtons:softButtons playTone:playTone ttsChunks:ttsChunks duration:@(duration) progressIndicator:false cancelID:nil];
+ return [self initWithAlertText:alertText1 alertText2:alertText2 alertText3:alertText3 softButtons:softButtons playTone:playTone ttsChunks:ttsChunks duration:@(duration) progressIndicator:false alertIcon:nil cancelID:nil];
}
-
#pragma mark - Getters and Setters
- (void)setAlertText1:(nullable NSString *)alertText1 {
@@ -157,6 +158,14 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectsForName:SDLRPCParameterNameSoftButtons ofClass:SDLSoftButton.class error:nil];
}
+- (void)setAlertIcon:(nullable SDLImage *)alertIcon {
+ [self.parameters sdl_setObject:alertIcon forName:SDLRPCParameterNameAlertIcon];
+}
+
+- (nullable SDLImage *)alertIcon {
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameAlertIcon ofClass:SDLImage.class error:nil];
+}
+
- (void)setCancelID:(nullable NSNumber<SDLInt> *)cancelID {
[self.parameters sdl_setObject:cancelID forName:SDLRPCParameterNameCancelID];
}
diff --git a/SmartDeviceLink/SDLFunctionID.m b/SmartDeviceLink/SDLFunctionID.m
index 5023c8808..61ae298c9 100644
--- a/SmartDeviceLink/SDLFunctionID.m
+++ b/SmartDeviceLink/SDLFunctionID.m
@@ -91,6 +91,7 @@ NS_ASSUME_NONNULL_BEGIN
@56: SDLRPCFunctionNameUnpublishAppService,
@57: SDLRPCFunctionNameCancelInteraction,
@58: SDLRPCFunctionNameCloseApplication,
+ @59: SDLRPCFunctionNameShowAppMenu,
@32768: SDLRPCFunctionNameOnHMIStatus,
@32769: SDLRPCFunctionNameOnAppInterfaceUnregistered,
@32770: SDLRPCFunctionNameOnButtonEvent,
diff --git a/SmartDeviceLink/SDLImageFieldName.h b/SmartDeviceLink/SDLImageFieldName.h
index 34e50c3b3..cd3e101c9 100644
--- a/SmartDeviceLink/SDLImageFieldName.h
+++ b/SmartDeviceLink/SDLImageFieldName.h
@@ -12,6 +12,11 @@
typedef SDLEnum SDLImageFieldName SDL_SWIFT_ENUM;
/**
+ The image field for Alert
+ */
+extern SDLImageFieldName const SDLImageFieldNameAlertIcon;
+
+/**
The image field for SoftButton
*/
extern SDLImageFieldName const SDLImageFieldNameSoftButtonImage;
diff --git a/SmartDeviceLink/SDLImageFieldName.m b/SmartDeviceLink/SDLImageFieldName.m
index 63397b089..0282f25b6 100644
--- a/SmartDeviceLink/SDLImageFieldName.m
+++ b/SmartDeviceLink/SDLImageFieldName.m
@@ -4,6 +4,7 @@
#import "SDLImageFieldName.h"
+SDLImageFieldName const SDLImageFieldNameAlertIcon = @"alertIcon";
SDLImageFieldName const SDLImageFieldNameSoftButtonImage = @"softButtonImage";
SDLImageFieldName const SDLImageFieldNameChoiceImage = @"choiceImage";
SDLImageFieldName const SDLImageFieldNameChoiceSecondaryImage = @"choiceSecondaryImage";
diff --git a/SmartDeviceLink/SDLLockScreenManager.h b/SmartDeviceLink/SDLLockScreenManager.h
index f709c53ee..a63e42234 100644
--- a/SmartDeviceLink/SDLLockScreenManager.h
+++ b/SmartDeviceLink/SDLLockScreenManager.h
@@ -23,6 +23,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (assign, nonatomic, readonly) BOOL lockScreenPresented;
/**
+ * Whether or not the lock screen is currently dismissable
+ */
+@property (assign, nonatomic, readonly, getter=isLockScreenDismissable) BOOL lockScreenDismissable;
+
+/**
* The lock screen configuration used to set up the manager
*/
@property (strong, nonatomic, readonly) SDLLockScreenConfiguration *config;
diff --git a/SmartDeviceLink/SDLLockScreenManager.m b/SmartDeviceLink/SDLLockScreenManager.m
index a8c8c3758..0ffba3f7c 100644
--- a/SmartDeviceLink/SDLLockScreenManager.m
+++ b/SmartDeviceLink/SDLLockScreenManager.m
@@ -15,6 +15,7 @@
#import "SDLLockScreenViewController.h"
#import "SDLNotificationConstants.h"
#import "SDLOnLockScreenStatus.h"
+#import "SDLOnDriverDistraction.h"
#import "SDLRPCNotificationNotification.h"
#import "SDLScreenshotViewController.h"
#import "SDLViewControllerPresentable.h"
@@ -27,7 +28,15 @@ NS_ASSUME_NONNULL_BEGIN
@property (assign, nonatomic) BOOL canPresent;
@property (strong, nonatomic, readwrite) SDLLockScreenConfiguration *config;
@property (strong, nonatomic) id<SDLViewControllerPresentable> presenter;
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property (strong, nonatomic, nullable) SDLOnLockScreenStatus *lastLockNotification;
+#pragma clang diagnostic pop
+
+@property (strong, nonatomic, nullable) SDLOnDriverDistraction *lastDriverDistractionNotification;
+@property (assign, nonatomic, readwrite, getter=isLockScreenDismissable) BOOL lockScreenDismissable;
+@property (assign, nonatomic) BOOL lockScreenDismissedByUser;
@end
@@ -41,12 +50,15 @@ NS_ASSUME_NONNULL_BEGIN
}
_canPresent = NO;
+ _lockScreenDismissable = NO;
_config = config;
_presenter = presenter;
-
+ _lockScreenDismissedByUser = NO;
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenStatusDidChange:) name:SDLDidChangeLockScreenStatusNotification object:dispatcher];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenIconReceived:) name:SDLDidReceiveLockScreenIcon object:dispatcher];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_appDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_driverDistractionStateDidChange:) name:SDLDidChangeDriverDistractionStateNotification object:dispatcher];
return self;
}
@@ -91,11 +103,13 @@ NS_ASSUME_NONNULL_BEGIN
return self.presenter.lockViewController;
}
-
#pragma mark - Notification Selectors
- (void)sdl_lockScreenStatusDidChange:(SDLRPCNotificationNotification *)notification {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (![notification isNotificationMemberOfClass:[SDLOnLockScreenStatus class]]) {
+#pragma clang diagnostic pop
return;
}
@@ -121,6 +135,14 @@ NS_ASSUME_NONNULL_BEGIN
[self sdl_checkLockScreen];
}
+- (void)sdl_driverDistractionStateDidChange:(SDLRPCNotificationNotification *)notification {
+ if (![notification isNotificationMemberOfClass:[SDLOnDriverDistraction class]]) {
+ return;
+ }
+
+ self.lastDriverDistractionNotification = notification.notification;
+ [self sdl_updateLockScreenDismissable];
+}
#pragma mark - Private Helpers
@@ -131,11 +153,11 @@ NS_ASSUME_NONNULL_BEGIN
// Present the VC depending on the lock screen status
if ([self.lastLockNotification.lockScreenStatus isEqualToEnum:SDLLockScreenStatusRequired]) {
- if (!self.presenter.presented && self.canPresent) {
+ if (!self.presenter.presented && self.canPresent && !self.lockScreenDismissedByUser) {
[self.presenter present];
}
} else if ([self.lastLockNotification.lockScreenStatus isEqualToEnum:SDLLockScreenStatusOptional]) {
- if (self.config.showInOptionalState && !self.presenter.presented && self.canPresent) {
+ if (self.config.showInOptionalState && !self.presenter.presented && self.canPresent && !self.lockScreenDismissedByUser) {
[self.presenter present];
} else if (!self.config.showInOptionalState && self.presenter.presented) {
[self.presenter dismiss];
@@ -147,6 +169,48 @@ NS_ASSUME_NONNULL_BEGIN
}
}
+- (void)sdl_updateLockScreenDismissable {
+ if (self.lastDriverDistractionNotification == nil ||
+ self.lastDriverDistractionNotification.lockScreenDismissalEnabled == nil ||
+ !self.lastDriverDistractionNotification.lockScreenDismissalEnabled.boolValue) {
+ self.lockScreenDismissable = NO;
+ } else {
+ self.lockScreenDismissable = YES;
+ }
+
+ if (self.lockScreenDismissedByUser &&
+ [self.lastDriverDistractionNotification.state isEqualToEnum:SDLDriverDistractionStateOn] &&
+ !self.lockScreenDismissable) {
+ self.lockScreenDismissedByUser = NO;
+ }
+
+ if (!self.lockScreenDismissedByUser) {
+ [self sdl_updateLockscreenViewControllerWithDismissableState:self.lockScreenDismissable];
+ }
+}
+
+- (void)sdl_updateLockscreenViewControllerWithDismissableState:(BOOL)enabled {
+ if (![self.lockScreenViewController isKindOfClass:[SDLLockScreenViewController class]]) {
+ return;
+ }
+
+ __weak typeof(self) weakself = self;
+ dispatch_async(dispatch_get_main_queue(), ^{
+ __strong typeof(self) strongSelf = weakself;
+ SDLLockScreenViewController *lockscreenViewController = (SDLLockScreenViewController *)strongSelf.lockScreenViewController;
+ if (enabled) {
+ [lockscreenViewController addDismissGestureWithCallback:^{
+ [strongSelf.presenter dismiss];
+ strongSelf.lockScreenDismissedByUser = YES;
+ }];
+ lockscreenViewController.lockedLabelText = strongSelf.lastDriverDistractionNotification.lockScreenDismissalWarning;
+ } else {
+ [lockscreenViewController removeDismissGesture];
+ lockscreenViewController.lockedLabelText = nil;
+ }
+ });
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLLockScreenStatus.h b/SmartDeviceLink/SDLLockScreenStatus.h
index 9926852c9..62f48ba05 100644
--- a/SmartDeviceLink/SDLLockScreenStatus.h
+++ b/SmartDeviceLink/SDLLockScreenStatus.h
@@ -24,6 +24,6 @@ extern SDLLockScreenStatus const SDLLockScreenStatusOff;
extern SDLLockScreenStatus const SDLLockScreenStatusOptional;
/**
- * LockScreen is Not Required
+ * LockScreen is Required
*/
extern SDLLockScreenStatus const SDLLockScreenStatusRequired;
diff --git a/SmartDeviceLink/SDLLockScreenStatusManager.h b/SmartDeviceLink/SDLLockScreenStatusManager.h
index 2a37b9d83..90b3d85a3 100644
--- a/SmartDeviceLink/SDLLockScreenStatusManager.h
+++ b/SmartDeviceLink/SDLLockScreenStatusManager.h
@@ -18,7 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (assign, nonatomic) BOOL driverDistracted;
@property (nullable, strong, nonatomic) SDLHMILevel hmiLevel;
@property (strong, nonatomic, readonly) SDLLockScreenStatus lockScreenStatus;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property (strong, nonatomic, readonly) SDLOnLockScreenStatus *lockScreenStatusNotification;
+#pragma clang diagnostic pop
@end
diff --git a/SmartDeviceLink/SDLLockScreenStatusManager.m b/SmartDeviceLink/SDLLockScreenStatusManager.m
index 82724eb6f..4ab22faa4 100644
--- a/SmartDeviceLink/SDLLockScreenStatusManager.m
+++ b/SmartDeviceLink/SDLLockScreenStatusManager.m
@@ -55,8 +55,11 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Custom Getters
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (SDLOnLockScreenStatus *)lockScreenStatusNotification {
SDLOnLockScreenStatus *notification = [[SDLOnLockScreenStatus alloc] init];
+#pragma clang diagnostic pop
notification.driverDistractionStatus = @(self.driverDistracted);
notification.hmiLevel = self.hmiLevel;
notification.userSelected = @(self.userSelected);
diff --git a/SmartDeviceLink/SDLLockScreenViewController.h b/SmartDeviceLink/SDLLockScreenViewController.h
index d340db61a..2b19537b5 100644
--- a/SmartDeviceLink/SDLLockScreenViewController.h
+++ b/SmartDeviceLink/SDLLockScreenViewController.h
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLLockScreenViewController : UIViewController
+typedef void (^SwipeGestureCallbackBlock)(void);
+
/**
* The app's icon. This will be set by the lock screen configuration.
*/
@@ -27,6 +29,21 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (copy, nonatomic, nullable) UIColor *backgroundColor;
+/**
+ * The locked label string. This will be set by the lock screen manager to inform the user about the dismissable state.
+ */
+@property (copy, nonatomic, nullable) NSString *lockedLabelText;
+
+/**
+ * Adds a swipe gesture to the lock screen view controller.
+ */
+- (void)addDismissGestureWithCallback:(SwipeGestureCallbackBlock)swipeGestureCallback;
+
+/**
+ * Remove swipe gesture to the lock screen view controller.
+ */
+- (void)removeDismissGesture;
+
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLLockScreenViewController.m b/SmartDeviceLink/SDLLockScreenViewController.m
index 291913aaa..9c5a14c99 100644
--- a/SmartDeviceLink/SDLLockScreenViewController.m
+++ b/SmartDeviceLink/SDLLockScreenViewController.m
@@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UILabel *lockedLabel;
@property (weak, nonatomic) IBOutlet UIImageView *arrowUpImageView;
@property (weak, nonatomic) IBOutlet UIImageView *arrowDownImageView;
+@property (strong, nonatomic) SwipeGestureCallbackBlock dismissGestureCallback;
+@property (strong, nonatomic, nullable) UISwipeGestureRecognizer *swipeGesture;
@end
@@ -49,7 +51,6 @@ NS_ASSUME_NONNULL_BEGIN
return useWhiteIcon ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault;
}
-
#pragma mark - Setters
- (void)setAppIcon:(UIImage *_Nullable)appIcon {
@@ -70,6 +71,31 @@ NS_ASSUME_NONNULL_BEGIN
[self sdl_layoutViews];
}
+- (void)setLockedLabelText:(NSString *_Nullable)lockedLabelText {
+ _lockedLabelText = lockedLabelText;
+
+ [self sdl_layoutViews];
+}
+
+#pragma mark - Swipe Gesture
+
+- (void)addDismissGestureWithCallback:(SwipeGestureCallbackBlock)swipeGestureCallback {
+ if (!self.swipeGesture) {
+ self.dismissGestureCallback = swipeGestureCallback;
+ self.swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(sdl_didSwipeToDismiss:)];
+ [self.swipeGesture setDirection: UISwipeGestureRecognizerDirectionDown];
+ [self.view addGestureRecognizer:self.swipeGesture];
+ }
+}
+
+- (void)removeDismissGesture {
+ [self.view removeGestureRecognizer:self.swipeGesture];
+ self.swipeGesture = nil;
+}
+
+- (void)sdl_didSwipeToDismiss:(UISwipeGestureRecognizer *)gesture {
+ self.dismissGestureCallback();
+}
#pragma mark - Layout
@@ -87,7 +113,14 @@ NS_ASSUME_NONNULL_BEGIN
self.arrowDownImageView.tintColor = iconColor;
self.lockedLabel.textColor = iconColor;
-
+ self.lockedLabel.numberOfLines = 0;
+
+ if (self.lockedLabelText != nil) {
+ self.lockedLabel.text = self.lockedLabelText;
+ } else {
+ self.lockedLabel.text = NSLocalizedString(@"Locked for your safety", nil);
+ }
+
self.view.backgroundColor = self.backgroundColor;
if (self.vehicleIcon != nil && self.appIcon != nil) {
diff --git a/SmartDeviceLink/SDLMenuManager.h b/SmartDeviceLink/SDLMenuManager.h
index f559b6fb8..475c4195d 100644
--- a/SmartDeviceLink/SDLMenuManager.h
+++ b/SmartDeviceLink/SDLMenuManager.h
@@ -36,6 +36,11 @@ typedef void(^SDLMenuUpdateCompletionHandler)(NSError *__nullable error);
@property (copy, nonatomic) NSArray<SDLMenuCell *> *menuCells;
@property (assign, nonatomic) SDLDynamicMenuUpdatesMode dynamicMenuUpdatesMode;
+
+- (BOOL)openMenu;
+
+- (BOOL)openSubmenu:(SDLMenuCell *)cell;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLMenuManager.m b/SmartDeviceLink/SDLMenuManager.m
index 3f95a5353..1ca796dcc 100644
--- a/SmartDeviceLink/SDLMenuManager.m
+++ b/SmartDeviceLink/SDLMenuManager.m
@@ -18,6 +18,7 @@
#import "SDLDisplayCapabilities+ShowManagerExtensions.h"
#import "SDLError.h"
#import "SDLFileManager.h"
+#import "SDLGlobals.h"
#import "SDLImage.h"
#import "SDLLogMacros.h"
#import "SDLMenuCell.h"
@@ -31,6 +32,8 @@
#import "SDLRPCResponseNotification.h"
#import "SDLSetDisplayLayoutResponse.h"
#import "SDLScreenManager.h"
+#import "SDLShowAppMenu.h"
+#import "SDLVersion.h"
#import "SDLVoiceCommand.h"
NS_ASSUME_NONNULL_BEGIN
@@ -638,6 +641,46 @@ UInt32 const MenuCellIdMin = 1;
}
}
+- (BOOL)openMenu {
+ if ([SDLGlobals.sharedGlobals.rpcVersion isLessThanVersion:[[SDLVersion alloc] initWithMajor:6 minor:0 patch:0]]) {
+ SDLLogE(@"The openMenu method is not supported on this head unit.");
+ return NO;
+ }
+
+ SDLShowAppMenu *openMenu = [[SDLShowAppMenu alloc] init];
+
+ [self.connectionManager sendConnectionRequest:openMenu withResponseHandler:^(__kindof SDLRPCRequest * _Nullable request, __kindof SDLRPCResponse * _Nullable response, NSError * _Nullable error) {
+ if (error != nil) {
+ SDLLogE(@"Error opening application menu: %@", error);
+ }
+ }];
+
+ return YES;
+}
+
+- (BOOL)openSubmenu:(SDLMenuCell *)cell {
+ if (cell.subCells.count == 0) {
+ SDLLogE(@"The cell %@ does not contain any sub cells, so no submenu can be opened", cell);
+ return NO;
+ } else if ([SDLGlobals.sharedGlobals.rpcVersion isLessThanVersion:[[SDLVersion alloc] initWithMajor:6 minor:0 patch:0]]) {
+ SDLLogE(@"The openSubmenu method is not supported on this head unit.");
+ return NO;
+ } else if (![self.menuCells containsObject:cell]) {
+ SDLLogE(@"This cell has not been sent to the head unit, so no submenu can be opened. Make sure that the cell exists in the SDLManager.menu array");
+ return NO;
+ }
+
+ SDLShowAppMenu *subMenu = [[SDLShowAppMenu alloc] initWithMenuID:cell.cellId];
+
+ [self.connectionManager sendConnectionRequest:subMenu withResponseHandler:^(__kindof SDLRPCRequest * _Nullable request, __kindof SDLRPCResponse * _Nullable response, NSError * _Nullable error) {
+ if (error != nil) {
+ SDLLogE(@"Error opening application to submenu cell: %@, with error: %@", cell, error);
+ }
+ }];
+
+ return YES;
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLNotificationConstants.h b/SmartDeviceLink/SDLNotificationConstants.h
index eeb0b41bd..01bdc6be3 100644
--- a/SmartDeviceLink/SDLNotificationConstants.h
+++ b/SmartDeviceLink/SDLNotificationConstants.h
@@ -162,6 +162,7 @@ extern SDLNotificationName const SDLDidReceiveSetInteriorVehicleDataResponse;
extern SDLNotificationName const SDLDidReceiveSetMediaClockTimerResponse;
extern SDLNotificationName const SDLDidReceiveShowConstantTBTResponse;
extern SDLNotificationName const SDLDidReceiveShowResponse;
+extern SDLNotificationName const SDLDidReceiveShowAppMenuResponse;
extern SDLNotificationName const SDLDidReceiveSliderResponse;
extern SDLNotificationName const SDLDidReceiveSpeakResponse;
extern SDLNotificationName const SDLDidReceiveSubscribeButtonResponse;
@@ -223,6 +224,7 @@ extern SDLNotificationName const SDLDidReceiveSetGlobalPropertiesRequest;
extern SDLNotificationName const SDLDidReceiveSetInteriorVehicleDataRequest;
extern SDLNotificationName const SDLDidReceiveSetMediaClockTimerRequest;
extern SDLNotificationName const SDLDidReceiveShowRequest;
+extern SDLNotificationName const SDLDidReceiveShowAppMenuRequest;
extern SDLNotificationName const SDLDidReceiveShowConstantTBTRequest;
extern SDLNotificationName const SDLDidReceiveSliderRequest;
extern SDLNotificationName const SDLDidReceiveSpeakRequest;
diff --git a/SmartDeviceLink/SDLNotificationConstants.m b/SmartDeviceLink/SDLNotificationConstants.m
index 6c5ef0099..949fb3afa 100644
--- a/SmartDeviceLink/SDLNotificationConstants.m
+++ b/SmartDeviceLink/SDLNotificationConstants.m
@@ -70,6 +70,7 @@ SDLNotificationName const SDLDidReceiveSetInteriorVehicleDataResponse = @"com.sd
SDLNotificationName const SDLDidReceiveSetMediaClockTimerResponse = @"com.sdl.response.setMediaClockTimer";
SDLNotificationName const SDLDidReceiveShowConstantTBTResponse = @"com.sdl.response.showConstantTBT";
SDLNotificationName const SDLDidReceiveShowResponse = @"com.sdl.response.show";
+SDLNotificationName const SDLDidReceiveShowAppMenuResponse = @"com.sdl.response.showAppMenu";
SDLNotificationName const SDLDidReceiveSliderResponse = @"com.sdl.response.slider";
SDLNotificationName const SDLDidReceiveSpeakResponse = @"com.sdl.response.speak";
SDLNotificationName const SDLDidReceiveSubscribeButtonResponse = @"com.sdl.response.subscribeButton";
@@ -128,6 +129,7 @@ SDLNotificationName const SDLDidReceiveSetGlobalPropertiesRequest = @"com.sdl.re
SDLNotificationName const SDLDidReceiveSetInteriorVehicleDataRequest = @"com.sdl.request.setInteriorVehicleData";
SDLNotificationName const SDLDidReceiveSetMediaClockTimerRequest = @"com.sdl.request.setMediaClockTimer";
SDLNotificationName const SDLDidReceiveShowRequest = @"com.sdl.request.show";
+SDLNotificationName const SDLDidReceiveShowAppMenuRequest = @"com.sdl.request.showAppMenu";
SDLNotificationName const SDLDidReceiveShowConstantTBTRequest = @"com.sdl.request.showConstantTBT";
SDLNotificationName const SDLDidReceiveSliderRequest = @"com.sdl.request.slider";
SDLNotificationName const SDLDidReceiveSpeakRequest = @"com.sdl.request.speak";
@@ -217,6 +219,7 @@ SDLNotificationName const SDLDidReceiveWaypointNotification = @"com.sdl.notifica
SDLDidReceiveSetMediaClockTimerResponse,
SDLDidReceiveShowConstantTBTResponse,
SDLDidReceiveShowResponse,
+ SDLDidReceiveShowAppMenuResponse,
SDLDidReceiveSliderResponse,
SDLDidReceiveSpeakResponse,
SDLDidReceiveSubscribeButtonResponse,
diff --git a/SmartDeviceLink/SDLNotificationDispatcher.m b/SmartDeviceLink/SDLNotificationDispatcher.m
index c1e1e9912..99bfb171f 100644
--- a/SmartDeviceLink/SDLNotificationDispatcher.m
+++ b/SmartDeviceLink/SDLNotificationDispatcher.m
@@ -279,6 +279,10 @@ NS_ASSUME_NONNULL_BEGIN
[self postRPCResponseNotification:SDLDidReceiveShowResponse response:response];
}
+- (void)onShowAppMenuResponse:(SDLShowAppMenuResponse *)response {
+ [self postRPCResponseNotification:SDLDidReceiveShowAppMenuResponse response:response];
+}
+
- (void)onSliderResponse:(SDLSliderResponse *)response {
[self postRPCResponseNotification:SDLDidReceiveSliderResponse response:response];
}
@@ -505,6 +509,10 @@ NS_ASSUME_NONNULL_BEGIN
[self postRPCRequestNotification:SDLDidReceiveShowRequest request:request];
}
+- (void)onShowAppMenu:(SDLShowAppMenu *)request {
+ [self postRPCRequestNotification:SDLDidReceiveShowAppMenuRequest request:request];
+}
+
- (void)onShowConstantTBT:(SDLShowConstantTBT *)request {
[self postRPCRequestNotification:SDLDidReceiveShowConstantTBTRequest request:request];
}
diff --git a/SmartDeviceLink/SDLOnDriverDistraction.h b/SmartDeviceLink/SDLOnDriverDistraction.h
index d7f369348..f7df06bd8 100644
--- a/SmartDeviceLink/SDLOnDriverDistraction.h
+++ b/SmartDeviceLink/SDLOnDriverDistraction.h
@@ -28,6 +28,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (strong, nonatomic) SDLDriverDistractionState state;
+/**
+ If enabled, the lock screen will be able to be dismissed while connected to SDL, allowing users the ability to interact with the app.
+
+ Optional, Boolean
+ */
+@property (strong, nonatomic) NSNumber<SDLBool> *lockScreenDismissalEnabled;
+
+/**
+ Warning message to be displayed on the lock screen when dismissal is enabled. This warning should be used to ensure that the user is not the driver of the vehicle, ex. `Swipe up to dismiss, acknowledging that you are not the driver.`. This parameter must be present if "lockScreenDismissalEnabled" is set to true.
+
+ Optional, String
+ */
+@property (strong, nonatomic) NSString *lockScreenDismissalWarning;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLOnDriverDistraction.m b/SmartDeviceLink/SDLOnDriverDistraction.m
index e65ef63d5..40fb3afa2 100644
--- a/SmartDeviceLink/SDLOnDriverDistraction.m
+++ b/SmartDeviceLink/SDLOnDriverDistraction.m
@@ -30,6 +30,24 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_enumForName:SDLRPCParameterNameState error:&error];
}
+- (void)setLockScreenDismissalEnabled:(NSNumber<SDLBool> *)lockScreenDismissalEnabled {
+ [self.parameters sdl_setObject:lockScreenDismissalEnabled forName:SDLRPCParameterNameLockScreenDismissalEnabled];
+}
+
+- (NSNumber<SDLBool> *)lockScreenDismissalEnabled {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameLockScreenDismissalEnabled ofClass:NSNumber.class error:&error];
+}
+
+- (void)setLockScreenDismissalWarning:(NSString *)lockScreenDismissalWarning {
+ [self.parameters sdl_setObject:lockScreenDismissalWarning forName:SDLRPCParameterNameLockScreenDismissalWarning];
+}
+
+- (NSString *)lockScreenDismissalWarning {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameLockScreenDismissalWarning ofClass:NSString.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLOnLockScreenStatus.h b/SmartDeviceLink/SDLOnLockScreenStatus.h
index 255c0d71f..ce1b2cd62 100644
--- a/SmartDeviceLink/SDLOnLockScreenStatus.h
+++ b/SmartDeviceLink/SDLOnLockScreenStatus.h
@@ -23,6 +23,7 @@
NS_ASSUME_NONNULL_BEGIN
+__deprecated
@interface SDLOnLockScreenStatus : SDLRPCNotification
/**
diff --git a/SmartDeviceLink/SDLOnLockScreenStatus.m b/SmartDeviceLink/SDLOnLockScreenStatus.m
index 563b593bb..6264ea5fd 100644
--- a/SmartDeviceLink/SDLOnLockScreenStatus.m
+++ b/SmartDeviceLink/SDLOnLockScreenStatus.m
@@ -13,7 +13,10 @@
NS_ASSUME_NONNULL_BEGIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-implementations"
@implementation SDLOnLockScreenStatus
+#pragma clang diagnostic pop
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
diff --git a/SmartDeviceLink/SDLProxyListener.h b/SmartDeviceLink/SDLProxyListener.h
index ac5c0b55b..a9241f7d2 100644
--- a/SmartDeviceLink/SDLProxyListener.h
+++ b/SmartDeviceLink/SDLProxyListener.h
@@ -114,6 +114,8 @@
@class SDLSetMediaClockTimer;
@class SDLSetMediaClockTimerResponse;
@class SDLShow;
+@class SDLShowAppMenu;
+@class SDLShowAppMenuResponse;
@class SDLShowConstantTBT;
@class SDLShowConstantTBTResponse;
@class SDLShowResponse;
@@ -505,6 +507,13 @@ NS_ASSUME_NONNULL_BEGIN
- (void)onShowResponse:(SDLShowResponse *)response;
/**
+ * Called when a ShowAppMenu Response is received from Core
+ *
+ * @param response A SDLShowAppMenuResponse object
+ */
+- (void)onShowAppMenuResponse:(SDLShowAppMenuResponse *)response;
+
+/**
* Called when a Slider Response is received from Core
*
* @param response A SDLSliderResponse object
@@ -899,6 +908,13 @@ NS_ASSUME_NONNULL_BEGIN
- (void)onShow:(SDLShow *)request;
/**
+ * Called when a `ShowAppMenu` is received from Core
+ *
+ * @param request A SDLShowAppMenu object
+ */
+- (void)onShowAppMenu:(SDLShowAppMenu *)request;
+
+/**
* Called when a `ShowConstantTBT` request is received from Core
*
* @param request A SDLShowConstantTBT object
@@ -1081,7 +1097,10 @@ NS_ASSUME_NONNULL_BEGIN
*
* @param notification A SDLOnLockScreenStatus object
*/
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (void)onOnLockScreenNotification:(SDLOnLockScreenStatus *)notification;
+#pragma clang diagnostic pop
/**
* Called when an On Permissions Change notification is received from Core
diff --git a/SmartDeviceLink/SDLRPCFunctionNames.h b/SmartDeviceLink/SDLRPCFunctionNames.h
index 9d42e5da9..0a19cd58c 100644
--- a/SmartDeviceLink/SDLRPCFunctionNames.h
+++ b/SmartDeviceLink/SDLRPCFunctionNames.h
@@ -82,6 +82,7 @@ extern SDLRPCFunctionName const SDLRPCFunctionNameSetGlobalProperties;
extern SDLRPCFunctionName const SDLRPCFunctionNameSetInteriorVehicleData;
extern SDLRPCFunctionName const SDLRPCFunctionNameSetMediaClockTimer;
extern SDLRPCFunctionName const SDLRPCFunctionNameShow;
+extern SDLRPCFunctionName const SDLRPCFunctionNameShowAppMenu;
extern SDLRPCFunctionName const SDLRPCFunctionNameShowConstantTBT;
extern SDLRPCFunctionName const SDLRPCFunctionNameSlider;
extern SDLRPCFunctionName const SDLRPCFunctionNameSpeak;
diff --git a/SmartDeviceLink/SDLRPCFunctionNames.m b/SmartDeviceLink/SDLRPCFunctionNames.m
index 25652b1d2..76bb5ba80 100644
--- a/SmartDeviceLink/SDLRPCFunctionNames.m
+++ b/SmartDeviceLink/SDLRPCFunctionNames.m
@@ -77,6 +77,7 @@ SDLRPCFunctionName const SDLRPCFunctionNameSetGlobalProperties = @"SetGlobalProp
SDLRPCFunctionName const SDLRPCFunctionNameSetInteriorVehicleData = @"SetInteriorVehicleData";
SDLRPCFunctionName const SDLRPCFunctionNameSetMediaClockTimer = @"SetMediaClockTimer";
SDLRPCFunctionName const SDLRPCFunctionNameShow = @"Show";
+SDLRPCFunctionName const SDLRPCFunctionNameShowAppMenu = @"ShowAppMenu";
SDLRPCFunctionName const SDLRPCFunctionNameShowConstantTBT = @"ShowConstantTBT";
SDLRPCFunctionName const SDLRPCFunctionNameSlider = @"Slider";
SDLRPCFunctionName const SDLRPCFunctionNameSpeak = @"Speak";
diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h
index 4a6435787..1b20b2c12 100644
--- a/SmartDeviceLink/SDLRPCParameterNames.h
+++ b/SmartDeviceLink/SDLRPCParameterNames.h
@@ -20,6 +20,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameAddress;
extern SDLRPCParameterName const SDLRPCParameterNameAddressLines;
extern SDLRPCParameterName const SDLRPCParameterNameAdministrativeArea;
extern SDLRPCParameterName const SDLRPCParameterNameAirbagStatus;
+extern SDLRPCParameterName const SDLRPCParameterNameAlertIcon;
extern SDLRPCParameterName const SDLRPCParameterNameAlerts;
extern SDLRPCParameterName const SDLRPCParameterNameAlertText1;
extern SDLRPCParameterName const SDLRPCParameterNameAlertText2;
@@ -318,6 +319,8 @@ extern SDLRPCParameterName const SDLRPCParameterNameLocationDescription;
extern SDLRPCParameterName const SDLRPCParameterNameLocationDetails;
extern SDLRPCParameterName const SDLRPCParameterNameLocationImage;
extern SDLRPCParameterName const SDLRPCParameterNameLocationName;
+extern SDLRPCParameterName const SDLRPCParameterNameLockScreenDismissalEnabled;
+extern SDLRPCParameterName const SDLRPCParameterNameLockScreenDismissalWarning;
extern SDLRPCParameterName const SDLRPCParameterNameLongitudeDegrees;
extern SDLRPCParameterName const SDLRPCParameterNameLongPress;
extern SDLRPCParameterName const SDLRPCParameterNameLongPressAvailable;
@@ -600,6 +603,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameTemperatureLow;
extern SDLRPCParameterName const SDLRPCParameterNameTemperatureUnit;
extern SDLRPCParameterName const SDLRPCParameterNameTemperatureUnitAvailable;
extern SDLRPCParameterName const SDLRPCParameterNameTemplatesAvailable;
+extern SDLRPCParameterName const SDLRPCParameterNameTemplateTitle;
extern SDLRPCParameterName const SDLRPCParameterNameTertiaryText;
extern SDLRPCParameterName const SDLRPCParameterNameText;
extern SDLRPCParameterName const SDLRPCParameterNameTextFields;
diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m
index dfadd0708..5c68991cc 100644
--- a/SmartDeviceLink/SDLRPCParameterNames.m
+++ b/SmartDeviceLink/SDLRPCParameterNames.m
@@ -18,6 +18,7 @@ SDLRPCParameterName const SDLRPCParameterNameAddress = @"address";
SDLRPCParameterName const SDLRPCParameterNameAddressLines = @"addressLines";
SDLRPCParameterName const SDLRPCParameterNameAdministrativeArea = @"administrativeArea";
SDLRPCParameterName const SDLRPCParameterNameAirbagStatus = @"airbagStatus";
+SDLRPCParameterName const SDLRPCParameterNameAlertIcon = @"alertIcon";
SDLRPCParameterName const SDLRPCParameterNameAlerts = @"alerts";
SDLRPCParameterName const SDLRPCParameterNameAlertText1 = @"alertText1";
SDLRPCParameterName const SDLRPCParameterNameAlertText2 = @"alertText2";
@@ -316,6 +317,8 @@ SDLRPCParameterName const SDLRPCParameterNameLocationDescription = @"locationDes
SDLRPCParameterName const SDLRPCParameterNameLocationDetails = @"locationDetails";
SDLRPCParameterName const SDLRPCParameterNameLocationImage = @"locationImage";
SDLRPCParameterName const SDLRPCParameterNameLocationName = @"locationName";
+SDLRPCParameterName const SDLRPCParameterNameLockScreenDismissalEnabled = @"lockScreenDismissalEnabled";
+SDLRPCParameterName const SDLRPCParameterNameLockScreenDismissalWarning = @"lockScreenDismissalWarning";
SDLRPCParameterName const SDLRPCParameterNameLongitudeDegrees = @"longitudeDegrees";
SDLRPCParameterName const SDLRPCParameterNameLongPress = @"longPress";
SDLRPCParameterName const SDLRPCParameterNameLongPressAvailable = @"longPressAvailable";
@@ -595,6 +598,7 @@ SDLRPCParameterName const SDLRPCParameterNameTemperatureLow = @"temperatureLow";
SDLRPCParameterName const SDLRPCParameterNameTemperatureUnit = @"temperatureUnit";
SDLRPCParameterName const SDLRPCParameterNameTemperatureUnitAvailable = @"temperatureUnitAvailable";
SDLRPCParameterName const SDLRPCParameterNameTemplatesAvailable = @"templatesAvailable";
+SDLRPCParameterName const SDLRPCParameterNameTemplateTitle = @"templateTitle";
SDLRPCParameterName const SDLRPCParameterNameTertiaryText = @"tertiaryText";
SDLRPCParameterName const SDLRPCParameterNameText = @"text";
SDLRPCParameterName const SDLRPCParameterNameTextFields = @"textFields";
diff --git a/SmartDeviceLink/SDLScreenManager.h b/SmartDeviceLink/SDLScreenManager.h
index 9bfe33fc7..9238b6d8f 100644
--- a/SmartDeviceLink/SDLScreenManager.h
+++ b/SmartDeviceLink/SDLScreenManager.h
@@ -106,6 +106,11 @@ typedef void(^SDLPreloadChoiceCompletionHandler)(NSError *__nullable error);
*/
@property (copy, nonatomic, nullable) SDLMetadataType textField4Type;
+/**
+ The title of the current template layout.
+ */
+@property (copy, nonatomic, nullable) NSString *title;
+
#pragma mark Soft Buttons
/**
@@ -277,12 +282,26 @@ If set to `SDLDynamicMenuUpdatesModeForceOff`, menu updates will work the legacy
*/
- (void)presentKeyboardWithInitialText:(NSString *)initialText delegate:(id<SDLKeyboardDelegate>)delegate;
-
/**
Dismisses a currently presented keyboard. Canceling a keyboard only works when connected to SDL Core v.6.0+. On older versions of SDL Core the keyboard can not be dismissed.
*/
- (void)dismissKeyboard;
+#pragma mark Menu
+
+/**
+ Present the top-level of your application menu. This method should be called if the menu needs to be opened programmatically because the built in menu button is hidden.
+ */
+- (BOOL)openMenu;
+
+/**
+ Present the application menu. This method should be called if the menu needs to be opened programmatically because the built in menu button is hidden. You must update the menu with the proper cells before calling this method. This RPC will fail if the cell does not contain a sub menu, or is not in the menu array.
+
+@param cell The submenu cell that should be opened as a sub menu, with its sub cells as the options.
+ */
+- (BOOL)openSubmenu:(SDLMenuCell *)cell;
+
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLScreenManager.m b/SmartDeviceLink/SDLScreenManager.m
index b850536f2..d191acf8f 100644
--- a/SmartDeviceLink/SDLScreenManager.m
+++ b/SmartDeviceLink/SDLScreenManager.m
@@ -13,7 +13,6 @@
#import "SDLSoftButtonManager.h"
#import "SDLTextAndGraphicManager.h"
#import "SDLVoiceCommandManager.h"
-
NS_ASSUME_NONNULL_BEGIN
@interface SDLScreenManager()
@@ -126,6 +125,10 @@ NS_ASSUME_NONNULL_BEGIN
self.textAndGraphicManager.textField4Type = textField4Type;
}
+- (void)setTitle:(nullable NSString *)title {
+ self.textAndGraphicManager.title = title;
+}
+
- (void)setSoftButtonObjects:(NSArray<SDLSoftButtonObject *> *)softButtonObjects {
self.softButtonManager.softButtonObjects = softButtonObjects;
}
@@ -268,6 +271,16 @@ NS_ASSUME_NONNULL_BEGIN
[self.choiceSetManager dismissKeyboard];
}
+#pragma mark - Menu
+
+- (BOOL)openMenu {
+ return [self.menuManager openMenu];
+}
+
+- (BOOL)openSubmenu:(SDLMenuCell *)cell {
+ return [self.menuManager openSubmenu:cell];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLShow.h b/SmartDeviceLink/SDLShow.h
index 833a3dea1..e1e360912 100644
--- a/SmartDeviceLink/SDLShow.h
+++ b/SmartDeviceLink/SDLShow.h
@@ -246,6 +246,15 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (strong, nonatomic, nullable) SDLMetadataTags *metadataTags;
+/**
+ The title of the current template.
+
+ How this will be displayed is dependent on the OEM design and implementation of the template.
+
+ Optional, since SmartDeviceLink 6.0
+ */
+@property (strong, nonatomic, nullable) NSString *templateTitle;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m
index cb67f1b69..a90949e4f 100644
--- a/SmartDeviceLink/SDLShow.m
+++ b/SmartDeviceLink/SDLShow.m
@@ -204,6 +204,14 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:SDLRPCParameterNameMetadataTags ofClass:SDLMetadataTags.class error:nil];
}
+- (void)setTemplateTitle:(nullable NSString *)templateTitle {
+ [self.parameters sdl_setObject:templateTitle forName:SDLRPCParameterNameTemplateTitle];
+}
+
+- (nullable NSString *)templateTitle {
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameTemplateTitle ofClass:NSString.class error:nil];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLShowAppMenu.h b/SmartDeviceLink/SDLShowAppMenu.h
new file mode 100644
index 000000000..a7ca2cf0f
--- /dev/null
+++ b/SmartDeviceLink/SDLShowAppMenu.h
@@ -0,0 +1,35 @@
+//
+// SDLOpenMenu.h
+// SmartDeviceLink
+//
+// Created by Justin Gluck on 7/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import "SDLRPCRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Used by an app to show the app's menu, typically this is used by a navigation app if the menu button is hidden.
+
+ Added in SmartDeviceLink 6.0
+ */
+@interface SDLShowAppMenu : SDLRPCRequest
+
+/**
+ Creates a ShowAppMenu RPC to open the app menu directly to a AddSubMenu RPC's submenu.
+
+ @param menuID The ID of the AddSubMenu to open
+ @return SDLShowAppMenu RPCRequest
+ */
+- (instancetype)initWithMenuID:(UInt32)menuID;
+
+/**
+ A Menu ID that identifies the AddSubMenu to open if it correlates with the AddSubMenu menuID parameter. If not set the top level menu will be opened.
+ */
+@property (nullable, strong, nonatomic) NSNumber<SDLInt> *menuID;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLShowAppMenu.m b/SmartDeviceLink/SDLShowAppMenu.m
new file mode 100644
index 000000000..d93b8480d
--- /dev/null
+++ b/SmartDeviceLink/SDLShowAppMenu.m
@@ -0,0 +1,48 @@
+//
+// SDLOpenMenu.m
+// SmartDeviceLink
+//
+// Created by Justin Gluck on 7/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import "SDLShowAppMenu.h"
+#import "NSMutableDictionary+Store.h"
+#import "SDLRPCParameterNames.h"
+#import "SDLRPCFunctionNames.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@implementation SDLShowAppMenu
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+- (instancetype)init {
+ if (self = [super initWithName:SDLRPCFunctionNameShowAppMenu]) {
+ }
+ return self;
+}
+#pragma clang diagnostic pop
+
+- (instancetype)initWithMenuID:(UInt32)menuID {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+
+ self.menuID = @(menuID);
+ return self;
+}
+
+- (void)setMenuID:(nullable NSNumber<SDLInt> *)menuID {
+ [self.parameters sdl_setObject:menuID forName:SDLRPCParameterNameMenuId];
+}
+
+- (nullable NSNumber<SDLInt> *)menuID {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameMenuId ofClass:NSNumber.class error:&error];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLShowAppMenuResponse.h b/SmartDeviceLink/SDLShowAppMenuResponse.h
new file mode 100644
index 000000000..d5acd4c34
--- /dev/null
+++ b/SmartDeviceLink/SDLShowAppMenuResponse.h
@@ -0,0 +1,20 @@
+//
+// SDLOpenMenuResponse.h
+// SmartDeviceLink
+//
+// Created by Justin Gluck on 7/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import "SDLRPCResponse.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * Response to the request to show the app menu.
+ */
+@interface SDLShowAppMenuResponse : SDLRPCResponse
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLShowAppMenuResponse.m b/SmartDeviceLink/SDLShowAppMenuResponse.m
new file mode 100644
index 000000000..281079e7b
--- /dev/null
+++ b/SmartDeviceLink/SDLShowAppMenuResponse.m
@@ -0,0 +1,23 @@
+//
+// SDLOpenMenuResponse.m
+// SmartDeviceLink
+//
+// Created by Justin Gluck on 7/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import "SDLShowAppMenuResponse.h"
+#import "SDLRPCFunctionNames.h"
+
+@implementation SDLShowAppMenuResponse
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+- (instancetype)init {
+ if (self = [super initWithName:SDLRPCFunctionNameShowAppMenu]) {
+ }
+ return self;
+}
+#pragma clang diagnostic pop
+
+@end
diff --git a/SmartDeviceLink/SDLTextAndGraphicManager.h b/SmartDeviceLink/SDLTextAndGraphicManager.h
index a3a9c23be..48c9c7332 100644
--- a/SmartDeviceLink/SDLTextAndGraphicManager.h
+++ b/SmartDeviceLink/SDLTextAndGraphicManager.h
@@ -36,6 +36,7 @@ typedef void(^SDLTextAndGraphicUpdateCompletionHandler)(NSError *__nullable erro
@property (copy, nonatomic, nullable) NSString *textField3;
@property (copy, nonatomic, nullable) NSString *textField4;
@property (copy, nonatomic, nullable) NSString *mediaTrackTextField;
+@property (copy, nonatomic, nullable) NSString *title;
@property (strong, nonatomic, nullable) SDLArtwork *primaryGraphic;
@property (strong, nonatomic, nullable) SDLArtwork *secondaryGraphic;
diff --git a/SmartDeviceLink/SDLTextAndGraphicManager.m b/SmartDeviceLink/SDLTextAndGraphicManager.m
index 3c3395f14..5692ddaf3 100644
--- a/SmartDeviceLink/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/SDLTextAndGraphicManager.m
@@ -282,6 +282,12 @@ NS_ASSUME_NONNULL_BEGIN
} else {
show.mediaTrack = @"";
}
+
+ if (self.title != nil) {
+ show.templateTitle = self.title;
+ } else {
+ show.templateTitle = @"";
+ }
NSArray *nonNilFields = [self sdl_findNonNilTextFields];
if (nonNilFields.count == 0) { return show; }
@@ -435,6 +441,7 @@ NS_ASSUME_NONNULL_BEGIN
show.mainField3 = @"";
show.mainField4 = @"";
show.mediaTrack = @"";
+ show.templateTitle = @"";
return show;
}
@@ -448,6 +455,7 @@ NS_ASSUME_NONNULL_BEGIN
newShow.mainField3 = show.mainField3;
newShow.mainField4 = show.mainField4;
newShow.mediaTrack = show.mediaTrack;
+ newShow.templateTitle = show.templateTitle;
newShow.metadataTags = show.metadataTags;
return newShow;
@@ -481,6 +489,7 @@ NS_ASSUME_NONNULL_BEGIN
self.currentScreenData.mainField3 = show.mainField3 ?: self.currentScreenData.mainField3;
self.currentScreenData.mainField4 = show.mainField4 ?: self.currentScreenData.mainField4;
self.currentScreenData.mediaTrack = show.mediaTrack ?: self.currentScreenData.mediaTrack;
+ self.currentScreenData.templateTitle = show.templateTitle ?: self.currentScreenData.templateTitle;
self.currentScreenData.metadataTags = show.metadataTags ?: self.currentScreenData.metadataTags;
self.currentScreenData.alignment = show.alignment ?: self.currentScreenData.alignment;
self.currentScreenData.graphic = show.graphic ?: self.currentScreenData.graphic;
@@ -596,6 +605,14 @@ NS_ASSUME_NONNULL_BEGIN
}
}
+- (void)setTitle:(nullable NSString *)title {
+ _title = title;
+ _isDirty = YES;
+ if (!self.isBatchingUpdates) {
+ [self updateWithCompletionHandler:nil];
+ }
+}
+
- (void)setPrimaryGraphic:(nullable SDLArtwork *)primaryGraphic {
_primaryGraphic = primaryGraphic;
_isDirty = YES;
diff --git a/SmartDeviceLink/SDLTextFieldName.h b/SmartDeviceLink/SDLTextFieldName.h
index 74c471657..7827e4e2a 100644
--- a/SmartDeviceLink/SDLTextFieldName.h
+++ b/SmartDeviceLink/SDLTextFieldName.h
@@ -38,6 +38,13 @@ extern SDLTextFieldName const SDLTextFieldNameMainField3;
extern SDLTextFieldName const SDLTextFieldNameMainField4;
/**
+ The title line of the persistent display. Applies to SDLShow.
+
+ @since SDL 6.0
+ */
+extern SDLTextFieldName const SDLTextFieldNameTemplateTitle;
+
+/**
* The status bar on the NGN display. Applies to SDLShow.
*/
extern SDLTextFieldName const SDLTextFieldNameStatusBar;
diff --git a/SmartDeviceLink/SDLTextFieldName.m b/SmartDeviceLink/SDLTextFieldName.m
index 8c597e532..3bb04fd4b 100644
--- a/SmartDeviceLink/SDLTextFieldName.m
+++ b/SmartDeviceLink/SDLTextFieldName.m
@@ -8,6 +8,7 @@ SDLTextFieldName const SDLTextFieldNameMainField1 = @"mainField1";
SDLTextFieldName const SDLTextFieldNameMainField2 = @"mainField2";
SDLTextFieldName const SDLTextFieldNameMainField3 = @"mainField3";
SDLTextFieldName const SDLTextFieldNameMainField4 = @"mainField4";
+SDLTextFieldName const SDLTextFieldNameTemplateTitle = @"templateTitle";
SDLTextFieldName const SDLTextFieldNameStatusBar = @"statusBar";
SDLTextFieldName const SDLTextFieldNameMediaClock = @"mediaClock";
SDLTextFieldName const SDLTextFieldNameMediaTrack = @"mediaTrack";
diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h
index d0ec5198b..8404f3fd8 100644
--- a/SmartDeviceLink/SmartDeviceLink.h
+++ b/SmartDeviceLink/SmartDeviceLink.h
@@ -63,6 +63,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[];
#import "SDLSetInteriorVehicleData.h"
#import "SDLSetMediaClockTimer.h"
#import "SDLShow.h"
+#import "SDLShowAppMenu.h"
#import "SDLShowConstantTBT.h"
#import "SDLSlider.h"
#import "SDLSpeak.h"
@@ -125,6 +126,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[];
#import "SDLSetMediaClockTimerResponse.h"
#import "SDLShowConstantTBTResponse.h"
#import "SDLShowResponse.h"
+#import "SDLShowAppMenuResponse.h"
#import "SDLSliderResponse.h"
#import "SDLSpeakResponse.h"
#import "SDLSubscribeButtonResponse.h"