[HAM] - change stop and unsetAccumulativePedometerListener functions 14/106414/2
authorAndrzej Popowski <a.popowski@samsung.com>
Wed, 21 Dec 2016 13:15:07 +0000 (14:15 +0100)
committerAndrzej Popowski <a.popowski@samsung.com>
Tue, 27 Dec 2016 12:44:12 +0000 (04:44 -0800)
Change-Id: I61286b34bcccaf43d44fdd0b7a50e8cc2b717de6
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/humanactivitymonitor/humanactivitymonitor_api.js

index 2d2d65e1c7172665684ae15ebad506e570a6de32..0e3dff440e363bd84a6799fa54c40dcc35187aea 100755 (executable)
@@ -354,9 +354,11 @@ HumanActivityMonitorManager.prototype.stop = function(type) {
     {name: 'type', type: types_.ENUM, values: Object.keys(HumanActivityType)}
   ]);
 
-  stopListener('HumanActivityMonitor_'  + args.type,
-               'HumanActivityMonitorManager_stop',
-               { type: args.type });
+  if (!pedometerListener || !accumulativePedometerListener) {
+    stopListener('HumanActivityMonitor_'  + args.type,
+                 'HumanActivityMonitorManager_stop',
+                 { type: args.type });
+  }
 
   if (HumanActivityType.PEDOMETER === args.type) {
     pedometerListener = null;