summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2019-07-25 15:37:53 -0400
committerGitHub <noreply@github.com>2019-07-25 15:37:53 -0400
commit87a6f6204a2742cb679ee7dae22a00567a02d1f8 (patch)
tree4ed518dd07b3324b5577957789edab910393cc95
parentb20c6990247a0bc88a6c3b86fd1d92530cd141e9 (diff)
parent097812db3e9af94767b22ba93bcc3dbe5aea6653 (diff)
downloadsdl_core-87a6f6204a2742cb679ee7dae22a00567a02d1f8.tar.gz
Merge pull request #2959 from smartdevicelink/feature/auto_complete_list
Add autoCompleteList parameter
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc51
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc11
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc4
-rw-r--r--src/components/interfaces/HMI_API.xml7
-rw-r--r--src/components/interfaces/MOBILE_API.xml25
7 files changed, 66 insertions, 39 deletions
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index 69e00f5838..c81f2dd2ea 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -255,6 +255,7 @@ extern const char* key_press_mode;
// duplicate names from hmi_request
extern const char* limited_character_list;
extern const char* auto_complete_text;
+extern const char* auto_complete_list;
extern const char* navigation_text;
// vehicle info
@@ -417,7 +418,6 @@ extern const char* const language_supported;
extern const char* const keyboard_layout_supported;
extern const char* const keypress_mode_supported;
extern const char* const limited_characters_list_supported;
-extern const char* const auto_complete_text_supported;
extern const char* const send_location_enabled;
extern const char* const get_way_points_enabled;
extern const char* const entity_type;
@@ -528,7 +528,7 @@ extern const char* keyboard_properties;
extern const char* method_name;
extern const char* keyboard_layout;
extern const char* limited_character_list;
-extern const char* auto_complete_text;
+extern const char* auto_complete_list;
extern const char* file;
extern const char* file_name;
extern const char* retry;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
index 39363bbad1..ffd8a7dc81 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
@@ -161,7 +161,8 @@ void ResetGlobalPropertiesRequest::Run() {
key_board_properties[hmi_request::limited_character_list] =
limited_character_list;*/
- key_board_properties[hmi_request::auto_complete_text] = "";
+ key_board_properties[hmi_request::auto_complete_list] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
msg_params[hmi_request::keyboard_properties] = key_board_properties;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
index bbfc61d463..3b13b00968 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
@@ -68,8 +68,7 @@ SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {}
void SetGlobalPropertiesRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
ApplicationSharedPtr app = application_manager_.application(connection_key());
@@ -90,11 +89,9 @@ void SetGlobalPropertiesRequest::Run() {
mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
- if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
+ if (msg_params.keyExists(strings::menu_icon)) {
verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::menu_icon],
- app,
- application_manager_);
+ msg_params[strings::menu_icon], app, application_manager_);
if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(
logger_, "MessageHelper::VerifyImage return " << verification_result);
@@ -103,18 +100,29 @@ void SetGlobalPropertiesRequest::Run() {
}
}
// Check for image file(s) in vrHelpItem
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (msg_params.keyExists(strings::vr_help)) {
if (mobile_apis::Result::INVALID_DATA ==
MessageHelper::VerifyImageVrHelpItems(
- (*message_)[strings::msg_params][strings::vr_help],
- app,
- application_manager_)) {
+ msg_params[strings::vr_help], app, application_manager_)) {
LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!");
SendResponse(false, mobile_apis::Result::INVALID_DATA);
return;
}
}
+ if (msg_params.keyExists(strings::keyboard_properties)) {
+ if (!msg_params[strings::keyboard_properties].keyExists(
+ strings::auto_complete_list) &&
+ msg_params[strings::keyboard_properties].keyExists(
+ strings::auto_complete_text)) {
+ LOG4CXX_ERROR(logger_, "Replacing deprecated autoCompleteText property");
+ msg_params[strings::keyboard_properties][strings::auto_complete_list][0] =
+ msg_params[strings::keyboard_properties][strings::auto_complete_text]
+ .asString();
+ }
+ msg_params[strings::keyboard_properties].erase(strings::auto_complete_text);
+ }
+
if (IsWhiteSpaceExist()) {
LOG4CXX_ERROR(logger_, "White spaces found");
SendResponse(false, mobile_apis::Result::INVALID_DATA);
@@ -549,16 +557,21 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
}
if (msg_params[strings::keyboard_properties].keyExists(
- strings::auto_complete_text)) {
- str =
- msg_params[strings::keyboard_properties][strings::auto_complete_text]
- .asCharArray();
+ strings::auto_complete_list)) {
+ const smart_objects::SmartArray* acl_array =
+ msg_params[strings::keyboard_properties][strings::auto_complete_list]
+ .asArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid keyboard_properties "
- "auto_complete_text syntax check failed");
- return true;
+ smart_objects::SmartArray::const_iterator it = acl_array->begin();
+
+ for (; it != acl_array->end(); ++it) {
+ str = it->asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid keyboard_properties "
+ "auto_complete_list syntax check failed");
+ return true;
+ }
}
}
}
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index d2e911f227..28f8fd88bb 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -632,15 +632,16 @@ void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
msg_params = *MessageHelper::CreateAppVrHelp(application);
msg_params[hmi_request::menu_title] = "";
- smart_objects::SmartObject key_board_properties =
+ smart_objects::SmartObject keyboard_properties =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- key_board_properties[strings::language] =
+ keyboard_properties[strings::language] =
static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
- key_board_properties[hmi_request::keyboard_layout] =
+ keyboard_properties[hmi_request::keyboard_layout] =
static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
- key_board_properties[hmi_request::auto_complete_text] = "";
- msg_params[hmi_request::keyboard_properties] = key_board_properties;
+ keyboard_properties[hmi_request::auto_complete_list] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[hmi_request::keyboard_properties] = keyboard_properties;
msg_params[strings::app_id] = application->app_id();
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 411d0a3e8a..cc87128bf0 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -222,6 +222,7 @@ const char* key_press_mode = "keypressMode";
// duplicate names from hmi_request
const char* limited_character_list = "limitedCharacterList";
const char* auto_complete_text = "autoCompleteText";
+const char* auto_complete_list = "autoCompleteList";
const char* navigation_text = "navigationText";
// vehicle info
@@ -378,7 +379,6 @@ const char* const keyboard_layout_supported = "keyboardLayoutSupported";
const char* const keypress_mode_supported = "keypressModeSupported";
const char* const limited_characters_list_supported =
"limitedCharactersListSupported";
-const char* const auto_complete_text_supported = "autoCompleteTextSupported";
const char* const send_location_enabled = "sendLocationEnabled";
const char* const get_way_points_enabled = "getWayPointsEnabled";
const char* const entity_type = "entityType";
@@ -487,7 +487,7 @@ const char* keyboard_properties = "keyboardProperties";
const char* method_name = "methodName";
const char* keyboard_layout = "keyboardLayout";
const char* limited_character_list = "limitedCharacterList";
-const char* auto_complete_text = "autoCompleteText";
+const char* auto_complete_list = "autoCompleteList";
const char* file = "file";
const char* file_name = "fileName";
const char* retry = "retry";
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index f3fe9cedab..e3eb1b6467 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -2933,8 +2933,11 @@
<description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
<description>If omitted, the entire keyboard will be enabled.</description>
</param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ <param name="autoCompleteList" type="String" maxlength="1000" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ Allows an app to prepopulate the text field with a list of suggested or completed entries as the user types.
+ If empty, the auto-complete list will be removed from the screen.
+ </description>
</param>
</struct>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index bf8728602d..05f568af37 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -2403,25 +2403,34 @@
<description>Configuration of on-screen keyboard (if available).</description>
<param name="language" type="Language" mandatory="false">
<description>The keyboard language.</description>
- </param>
+ </param>
<param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
<description>Desired keyboard layout.</description>
- </param>
+ </param>
<param name="keypressMode" type="KeypressMode" mandatory="false" >
<description>
Desired keypress mode.
If omitted, this value will be set to RESEND_CURRENT_ENTRY.
</description>
- </param>
+ </param>
<param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
<description>Array of keyboard characters to enable.</description>
<description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
<description>If omitted, the entire keyboard will be enabled.</description>
- </param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
- </struct>
+ </param>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false" deprecated="true" since="6.0">
+ <description>Deprecated, use autoCompleteList instead.</description>
+ <history>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false" since="3.0" until="6.0" />
+ </history>
+ </param>
+ <param name="autoCompleteList" type="String" maxlength="1000" minsize="0" maxsize="100" array="true" mandatory="false" since="6.0">
+ <description>
+ Allows an app to prepopulate the text field with a list of suggested or completed entries as the user types.
+ If empty, the auto-complete list will be removed from the screen.
+ </description>
+ </param>
+ </struct>
<struct name="DeviceInfo" since="3.0">
<description>Various information about connecting device.</description>