diff options
author | Madhu Yaduguri <madhuyaduguri@UIE08563.lan> | 2016-06-06 17:41:14 -0700 |
---|---|---|
committer | Jacob Keeler <jacob.keeler@livioradio.com> | 2016-11-03 15:13:18 -0400 |
commit | 38471c26a25e7285ced2f57c23b3ed0d71d70b4c (patch) | |
tree | 5048d10f08b6d228dee2c6cdd365a86a7e08f91e | |
parent | a6c32b45832653d6b851be9b19355fa35f377e07 (diff) | |
download | sdl_core-38471c26a25e7285ced2f57c23b3ed0d71d70b4c.tar.gz |
Sending button press event based on conditions(recommended by Justin) a. If no 'appID' -> send to FULL apps only \n b.If 'appID' is present -> send to the named app, only if it’s in FULL or LIMITED? \n c. ignore for background & none even if there is 'appID'
-rwxr-xr-x | src/components/application_manager/src/commands/mobile/on_button_press_notification.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc index fdf8b559bc..8c5600ec14 100755 --- a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc @@ -59,6 +59,9 @@ void OnButtonPressNotification::Run() { const ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::msg_params][strings::app_id].asUInt()); + ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application( + (*message_)[strings::msg_params][strings::app_id].asUInt()); + // CUSTOM_BUTTON notification if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { // app_id is mandatory for CUSTOM_BUTTON notification @@ -108,16 +111,22 @@ void OnButtonPressNotification::Run() { continue; } - // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode - if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && - (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) { - LOG4CXX_WARN(logger_, - "OnButtonPress notification is allowed only" - << "in FULL or LIMITED hmi level"); - continue; - } - // if "app_id" absent send notification only in HMI_FULL mode - if (is_app_id_exists || subscribed_app->IsFullscreen()) { + if (app.valid()) { + // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode + if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && + (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) { + LOG4CXX_WARN(logger_, + "OnButtonPress notification is allowed only" + << "in FULL or LIMITED hmi level"); + continue; + } + // if "appID" is present send it to Named app , only if its FULL or + // LIMITED + if (app == subscribed_app) { + SendButtonPress(subscribed_app); + } + } else if (mobile_api::HMILevel::HMI_FULL == subscribed_app->hmi_level()) { + // if No "appID" - send it FULL apps only. SendButtonPress(subscribed_app); } } |