Skip to content

Commit bb338e3

Browse files
committed
Add hashId to sdlmanager builder
1 parent b85d06a commit bb338e3

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

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

Lines changed: 13 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, hashId;
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.setHashId(hashId);
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 hashId String representation of the Hash ID Used to resume the application
637+
*/
638+
public Builder setHashId(final String hashId) {
639+
sdlManager.hashId = hashId;
640+
return this;
641+
}
642+
632643
/**
633644
* Sets the Application Name
634645
*
@@ -716,6 +727,7 @@ public Builder setAppIcon(final SdlArtwork sdlArtwork) {
716727
return this;
717728
}
718729

730+
719731
/**
720732
* Sets the vector of AppHMIType <br>
721733
* <strong>Note: This should be an ordered list from most -> least relevant</strong>

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ public interface LifecycleListener {
11861186
}
11871187

11881188
public static class AppConfig {
1189-
private String appID, appName, ngnMediaScreenAppName;
1189+
private String appID, appName, ngnMediaScreenAppName, hashId;
11901190
private Vector<TTSChunk> ttsName;
11911191
private Vector<String> vrSynonyms;
11921192
private boolean isMediaApp = false;
@@ -1287,6 +1287,14 @@ public void setAppType(Vector<AppHMIType> appType) {
12871287
this.appType = appType;
12881288
}
12891289

1290+
public String getHashId() {
1291+
return this.hashId;
1292+
}
1293+
1294+
public void setHashId(String hashId) {
1295+
this.hashId = hashId;
1296+
}
1297+
12901298
public TemplateColorScheme getDayColorScheme() {
12911299
return dayColorScheme;
12921300
}
@@ -1505,9 +1513,8 @@ void onProtocolSessionStarted(SessionType sessionType) {
15051513
rai.setAppHMIType(appConfig.getAppType());
15061514
rai.setDayColorScheme(appConfig.getDayColorScheme());
15071515
rai.setNightColorScheme(appConfig.getNightColorScheme());
1508-
1516+
rai.setHashID(appConfig.getHashId());
15091517
//Add device/system info in the future
1510-
//TODO attach previous hash id
15111518

15121519
sendRPCMessagePrivate(rai, true);
15131520
} else {

0 commit comments

Comments
 (0)