summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal <bilal@Bilals-MBP.localdomain>2018-06-28 17:21:06 -0400
committerBilal <bilal@Bilals-MBP.localdomain>2018-06-28 17:21:06 -0400
commitdc5bdad57061e30eb8f1f6e313f00fab669a2b79 (patch)
treeba55fe2e49a4925f294fcc61c5e5d86318975388
parentdd060ef3275451920ed5028a0f660280a6a83efa (diff)
downloadsdl_android-dc5bdad57061e30eb8f1f6e313f00fab669a2b79.tar.gz
Add setFullAppID method
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java2
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java38
2 files changed, 28 insertions, 12 deletions
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
index c2f06c843..85b6f28ea 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
@@ -37,7 +37,7 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION);
msg.setAppName(Test.GENERAL_STRING);
msg.setNgnMediaScreenAppName(Test.GENERAL_STRING);
- msg.setAppID(Test.GENERAL_FULL_APP_ID);
+ msg.setFullAppID(Test.GENERAL_FULL_APP_ID);
msg.setLanguageDesired(Test.GENERAL_LANGUAGE);
msg.setHmiDisplayLanguageDesired(Test.GENERAL_LANGUAGE);
msg.setHashID(Test.GENERAL_STRING);
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
index 6a38f5ff8..fedee5a8c 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
@@ -300,18 +300,18 @@ public class RegisterAppInterface extends RPCRequest {
* @param isMediaApplication a Boolean value
* @param languageDesired a Language Enumeration
* @param hmiDisplayLanguageDesired
- * @param appID a String value representing a unique ID, which an app will be given when approved <br>
+ * @param fullAppID a String value representing a unique ID, which an app will be given when approved <br>
* <b>Notes: </b>Maxlength = 100
*/
public RegisterAppInterface(@NonNull SdlMsgVersion syncMsgVersion, @NonNull String appName, @NonNull Boolean isMediaApplication,
- @NonNull Language languageDesired, @NonNull Language hmiDisplayLanguageDesired, @NonNull String appID) {
+ @NonNull Language languageDesired, @NonNull Language hmiDisplayLanguageDesired, @NonNull String fullAppID) {
this();
setSdlMsgVersion(syncMsgVersion);
setAppName(appName);
setIsMediaApplication(isMediaApplication);
setLanguageDesired(languageDesired);
setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
- setAppID(appID);
+ setFullAppID(fullAppID);
}
/**
* Gets the version of the SDL&reg; SmartDeviceLink interface
@@ -606,14 +606,7 @@ public class RegisterAppInterface extends RPCRequest {
* @since SmartDeviceLink 2.0
*/
public void setAppID(@NonNull String appID) {
- if (appID != null) {
- setParameters(KEY_FULL_APP_ID, appID);
- if (appID.length() <= APP_ID_MAX_LENGTH) {
- setParameters(KEY_APP_ID, appID);
- } else {
- setParameters(KEY_APP_ID, appID.replace("-", "").substring(0, APP_ID_MAX_LENGTH));
- }
- }
+ setParameters(KEY_APP_ID, appID);
}
/**
@@ -628,6 +621,29 @@ public class RegisterAppInterface extends RPCRequest {
}
/**
+ * Sets a unique ID, which an app will be given when approved
+ *
+ * @param fullAppID
+ * a String value representing a unique ID, which an app will be
+ * given when approved
+ * <p></p>
+ * <b>Notes: </b>Maxlength = 100
+ * @since SmartDeviceLink 2.0
+ */
+ public void setFullAppID(@NonNull String fullAppID) {
+ if (fullAppID != null) {
+ setParameters(KEY_FULL_APP_ID, fullAppID);
+ String appID;
+ if (fullAppID.length() <= APP_ID_MAX_LENGTH) {
+ appID = fullAppID;
+ } else {
+ appID = fullAppID.replace("-", "").substring(0, APP_ID_MAX_LENGTH);
+ }
+ setAppID(appID);
+ }
+ }
+
+ /**
* Gets the color scheme that is currently used for day
*
* @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used