[5.5][humanactivitymonitor] Deprecate STRESS_MONITOR 94/234294/3
authorDawid Juszczak <d.juszczak@samsung.com>
Fri, 22 May 2020 17:58:09 +0000 (19:58 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Tue, 26 May 2020 10:22:58 +0000 (10:22 +0000)
[ACR]
https://code.sec.samsung.net/jira/browse/TWDAPI-262

[Description]
Deprecated methods:
- addStressMonitorChangeListener()
- removeStressMonitorChangeListener()

Deprecated interfaces:
- HumanActivityStressMonitorData
- StressMonitorDataRange
- stressMonitorListener

[Verification]
builds witout errors

Change-Id: I3adffddcca970cb668a65bbb1254564a3bde30b1
Signed-off-by: Dawid Juszczak <d.juszczak@samsung.com>
src/humanactivitymonitor/humanactivitymonitor_api.js

index f023dea..28a01d0 100755 (executable)
@@ -154,6 +154,7 @@ function convertActivityRecorderData(type, data) {
 }
 
 function StressMonitorDataRange(label, min, max) {
+    utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
     validator_.validateConstructorCall(this, tizen.StressMonitorDataRange);
 
     var args = validator_.validateArgs(arguments, [
@@ -269,6 +270,10 @@ HumanActivityMonitorManager.prototype.getHumanActivityData = function(
         throw new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR);
     }
 
+    if (HumanActivityType.STRESS_MONITOR == args.type) {
+        utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
+    }
+
     var data = {
         type: args.type
     };
@@ -380,6 +385,10 @@ HumanActivityMonitorManager.prototype.start = function(type, changedCallback) {
         );
     }
 
+    if (HumanActivityType.STRESS_MONITOR == args.type) {
+        utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
+    }
+
     var listenerId = 'HumanActivityMonitor_' + args.type;
     var optionsAttributes = ['callbackInterval', 'sampleInterval'],
         options = args.options || {};
@@ -482,6 +491,10 @@ HumanActivityMonitorManager.prototype.stop = function(type) {
         );
     }
 
+    if (HumanActivityType.STRESS_MONITOR == args.type) {
+        utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
+    }
+
     if (HumanActivityType.PEDOMETER === args.type) {
         stopListener(
             'HumanActivityMonitor_PEDOMETER',
@@ -867,6 +880,7 @@ function StressMonitorListenerManager() {
 }
 
 StressMonitorListenerManager.prototype.onListener = function(data) {
+    utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
     if (stressListener) {
         stressListener(data);
     }
@@ -919,6 +933,7 @@ StressMonitorListenerManager.prototype.removeListener = function(watchId) {
 var stressMonitorListener = new StressMonitorListenerManager();
 
 HumanActivityMonitorManager.prototype.addStressMonitorChangeListener = function() {
+    utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
     utils_.checkPrivilegeAccess(privilege_.HEALTHINFO);
     var args = validator_.validateMethod(arguments, [
         {
@@ -936,6 +951,7 @@ HumanActivityMonitorManager.prototype.addStressMonitorChangeListener = function(
 };
 
 HumanActivityMonitorManager.prototype.removeStressMonitorChangeListener = function() {
+    utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
     var args = validator_.validateMethod(arguments, [
         {
             name: 'watchId',
@@ -1052,6 +1068,7 @@ HumanActivitySleepDetectorData.prototype = new HumanActivityData();
 HumanActivitySleepDetectorData.prototype.constructor = HumanActivitySleepMonitorData;
 
 function HumanActivityStressMonitorData(data) {
+    utils_.printDeprecationWarningFor(HumanActivityType.STRESS_MONITOR);
     SetReadOnlyProperty(this, 'stressScore', data.stressScore);
 }