compare app_id as unsigned int
authorJustin Dickow <jjdickow@gmail.com>
Wed, 19 Mar 2014 13:05:57 +0000 (09:05 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Wed, 19 Mar 2014 13:05:57 +0000 (09:05 -0400)
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
SDL_Core/src/components/application_manager/src/resume_ctrl.cpp

index 74cb245..587c312 100644 (file)
@@ -40,10 +40,10 @@ void ResumeCtrl::SaveApplication(ApplicationConstSharedPtr application) {
   DCHECK(application.get());
 
   Json::Value* json_app = NULL;
-  const uint32_t app_id = application->mobile_app_id()->asInt();
+  const uint32_t app_id = application->mobile_app_id()->asUInt();
   for (std::vector<Json::Value>::iterator it = saved_applications_.begin();
             it != saved_applications_.end(); ++it) {
-    if ((*it)[strings::app_id].asInt() == app_id) {
+    if ((*it)[strings::app_id].asUInt() == app_id) {
       json_app = &(*it);
       LOG4CXX_INFO(logger_, "ResumeCtrl Application with this id"
                             "is already exist ( update info ) " << app_id);
@@ -117,8 +117,8 @@ bool ResumeCtrl::RestoreApplicationHMILevel(ApplicationSharedPtr application) {
 
   for (std::vector<Json::Value>::iterator it = saved_applications_.begin();
       it != saved_applications_.end(); ++it) {
-    if ((*it)[strings::app_id].asInt() ==
-        application->mobile_app_id()->asInt()) {
+    if ((*it)[strings::app_id].asUInt() ==
+        application->mobile_app_id()->asUInt()) {
 
       mobile_apis::HMILevel::eType saved_hmi_level;
       mobile_apis::HMILevel::eType restored_hmi_level;
@@ -136,7 +136,7 @@ bool ResumeCtrl::RestoreApplicationHMILevel(ApplicationSharedPtr application) {
       }
       MessageHelper::SendHMIStatusNotification(*(application.get()));
       LOG4CXX_INFO(logger_, "Restore Application "
-                   << (*it)[strings::app_id].asInt()
+                   << (*it)[strings::app_id].asUInt()
                    << " to HMILevel " << restored_hmi_level);
       return true;
     }
@@ -151,8 +151,8 @@ bool ResumeCtrl::RestoreApplicationData(ApplicationSharedPtr application) {
 
   std::vector<Json::Value>::iterator it = saved_applications_.begin();
   for (; it != saved_applications_.end(); ++it) {
-    if ((*it)[strings::app_id].asInt() ==
-        application->mobile_app_id()->asInt()) {
+    if ((*it)[strings::app_id].asUInt() ==
+        application->mobile_app_id()->asUInt()) {
       break;
     }
   }
@@ -264,7 +264,7 @@ bool ResumeCtrl::RemoveApplicationFromSaved(ApplicationConstSharedPtr applicatio
 
   for (std::vector<Json::Value>::iterator it = saved_applications_.begin();
       it != saved_applications_.end(); ) {
-    if ((*it)[strings::app_id].asInt() == application->mobile_app_id()->asInt()) {
+    if ((*it)[strings::app_id].asUInt() == application->mobile_app_id()->asUInt()) {
       saved_applications_.erase(it);
       return true;
     } else {
@@ -310,8 +310,8 @@ bool ResumeCtrl::StartResumption(ApplicationSharedPtr application,
 
   std::vector<Json::Value>::iterator it = saved_applications_.begin();
   for (; it != saved_applications_.end(); ++it) {
-    if ((*it)[strings::app_id].asInt() ==
-        application->mobile_app_id()->asInt()) {
+    if ((*it)[strings::app_id].asUInt() ==
+        application->mobile_app_id()->asUInt()) {
 
       uint32_t saved_hash = (*it)[strings::hash_id].asUInt();
       uint32_t time_stamp= (*it)[strings::time_stamp].asUInt();
@@ -332,7 +332,7 @@ bool ResumeCtrl::StartResumption(ApplicationSharedPtr application,
 bool ResumeCtrl::CheckApplicationHash(uint32_t app_id, uint32_t hash) {
   std::vector<Json::Value>::iterator it = saved_applications_.begin();
   for (; it != saved_applications_.end(); ++it) {
-    if ((*it)[strings::app_id].asInt() == app_id) {
+    if ((*it)[strings::app_id].asUInt() == app_id) {
       uint32_t saved_hash = (*it)[strings::hash_id].asUInt();
       if (hash == saved_hash) {
         return true;