[HAM] Fix throwing exceptions for getHumanActivityData 71/185771/3
authorPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Wed, 18 Jul 2018 13:45:45 +0000 (15:45 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Tue, 7 Aug 2018 12:39:36 +0000 (12:39 +0000)
[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 <p.kaczmarczy@samsung.com>
src/humanactivitymonitor/humanactivitymonitor_api.js

index 3f06004..dccf34c 100755 (executable)
@@ -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
   };