Skip to content

Commit 7a2f581

Browse files
Merge pull request #1401 from smartdevicelink/bugfix/issue_1400
Add hashId to sdlmanager builder
2 parents 3a2800d + a652198 commit 7a2f581

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ abstract class BaseSdlManager {
8383
static final String TAG = "BaseSubManager";
8484
final Object STATE_LOCK = new Object();
8585
int state = -1;
86-
String appId, appName, shortAppName;
86+
String appId, appName, shortAppName, resumeHash;
8787
boolean isMediaApp;
8888
Language hmiLanguage;
8989
Language language;
@@ -333,6 +333,7 @@ public void start() {
333333
appConfig.setAppID(appId);
334334
appConfig.setMinimumProtocolVersion(minimumProtocolVersion);
335335
appConfig.setMinimumRPCVersion(minimumRPCVersion);
336+
appConfig.setResumeHash(resumeHash);
336337

337338
lifecycleManager = new LifecycleManager(appConfig, transport, lifecycleListener);
338339
_internalInterface = lifecycleManager.getInternalInterface((SdlManager) BaseSdlManager.this);
@@ -629,6 +630,16 @@ public Builder setAppId(@NonNull final String appId) {
629630
return this;
630631
}
631632

633+
/**
634+
* Sets the Resumption Hash ID
635+
*
636+
* @param resumeHash String representation of the Hash ID Used to resume the application
637+
*/
638+
public Builder setResumeHash(final String resumeHash) {
639+
sdlManager.resumeHash = resumeHash;
640+
return this;
641+
}
642+
632643
/**
633644
* Sets the Application Name
634645
*

base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,9 +1348,9 @@ void onServiceStarted(SessionType sessionType) {
13481348
rai.setAppHMIType(appConfig.getAppType());
13491349
rai.setDayColorScheme(appConfig.getDayColorScheme());
13501350
rai.setNightColorScheme(appConfig.getNightColorScheme());
1351+
rai.setHashID(appConfig.getResumeHash());
13511352

13521353
//Add device/system info in the future
1353-
//TODO attach previous hash id
13541354

13551355
sendRPCMessagePrivate(rai, true);
13561356
} else {
@@ -1405,7 +1405,7 @@ public interface LifecycleListener {
14051405
}
14061406

14071407
public static class AppConfig {
1408-
private String appID, appName, ngnMediaScreenAppName;
1408+
private String appID, appName, ngnMediaScreenAppName, resumeHash;
14091409
private Vector<TTSChunk> ttsName;
14101410
private Vector<String> vrSynonyms;
14111411
private boolean isMediaApp = false;
@@ -1506,6 +1506,14 @@ public void setAppType(Vector<AppHMIType> appType) {
15061506
this.appType = appType;
15071507
}
15081508

1509+
public String getResumeHash() {
1510+
return this.resumeHash;
1511+
}
1512+
1513+
public void setResumeHash(String resumeHash) {
1514+
this.resumeHash = resumeHash;
1515+
}
1516+
15091517
public TemplateColorScheme getDayColorScheme() {
15101518
return dayColorScheme;
15111519
}

0 commit comments

Comments
 (0)