Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement SDL-0041 - App Icon Resumption #1033

Merged
merged 3 commits into from Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions SmartDeviceLink/SDLLifecycleManager.m
Expand Up @@ -385,6 +385,11 @@ - (void)didEnterStateSettingUpManagers {
}

- (void)didEnterStateSettingUpAppIcon {
if (self.registerResponse.iconResumed.boolValue) {
[self.lifecycleStateMachine transitionToState:SDLLifecycleStateSettingUpHMI];
return;
}

// We only want to send the app icon when the file manager is complete, and when that's done, wait for hmi status to be ready
__weak typeof(self) weakself = self;
[self sdl_sendAppIcon:self.configuration.lifecycleConfig.appIcon withCompletion:^() {
Expand Down
1 change: 1 addition & 0 deletions SmartDeviceLink/SDLNames.h
Expand Up @@ -248,6 +248,7 @@ extern SDLName const SDLNameHorizontalPosition;
extern SDLName const SDLNameHorizontalPositionAvailable;
extern SDLName const SDLNameHour;
extern SDLName const SDLNameHours;
extern SDLName const SDLNameIconResumed;
extern SDLName const SDLNameId;
extern SDLName const SDLNameIgnitionStableStatus;
extern SDLName const SDLNameIgnitionStatus;
Expand Down
1 change: 1 addition & 0 deletions SmartDeviceLink/SDLNames.m
Expand Up @@ -245,6 +245,7 @@
SDLName const SDLNameHorizontalPositionAvailable = @"horizontalPositionAvailable";
SDLName const SDLNameHour = @"hour";
SDLName const SDLNameHours = @"hours";
SDLName const SDLNameIconResumed = @"iconResumed";
SDLName const SDLNameId = @"id";
SDLName const SDLNameIgnitionStableStatus = @"ignitionStableStatus";
SDLName const SDLNameIgnitionStatus = @"ignitionStatus";
Expand Down
4 changes: 4 additions & 0 deletions SmartDeviceLink/SDLRegisterAppInterfaceResponse.h
Expand Up @@ -154,6 +154,10 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSString *systemSoftwareVersion;

/**
Whether or not the app's icon already existed on the system and was resumed. That means that the icon does not need to be sent by the app.
*/
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *iconResumed;

@end

Expand Down
8 changes: 8 additions & 0 deletions SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
Expand Up @@ -170,6 +170,14 @@ - (nullable NSString *)systemSoftwareVersion {
return [parameters sdl_objectForName:SDLNameSystemSoftwareVersion];
}

- (void)setIconResumed:(nullable NSNumber<SDLBool> *)iconResumed {
[parameters sdl_setObject:iconResumed forName:SDLNameIconResumed];
}

- (nullable NSNumber<SDLBool> *)iconResumed {
return [parameters sdl_objectForName:SDLNameIconResumed];
}

@end

NS_ASSUME_NONNULL_END
Expand Up @@ -45,6 +45,7 @@
testResponse.hmiCapabilities = hmiCapabilities;
testResponse.sdlVersion = @"sdlVersion";
testResponse.systemSoftwareVersion = @"systemSoftwareVersion";
testResponse.iconResumed = @YES;

expect(testResponse.syncMsgVersion).to(equal(version));
expect(testResponse.language).to(equal(SDLLanguageEsMx));
Expand All @@ -64,6 +65,7 @@
expect(testResponse.hmiCapabilities).to(equal(hmiCapabilities));
expect(testResponse.sdlVersion).to(equal(@"sdlVersion"));
expect(testResponse.systemSoftwareVersion).to(equal(@"systemSoftwareVersion"));
expect(testResponse.iconResumed).to(beTrue());
});

it(@"Should get correctly when initialized", ^ {
Expand All @@ -86,7 +88,8 @@
SDLNameSupportedDiagnosticModes:@[@67, @99, @111],
SDLNameHMICapabilities: hmiCapabilities,
SDLNameSDLVersion: @"sdlVersion",
SDLNameSystemSoftwareVersion: @"systemSoftwareVersion"
SDLNameSystemSoftwareVersion: @"systemSoftwareVersion",
SDLNameIconResumed: @YES,
},
SDLNameOperationName:SDLNameRegisterAppInterface}};
SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] initWithDictionary:dict];
Expand All @@ -109,6 +112,7 @@
expect(testResponse.hmiCapabilities).to(equal(hmiCapabilities));
expect(testResponse.sdlVersion).to(equal(@"sdlVersion"));
expect(testResponse.systemSoftwareVersion).to(equal(@"systemSoftwareVersion"));
expect(testResponse.iconResumed).to(beTrue());
});

it(@"Should return nil if not set", ^ {
Expand All @@ -132,6 +136,7 @@
expect(testResponse.hmiCapabilities).to(beNil());
expect(testResponse.sdlVersion).to(beNil());
expect(testResponse.systemSoftwareVersion).to(beNil());
expect(testResponse.iconResumed).to(beNil());
});
});

Expand Down