summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2019-02-24 14:22:38 -0500
committerJackLivio <jack@livio.io>2019-02-24 14:22:38 -0500
commitdaff7d970e6a23c9b1663381b10ba852b780b632 (patch)
treea68556366fb073b1ee238e0a834835ff33ad09c0
parenta3f39e693a92a6720cbff18edc84370acf74d1f0 (diff)
parentc1a903b5fe0831044b5e88dc4d27b0160b703955 (diff)
downloadsdl_core-feature/get_app_service_data_w_subscribe.tar.gz
Merge remote-tracking branch 'origin/feature/base_app_services_implementation' into feature/app_service_app_extensionfeature/get_app_service_data_w_subscribe
-rw-r--r--src/appMain/smartDeviceLink.ini7
-rw-r--r--src/components/config_profile/include/config_profile/profile.h6
-rw-r--r--src/components/config_profile/src/profile.cc50
-rw-r--r--src/components/include/application_manager/application_manager_settings.h2
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h4
5 files changed, 69 insertions, 0 deletions
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index ccb377d1e6..90c2d94bf3 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -369,3 +369,10 @@ EnableAppLaunchIOS = true
; Note: this configuration is applied even if multiple-transports feature is not enabled.
;AudioServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
;VideoServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
+
+[AppServices]
+; The ID used to fill the originApp field when the HMI sends a PerformAppServiceInteraction request
+HMIOriginID = "HMI_ID"
+
+; Services that exist on the module. Values are of AppServiceType in RPC Spec. These services will be used as default and app services will only become primary service publisher with direct user interaction. These services will also be a fallback if no app service publisher is registered with the system of that type.
+EmbeddedServices = MEDIA, WEATHER, NAVIGATION, VOICE_ASSISTANT
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 4846648b2b..02fff3764b 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -526,6 +526,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<std::string>& audio_service_transports() const OVERRIDE;
const std::vector<std::string>& video_service_transports() const OVERRIDE;
+ const std::vector<std::string>& embedded_services() const OVERRIDE;
+ const std::string hmi_origin_id() const OVERRIDE;
/**
* @brief Reads a string value from the profile
*
@@ -1064,6 +1066,10 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
int wake_up_signal_offset_;
int ignition_off_signal_offset_;
+ std::vector<std::string> embedded_services_;
+
+ std::string hmi_origin_id_;
+
DISALLOW_COPY_AND_ASSIGN(Profile);
};
} // namespace profile
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 38afdbf35b..5a6d3b3808 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -96,6 +96,7 @@ const char* kTransportRequiredForResumptionSection =
"TransportRequiredForResumption";
const char* kLowBandwidthTransportResumptionLevelSection =
"LowBandwidthTransportResumptionLevel";
+const char* kAppServicesSection = "AppServices";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -284,6 +285,8 @@ const char* kProjectionLowBandwidthResumptionLevelKey =
"ProjectionLowBandwidthResumptionLevel";
const char* kMediaLowBandwidthResumptionLevelKey =
"MediaLowBandwidthResumptionLevel";
+const char* kHMIOriginIDKey = "HMIOriginID";
+const char* kEmbeddedServicesKey = "EmbeddedServices";
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
@@ -391,6 +394,7 @@ const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
const bool kDefaultMultipleTransportsEnabled = false;
const char* kDefaultLowBandwidthResumptionLevel = "NONE";
+const char* kDefaultHMIOriginId = "HMI_ID";
} // namespace
namespace profile {
@@ -1114,6 +1118,14 @@ bool Profile::IsFileNamePortable(const std::string& file_name) const {
return true;
}
+const std::vector<std::string>& Profile::embedded_services() const {
+ return embedded_services_;
+}
+
+const std::string Profile::hmi_origin_id() const {
+ return hmi_origin_id_;
+}
+
void Profile::UpdateValues() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2278,6 +2290,44 @@ void Profile::UpdateValues() {
entry++;
}
}
+
+ ReadStringValue(&hmi_origin_id_,
+ kDefaultHMIOriginId,
+ kAppServicesSection,
+ kHMIOriginIDKey);
+
+ LOG_UPDATED_VALUE(hmi_origin_id_, kHMIOriginIDKey, kAppServicesSection);
+
+ { // App Services map
+ struct KeyPair {
+ std::vector<std::string>* ini_vector;
+ const char* ini_section_name;
+ const char* ini_key_name;
+ } keys[] = {
+ {&embedded_services_, kAppServicesSection, kEmbeddedServicesKey},
+ {NULL, NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_vector != NULL) {
+ bool exist = false;
+ std::vector<std::string> profile_entry = ReadStringContainer(
+ entry->ini_section_name, entry->ini_key_name, &exist, true);
+ if (exist) {
+ *entry->ini_vector = profile_entry;
+
+ const std::string list_with_comma = std::accumulate(
+ profile_entry.begin(),
+ profile_entry.end(),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ LOG_UPDATED_VALUE(
+ list_with_comma, entry->ini_key_name, entry->ini_section_name);
+ }
+ entry++;
+ }
+ }
}
bool Profile::ReadValue(bool* value,
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index fc16f1f1ed..a48d0ecc63 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -109,6 +109,8 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_icons_amount_to_remove() const = 0;
virtual const uint32_t& list_files_response_size() const = 0;
virtual const std::string& plugins_folder() const = 0;
+ virtual const std::vector<std::string>& embedded_services() const = 0;
+ virtual const std::string hmi_origin_id() const = 0;
};
} // namespace application_manager
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index 0f9ca194b1..b95a219111 100644
--- a/src/components/include/test/application_manager/mock_application_manager_settings.h
+++ b/src/components/include/test/application_manager/mock_application_manager_settings.h
@@ -136,6 +136,10 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(max_number_of_ios_device, const uint16_t());
MOCK_CONST_METHOD0(wait_time_between_apps, const uint16_t());
MOCK_CONST_METHOD0(enable_app_launch_ios, const bool());
+
+ // AppServices
+ MOCK_CONST_METHOD0(embedded_services, const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(hmi_origin_id, const std::string());
};
} // namespace application_manager_test