summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-12-09 11:48:34 -0500
committerJoel Fischer <joeljfischer@gmail.com>2020-12-09 11:48:34 -0500
commit734b76958e738a5556372e71d1df702251d1e5fe (patch)
treede4a1df08c57764d8c2f958569d01d010dee2081
parentc9cc78020f16b80437d9c651337f7693a2fae06a (diff)
parent361db38c0df94d69269358d55c34cc77a0102dac (diff)
downloadsdl_ios-734b76958e738a5556372e71d1df702251d1e5fe.tar.gz
Merge branch 'develop' into bugfix/issue-1778-softbutton-delay
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md2
-rw-r--r--.github/workflows/test.yml17
-rw-r--r--CHANGELOG.md8
-rw-r--r--Example Apps/Example ObjC/AlertManager.m2
-rw-r--r--Example Apps/Example ObjC/ProxyManager.m12
-rw-r--r--Example Apps/Example Swift/AlertManager.swift2
-rw-r--r--Example Apps/Example Swift/ProxyManager.swift12
-rw-r--r--Package.swift2
-rw-r--r--SmartDeviceLink-iOS.podspec4
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj18
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink-Example-ObjC.xcscheme2
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme2
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLinkSwift.xcscheme2
-rw-r--r--SmartDeviceLink.podspec4
-rw-r--r--SmartDeviceLink/private/SDLChoiceSetManager.m5
-rw-r--r--SmartDeviceLink/private/SDLGlobals.h2
-rw-r--r--SmartDeviceLink/private/SDLGlobals.m6
-rw-r--r--SmartDeviceLink/private/SDLLifecycleManager.m2
-rw-r--r--SmartDeviceLink/private/SDLLifecycleProtocolHandler.m1
-rw-r--r--SmartDeviceLink/private/SDLPresentChoiceSetOperation.m3
-rw-r--r--SmartDeviceLink/private/SDLPresentKeyboardOperation.m3
-rw-r--r--SmartDeviceLink/private/SDLSoftButtonManager.m3
-rw-r--r--SmartDeviceLink/private/SDLTextAndGraphicManager.m2
-rw-r--r--SmartDeviceLink/public/SDLArtwork.m14
-rw-r--r--SmartDeviceLink/public/SDLDisplayCapabilities.h2
-rw-r--r--SmartDeviceLink/public/SDLDisplayCapabilities.m3
-rw-r--r--SmartDeviceLink/public/SDLFileManager.m7
-rw-r--r--SmartDeviceLink/public/SDLKeyboardProperties.h24
-rw-r--r--SmartDeviceLink/public/SDLKeyboardProperties.m13
-rw-r--r--SmartDeviceLink/public/SDLMsgVersion.m2
-rw-r--r--SmartDeviceLink/public/SDLSystemCapabilityManager.m9
-rw-r--r--SmartDeviceLink/public/SDLTouchManager.m16
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLArtworkSpec.m33
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m2
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPresentChoiceSetOperationSpec.m5
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPresentKeyboardOperationSpec.m5
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonManagerSpec.m4
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m6
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m3
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m3
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m54
-rw-r--r--SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m13
-rw-r--r--SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m13
m---------bson_c_lib0
-rw-r--r--docs/Classes.html6
-rw-r--r--docs/Classes/SDLOnDriverDistraction.html8
-rw-r--r--generator/generator.py4
m---------generator/rpc_spec0
-rw-r--r--generator/templates/SDLRPCFunctionNames.h.jinja22
-rw-r--r--generator/templates/SDLRPCParameterNames.h.jinja22
-rw-r--r--generator/templates/enums/template.h.jinja22
-rw-r--r--generator/templates/enums/template.m.jinja22
-rw-r--r--generator/test/runner.py7
-rwxr-xr-xgenerator/test/test_CodeFormatAndQuality.py2
-rw-r--r--generator/test/test_enums.py26
-rw-r--r--generator/test/test_functions.py152
-rw-r--r--generator/test/test_structs.py39
-rw-r--r--generator/transformers/common_producer.py13
58 files changed, 470 insertions, 142 deletions
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index a980c7629..3a169cd81 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,6 +1,6 @@
[Things to note: Pull Requests **must** fix an issue. Discussion about the feature / bug takes place in the issue, discussion of the implementation takes place in the PR. Please also see the [Contributing Guide](https://github.com/smartdevicelink/sdl_ios/blob/master/.github/CONTRIBUTING.md) for information on branch naming and the CLA, and the [SmartDeviceLink GitHub Best Practices](https://d83tozu1c8tt6.cloudfront.net/media/resources/SDL_GitHub_BestPractices.pdf) document for more information on how to enter a pull request. Please create the PR as a draft until it is ready for review. Once this PR is ready for review, please request one from @smartdevicelink/ios and mark the PR as ready for review.
-Also, remember that all new public file headers should be added as public in the `File Inspector / Target Membership` pane, added to `SmartDeviceLink.h` and to *both* `.podspec` files.
+Also, remember that all new public file headers should be added as public in the `File Inspector / Target Membership` pane, placed in the `SmartDeviceLink/public` folder on the file system, and added to `SmartDeviceLink.h`. Private files should be placed in the `SmartDeviceLink/private` folder.
Delete the above section when you've read it.]
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 0b7318596..cf53b5bda 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -78,3 +78,20 @@ jobs:
uses: codecov/codecov-action@v1.0.10
with:
yml: ./codecov.yml
+
+ rpcTest:
+ name: RPC Generator Tests
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2.3.1
+ with:
+ submodules: true
+
+ - name: Install dependencies
+ run: python3 -m pip install -r generator/requirements.txt
+
+ - name: Run RPC generator tests
+ run: python3 generator/test/runner.py
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8bfa008a1..45e312fa6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
* Updated max URL lengths in `SystemRequest` to be unlimited (https://github.com/smartdevicelink/sdl_ios/issues/1110).
* Added support for new types of character sets (https://github.com/smartdevicelink/sdl_ios/issues/1139).
* Added new RPC for `SubtleAlert`, a notification-like alert (https://github.com/smartdevicelink/sdl_ios/issues/1355).
+* Added support to Swift Package Manager (https://github.com/smartdevicelink/sdl_ios/issues/1387).
* Added new vehicle data `StabilityControlsStatus` (https://github.com/smartdevicelink/sdl_ios/issues/1449).
* Changed fuel-related vehicle data RPCs (https://github.com/smartdevicelink/sdl_ios/issues/1472).
* Added new vehicle data `HandsOffSteering` (https://github.com/smartdevicelink/sdl_ios/issues/1473).
@@ -29,6 +30,8 @@
* Added support for new WebEngine projection hmi types and templates (note that this is not properly supported in this library outside of the RPCs; look at the JavaScript Suite library for more information) (https://github.com/smartdevicelink/sdl_ios/issues/1681).
* Added a `reason` parameter to protocol NAKs (https://github.com/smartdevicelink/sdl_ios/issues/1684).
* Update the minimum required iOS version to 10.0 (https://github.com/smartdevicelink/sdl_ios/issues/1738).
+* `SDLSetDisplayLayout(+Response)` is now deprecated (https://github.com/smartdevicelink/sdl_ios/issues/1785).
+* `SDLLockScreenViewController` now defaults to modal presentation style `.fullScreen` (https://github.com/smartdevicelink/sdl_ios/issues/1794).
### Bug Fixes
* `SDLServiceUpdateReason` enums are now named properly (https://github.com/smartdevicelink/sdl_ios/issues/1502).
@@ -36,6 +39,7 @@
* Consolidated logic for saving the dynamic MTU size (https://github.com/smartdevicelink/sdl_ios/issues/1615).
* Fixed example app files not in the proper folder (https://github.com/smartdevicelink/sdl_ios/issues/1765).
* Fixed `SDLSetGlobalProperties` init missing `userLocation` (https://github.com/smartdevicelink/sdl_ios/issues/1771).
+* Fixed `SDLOnDriverDistraction` properties missing `nullable` (https://github.com/smartdevicelink/sdl_ios/issues/1813).
### RPC Generator
* Fixed generator not sorting imports (https://github.com/smartdevicelink/sdl_ios/issues/1720).
@@ -51,8 +55,12 @@
### Other
* Moved files around to simplify distribution (https://github.com/smartdevicelink/sdl_ios/issues/568).
* Fixed warnings in Objective-C example app (https://github.com/smartdevicelink/sdl_ios/issues/1772).
+* Fixed example apps resetting soft buttons whenever going to HMI FULL (https://github.com/smartdevicelink/sdl_ios/issues/1782).
* Cleaned up inline documentation grammar and spelling issues (https://github.com/smartdevicelink/sdl_ios/issues/1787).
* Update CI to Xcode 12 and fix screenshot failures (https://github.com/smartdevicelink/sdl_ios/issues/1801).
+* Fixed unit tests crashing (https://github.com/smartdevicelink/sdl_ios/issues/1802).
+* README updates to point to testing YAML (https://github.com/smartdevicelink/sdl_ios/issues/1816).
+* Removed some unnecessary warning suppression (https://github.com/smartdevicelink/sdl_ios/issues/1819).
## 6.7.0
### Versions
diff --git a/Example Apps/Example ObjC/AlertManager.m b/Example Apps/Example ObjC/AlertManager.m
index 9ee13fcdd..df902dc0a 100644
--- a/Example Apps/Example ObjC/AlertManager.m
+++ b/Example Apps/Example ObjC/AlertManager.m
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation AlertManager
+ (void)sendAlertWithManager:(SDLManager *)sdlManager image:(nullable NSString *)imageName textField1:(NSString *)textField1 textField2:(nullable NSString *)textField2 {
- SDLSoftButton *okSoftButton = [[SDLSoftButton alloc] initWithType:SDLSoftButtonTypeText text:AlertOKButtonText image:nil highlighted:YES buttonId:1 systemAction:nil handler:nil];
+ SDLSoftButton *okSoftButton = [[SDLSoftButton alloc] initWithType:SDLSoftButtonTypeText text:AlertOKButtonText image:nil highlighted:YES buttonId:10000 systemAction:nil handler:nil];
SDLAlert *alert = [[SDLAlert alloc] initWithAlertText1:textField1 alertText2:textField2 alertText3:nil softButtons:@[okSoftButton] playTone:YES ttsChunks:nil duration:5000 progressIndicator:NO alertIcon:nil cancelID:0];
if (imageName == nil) {
diff --git a/Example Apps/Example ObjC/ProxyManager.m b/Example Apps/Example ObjC/ProxyManager.m
index ed2c057e3..0d13454d7 100644
--- a/Example Apps/Example ObjC/ProxyManager.m
+++ b/Example Apps/Example ObjC/ProxyManager.m
@@ -164,6 +164,10 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)sdlex_showInitialData {
+ // Send static menu items and soft buttons
+ [self sdlex_createMenus];
+ self.sdlManager.screenManager.softButtonObjects = [self.buttonManager allScreenSoftButtons];
+
if (![self.sdlManager.hmiLevel isEqualToEnum:SDLHMILevelFull]) { return; }
[self.sdlManager.screenManager changeLayout:[[SDLTemplateConfiguration alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia] withCompletionHandler:nil];
@@ -243,17 +247,15 @@ NS_ASSUME_NONNULL_BEGIN
// This is our first time in a non-NONE state
self.firstHMILevel = newLevel;
- // Send static menu items and soft buttons
- [self sdlex_createMenus];
- self.sdlManager.screenManager.softButtonObjects = [self.buttonManager allScreenSoftButtons];
-
// Subscribe to vehicle data.
[self.vehicleDataManager subscribeToVehicleOdometer];
+
+ //Handle initial launch
+ [self sdlex_showInitialData];
}
if ([newLevel isEqualToEnum:SDLHMILevelFull]) {
// The SDL app is in the foreground. Always try to show the initial state to guard against some possible weird states. Duplicates will be ignored by Core.
- [self sdlex_showInitialData];
[self.subscribeButtonManager subscribeToAllPresetButtons];
} else if ([newLevel isEqualToEnum:SDLHMILevelLimited]) {
// An active NAV or MEDIA SDL app is in the background
diff --git a/Example Apps/Example Swift/AlertManager.swift b/Example Apps/Example Swift/AlertManager.swift
index 9e37dd1c5..bf0f1af96 100644
--- a/Example Apps/Example Swift/AlertManager.swift
+++ b/Example Apps/Example Swift/AlertManager.swift
@@ -17,7 +17,7 @@ class AlertManager {
/// - textField2: The second line of text in the alert
/// - sdlManager: The SDLManager
class func sendAlert(imageName: String? = nil, textField1: String, textField2: String? = nil, sdlManager: SDLManager) {
- let okSoftButton = SDLSoftButton(type: .text, text: AlertOKButtonText, image: nil, highlighted: true, buttonId: 1, systemAction: nil, handler: nil)
+ let okSoftButton = SDLSoftButton(type: .text, text: AlertOKButtonText, image: nil, highlighted: true, buttonId: 10000, systemAction: nil, handler: nil)
let alert = SDLAlert(alertText1: textField1, alertText2: textField2, alertText3: nil, softButtons: [okSoftButton], playTone: true, ttsChunks: nil, duration: 5000, progressIndicator: false, alertIcon: nil, cancelID: 0)
if let imageName = imageName {
diff --git a/Example Apps/Example Swift/ProxyManager.swift b/Example Apps/Example Swift/ProxyManager.swift
index bce2617ad..8a53e7c76 100644
--- a/Example Apps/Example Swift/ProxyManager.swift
+++ b/Example Apps/Example Swift/ProxyManager.swift
@@ -165,18 +165,16 @@ extension ProxyManager: SDLManagerDelegate {
// This is our first time in a non-NONE state
firstHMILevelState = newLevel
- // Send static menu items and soft buttons
- createMenuAndGlobalVoiceCommands()
- sdlManager.screenManager.softButtonObjects = buttonManager.allScreenSoftButtons()
-
// Subscribe to vehicle data.
vehicleDataManager.subscribeToVehicleOdometer()
+
+ //Handle initial launch
+ showInitialData()
}
switch newLevel {
case .full:
// The SDL app is in the foreground. Always try to show the initial state to guard against some possible weird states. Duplicates will be ignored by Core.
- showInitialData()
subscribeButtonManager.subscribeToPresetButtons()
case .limited: break // An active NAV or MEDIA SDL app is in the background
case .background: break // The SDL app is not in the foreground
@@ -250,6 +248,10 @@ private extension ProxyManager {
/// Set the template and create the UI
func showInitialData() {
+ // Send static menu items and soft buttons
+ createMenuAndGlobalVoiceCommands()
+ sdlManager.screenManager.softButtonObjects = buttonManager.allScreenSoftButtons()
+
guard sdlManager.hmiLevel == .full else { return }
sdlManager.screenManager.changeLayout(SDLTemplateConfiguration(predefinedLayout: .nonMedia), withCompletionHandler: nil)
diff --git a/Package.swift b/Package.swift
index 56b8926d2..0b7fda6d4 100644
--- a/Package.swift
+++ b/Package.swift
@@ -12,7 +12,7 @@ let package = Package(
.library(name: "SmartDeviceLinkSwift", targets: ["SmartDeviceLinkSwift"])
],
dependencies: [
- .package(name: "BiSON", url: "https://github.com/smartdevicelink/bson_c_lib.git", .branch("feature/swift_pm_support"))
+ .package(name: "BiSON", url: "https://github.com/smartdevicelink/bson_c_lib.git", from: "1.2.2")
],
targets: [
.target(
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec
index 83b4a9449..2426b129c 100644
--- a/SmartDeviceLink-iOS.podspec
+++ b/SmartDeviceLink-iOS.podspec
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "SmartDeviceLink-iOS"
-s.version = "7.0.0-rc.2"
+s.version = "7.0.0"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" }
s.platform = :ios, "10.0"
-s.dependency 'BiSON', '~> 1.2.0'
+s.dependency 'BiSON', '~> 1.2.2'
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.requires_arc = true
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index 5091c70fc..948f32bfb 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -7527,7 +7527,7 @@
attributes = {
CLASSPREFIX = SDL;
LastSwiftUpdateCheck = 0710;
- LastUpgradeCheck = 1200;
+ LastUpgradeCheck = 1210;
ORGANIZATIONNAME = smartdevicelink;
TargetAttributes = {
5D4019AE1A76EC350006B0C2 = {
@@ -8957,7 +8957,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example";
SWIFT_VERSION = 5.0;
@@ -8973,7 +8973,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example";
SWIFT_VERSION = 5.0;
@@ -9016,7 +9016,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.smartdevicelink;
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
@@ -9062,7 +9062,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.smartdevicelink;
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
@@ -9156,7 +9156,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example Swift";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -9178,7 +9178,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example Swift";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -9225,7 +9225,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SmartDeviceLinkSwift;
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
@@ -9276,7 +9276,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
- MARKETING_VERSION = "7.0.0-rc.2";
+ MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SmartDeviceLinkSwift;
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
diff --git a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink-Example-ObjC.xcscheme b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink-Example-ObjC.xcscheme
index ace9007ab..144ab0c4b 100644
--- a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink-Example-ObjC.xcscheme
+++ b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink-Example-ObjC.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1200"
+ LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme
index fd8fd90e9..a9b412148 100644
--- a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme
+++ b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1200"
+ LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLinkSwift.xcscheme b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLinkSwift.xcscheme
index 3151474db..55446e4f2 100644
--- a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLinkSwift.xcscheme
+++ b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLinkSwift.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "1200"
+ LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/SmartDeviceLink.podspec b/SmartDeviceLink.podspec
index df142eaa0..87028fab6 100644
--- a/SmartDeviceLink.podspec
+++ b/SmartDeviceLink.podspec
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "SmartDeviceLink"
-s.version = "7.0.0-rc.2"
+s.version = "7.0.0"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" }
s.platform = :ios, "10.0"
-s.dependency 'BiSON', '~> 1.2.0'
+s.dependency 'BiSON', '~> 1.2.2'
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.requires_arc = true
s.swift_version = '5.2'
diff --git a/SmartDeviceLink/private/SDLChoiceSetManager.m b/SmartDeviceLink/private/SDLChoiceSetManager.m
index f00f061b6..51dd32b9e 100644
--- a/SmartDeviceLink/private/SDLChoiceSetManager.m
+++ b/SmartDeviceLink/private/SDLChoiceSetManager.m
@@ -503,7 +503,10 @@ UInt16 const ChoiceCellCancelIdMin = 1;
_keyboardConfiguration = [self sdl_defaultKeyboardConfiguration];
} else {
SDLLogD(@"Updating keyboard configuration to a new configuration: %@", keyboardConfiguration);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
_keyboardConfiguration = [[SDLKeyboardProperties alloc] initWithLanguage:keyboardConfiguration.language layout:keyboardConfiguration.keyboardLayout keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:keyboardConfiguration.limitedCharacterList autoCompleteText:keyboardConfiguration.autoCompleteText autoCompleteList:keyboardConfiguration.autoCompleteList];
+#pragma clang diagnostic pop
if (keyboardConfiguration.keypressMode != SDLKeypressModeResendCurrentEntry) {
SDLLogW(@"Attempted to set a keyboard configuration with an invalid keypress mode; only .resentCurrentEntry is valid. This value will be ignored, the rest of the properties will be set.");
@@ -512,7 +515,7 @@ UInt16 const ChoiceCellCancelIdMin = 1;
}
- (SDLKeyboardProperties *)sdl_defaultKeyboardConfiguration {
- return [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageEnUs layout:SDLKeyboardLayoutQWERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteText:nil autoCompleteList:nil];
+ return [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageEnUs keyboardLayout:SDLKeyboardLayoutQWERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteList:nil];
}
#pragma mark - Getters
diff --git a/SmartDeviceLink/private/SDLGlobals.h b/SmartDeviceLink/private/SDLGlobals.h
index 321fc60b4..eb1969a96 100644
--- a/SmartDeviceLink/private/SDLGlobals.h
+++ b/SmartDeviceLink/private/SDLGlobals.h
@@ -48,6 +48,8 @@ extern void *const SDLConcurrentQueueName;
/// @param block The block to run on the serial sub-queue.
+ (void)runSyncOnSerialSubQueue:(dispatch_queue_t)queue block:(void (^)(void))block;
+- (void)reset;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/private/SDLGlobals.m b/SmartDeviceLink/private/SDLGlobals.m
index db731993a..9bca04e37 100644
--- a/SmartDeviceLink/private/SDLGlobals.m
+++ b/SmartDeviceLink/private/SDLGlobals.m
@@ -131,6 +131,12 @@ typedef NSNumber *MTUBox;
}
}
+- (void)reset {
+ _protocolVersion = [[SDLVersion alloc] initWithString:@"1.0.0"];
+ _maxHeadUnitProtocolVersion = [[SDLVersion alloc] initWithString:@"0.0.0"];
+ _rpcVersion = [[SDLVersion alloc] initWithString:@"1.0.0"];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/private/SDLLifecycleManager.m b/SmartDeviceLink/private/SDLLifecycleManager.m
index cd95709bc..c81dc6dd0 100644
--- a/SmartDeviceLink/private/SDLLifecycleManager.m
+++ b/SmartDeviceLink/private/SDLLifecycleManager.m
@@ -396,6 +396,8 @@ NSString *const BackgroundTaskTransportName = @"com.sdl.transport.backgroundTask
weakSelf.registerResponse = (SDLRegisterAppInterfaceResponse *)response;
[SDLGlobals sharedGlobals].rpcVersion = [SDLVersion versionWithSDLMsgVersion:weakSelf.registerResponse.sdlMsgVersion];
+ SDLLogD(@"Did register app; RPC version: %@, SDL version: %@, starting languages: (VR) %@, (HMI) %@, vehicle type: %@", weakSelf.registerResponse.sdlMsgVersion, (weakSelf.registerResponse.sdlVersion ?: @"unavailable"), weakSelf.registerResponse.language, weakSelf.registerResponse.hmiDisplayLanguage, weakSelf.registerResponse.vehicleType);
+
[weakSelf sdl_transitionToState:SDLLifecycleStateRegistered];
}];
}
diff --git a/SmartDeviceLink/private/SDLLifecycleProtocolHandler.m b/SmartDeviceLink/private/SDLLifecycleProtocolHandler.m
index 858b0bdaf..e415af391 100644
--- a/SmartDeviceLink/private/SDLLifecycleProtocolHandler.m
+++ b/SmartDeviceLink/private/SDLLifecycleProtocolHandler.m
@@ -92,6 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
/// Called when the transport is closed.
- (void)protocolDidClose:(SDLProtocol *)protocol {
if (self.protocol != protocol) { return; }
+ [[SDLGlobals sharedGlobals] reset];
SDLLogW(@"Transport disconnected");
[self.notificationDispatcher postNotificationName:SDLTransportDidDisconnect infoObject:nil];
diff --git a/SmartDeviceLink/private/SDLPresentChoiceSetOperation.m b/SmartDeviceLink/private/SDLPresentChoiceSetOperation.m
index 0788b0b97..f0fbbf28a 100644
--- a/SmartDeviceLink/private/SDLPresentChoiceSetOperation.m
+++ b/SmartDeviceLink/private/SDLPresentChoiceSetOperation.m
@@ -278,7 +278,10 @@ NS_ASSUME_NONNULL_BEGIN
}
weakself.keyboardProperties.autoCompleteList = (newList.count > 0) ? newList : @[];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
weakself.keyboardProperties.autoCompleteText = (newList.count > 0) ? newList.firstObject : nil;
+#pragma clang diagnostic pop
[weakself sdl_updateKeyboardPropertiesWithCompletionHandler:nil];
}];
}
diff --git a/SmartDeviceLink/private/SDLPresentKeyboardOperation.m b/SmartDeviceLink/private/SDLPresentKeyboardOperation.m
index 633ccfba6..798e046af 100644
--- a/SmartDeviceLink/private/SDLPresentKeyboardOperation.m
+++ b/SmartDeviceLink/private/SDLPresentKeyboardOperation.m
@@ -192,7 +192,10 @@ NS_ASSUME_NONNULL_BEGIN
}
weakself.keyboardProperties.autoCompleteList = (newList.count > 0) ? newList : @[];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
weakself.keyboardProperties.autoCompleteText = (newList.count > 0) ? newList.firstObject : nil;
+#pragma clang diagnostic pop
[weakself sdl_updateKeyboardPropertiesWithCompletionHandler:nil];
}];
}
diff --git a/SmartDeviceLink/private/SDLSoftButtonManager.m b/SmartDeviceLink/private/SDLSoftButtonManager.m
index f3387cf42..7a7605d22 100644
--- a/SmartDeviceLink/private/SDLSoftButtonManager.m
+++ b/SmartDeviceLink/private/SDLSoftButtonManager.m
@@ -127,7 +127,8 @@ NS_ASSUME_NONNULL_BEGIN
// Set the soft button ids. Check to make sure no two soft buttons have the same name, there aren't many soft buttons, so n^2 isn't going to be bad
for (NSUInteger i = 0; i < softButtonObjects.count; i++) {
NSString *buttonName = softButtonObjects[i].name;
- softButtonObjects[i].buttonId = i * 100;
+ // HAX: Due to a SYNC 3.0 bug (https://github.com/smartdevicelink/sdl_ios/issues/1793#issue-708356008), a `buttonId` can not be zero. As a workaround we will start the `buttonId`s from 1.
+ softButtonObjects[i].buttonId = i + 1;
for (NSUInteger j = (i + 1); j < softButtonObjects.count; j++) {
if ([softButtonObjects[j].name isEqualToString:buttonName]) {
_softButtonObjects = @[];
diff --git a/SmartDeviceLink/private/SDLTextAndGraphicManager.m b/SmartDeviceLink/private/SDLTextAndGraphicManager.m
index a1d00186f..6f416b2f1 100644
--- a/SmartDeviceLink/private/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/private/SDLTextAndGraphicManager.m
@@ -368,7 +368,7 @@ NS_ASSUME_NONNULL_BEGIN
UIImage *blankImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
- _blankArtwork = [SDLArtwork artworkWithImage:blankImage name:@"sdl_BlankArt" asImageFormat:SDLArtworkImageFormatPNG];
+ _blankArtwork = [SDLArtwork persistentArtworkWithImage:blankImage name:@"sdl_BlankArt" asImageFormat:SDLArtworkImageFormatPNG];
return _blankArtwork;
}
diff --git a/SmartDeviceLink/public/SDLArtwork.m b/SmartDeviceLink/public/SDLArtwork.m
index 85dd4705a..9ac173307 100644
--- a/SmartDeviceLink/public/SDLArtwork.m
+++ b/SmartDeviceLink/public/SDLArtwork.m
@@ -156,9 +156,17 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - NSObject overrides
- (id)copyWithZone:(nullable NSZone *)zone {
- SDLArtworkImageFormat imageFormat = self.fileType == SDLFileTypePNG ? SDLArtworkImageFormatPNG : SDLArtworkImageFormatJPG;
+ SDLArtwork *artwork = nil;
+ if (self.isStaticIcon) {
+ artwork = [[SDLArtwork allocWithZone:zone] initWithStaticIcon:[[NSString alloc] initWithData:self.data encoding:NSASCIIStringEncoding]];
+ } else {
+ SDLArtworkImageFormat imageFormat = self.fileType == SDLFileTypePNG ? SDLArtworkImageFormatPNG : SDLArtworkImageFormatJPG;
+ artwork = [[SDLArtwork allocWithZone:zone] initWithImage:[self.image copy] name:[self.name copy] persistent:self.isPersistent asImageFormat:imageFormat];
+ }
+
+ artwork.overwrite = self.overwrite;
- return [[SDLArtwork allocWithZone:zone] initWithImage:[self.image copy] name:[self.name copy] persistent:self.isPersistent asImageFormat:imageFormat];
+ return artwork;
}
- (NSUInteger)hash {
@@ -184,7 +192,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (NSString *)description {
- return [NSString stringWithFormat:@"SDLArtwork name: %@, image: %@, isTemplate: %@, isStaticIcon: %@", self.name, self.image, (self.isTemplate ? @"YES" : @"NO"), (self.isStaticIcon ? @"YES" : @"NO")];
+ return [NSString stringWithFormat:@"SDLArtwork name: %@, image: %@, isTemplate: %@, isStaticIcon: %@, isOverwrite: %@", self.name, self.image, (self.isTemplate ? @"YES" : @"NO"), (self.isStaticIcon ? @"YES" : @"NO"), (self.overwrite ? @"YES" : @"NO")];
}
@end
diff --git a/SmartDeviceLink/public/SDLDisplayCapabilities.h b/SmartDeviceLink/public/SDLDisplayCapabilities.h
index b5644379f..42fa9723c 100644
--- a/SmartDeviceLink/public/SDLDisplayCapabilities.h
+++ b/SmartDeviceLink/public/SDLDisplayCapabilities.h
@@ -17,7 +17,7 @@
*/
NS_ASSUME_NONNULL_BEGIN
-
+__deprecated_msg("Use SDLSystemCapabilityManager.defaultMainWindowCapability instead")
@interface SDLDisplayCapabilities : SDLRPCStruct
/**
diff --git a/SmartDeviceLink/public/SDLDisplayCapabilities.m b/SmartDeviceLink/public/SDLDisplayCapabilities.m
index b85208a83..78534d9a2 100644
--- a/SmartDeviceLink/public/SDLDisplayCapabilities.m
+++ b/SmartDeviceLink/public/SDLDisplayCapabilities.m
@@ -11,6 +11,8 @@
NS_ASSUME_NONNULL_BEGIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-implementations"
@implementation SDLDisplayCapabilities
- (void)setDisplayType:(SDLDisplayType)displayType {
@@ -90,5 +92,6 @@ NS_ASSUME_NONNULL_BEGIN
}
@end
+#pragma clang diagnostic pop
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/public/SDLFileManager.m b/SmartDeviceLink/public/SDLFileManager.m
index 2acafe62b..9bade2752 100644
--- a/SmartDeviceLink/public/SDLFileManager.m
+++ b/SmartDeviceLink/public/SDLFileManager.m
@@ -22,6 +22,7 @@
#import "SDLPutFile.h"
#import "SDLStateMachine.h"
#import "SDLUploadFileOperation.h"
+#import "SDLVersion.h"
NS_ASSUME_NONNULL_BEGIN
@@ -377,9 +378,9 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
return;
}
- // HAX: [#827](https://github.com/smartdevicelink/sdl_ios/issues/827) Older versions of Core had a bug where list files would cache incorrectly. This led to attempted uploads failing due to the system thinking they were already there when they were not.
- if (!file.persistent && ![self hasUploadedFile:file]) {
- file.overwrite = true;
+ // HAX: [#827](https://github.com/smartdevicelink/sdl_ios/issues/827) Older versions of Core had a bug where list files would cache incorrectly. This led to attempted uploads failing due to the system thinking they were already there when they were not. This is only needed if connecting to Core v4.3.1 or less which corresponds to RPC v4.3.1 or less
+ if (!file.persistent && ![self hasUploadedFile:file] && [[SDLGlobals sharedGlobals].rpcVersion isLessThanVersion:[SDLVersion versionWithMajor:4 minor:4 patch:0]]) {
+ file.overwrite = YES;
}
// Check our overwrite settings and error out if it would overwrite
diff --git a/SmartDeviceLink/public/SDLKeyboardProperties.h b/SmartDeviceLink/public/SDLKeyboardProperties.h
index 5939d398f..a538b52bd 100644
--- a/SmartDeviceLink/public/SDLKeyboardProperties.h
+++ b/SmartDeviceLink/public/SDLKeyboardProperties.h
@@ -25,7 +25,19 @@ NS_ASSUME_NONNULL_BEGIN
@param autoCompleteList A list of strings to show the user to complete what they are typing.
@return The RPC object
*/
-- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList;
+- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList __deprecated_msg("Use initWithLanguage:keyboardLayout:keypressMode:limitedCharacterList:autoCompleteList: instead");
+
+/**
+ * Convenience init with all properties.
+ *
+ * @param language - language
+ * @param keyboardLayout - keyboardLayout
+ * @param keypressMode - keypressMode
+ * @param limitedCharacterList - limitedCharacterList
+ * @param autoCompleteList - autoCompleteList
+ * @return A SDLKeyboardProperties object
+ */
+- (instancetype)initWithLanguage:(nullable SDLLanguage)language keyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList;
/**
The keyboard language
@@ -58,11 +70,13 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, strong, nonatomic) NSArray<NSString *> *limitedCharacterList;
/**
- Allows an app to prepopulate the text field with a suggested or completed entry as the user types
-
- Optional
+ * Deprecated, use autoCompleteList instead.
+ * {"string_min_length": 1, "string_max_length": 1000}
+ *
+ * @deprecated in SmartDeviceLink 6.0.0
+ * @added in SmartDeviceLink 3.0.0
*/
-@property (nullable, strong, nonatomic) NSString *autoCompleteText;
+@property (nullable, strong, nonatomic) NSString *autoCompleteText __deprecated_msg("Use autoCompleteList instead");
/**
Allows an app to show a list of possible autocomplete suggestions as the user types
diff --git a/SmartDeviceLink/public/SDLKeyboardProperties.m b/SmartDeviceLink/public/SDLKeyboardProperties.m
index 5f6fa82dd..c21c91bc7 100644
--- a/SmartDeviceLink/public/SDLKeyboardProperties.m
+++ b/SmartDeviceLink/public/SDLKeyboardProperties.m
@@ -11,16 +11,23 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLKeyboardProperties
- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList {
+ self = [[self init] initWithLanguage:language keyboardLayout:layout keypressMode:keypressMode limitedCharacterList:limitedCharacterList autoCompleteList:autoCompleteList];
+ if (!self) { return nil; }
+ self.autoCompleteText = autoCompleteText;
+
+ return self;
+}
+
+- (instancetype)initWithLanguage:(nullable SDLLanguage)language keyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList autoCompleteList:(nullable NSArray<NSString *> *)autoCompleteList {
self = [self init];
if (!self) {
return nil;
}
self.language = language;
- self.keyboardLayout = layout;
+ self.keyboardLayout = keyboardLayout;
self.keypressMode = keypressMode;
- self.limitedCharacterList = [limitedCharacterList mutableCopy];
- self.autoCompleteText = autoCompleteText;
+ self.limitedCharacterList = limitedCharacterList;
self.autoCompleteList = autoCompleteList;
return self;
diff --git a/SmartDeviceLink/public/SDLMsgVersion.m b/SmartDeviceLink/public/SDLMsgVersion.m
index dce291b1b..ee0dc04fa 100644
--- a/SmartDeviceLink/public/SDLMsgVersion.m
+++ b/SmartDeviceLink/public/SDLMsgVersion.m
@@ -52,7 +52,7 @@
}
- (NSString *)description {
- return [NSString stringWithFormat:@"%@.%@.%@", self.majorVersion, self.minorVersion, self.patchVersion];
+ return [NSString stringWithFormat:@"%@.%@.%@", self.majorVersion, self.minorVersion, (self.patchVersion ?: @"0")];
}
@end
diff --git a/SmartDeviceLink/public/SDLSystemCapabilityManager.m b/SmartDeviceLink/public/SDLSystemCapabilityManager.m
index 8d7e14a78..bd61a2e05 100644
--- a/SmartDeviceLink/public/SDLSystemCapabilityManager.m
+++ b/SmartDeviceLink/public/SDLSystemCapabilityManager.m
@@ -53,7 +53,10 @@ typedef NSString * SDLServiceID;
@property (weak, nonatomic) id<SDLConnectionManagerType> connectionManager;
@property (nullable, strong, nonatomic, readwrite) NSArray<SDLDisplayCapability *> *displays;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property (nullable, strong, nonatomic, readwrite) SDLDisplayCapabilities *displayCapabilities;
+#pragma clang diagnostic pop
@property (nullable, strong, nonatomic, readwrite) SDLHMICapabilities *hmiCapabilities;
@property (nullable, copy, nonatomic, readwrite) NSArray<SDLSoftButtonCapabilities *> *softButtonCapabilities;
@property (nullable, copy, nonatomic, readwrite) NSArray<SDLButtonCapabilities *> *buttonCapabilities;
@@ -200,6 +203,8 @@ typedef NSString * SDLServiceID;
/// @param display The old-style `SDLDisplayCapabilities` object to convert
/// @param buttons The old-style `SDLButtonCapabilities` object to convert
/// @param softButtons The old-style `SDLSoftButtonCapabilities` to convert
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (NSArray<SDLDisplayCapability *> *)sdl_createDisplayCapabilityListFromDeprecatedDisplayCapabilities:(SDLDisplayCapabilities *)display buttons:(NSArray<SDLButtonCapabilities *> *)buttons softButtons:(NSArray<SDLSoftButtonCapabilities *> *)softButtons {
SDLLogV(@"Creating display capability from deprecated display capabilities");
// Based on deprecated Display capabilities we don't know if widgets are supported. The default MAIN window is the only window we know is supported, so it's the only one we will expose.
@@ -245,6 +250,7 @@ typedef NSString * SDLServiceID;
displayCapability.windowCapabilities = @[defaultWindowCapability];
return @[displayCapability];
}
+#pragma clang diagnostic pop
#pragma mark Convert New to Deprecated
@@ -257,7 +263,10 @@ typedef NSString * SDLServiceID;
}
// Create the deprecated capabilities for backward compatibility if developers try to access them
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLDisplayCapabilities *convertedCapabilities = [[SDLDisplayCapabilities alloc] init];
+#pragma clang diagnostic pop
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
convertedCapabilities.displayType = SDLDisplayTypeGeneric; // deprecated but it is mandatory
diff --git a/SmartDeviceLink/public/SDLTouchManager.m b/SmartDeviceLink/public/SDLTouchManager.m
index ad9eb4703..25b88d6fa 100644
--- a/SmartDeviceLink/public/SDLTouchManager.m
+++ b/SmartDeviceLink/public/SDLTouchManager.m
@@ -434,12 +434,16 @@ static NSUInteger const MaximumNumberOfTouches = 2;
[self sdl_cancelSingleTapTimer];
}
- __weak typeof(self) weakSelf = self;
- self.singleTapTimer = [[SDLTimer alloc] initWithDuration:self.tapTimeThreshold];
- self.singleTapTimer.elapsedBlock = ^{
- [weakSelf sdl_singleTapTimerCallbackWithPoint:point];
- };
- [self.singleTapTimer start];
+ if (self.tapTimeThreshold == 0.0) {
+ [self sdl_singleTapTimerCallbackWithPoint:point];
+ } else {
+ __weak typeof(self) weakSelf = self;
+ self.singleTapTimer = [[SDLTimer alloc] initWithDuration:self.tapTimeThreshold];
+ self.singleTapTimer.elapsedBlock = ^{
+ [weakSelf sdl_singleTapTimerCallbackWithPoint:point];
+ };
+ [self.singleTapTimer start];
+ }
}
/**
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLArtworkSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLArtworkSpec.m
index afd6a783b..986accda5 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLArtworkSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLArtworkSpec.m
@@ -162,6 +162,39 @@ describe(@"SDLArtwork Tests", ^{
expect(expectedName1).toNot(equal(expectedName2));
});
});
+
+ describe(@"copying the image", ^{
+ context(@"a dynamic image", ^{
+ beforeEach(^{
+ expectedArtwork = [[SDLArtwork alloc] initWithImage:testImagePNGTemplate persistent:YES asImageFormat:SDLArtworkImageFormatPNG];
+ expectedArtwork.overwrite = YES;
+ });
+
+ it(@"should copy correctly", ^{
+ SDLArtwork *copiedArtwork = [expectedArtwork copy];
+ expect(copiedArtwork.isTemplate).to(equal(expectedArtwork.isTemplate));
+ expect(copiedArtwork.data).to(equal(expectedArtwork.data));
+ expect(copiedArtwork.imageRPC).to(equal(expectedArtwork.imageRPC));
+ expect(copiedArtwork.overwrite).to(equal(expectedArtwork.overwrite));
+ expect(copiedArtwork.isStaticIcon).to(equal(expectedArtwork.isStaticIcon));
+ });
+ });
+
+ context(@"a static image", ^{
+ beforeEach(^{
+ expectedArtwork = [[SDLArtwork alloc] initWithStaticIcon:SDLStaticIconNameKey];
+ });
+
+ it(@"should copy correctly", ^{
+ SDLArtwork *copiedArtwork = [expectedArtwork copy];
+ expect(copiedArtwork.isTemplate).to(equal(expectedArtwork.isTemplate));
+ expect(copiedArtwork.data).to(equal(expectedArtwork.data));
+ expect(copiedArtwork.imageRPC).to(equal(expectedArtwork.imageRPC));
+ expect(copiedArtwork.overwrite).to(equal(expectedArtwork.overwrite));
+ expect(copiedArtwork.isStaticIcon).to(equal(expectedArtwork.isStaticIcon));
+ });
+ });
+ });
});
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m
index 47156d1c0..321a2dde6 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m
@@ -105,7 +105,7 @@ describe(@"choice set manager tests", ^{
it(@"should be in the correct startup state", ^{
expect(testManager.currentState).to(equal(SDLChoiceManagerStateShutdown));
- SDLKeyboardProperties *defaultProperties = [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageEnUs layout:SDLKeyboardLayoutQWERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteText:nil autoCompleteList:nil];
+ SDLKeyboardProperties *defaultProperties = [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageEnUs keyboardLayout:SDLKeyboardLayoutQWERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteList:nil];
expect(testManager.keyboardConfiguration).to(equal(defaultProperties));
});
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPresentChoiceSetOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPresentChoiceSetOperationSpec.m
index 7ca891608..883720b82 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPresentChoiceSetOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPresentChoiceSetOperationSpec.m
@@ -60,7 +60,7 @@ describe(@"present choice operation", ^{
testKeyboardDelegate = OCMProtocolMock(@protocol(SDLKeyboardDelegate));
OCMStub([testKeyboardDelegate customKeyboardConfiguration]).andReturn(nil);
- testKeyboardProperties = [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageArSa layout:SDLKeyboardLayoutAZERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteText:nil autoCompleteList:nil];
+ testKeyboardProperties = [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageArSa keyboardLayout:SDLKeyboardLayoutAZERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteList:nil];
});
it(@"should have a priority of 'normal'", ^{
@@ -460,7 +460,10 @@ describe(@"present choice operation", ^{
expect(testConnectionManager.receivedRequests.lastObject).to(beAnInstanceOf([SDLSetGlobalProperties class]));
SDLSetGlobalProperties *setProperties = testConnectionManager.receivedRequests.lastObject;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(setProperties.keyboardProperties.autoCompleteText).to(equal(inputData));
+#pragma clang diagnostic pop
});
it(@"should respond to text input notification with character set", ^{
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPresentKeyboardOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPresentKeyboardOperationSpec.m
index 08424949d..29ed6d0b0 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPresentKeyboardOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPresentKeyboardOperationSpec.m
@@ -43,7 +43,7 @@ describe(@"present keyboard operation", ^{
testDelegate = OCMProtocolMock(@protocol(SDLKeyboardDelegate));
OCMStub([testDelegate customKeyboardConfiguration]).andReturn(nil);
- testInitialProperties = [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageArSa layout:SDLKeyboardLayoutAZERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteText:nil autoCompleteList:nil];
+ testInitialProperties = [[SDLKeyboardProperties alloc] initWithLanguage:SDLLanguageArSa keyboardLayout:SDLKeyboardLayoutAZERTY keypressMode:SDLKeypressModeResendCurrentEntry limitedCharacterList:nil autoCompleteList:nil];
});
it(@"should have a priority of 'normal'", ^{
@@ -194,7 +194,10 @@ describe(@"present keyboard operation", ^{
expect(testConnectionManager.receivedRequests.lastObject).to(beAnInstanceOf([SDLSetGlobalProperties class]));
SDLSetGlobalProperties *setProperties = testConnectionManager.receivedRequests.lastObject;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(setProperties.keyboardProperties.autoCompleteText).to(equal(inputData));
+#pragma clang diagnostic pop
});
it(@"should respond to text input notification with character set", ^{
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonManagerSpec.m
index 4f708087b..6a5996116 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonManagerSpec.m
@@ -172,8 +172,8 @@ describe(@"a soft button manager", ^{
it(@"should set soft buttons correctly", ^{
expect(testManager.softButtonObjects).toNot(beNil());
- expect(testObject1.buttonId).to(equal(0));
- expect(testObject2.buttonId).to(equal(100));
+ expect(testObject1.buttonId).to(equal(1));
+ expect(testObject2.buttonId).to(equal(2));
expect(testObject1.manager).to(equal(testManager));
expect(testObject2.manager).to(equal(testManager));
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m
index c42e10961..e444ba473 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m
@@ -151,7 +151,10 @@ describe(@"the streaming video manager", ^{
describe(@"after receiving a register app interface response", ^{
__block SDLRegisterAppInterfaceResponse *someRegisterAppInterfaceResponse = nil;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__block SDLDisplayCapabilities *someDisplayCapabilities = nil;
+#pragma clang diagnostic pop
__block SDLScreenParams *someScreenParams = nil;
__block SDLImageResolution *someImageResolution = nil;
__block SDLHMICapabilities *someHMICapabilities = nil;
@@ -194,7 +197,10 @@ describe(@"the streaming video manager", ^{
someHMICapabilities = [[SDLHMICapabilities alloc] init];
someHMICapabilities.videoStreaming = @YES;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
someDisplayCapabilities = [[SDLDisplayCapabilities alloc] init];
+#pragma clang diagnostic pop
someDisplayCapabilities.screenParams = someScreenParams;
someRegisterAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m
index d7e776aab..1b00938fb 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m
@@ -16,7 +16,10 @@
QuickSpecBegin(SDLRegisterAppInterfaceResponseSpec)
__block SDLMsgVersion *sdlVersion = [[SDLMsgVersion alloc] initWithMajorVersion:0 minorVersion:0 patchVersion:0];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__block SDLDisplayCapabilities* info = [[SDLDisplayCapabilities alloc] init];
+#pragma clang diagnostic pop
__block SDLButtonCapabilities* button = [[SDLButtonCapabilities alloc] init];
__block SDLSoftButtonCapabilities* softButton = [[SDLSoftButtonCapabilities alloc] init];
__block SDLPresetBankCapabilities* presetBank = [[SDLPresetBankCapabilities alloc] init];__block
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m
index 0d958e18d..ff1a249f7 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m
@@ -19,7 +19,10 @@
QuickSpecBegin(SDLSetDisplayLayoutResponseSpec)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLDisplayCapabilities* info = [[SDLDisplayCapabilities alloc] init];
+#pragma clang diagnostic pop
SDLButtonCapabilities* button = [[SDLButtonCapabilities alloc] init];
SDLSoftButtonCapabilities* softButton = [[SDLSoftButtonCapabilities alloc] init];
SDLPresetBankCapabilities* presetBank = [[SDLPresetBankCapabilities alloc] init];
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m
index 7b1e28362..b1f15a63f 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m
@@ -32,45 +32,72 @@ describe(@"Getter/Setter Tests", ^ {
testStruct.keyboardLayout = testLayout;
testStruct.keypressMode = testMode;
testStruct.limitedCharacterList = testLimitedCharacterList;
- testStruct.autoCompleteText = testAutoCompleteText;
testStruct.autoCompleteList = testAutoCompleteList;
-
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ testStruct.autoCompleteText = testAutoCompleteText;
+#pragma clang diagnostic pop
+
expect(testStruct.language).to(equal(testLanguage));
expect(testStruct.keyboardLayout).to(equal(testLayout));
expect(testStruct.keypressMode).to(equal(testMode));
expect(testStruct.limitedCharacterList).to(equal(testLimitedCharacterList));
- expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
expect(testStruct.autoCompleteList).to(equal(testAutoCompleteList));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
+#pragma clang diagnostic pop
});
it(@"Should get correctly when initialized with a dictionary", ^ {
NSDictionary* dict = @{SDLRPCParameterNameLanguage: testLanguage,
- SDLRPCParameterNameKeyboardLayout: testLayout,
- SDLRPCParameterNameKeypressMode: testMode,
- SDLRPCParameterNameLimitedCharacterList: testLimitedCharacterList,
- SDLRPCParameterNameAutoCompleteText: testAutoCompleteText,
- SDLRPCParameterNameAutoCompleteList: testAutoCompleteList
- };
+ SDLRPCParameterNameKeyboardLayout: testLayout,
+ SDLRPCParameterNameKeypressMode: testMode,
+ SDLRPCParameterNameLimitedCharacterList: testLimitedCharacterList,
+ SDLRPCParameterNameAutoCompleteList: testAutoCompleteList,
+ SDLRPCParameterNameAutoCompleteText: testAutoCompleteText
+ };
SDLKeyboardProperties* testStruct = [[SDLKeyboardProperties alloc] initWithDictionary:dict];
expect(testStruct.language).to(equal(testLanguage));
expect(testStruct.keyboardLayout).to(equal(testLayout));
expect(testStruct.keypressMode).to(equal(testMode));
expect(testStruct.limitedCharacterList).to(equal(testLimitedCharacterList));
- expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
expect(testStruct.autoCompleteList).to(equal(testAutoCompleteList));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
+#pragma clang diagnostic pop
});
it(@"Should get correctly when initialized with initWithLanguage:layout:keypressMode:limitedCharacterList:autoCompleteText:autoCompleteList:", ^ {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLKeyboardProperties *testStruct = [[SDLKeyboardProperties alloc] initWithLanguage:testLanguage layout:testLayout keypressMode:testMode limitedCharacterList:testLimitedCharacterList autoCompleteText:testAutoCompleteText autoCompleteList:testAutoCompleteList];
-
+#pragma clang diagnostic pop
expect(testStruct.language).to(equal(testLanguage));
expect(testStruct.keyboardLayout).to(equal(testLayout));
expect(testStruct.keypressMode).to(equal(testMode));
expect(testStruct.limitedCharacterList).to(equal(testLimitedCharacterList));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
expect(testStruct.autoCompleteText).to(equal(testAutoCompleteText));
+#pragma clang diagnostic pop
expect(testStruct.autoCompleteList).to(equal(testAutoCompleteList));
});
+
+ it(@"Should get correctly when initialized with initWithLanguage:keyboardLayout:keypressMode:limitedCharacterList:autoCompleteList:", ^ {
+ SDLKeyboardProperties *testStruct = [[SDLKeyboardProperties alloc] initWithLanguage:testLanguage keyboardLayout:testLayout keypressMode:testMode limitedCharacterList:testLimitedCharacterList autoCompleteList:testAutoCompleteList];
+ expect(testStruct.language).to(equal(testLanguage));
+ expect(testStruct.keyboardLayout).to(equal(testLayout));
+ expect(testStruct.keypressMode).to(equal(testMode));
+ expect(testStruct.limitedCharacterList).to(equal(testLimitedCharacterList));
+ expect(testStruct.autoCompleteList).to(equal(testAutoCompleteList));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ expect(testStruct.autoCompleteText).to(beNil());
+#pragma clang diagnostic pop
+ });
it(@"Should return nil if not set", ^ {
SDLKeyboardProperties* testStruct = [[SDLKeyboardProperties alloc] init];
@@ -79,8 +106,11 @@ describe(@"Getter/Setter Tests", ^ {
expect(testStruct.keyboardLayout).to(beNil());
expect(testStruct.keypressMode).to(beNil());
expect(testStruct.limitedCharacterList).to(beNil());
- expect(testStruct.autoCompleteText).to(beNil());
expect(testStruct.autoCompleteList).to(beNil());
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ expect(testStruct.autoCompleteText).to(beNil());
+#pragma clang diagnostic pop
});
});
diff --git a/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m b/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m
index 184ad81a7..4afa389d2 100644
--- a/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m
+++ b/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m
@@ -48,7 +48,10 @@ typedef NSString * SDLServiceID;
@property (weak, nonatomic) id<SDLConnectionManagerType> connectionManager;
@property (nullable, strong, nonatomic, readwrite) NSArray<SDLDisplayCapability *> *displays;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property (nullable, strong, nonatomic, readwrite) SDLDisplayCapabilities *displayCapabilities;
+#pragma clang diagnostic pop
@property (nullable, strong, nonatomic, readwrite) SDLHMICapabilities *hmiCapabilities;
@property (nullable, copy, nonatomic, readwrite) NSArray<SDLSoftButtonCapabilities *> *softButtonCapabilities;
@property (nullable, copy, nonatomic, readwrite) NSArray<SDLButtonCapabilities *> *buttonCapabilities;
@@ -87,7 +90,10 @@ describe(@"System capability manager", ^{
__block TestConnectionManager *testConnectionManager = nil;
__block NSArray<SDLDisplayCapability *> *testDisplayCapabilityList = nil;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__block SDLDisplayCapabilities *testDisplayCapabilities = nil;
+#pragma clang diagnostic pop
__block NSArray<SDLSoftButtonCapabilities *> *testSoftButtonCapabilities = nil;
__block NSArray<SDLButtonCapabilities *> *testButtonCapabilities = nil;
__block SDLPresetBankCapabilities *testPresetBankCapabilities = nil;
@@ -95,8 +101,10 @@ describe(@"System capability manager", ^{
beforeEach(^{
testConnectionManager = [[TestConnectionManager alloc] init];
testSystemCapabilityManager = [[SDLSystemCapabilityManager alloc] initWithConnectionManager:testConnectionManager];
-
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
testDisplayCapabilities = [[SDLDisplayCapabilities alloc] init];
+#pragma clang diagnostic pop
testDisplayCapabilities.graphicSupported = @NO;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
@@ -267,7 +275,10 @@ describe(@"System capability manager", ^{
context(@"when displayCapabilities.graphicSupported is true", ^{
beforeEach(^{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
testSystemCapabilityManager.displayCapabilities = [[SDLDisplayCapabilities alloc] init];
+#pragma clang diagnostic pop
testSystemCapabilityManager.displayCapabilities.graphicSupported = @YES;
});
diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m
index f730c17c1..379b269e8 100644
--- a/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m
+++ b/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m
@@ -40,6 +40,19 @@ describe(@"The SDLGlobals class", ^{
expect(testGlobals.maxHeadUnitProtocolVersion).to(equal(someVersionHigherThanMaxProxyVersion));
});
});
+
+ describe(@"test values after calling sdl_resetProtocolVersion", ^{
+ beforeEach(^{
+ [testGlobals reset];
+ });
+
+ it(@"should return should properly set values", ^{
+ expect(testGlobals.protocolVersion.stringVersion).to(equal(@"1.0.0"));
+ expect(testGlobals.protocolVersion.major).to(equal(1));
+ expect(testGlobals.maxHeadUnitProtocolVersion.stringVersion).to(equal(@"0.0.0"));
+ expect(testGlobals.rpcVersion).to(equal([[SDLVersion alloc] initWithMajor:1 minor:0 patch:0]));
+ });
+ });
describe(@"getting the max MTU version", ^{
context(@"when protocol version is 1 - 2", ^{
diff --git a/bson_c_lib b/bson_c_lib
-Subproject c92f3a73836f80b61419d6870b80f574c465c5f
+Subproject e82d717ae4a9abc833fba51c75bc9b25a32dd5b
diff --git a/docs/Classes.html b/docs/Classes.html
index f2f9fb7dc..0b4890dd8 100644
--- a/docs/Classes.html
+++ b/docs/Classes.html
@@ -5203,7 +5203,8 @@ Subsequent calls with the same service type will update the manifest for that se
<h4>Objective-C</h4>
- <pre class="highlight objective_c"><code><span class="k">@interface</span> <span class="nc">SDLSetDisplayLayout</span> <span class="p">:</span> <span class="nc"><a href="Classes/SDLRPCRequest.html">SDLRPCRequest</a></span></code></pre>
+ <pre class="highlight objective_c"><code>
+<span class="k">@interface</span> <span class="nc">SDLSetDisplayLayout</span> <span class="p">:</span> <span class="nc"><a href="Classes/SDLRPCRequest.html">SDLRPCRequest</a></span></code></pre>
<h4>Swift</h4>
@@ -5224,7 +5225,8 @@ Subsequent calls with the same service type will update the manifest for that se
<h4>Objective-C</h4>
- <pre class="highlight objective_c"><code><span class="k">@interface</span> <span class="nc">SDLSetDisplayLayoutResponse</span> <span class="p">:</span> <span class="nc"><a href="Classes/SDLRPCResponse.html">SDLRPCResponse</a></span></code></pre>
+ <pre class="highlight objective_c"><code>
+<span class="k">@interface</span> <span class="nc">SDLSetDisplayLayoutResponse</span> <span class="p">:</span> <span class="nc"><a href="Classes/SDLRPCResponse.html">SDLRPCResponse</a></span></code></pre>
<h4>Swift</h4>
diff --git a/docs/Classes/SDLOnDriverDistraction.html b/docs/Classes/SDLOnDriverDistraction.html
index 26ad20c90..168dd33e1 100644
--- a/docs/Classes/SDLOnDriverDistraction.html
+++ b/docs/Classes/SDLOnDriverDistraction.html
@@ -53,11 +53,11 @@
<h4>Objective-C</h4>
- <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">strong</span><span class="p">)</span> <span class="n">NSNumber</span><span class="o">&lt;</span><span class="n"><a href="../Protocols.html#/c:objc(pl)SDLBool">SDLBool</a></span><span class="o">&gt;</span> <span class="o">*</span><span class="n">_Nonnull</span> <span class="n">lockScreenDismissalEnabled</span><span class="p">;</span></code></pre>
+ <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">nullable</span><span class="p">)</span> <span class="n">NSNumber</span><span class="o">&lt;</span><span class="n"><a href="../Protocols.html#/c:objc(pl)SDLBool">SDLBool</a></span><span class="o">&gt;</span> <span class="o">*</span><span class="n">lockScreenDismissalEnabled</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
- <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">lockScreenDismissalEnabled</span><span class="p">:</span> <span class="kt">NSNumber</span> <span class="o">&amp;</span> <span class="kt"><a href="../Protocols.html#/c:objc(pl)SDLBool">SDLBool</a></span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
+ <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">lockScreenDismissalEnabled</span><span class="p">:</span> <span class="p">(</span><span class="kt">NSNumber</span> <span class="o">&amp;</span> <span class="kt"><a href="../Protocols.html#/c:objc(pl)SDLBool">SDLBool</a></span><span class="p">)?</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
@@ -73,11 +73,11 @@
<h4>Objective-C</h4>
- <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">strong</span><span class="p">)</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">_Nonnull</span> <span class="n">lockScreenDismissalWarning</span><span class="p">;</span></code></pre>
+ <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">nullable</span><span class="p">)</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">lockScreenDismissalWarning</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
- <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">lockScreenDismissalWarning</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
+ <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">lockScreenDismissalWarning</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
diff --git a/generator/generator.py b/generator/generator.py
index 2dda4129f..f7ccb4368 100644
--- a/generator/generator.py
+++ b/generator/generator.py
@@ -103,11 +103,11 @@ class Generator:
:param paths: list with paths to all Jinja2 templates
:return: None
"""
- loaders = list(filter(lambda l: Path(l).exists(), paths))
+ loaders = list(filter(lambda lambdaList: Path(lambdaList).exists(), paths))
if not loaders:
self.logger.error('Directory with templates not found %s', str(paths))
sys.exit(1)
- loaders = [FileSystemLoader(l) for l in loaders]
+ loaders = [FileSystemLoader(lambdaList) for lambdaList in loaders]
self._env = Environment(loader=ChoiceLoader(loaders))
self._env.filters['title'] = self.title
diff --git a/generator/rpc_spec b/generator/rpc_spec
-Subproject eead323f356be713d2b0f0a253f3f3d36143460
+Subproject 762489ca140f246923e8bb8f54e96364e9d0101
diff --git a/generator/templates/SDLRPCFunctionNames.h.jinja2 b/generator/templates/SDLRPCFunctionNames.h.jinja2
index 5e13b735b..419081b51 100644
--- a/generator/templates/SDLRPCFunctionNames.h.jinja2
+++ b/generator/templates/SDLRPCFunctionNames.h.jinja2
@@ -6,7 +6,7 @@
/**
* All RPC request / response / notification names
*/
-typedef SDLEnum SDLRPCFunctionName SDL_SWIFT_ENUM;
+typedef SDLEnum SDLRPCFunctionName NS_TYPED_ENUM;
{% for param in params %}
{#- description if exist in source xml, will be putted here
since if exist in source xml, will be putted here -#}
diff --git a/generator/templates/SDLRPCParameterNames.h.jinja2 b/generator/templates/SDLRPCParameterNames.h.jinja2
index 7a5bbb746..93bf39c88 100644
--- a/generator/templates/SDLRPCParameterNames.h.jinja2
+++ b/generator/templates/SDLRPCParameterNames.h.jinja2
@@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN
-typedef NSString* SDLRPCParameterName SDL_SWIFT_ENUM;
+typedef NSString* SDLRPCParameterName NS_TYPED_ENUM;
{% for param in params %}
extern SDLRPCParameterName const SDLRPCParameterName{{ param.name }};
{%- endfor %}
diff --git a/generator/templates/enums/template.h.jinja2 b/generator/templates/enums/template.h.jinja2
index fb811fcd8..3d26960ec 100644
--- a/generator/templates/enums/template.h.jinja2
+++ b/generator/templates/enums/template.h.jinja2
@@ -7,7 +7,7 @@
{%- endblock -%}
{%- block body %}
{% include 'description.jinja2' %}
-typedef SDLEnum {{ name }} SDL_SWIFT_ENUM{{ending}};
+typedef SDLEnum {{ name }} NS_TYPED_ENUM{{ending}};
{%- for param in params %}
{%- include 'description_param.jinja2' %}
extern {{ name }} const {{ name }}{{param.name}}{{ " __deprecated" if param.deprecated and param.deprecated }};
diff --git a/generator/templates/enums/template.m.jinja2 b/generator/templates/enums/template.m.jinja2
index e434bf758..fa82a9e44 100644
--- a/generator/templates/enums/template.m.jinja2
+++ b/generator/templates/enums/template.m.jinja2
@@ -3,7 +3,7 @@
#import "{{name}}.h"
{%- block body %}
{% if add_typedef %}
-typedef SDLEnum {{name}} SDL_SWIFT_ENUM;
+typedef SDLEnum {{name}} NS_TYPED_ENUM;
{% endif -%}
{%- for param in params %}
{{ name }} const {{ name }}{{param.name}} = @"{{param.origin}}";
diff --git a/generator/test/runner.py b/generator/test/runner.py
index 2cb413227..3c2a8231e 100644
--- a/generator/test/runner.py
+++ b/generator/test/runner.py
@@ -57,7 +57,12 @@ def main():
suite.addTests(TestLoader().loadTestsFromTestCase(CodeFormatAndQuality))
runner = TextTestRunner(verbosity=2)
- runner.run(suite)
+ test_results = runner.run(suite)
+
+ if test_results.wasSuccessful():
+ exit(0)
+ else:
+ exit(1)
if __name__ == '__main__':
diff --git a/generator/test/test_CodeFormatAndQuality.py b/generator/test/test_CodeFormatAndQuality.py
index c9b34e06f..affc4affe 100755
--- a/generator/test/test_CodeFormatAndQuality.py
+++ b/generator/test/test_CodeFormatAndQuality.py
@@ -23,7 +23,7 @@ class CodeFormatAndQuality(unittest.TestCase):
If any inconvenient low quality code will be found, this will be shown in stdout and
each such cases will be reflected with report.total_errors number
"""
- style_guide = flake8.get_style_guide(max_line_length=120)
+ style_guide = flake8.get_style_guide(max_line_length=2048)
report = style_guide.check_files(self.list_of_files)
self.assertEqual(report.total_errors, 0)
diff --git a/generator/test/test_enums.py b/generator/test/test_enums.py
index 22650ce67..4e6b52490 100644
--- a/generator/test/test_enums.py
+++ b/generator/test/test_enums.py
@@ -43,12 +43,16 @@ class TestEnumsProducer(TestCase):
expected = OrderedDict()
expected['origin'] = 'FunctionID'
expected['name'] = 'SDLFunctionID'
- expected['imports'] = {'.h': {'SDLEnum'}, '.m': {'SDLEnum'}}
+ expected['imports'] = {
+ '.h': {'SDLEnum'},
+ '.m': ['SDLEnum']
+ }
+ expected['history'] = None
expected['params'] = (
- self.producer.param_named(description=[], name='Reserved', origin='RESERVED', since=None, deprecated=False),
- self.producer.param_named(description=[], name='RegisterAppInterface', origin='RegisterAppInterfaceID',
+ self.producer.param_named(history=None, description=[], name='Reserved', origin='RESERVED', since=None, deprecated=False),
+ self.producer.param_named(history=None, description=[], name='RegisterAppInterface', origin='RegisterAppInterfaceID',
since=None, deprecated=False),
- self.producer.param_named(description=[], name='PerformAudioPassThru', origin='PerformAudioPassThruID',
+ self.producer.param_named(history=None, description=[], name='PerformAudioPassThru', origin='PerformAudioPassThruID',
since=None, deprecated=False),)
actual = self.producer.transform(item)
@@ -69,14 +73,18 @@ class TestEnumsProducer(TestCase):
expected = OrderedDict()
expected['origin'] = 'TextFieldName'
expected['name'] = 'SDLTextFieldName'
- expected['imports'] = {'.h': {'SDLEnum'}, '.m': {'SDLEnum'}}
+ expected['imports'] = {
+ '.h': {'SDLEnum'},
+ '.m': ['SDLEnum']
+ }
+ expected['history'] = None
expected['params'] = (
- self.producer.param_named(description=[], name='Success', origin='SUCCESS', since=None,
+ self.producer.param_named(history=None, description=[], name='Success', origin='SUCCESS', since=None,
deprecated=False),
- self.producer.param_named(description=[], name='MainField1', origin='mainField1', since=None,
+ self.producer.param_named(history=None, description=[], name='MainField1', origin='mainField1', since=None,
deprecated=False),
- self.producer.param_named(description=[], name='H264', origin='H264', since=None, deprecated=False),
- self.producer.param_named(description=[], name='UnsupportedRequest', origin='UNSUPPORTED_REQUEST',
+ self.producer.param_named(history=None, description=[], name='H264', origin='H264', since=None, deprecated=False),
+ self.producer.param_named(history=None, description=[], name='UnsupportedRequest', origin='UNSUPPORTED_REQUEST',
since=None, deprecated=False))
actual = self.producer.transform(item)
diff --git a/generator/test/test_functions.py b/generator/test/test_functions.py
index a271fa23a..d2b885e21 100644
--- a/generator/test/test_functions.py
+++ b/generator/test/test_functions.py
@@ -130,37 +130,58 @@ class TestFunctionsProducer(TestCase):
expected['name'] = 'SDLRegisterAppInterface'
expected['extends_class'] = 'SDLRPCRequest'
expected['imports'] = {
- '.h': {'enum': {'SDLRPCRequest'}, 'struct': {'SDLTemplateColorScheme', 'SDLTTSChunk', 'SDLSdlMsgVersion'}},
- '.m': {'SDLTemplateColorScheme', 'SDLTTSChunk', 'SDLSdlMsgVersion'}}
+ '.h': {
+ 'enum': ['SDLRPCRequest'],
+ 'struct': [
+ 'SDLSdlMsgVersion',
+ 'SDLTTSChunk',
+ 'SDLTemplateColorScheme'
+ ]
+ },
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLRPCFunctionNames',
+ 'SDLRPCParameterNames',
+ 'SDLRegisterAppInterface',
+ 'SDLSdlMsgVersion',
+ 'SDLTTSChunk',
+ 'SDLTemplateColorScheme'
+ ]
+ }
+ expected['history'] = None
expected['description'] = ['Establishes an interface with a mobile application. Before registerAppInterface no '
- 'other commands will be', 'accepted/executed.']
+ 'other commands will be accepted/executed.']
expected['since'] = '1.0.0'
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='sdlMsgVersion', constructor_argument_override=None,
constructor_prefix='SdlMsgVersion', deprecated=False, description=['See SyncMsgVersion'],
for_name='object', mandatory=True, method_suffix='SdlMsgVersion', modifier='strong',
of_class='SDLSdlMsgVersion.class', origin='sdlMsgVersion', since=None,
type_native='SDLSdlMsgVersion *', type_sdl='SDLSdlMsgVersion *'),
self.producer.param_named(
+ history=None,
constructor_argument='fullAppID', constructor_argument_override=None, constructor_prefix='FullAppID',
- deprecated=False, description=['ID used',
- '{"default_value": null, "max_length": null, "min_length": null}'],
+ deprecated=False, description=['ID used', '{"string_min_length": null, "string_max_length": null}'],
for_name='object', mandatory=False, method_suffix='FullAppID', modifier='strong',
of_class='NSString.class', origin='fullAppID', since=None, type_native='NSString *',
type_sdl='NSString *'),
self.producer.param_named(
+ history=None,
constructor_argument='dayColorScheme', constructor_argument_override=None, mandatory=False,
constructor_prefix='DayColorScheme', deprecated=False, description=[], for_name='object',
method_suffix='DayColorScheme', modifier='strong', of_class='SDLTemplateColorScheme.class',
origin='dayColorScheme', since=None, type_native='SDLTemplateColorScheme *',
type_sdl='SDLTemplateColorScheme *'),
self.producer.param_named(
+ history=None,
constructor_argument='ttsName', constructor_argument_override=None, constructor_prefix='TtsName',
- deprecated=False, description=['TTS string for'], for_name='objects', mandatory=False,
+ deprecated=False, description=['TTS string for', '{"array_min_size": null, "array_max_size": null}'], for_name='objects', mandatory=False,
method_suffix='TtsName', modifier='strong', of_class='SDLTTSChunk.class', origin='ttsName', since=None,
type_native='NSArray<SDLTTSChunk *> *', type_sdl='NSArray<SDLTTSChunk *> *'),
self.producer.param_named(
+ history=None,
constructor_argument='isMediaApplication', constructor_argument_override=None,
constructor_prefix='IsMediaApplication', deprecated=False,
description=['Indicates if the application is a media or a'], for_name='object', mandatory=True,
@@ -184,10 +205,10 @@ class TestFunctionsProducer(TestCase):
expected['constructors'] = (
self.producer.constructor_named(
- all=mandatory_arguments, arguments=mandatory_arguments, deprecated=False,
+ all=mandatory_arguments, arguments=mandatory_arguments,
init=mandatory_init, self=True),
self.producer.constructor_named(
- all=mandatory_arguments + not_mandatory_arguments, arguments=not_mandatory_arguments, deprecated=False,
+ all=mandatory_arguments + not_mandatory_arguments, arguments=not_mandatory_arguments,
init=mandatory_init + ' fullAppID:(nullable NSString *)fullAppID dayColorScheme:(nullable '
'SDLTemplateColorScheme *)dayColorScheme ttsName:(nullable NSArray<SDLTTSChunk '
'*> *)ttsName',
@@ -219,24 +240,41 @@ class TestFunctionsProducer(TestCase):
expected['origin'] = 'RegisterAppInterface'
expected['name'] = 'SDLRegisterAppInterfaceResponse'
expected['extends_class'] = 'SDLRPCResponse'
- expected['imports'] = {'.h': {'enum': {'SDLRPCResponse', 'SDLLanguage'}, 'struct': set()},
- '.m': {'SDLLanguage'}}
+ expected['imports'] = {
+ '.h': {
+ 'enum': [
+ 'SDLLanguage',
+ 'SDLRPCResponse'
+ ],
+ 'struct': []},
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLLanguage',
+ 'SDLRPCFunctionNames',
+ 'SDLRPCParameterNames',
+ 'SDLRegisterAppInterface'
+ ]
+ }
+ expected['history'] = None
expected['description'] = ['The response']
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='language', constructor_argument_override=None, constructor_prefix='Language',
deprecated=False, description=['The currently'], for_name='enum', mandatory=False,
method_suffix='Language', modifier='strong', of_class='', origin='language',
since=None, type_native='SDLLanguage ', type_sdl='SDLLanguage '),
self.producer.param_named(
+ history=None,
constructor_argument='supportedDiagModes', constructor_argument_override=None,
- constructor_prefix='SupportedDiagModes', deprecated=False, description=['Specifies the'],
+ constructor_prefix='SupportedDiagModes', deprecated=False, description=['Specifies the', '{"array_min_size": 1, "array_max_size": 100, "num_min_value": 0, "num_max_value": 255}'],
for_name='objects', mandatory=False, method_suffix='SupportedDiagModes', modifier='strong',
of_class='NSNumber.class', origin='supportedDiagModes', since=None,
type_native='NSArray<NSNumber<SDLUInt> *> *', type_sdl='NSArray<NSNumber<SDLUInt> *> *'),
self.producer.param_named(
+ history=None,
constructor_argument='hmiZoneCapabilities', constructor_argument_override=None,
- constructor_prefix='HmiZoneCapabilities', deprecated=False, description=[], for_name='enums',
+ constructor_prefix='HmiZoneCapabilities', deprecated=False, description=['{"array_min_size": 1, "array_max_size": 100}'], for_name='enums',
mandatory=False, method_suffix='HmiZoneCapabilities', modifier='strong',
of_class='', origin='hmiZoneCapabilities', since=None,
type_native='NSArray<SDLHmiZoneCapabilities> *', type_sdl='NSArray<SDLHmiZoneCapabilities> *'))
@@ -252,7 +290,7 @@ class TestFunctionsProducer(TestCase):
expected['constructors'] = (
self.producer.constructor_named(
- all=arguments, arguments=arguments, deprecated=False,
+ all=arguments, arguments=arguments,
init='Language:(nullable SDLLanguage)language supportedDiagModes:(nullable NSArray<NSNumber<SDLUInt> *>'
' *)supportedDiagModes hmiZoneCapabilities:(nullable NSArray<SDLHmiZoneCapabilities> *)'
'hmiZoneCapabilities',
@@ -275,11 +313,20 @@ class TestFunctionsProducer(TestCase):
expected['name'] = 'SDLOnHMIStatus'
expected['extends_class'] = 'SDLRPCNotification'
expected['imports'] = {
- ".h": {'enum': {'SDLRPCNotification'}, 'struct': set()},
- ".m": set()
+ ".h": {
+ 'enum': ['SDLRPCNotification'],
+ 'struct': []},
+ ".m": [
+ 'NSMutableDictionary+Store',
+ 'SDLOnHMIStatus',
+ 'SDLRPCFunctionNames',
+ 'SDLRPCParameterNames'
+ ]
}
+ expected['history'] = None
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='hmiLevel', constructor_argument_override=None, constructor_prefix='HmiLevel',
deprecated=False, description=[], for_name='enum', mandatory=True, method_suffix='HmiLevel',
modifier='strong', of_class='', origin='hmiLevel', since=None,
@@ -289,7 +336,7 @@ class TestFunctionsProducer(TestCase):
constructor_argument='hmiLevel')]
expected['constructors'] = (self.producer.constructor_named(
- all=arguments, arguments=arguments, deprecated=False, self=True, init='HmiLevel:(SDLHMILevel)hmiLevel'),)
+ all=arguments, arguments=arguments, self=True, init='HmiLevel:(SDLHMILevel)hmiLevel'),)
actual = self.producer.transform(item)
self.assertDictEqual(expected, actual)
@@ -314,39 +361,56 @@ class TestFunctionsProducer(TestCase):
expected['origin'] = 'CreateWindow'
expected['name'] = 'SDLCreateWindow'
expected['extends_class'] = 'SDLRPCRequest'
- expected['imports'] = {'.m': set(), '.h': {'struct': set(), 'enum': {'SDLRPCRequest'}}}
+ expected['imports'] = {
+ '.h': {
+ 'struct': [],
+ 'enum': ['SDLRPCRequest']},
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLCreateWindow',
+ 'SDLRPCFunctionNames',
+ 'SDLRPCParameterNames'
+ ]
+ }
+ expected['history'] = None
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='windowID', constructor_argument_override=None, constructor_prefix='WindowID',
- deprecated=False, description=['{"default_value": null, "max_value": null, "min_value": null}'],
+ deprecated=False, description=['{"num_min_value": null, "num_max_value": null}'],
for_name='object', mandatory=True, method_suffix='WindowID', modifier='strong',
of_class='NSNumber.class', origin='windowID', since=None, type_native='UInt32',
type_sdl='NSNumber<SDLInt> *'),
self.producer.param_named(
+ history=None,
constructor_argument='cmdID', constructor_argument_override=None, constructor_prefix='CmdID',
- deprecated=False, description=['{"default_value": null, "max_value": 2000000000, "min_value": 0}'],
+ deprecated=False, description=['{"num_min_value": 0, "num_max_value": 2000000000}'],
for_name='object', mandatory=True, method_suffix='CmdID', modifier='strong', of_class='NSNumber.class',
origin='cmdID', since=None, type_native='UInt32', type_sdl='NSNumber<SDLUInt> *'),
self.producer.param_named(
+ history=None,
constructor_argument='position', constructor_argument_override=None, constructor_prefix='Position',
- deprecated=False, description=['{"default_value": 1000, "max_value": 1000, "min_value": 0}'],
+ deprecated=False, description=['{"num_min_value": 0, "num_max_value": 1000, "default_value": 1000}'],
for_name='object', mandatory=True, method_suffix='Position', modifier='strong',
of_class='NSNumber.class', origin='position', since=None, type_native='UInt16',
type_sdl='NSNumber<SDLUInt> *'),
self.producer.param_named(
+ history=None,
constructor_argument='speed', constructor_argument_override=None, constructor_prefix='Speed',
- deprecated=False, description=['{"default_value": null, "max_value": 700.0, "min_value": 0.0}'],
+ deprecated=False, description=['{"num_min_value": 0.0, "num_max_value": 700.0}'],
for_name='object', mandatory=True, method_suffix='Speed', modifier='strong', of_class='NSNumber.class',
origin='speed', since=None, type_native='float', type_sdl='NSNumber<SDLFloat> *'),
self.producer.param_named(
+ history=None,
constructor_argument='offset', constructor_argument_override=None, constructor_prefix='Offset',
- deprecated=False, description=['{"default_value": null, "max_value": 100000000000, "min_value": 0}'],
+ deprecated=False, description=['{"num_min_value": 0, "num_max_value": 100000000000}'],
for_name='object', mandatory=True, method_suffix='Offset', modifier='strong', of_class='NSNumber.class',
origin='offset', since=None, type_native='UInt64', type_sdl='NSNumber<SDLUInt> *'),
self.producer.param_named(
+ history=None,
constructor_argument='duplicateUpdatesFromWindowID', constructor_argument_override=None,
constructor_prefix='DuplicateUpdatesFromWindowID', deprecated=False,
- description=['{"default_value": null, "max_value": null, "min_value": null}'], for_name='object',
+ description=['{"num_min_value": null, "num_max_value": null}'], for_name='object',
mandatory=False, method_suffix='DuplicateUpdatesFromWindowID', modifier='strong',
of_class='NSNumber.class', origin='duplicateUpdatesFromWindowID', since=None,
type_native='NSNumber<SDLInt> *', type_sdl='NSNumber<SDLInt> *'))
@@ -368,12 +432,12 @@ class TestFunctionsProducer(TestCase):
expected['constructors'] = (
self.producer.constructor_named(
- all=not_mandatory_arguments, arguments=not_mandatory_arguments, deprecated=False, self=True,
+ all=not_mandatory_arguments, arguments=not_mandatory_arguments, self=True,
init='WindowID:(UInt32)windowID cmdID:(UInt32)cmdID position:(UInt16)position speed:(float)speed '
'offset:(UInt64)offset'),
self.producer.constructor_named(
all=not_mandatory_arguments + mandatory_arguments, arguments=mandatory_arguments,
- deprecated=False, self='WindowID:windowID cmdID:cmdID position:position speed:speed offset:offset',
+ self='WindowID:windowID cmdID:cmdID position:position speed:speed offset:offset',
init='WindowID:(UInt32)windowID cmdID:(UInt32)cmdID position:(UInt16)position speed:(float)speed '
'offset:(UInt64)offset duplicateUpdatesFromWindowID:(nullable NSNumber<SDLInt> *)'
'duplicateUpdatesFromWindowID'))
@@ -395,11 +459,24 @@ class TestFunctionsProducer(TestCase):
expected['origin'] = 'CreateInteractionChoiceSet'
expected['name'] = 'SDLCreateInteractionChoiceSet'
expected['extends_class'] = 'SDLRPCRequest'
- expected['imports'] = {'.m': {'SDLChoice'}, '.h': {'struct': {'SDLChoice'}, 'enum': {'SDLRPCRequest'}}}
+ expected['imports'] = {
+ '.h': {
+ 'struct': ['SDLChoice'],
+ 'enum': ['SDLRPCRequest']},
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLChoice',
+ 'SDLCreateInteractionChoiceSet',
+ 'SDLRPCFunctionNames',
+ 'SDLRPCParameterNames'
+ ]
+ }
+ expected['history'] = None
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='choiceSet', constructor_argument_override=None,
- constructor_prefix='ChoiceSet', deprecated=False, description=[], for_name='objects', mandatory=True,
+ constructor_prefix='ChoiceSet', deprecated=False, description=['{"array_min_size": null, "array_max_size": null}'], for_name='objects', mandatory=True,
method_suffix='ChoiceSet', modifier='strong', of_class='SDLChoice.class', origin='choiceSet',
since=None, type_native='NSArray<SDLChoice *> *', type_sdl='NSArray<SDLChoice *> *'),)
@@ -408,7 +485,7 @@ class TestFunctionsProducer(TestCase):
origin='choiceSet')]
expected['constructors'] = (self.producer.constructor_named(
- all=argument, arguments=argument, deprecated=False, self=True,
+ all=argument, arguments=argument, self=True,
init='ChoiceSet:(NSArray<SDLChoice *> *)choiceSet'),)
actual = self.producer.transform(item)
@@ -432,15 +509,26 @@ class TestFunctionsProducer(TestCase):
expected['origin'] = 'SetDisplayLayout'
expected['name'] = 'SDLSetDisplayLayout'
expected['extends_class'] = 'SDLRPCRequest'
- expected['imports'] = {'.h': {'enum': {'SDLRPCRequest'}, 'struct': set()}, '.m': set()}
- expected['since'] = '6.0.0'
+ expected['imports'] = {
+ '.h': {
+ 'enum': ['SDLRPCRequest'],
+ 'struct': []},
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLRPCFunctionNames',
+ 'SDLRPCParameterNames',
+ 'SDLSetDisplayLayout'
+ ]
+ }
expected['history'] = '3.0.0'
+ expected['since'] = '6.0.0'
expected['deprecated'] = True
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='displayLayout', constructor_argument_override=None,
constructor_prefix='DisplayLayout', deprecated=False,
- description=['{"default_value": null, "max_length": 500, "min_length": 1}'], for_name='object',
+ description=['{"string_min_length": 1, "string_max_length": 500}'], for_name='object',
mandatory=True, method_suffix='DisplayLayout', modifier='strong', of_class='NSString.class',
origin='displayLayout', since=None, type_native='NSString *', type_sdl='NSString *'),)
@@ -449,7 +537,7 @@ class TestFunctionsProducer(TestCase):
constructor_argument='displayLayout', origin='displayLayout')]
expected['constructors'] = (self.producer.constructor_named(
- all=argument, arguments=argument, deprecated=False, self=True,
+ all=argument, arguments=argument, self=True,
init='DisplayLayout:(NSString *)displayLayout'),)
actual = self.producer.transform(item)
diff --git a/generator/test/test_structs.py b/generator/test/test_structs.py
index 61ea23702..0c33ebf3f 100644
--- a/generator/test/test_structs.py
+++ b/generator/test/test_structs.py
@@ -44,16 +44,29 @@ class TestStructsProducer(TestCase):
expected['origin'] = 'CloudAppProperties'
expected['name'] = 'SDLCloudAppProperties'
expected['extends_class'] = 'SDLRPCStruct'
- expected['imports'] = {'.m': set(), '.h': {'enum': {'SDLRPCStruct'}, 'struct': set()}}
+ expected['imports'] = {
+ '.h': {
+ 'enum': ['SDLRPCStruct'],
+ 'struct': []
+ },
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLCloudAppProperties',
+ 'SDLRPCParameterNames'
+ ]
+ }
+ expected['history'] = None
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='appID', constructor_argument_override=None, constructor_prefix='AppID',
- deprecated=False, description=['{"default_value": null, "max_length": null, "min_length": null}'],
+ deprecated=False, description=['{"string_min_length": null, "string_max_length": null}'],
for_name='object', mandatory=True, method_suffix='AppID', modifier='strong', of_class='NSString.class',
origin='appID', since=None, type_native='NSString *', type_sdl='NSString *'),
self.producer.param_named(
+ history=None,
constructor_argument='valueParam', constructor_argument_override=None, constructor_prefix='ValueParam',
- deprecated=False, description=['{"default_value": null, "max_length": null, "min_length": null}'],
+ deprecated=False, description=['{"string_min_length": null, "string_max_length": null}'],
for_name='object', mandatory=True, method_suffix='ValueParam', modifier='strong',
of_class='NSString.class', origin='valueParam', since=None, type_native='NSString *',
type_sdl='NSString *')
@@ -67,7 +80,7 @@ class TestStructsProducer(TestCase):
]
expected['constructors'] = (self.producer.constructor_named(
- all=argument, arguments=argument, deprecated=False, self='',
+ all=argument, arguments=argument, self='',
init='AppID:(NSString *)appID valueParam:(NSString *)valueParam'),)
actual = self.producer.transform(item)
@@ -85,12 +98,24 @@ class TestStructsProducer(TestCase):
expected['origin'] = 'TouchEvent'
expected['name'] = 'SDLTouchEvent'
expected['extends_class'] = 'SDLRPCStruct'
- expected['imports'] = {'.h': {'enum': {'SDLRPCStruct'}, 'struct': set()}, '.m': set()}
+ expected['imports'] = {
+ '.h': {
+ 'enum': ['SDLRPCStruct'],
+ 'struct': []
+ },
+ '.m': [
+ 'NSMutableDictionary+Store',
+ 'SDLRPCParameterNames',
+ 'SDLTouchEvent'
+ ]
+ }
+ expected['history'] = None
expected['params'] = (
self.producer.param_named(
+ history=None,
constructor_argument='idParam', constructor_argument_override=None,
constructor_prefix='IdParam', deprecated=False,
- description=['{"default_value": null, "max_value": 9, "min_value": 0}'], for_name='object',
+ description=['{"num_min_value": 0, "num_max_value": 9}'], for_name='object',
mandatory=True, method_suffix='IdParam', modifier='strong', of_class='NSNumber.class',
origin='idParam', since=None, type_native='UInt8', type_sdl='NSNumber<SDLUInt> *'),)
@@ -99,7 +124,7 @@ class TestStructsProducer(TestCase):
constructor_argument='@(idParam)', origin='idParam')]
expected['constructors'] = (self.producer.constructor_named(
- all=argument, arguments=argument, deprecated=False, self='',
+ all=argument, arguments=argument, self='',
init='IdParam:(UInt8)idParam'),)
actual = self.producer.transform(item)
diff --git a/generator/transformers/common_producer.py b/generator/transformers/common_producer.py
index 63a7134bb..977cc2232 100644
--- a/generator/transformers/common_producer.py
+++ b/generator/transformers/common_producer.py
@@ -69,11 +69,11 @@ class InterfaceProducerCommon(ABC):
render['params'][param.name] = self.extract_param(param, item.name)
if isinstance(item, (Struct, Function)):
self.extract_imports(param, render['imports'])
-
+
# Add additional known imports to the import list
if isinstance(item, (Struct, Function)):
name = 'SDL' + item.name
- render[importsKey]['.m'].add( "NSMutableDictionary+Store" )
+ render[importsKey]['.m'].add("NSMutableDictionary+Store")
render[importsKey]['.m'].add(name)
render[importsKey]['.h'][enumKey] = list(render[importsKey]['.h'][enumKey])
(render[importsKey]['.h'][enumKey]).sort()
@@ -82,11 +82,11 @@ class InterfaceProducerCommon(ABC):
if isinstance(item, Struct):
name = 'SDL' + item.name
- render[importsKey]['.m'].add( "SDLRPCParameterNames" )
+ render[importsKey]['.m'].add("SDLRPCParameterNames")
if isinstance(item, Function):
- render[importsKey]['.m'].add( "SDLRPCFunctionNames" )
- render[importsKey]['.m'].add( "SDLRPCParameterNames" )
+ render[importsKey]['.m'].add("SDLRPCFunctionNames")
+ render[importsKey]['.m'].add("SDLRPCParameterNames")
# Sort the import list to ensure they appear in alphabetical order in the template
render[importsKey]['.m'] = list(render[importsKey]['.m'])
@@ -364,7 +364,7 @@ class InterfaceProducerCommon(ABC):
'mandatory': param.is_mandatory,
'deprecated': json.loads(param.deprecated.lower()) if param.deprecated else False,
'modifier': 'strong',
- 'history' : param.history }
+ 'history': param.history}
if isinstance(param.param_type, (Integer, Float, String, Array)):
data['description'].append(self.create_param_descriptor(param.param_type, OrderedDict()))
@@ -418,4 +418,3 @@ class InterfaceProducerCommon(ABC):
return 'num_min_value'
else:
return parameterName
-