[Badge] Return '0' from GetBadgeCount, if a badge does not exist 95/107595/1
authorPawel Wasowski <p.wasowski2@partner.samsung.com>
Wed, 28 Dec 2016 16:09:51 +0000 (17:09 +0100)
committerPawel Wasowski <p.wasowski2@partner.samsung.com>
Wed, 28 Dec 2016 16:56:26 +0000 (17:56 +0100)
[Verification] tct-badge-tizen-tests pass rate is 100%

Change-Id: I976ad1eec84d0b884e944d6dcd90ebf5b05b4c47

src/badge/badge_manager.cc

index e685e2bef75a4680817754ce938b3a0b14048dde..8736e8492a19a61778ba34c07cf9a7be6a87b6bd 100755 (executable)
@@ -136,11 +136,10 @@ PlatformResult BadgeManager::GetBadgeCount(const std::string& app_id,
   LoggerD("badge exist : %d", badge_exist);
 
   if (!badge_exist) {
-    return LogAndCreateResult(ErrorCode::UNKNOWN_ERR,
-                              "badge not exist. app_id: " + app_id);
+    *count = 0;
+    return PlatformResult(ErrorCode::NO_ERROR);
   }
 
-  *count = 0;
   ret = badge_get_count(app_id.c_str(), count);
 
   LoggerD("badge_get_count() ret : %d count : %d", ret, *count);