summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-03-29 15:07:55 -0400
committerJackLivio <jack@livio.io>2018-03-29 15:07:55 -0400
commit92ae20abe98d1ece5293ce69c77762627db7708f (patch)
treeb7a4d4d8eb57eb1b84ea35ccbf12f2d3a00c0049
parent95cd0fc678768e9fc9e977bdb1026e896397e0df (diff)
downloadsdl_core-92ae20abe98d1ece5293ce69c77762627db7708f.tar.gz
External Proprietary Lock Screen URL Fix
The service enpoints in the policy table should be saved as strings instead of integers.
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc2
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc6
2 files changed, 2 insertions, 6 deletions
diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc
index 4afce16885..9702c315b0 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -325,7 +325,7 @@ const std::string kCreateSchema =
"`consent_group.fk_consent_group_functional_group1_idx` "
" ON `consent_group`(`functional_group_id`); "
"CREATE TABLE IF NOT EXISTS `endpoint`( "
- " `service` INTEGER NOT NULL, "
+ " `service` VARCHAR(100) NOT NULL, "
" `url` VARCHAR(100) NOT NULL, "
" `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" CONSTRAINT `fk_endpoint_application1` "
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index f9cc5e5ed5..6cc68cb102 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -1262,11 +1262,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints(
const policy_table::URL& urls = app_it->second;
policy_table::URL::const_iterator url_it;
for (url_it = urls.begin(); url_it != urls.end(); ++url_it) {
- std::stringstream temp_stream(it->first);
- int service;
- temp_stream.seekg(3);
- temp_stream >> service;
- query.Bind(0, service);
+ query.Bind(0, it->first);
query.Bind(1, *url_it);
query.Bind(2, app_it->first);
if (!query.Exec() || !query.Reset()) {