From 71925b02502289e3f584a38b50734063b57fd00e Mon Sep 17 00:00:00 2001 From: Dawid Juszczak Date: Fri, 22 May 2020 19:58:09 +0200 Subject: [PATCH] [5.5][humanactivitymonitor] Deprecate STRESS_MONITOR [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 --- src/humanactivitymonitor/humanactivitymonitor_api.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/humanactivitymonitor/humanactivitymonitor_api.js b/src/humanactivitymonitor/humanactivitymonitor_api.js index f023dea..28a01d0 100755 --- a/src/humanactivitymonitor/humanactivitymonitor_api.js +++ b/src/humanactivitymonitor/humanactivitymonitor_api.js @@ -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); } -- 2.7.4