summaryrefslogtreecommitdiff
path: root/src/components/include
diff options
context:
space:
mode:
authorMykola Korniichuk (GitHub) <42380041+mkorniichuk@users.noreply.github.com>2020-01-17 18:36:02 +0200
committerShobhit Adlakha <ShobhitAd@users.noreply.github.com>2020-01-17 11:36:02 -0500
commit6710b2e04ba5417ce1c0e1794b473963bf51df08 (patch)
treeec36f77b62c3c7e8a81a068bcc0ab96a53a0d9c5 /src/components/include
parente9709e670196427035466f07786fb0d22d484017 (diff)
downloadsdl_core-6710b2e04ba5417ce1c0e1794b473963bf51df08.tar.gz
Fix SDL app stream processing with non-streamable state. (#3151)
* Fix SDL app stream processing with non-streamable state. For determining whether an application is allowed to stream, SDL considered only HMI_Level. Now streaming state is also taken into account. Fix notifications for not streamable apps * Fix unit tests after rename function in new inplimentation * Minor fixes * const parameter for StartEndStreamTimer * Fix logging messages * end_stream_timer shanged to SingleShot * fix unit test for state_controller * fixup! Minor fixes * const parameter for StartEndStreamTimer * Fix logging messages * end_stream_timer shanged to SingleShot * fix unit test for state_controller * rename HMILevelAllowsStreaming -> HMIStateAllowsStreaming * fixup! Fix SDL app stream processing with non-streamable state. Co-authored-by: Yevhenii Dementieiev (GitHub) <57259850+ydementieiev@users.noreply.github.com>
Diffstat (limited to 'src/components/include')
-rw-r--r--src/components/include/application_manager/application_manager.h19
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h10
2 files changed, 15 insertions, 14 deletions
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 6d5c7607cc..04b5049c3d 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -286,17 +286,17 @@ class ApplicationManager {
virtual void set_current_audio_source(const uint32_t source) = 0;
/**
- * @brief OnHMILevelChanged the callback that allows SDL to react when
+ * @brief OnHMIStateChanged the callback that allows SDL to react when
* application's HMI level has been changed.
*
- * @param app_id application identifier for which HMILevel has been chaned.
+ * @param app_id application identifier for which HMIState has been chaned.
*
- * @param from previous HMILevel.
- * @param to current HMILevel.
+ * @param from previous HMIState.
+ * @param to current HMIState.
*/
- virtual void OnHMILevelChanged(uint32_t app_id,
- mobile_apis::HMILevel::eType from,
- mobile_apis::HMILevel::eType to) = 0;
+ virtual void OnHMIStateChanged(const uint32_t app_id,
+ const HmiStatePtr from,
+ const HmiStatePtr to) = 0;
/**
* @brief Updates streaming service status for specified session and notifies
@@ -619,12 +619,13 @@ class ApplicationManager {
mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0;
/**
- * @brief Checks HMI level and returns true if streaming is allowed
+ * @brief Checks application HMI state and returns true if streaming is
+ * allowed
* @param app_id Application id
* @param service_type Service type to check
* @return True if streaming is allowed, false in other case
*/
- virtual bool HMILevelAllowsStreaming(
+ virtual bool HMIStateAllowsStreaming(
uint32_t app_id, protocol_handler::ServiceType service_type) const = 0;
/**
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
index 92677b12bb..e5706c2003 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -139,10 +139,10 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id));
MOCK_METHOD2(set_application_id,
void(const int32_t correlation_id, const uint32_t app_id));
- MOCK_METHOD3(OnHMILevelChanged,
- void(uint32_t app_id,
- mobile_apis::HMILevel::eType from,
- mobile_apis::HMILevel::eType to));
+ MOCK_METHOD3(OnHMIStateChanged,
+ void(const uint32_t app_id,
+ const application_manager::HmiStatePtr from,
+ const application_manager::HmiStatePtr to));
MOCK_METHOD3(ProcessOnDataStreamingNotification,
void(const protocol_handler::ServiceType service_type,
const uint32_t app_id,
@@ -260,7 +260,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
MOCK_METHOD1(HeadUnitReset,
void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
- MOCK_CONST_METHOD2(HMILevelAllowsStreaming,
+ MOCK_CONST_METHOD2(HMIStateAllowsStreaming,
bool(uint32_t app_id,
protocol_handler::ServiceType service_type));
MOCK_METHOD5(CheckPolicyPermissions,