diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2019-06-24 13:51:24 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2019-06-26 17:13:08 -0400 |
commit | 0386fba866e66afbba609ad21fb900b5b2973ffa (patch) | |
tree | 5d37342c6ae802bcc0b5717e36cf8508da5e4ff6 | |
parent | d9ac61f77b1fb39619dc5bf0c0841684d93cff58 (diff) | |
download | sdl_core-0386fba866e66afbba609ad21fb900b5b2973ffa.tar.gz |
Add autoCompleteList parameter
7 files changed, 60 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 fc124f7558..b91d32e469 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 @@ -254,6 +254,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 @@ -409,7 +410,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; @@ -518,7 +518,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 6530004499..72429cfb08 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -623,15 +623,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 872103929f..baef435bee 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -221,6 +221,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 @@ -369,7 +370,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"; @@ -476,7 +476,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 488c986df5..d2ebe62575 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -2905,8 +2905,8 @@ <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 entry as the user types</description> </param> </struct> diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index d6fe4d6cc0..8fe5643301 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2376,25 +2376,31 @@ <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="1" 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 entry as the user types</description> + </param> + </struct> <struct name="DeviceInfo" since="3.0"> <description>Various information about connecting device.</description> |