From: Pawel Kaczmarczyk
Date: Wed, 18 Jul 2018 13:45:45 +0000 (+0200)
Subject: [HAM] Fix throwing exceptions for getHumanActivityData
X-Git-Tag: accepted/tizen/3.0/common/20181024.102404~9
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F185771%2F3;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[HAM] Fix throwing exceptions for getHumanActivityData
[Bug] getHumanActivityData method accepts only 'PEDOMETER'
and 'HRM' values of HumanActivityType enum as type
parameter. Any other value should cause NotSupportedError,
but implementation leaded to UnknownError instead.
[Verification] AutoTCT 100% passrate
Change-Id: Id5145d76f8957527e28f42c9b1c3141b11b8e5ca
Signed-off-by: Pawel Kaczmarczyk
---
diff --git a/src/humanactivitymonitor/humanactivitymonitor_api.js b/src/humanactivitymonitor/humanactivitymonitor_api.js
index 3f06004..dccf34c 100755
--- a/src/humanactivitymonitor/humanactivitymonitor_api.js
+++ b/src/humanactivitymonitor/humanactivitymonitor_api.js
@@ -191,12 +191,10 @@ HumanActivityMonitorManager.prototype.getHumanActivityData = function(type, succ
{name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true}
]);
- if (args.type === HumanActivityType.WRIST_UP) {
+ if (-1 === [HumanActivityType.HRM, HumanActivityType.PEDOMETER].indexOf(args.type)) {
throw new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR);
}
- var listenerId = 'HumanActivityMonitor_' + args.type;
-
var data = {
type: args.type
};