diff options
author | Veronica Veremjova <vveremjova@luxoft.com> | 2017-02-09 17:05:05 +0200 |
---|---|---|
committer | Veronica Veremjova <vveremjova@luxoft.com> | 2017-02-09 17:05:05 +0200 |
commit | 5a8a0ac6f3f165cc4fc16a105a7406fc72022659 (patch) | |
tree | 07878301ab88d949569f0955e2abc304ab8a91bf | |
parent | 7f538905f9466f665613abb3f5b66bdde2375f89 (diff) | |
download | sdl_core-revert-1260-fix/FixAddSubMenuIconInvalidCase.tar.gz |
Revert "Add new param "subMenuIcon" at AddSubMenu RPC"revert-1260-fix/FixAddSubMenuIconInvalidCase
This reverts commit 1244b962f27ce9e26b32b0327a55f0ae22d4bc92.
7 files changed, 5 insertions, 87 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h index 806ca701c3..10e2628035 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h @@ -79,20 +79,6 @@ class AddSubMenuRequest : public CommandRequestImpl { */ bool CheckSubMenuName(); - /* - * @brief Check if submenu icon is valid - * - * @return TRUE on success, otherwise FALSE - */ - bool CheckSubMenuIcon(); - - /* - * @brief Check if submenu icon is existed in storage folder - * - * @return TRUE on success, otherwise FALSE - */ - bool CheckMenuIconExistedInStorage(); - DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest); }; 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 8c4085b6d6..c19b12fff6 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 @@ -103,7 +103,6 @@ extern const char* cmd_id; extern const char* menu_params; extern const char* menu_title; extern const char* menu_icon; -extern const char* sub_menu_icon; extern const char* keyboard_properties; extern const char* vr_commands; extern const char* position; diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc index 51be5d8d1b..6838d1af7d 100644 --- a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc @@ -36,7 +36,6 @@ #include "application_manager/message_helper.h" #include "application_manager/application.h" #include "utils/helpers.h" -#include "utils/file_system.h" namespace application_manager { @@ -95,12 +94,6 @@ void AddSubMenuRequest::Run() { (*message_)[strings::msg_params][strings::menu_name]; msg_params[strings::app_id] = app->app_id(); - if (((*message_)[strings::msg_params].keyExists(strings::sub_menu_icon)) && - CheckSubMenuIcon()) { - msg_params[strings::sub_menu_icon] = - (*message_)[strings::msg_params][strings::sub_menu_icon]; - } - SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true); } @@ -130,9 +123,6 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { application->AddSubMenu( (*message_)[strings::msg_params][strings::menu_id].asInt(), (*message_)[strings::msg_params]); - if (!CheckMenuIconExistedInStorage()) { - response_info = "Reference image(s) not found"; - } } SendResponse(result, MessageHelper::HMIToMobileResult(result_code), @@ -162,38 +152,6 @@ bool AddSubMenuRequest::CheckSubMenuName() { return true; } -bool AddSubMenuRequest::CheckSubMenuIcon() { - if (!(*message_)[strings::msg_params].keyExists(strings::sub_menu_icon)) { - return false; - } - const std::string str = - (*message_)[strings::msg_params][strings::sub_menu_icon][strings::value] - .asString(); - if (!CheckSyntax(str) || std::string::npos != str.find(" ")) { - LOG4CXX_ERROR(logger_, "Invalid menu icon syntax check failed."); - return false; - } - - return true; -} - -bool AddSubMenuRequest::CheckMenuIconExistedInStorage() { - if (!(*message_)[strings::msg_params].keyExists(strings::sub_menu_icon)) { - return true; - } - std::string full_file_path = - application_manager_.get_settings().app_storage_folder() + "/"; - - full_file_path += - (*message_)[strings::msg_params][strings::sub_menu_icon][strings::value] - .asString(); - - if (!file_system::FileExists(full_file_path)) { - return false; - } - return true; -} - } // namespace commands } // namespace application_manager 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 375fc4b6d9..bdae1459a8 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -1319,18 +1319,12 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI( smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); - const smart_objects::SmartObject& message_body = *i->second; + msg_params[strings::menu_id] = i->first; msg_params[strings::menu_params][strings::position] = - message_body[strings::position]; - if ((message_body.keyExists(strings::sub_menu_icon)) && - (!message_body[strings::sub_menu_icon][strings::value].empty())) { - msg_params[strings::sub_menu_icon] = message_body[strings::sub_menu_icon]; - msg_params[strings::sub_menu_icon][strings::value] = - message_body[strings::sub_menu_icon][strings::value].asString(); - } + (*i->second)[strings::position]; msg_params[strings::menu_params][strings::menu_name] = - message_body[strings::menu_name]; + (*i->second)[strings::menu_name]; msg_params[strings::app_id] = app->app_id(); (*ui_sub_menu)[strings::msg_params] = msg_params; requsets.push_back(ui_sub_menu); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 783f497212..279e967eda 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -70,7 +70,6 @@ const char* cmd_id = "cmdID"; const char* menu_params = "menuParams"; const char* menu_title = "menuTitle"; const char* menu_icon = "menuIcon"; -const char* sub_menu_icon = "subMenuIcon"; const char* keyboard_properties = "keyboardProperties"; const char* vr_commands = "vrCommands"; const char* position = "position"; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0757160947..2182496760 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -34,7 +34,7 @@ <interfaces name="SmartDeviceLink HMI API"> -<interface name="Common" version="1.5" date="2016-10-27"> +<interface name="Common" version="1.4" date="2016-05-11"> <enum name="Result"> <element name="SUCCESS" value="0"/> @@ -539,9 +539,6 @@ <element name="locationImage"> <description>The optional image of a destination / location</description> </element> - <element name="subMenuIcon"> - <description>The image field for AddSubMenu </description> - </element> </enum> <enum name="TextAlignment"> @@ -2739,7 +2736,7 @@ </function> </interface> -<interface name="UI" version="1.0" date="2016-10-27"> +<interface name="UI" version="1.0" date="2013-04-16"> <function name="Alert" messagetype="request"> <description>Request from SDL to show an alert message on the display.</description> <param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3"> @@ -2845,11 +2842,6 @@ <param name="appID" type="Integer" mandatory="true"> <description>ID of application that requested this RPC.</description> </param> - <param name="subMenuIcon" type="Common.Image" mandatory="false"> - <description> - If omited on supported displays, no (or the default if applicable) icon shall be displayed. - </description> - </param> </function> <function name="AddSubMenu" messagetype="response"> </function> diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index f8c12dcdda..3bf347b605 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -747,10 +747,6 @@ <description>The optional image of a destination / location</description>
</element>
- <element name="subMenuIcon">
- <description>The image field for AddSubMenu </description>
- </element>
-
</enum>
<enum name="CharacterSet">
@@ -2831,12 +2827,6 @@ <param name="menuName" maxlength="500" type="String">
<description>Text to show in the menu for this sub menu.</description>
</param>
-
- <param name="subMenuIcon" type="Image" mandatory="false">
- <description>
- If omited on supported displays, no (or the default if applicable) icon shall be displayed.
- </description>
- </param>
</function>
<function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
|