summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/resumption/resumption_sql_queries.cc
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-09-04 11:27:42 -0400
committerJackLivio <jack@livio.io>2018-09-04 11:27:42 -0400
commit548867072facaeb1d696b4534c8e64f9f9ea13d5 (patch)
treec275015ac588514a5140145bad24d1688d6c6af7 /src/components/application_manager/src/resumption/resumption_sql_queries.cc
parent6bb3a0e5d9938ddfbf36994fe9937d6fafb047b7 (diff)
parentddc79ce414adcd966bdab61b814ce8a422e780f8 (diff)
downloadsdl_core-548867072facaeb1d696b4534c8e64f9f9ea13d5.tar.gz
Merge remote-tracking branch 'origin/develop' into fix/Wrong_connection_closure
# Conflicts: # src/components/connection_handler/test/heart_beat_monitor_test.cc
Diffstat (limited to 'src/components/application_manager/src/resumption/resumption_sql_queries.cc')
-rw-r--r--src/components/application_manager/src/resumption/resumption_sql_queries.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/components/application_manager/src/resumption/resumption_sql_queries.cc b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
index 9ca91e859a..4770bafef4 100644
--- a/src/components/application_manager/src/resumption/resumption_sql_queries.cc
+++ b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
@@ -37,6 +37,7 @@ const std::string kCreateSchema =
"BEGIN ; "
"CREATE TABLE IF NOT EXISTS `resumption`( "
" `idresumption` INTEGER PRIMARY KEY, "
+ " `global_ign_on_count` INTEGER, "
" `last_ign_off_time` INTEGER "
" ); "
"CREATE TABLE IF NOT EXISTS `subscribedForWayPoints`( "
@@ -372,7 +373,9 @@ const std::string kDropSchema =
"VACUUM;";
const std::string kInsertInitData =
- "INSERT OR IGNORE INTO `resumption` (`last_ign_off_time`) VALUES (0); "
+ "INSERT OR IGNORE INTO `resumption` "
+ "(`last_ign_off_time`, `global_ign_on_count`) "
+ "VALUES (0, 0); "
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); ";
const std::string kChecksResumptionData =
@@ -410,6 +413,17 @@ const std::string kSelectHashId =
const std::string kSelectIgnOffTime =
"SELECT `last_ign_off_time` FROM `resumption`";
+const std::string kSelectGlobalIgnOnCounter =
+ "SELECT `global_ign_on_count` FROM `resumption`";
+
+const std::string kResetGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = 0";
+
+const std::string kUpdateGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = `global_ign_on_count` + 1 ";
+
const std::string kCheckApplication =
"SELECT COUNT (`deviceID`) FROM `application` "
"WHERE `deviceID` = ? AND `appID` = ?";
@@ -445,7 +459,7 @@ const std::string kUpdateSuspendData =
"UPDATE `application` "
"SET `ign_off_count` = `ign_off_count` + 1";
-const std::string KUpdateLastIgnOffTime =
+const std::string kUpdateLastIgnOffTime =
"UPDATE `resumption` "
"SET `last_ign_off_time` = ?";