From: Pawel Kaczmarczyk
Date: Thu, 9 Aug 2018 08:40:58 +0000 (+0200)
Subject: [HAM][Notification][Alarm] Add missing deprecation warnings since Tizen 4.0
X-Git-Tag: submit/tizen/20180816.094841^2~1
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07f110666a1c9cb17b2f6cc66d4573b097ad4b8d;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[HAM][Notification][Alarm] Add missing deprecation warnings since Tizen 4.0
[Verification]
tct-humanactivitymonitor-tizen-tests auto 100%
tct-notification-tizen-tests auto 100%
tct-alarm-tizen-tests auto 100%
Change-Id: I8d0de96c0d6a2ca8a009a25a7c1373dc4064ec36
Signed-off-by: Pawel Kaczmarczyk
---
diff --git a/src/alarm/alarm_api.js b/src/alarm/alarm_api.js
index e8507f69..626756df 100755
--- a/src/alarm/alarm_api.js
+++ b/src/alarm/alarm_api.js
@@ -443,9 +443,18 @@ tizen.AlarmAbsolute = function(date, second, internal) {
},
period: {
get: function() {
+ if(_warningLogs.enableLog){
+ privUtils_.warn('Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) ' +
+ 'is deprecated, thus period attribute should not be used.');
+ }
return m_period;
},
set: function(v) {
+ if(_warningLogs.enableLog){
+ privUtils_.warn('Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) ' +
+ 'is deprecated, thus period attribute should not be used.');
+ }
+
if (_edit.canEdit && v) {
m_period = Converter.toLong(v.period);
}
diff --git a/src/humanactivitymonitor/humanactivitymonitor_api.js b/src/humanactivitymonitor/humanactivitymonitor_api.js
index 691b9533..5c7daf64 100755
--- a/src/humanactivitymonitor/humanactivitymonitor_api.js
+++ b/src/humanactivitymonitor/humanactivitymonitor_api.js
@@ -296,6 +296,11 @@ HumanActivityMonitorManager.prototype.start = function(type, changedCallback) {
{name: 'options', type : types_.DICTIONARY, optional : true, nullable : true}
]);
+ if (HumanActivityType.WRIST_UP === args.type) {
+ utils_.warn('DEPRECATION WARNING: HumanActivityType.WRIST_UP is deprecated since Tizen 4.0. '
+ + 'Use GestureType and addGestureRecognitionListener to monitor WRIST_UP gesture');
+ }
+
var listenerId = 'HumanActivityMonitor_' + args.type;
var optionsAttributes = ["callbackInterval", "sampleInterval"], options = args.options || {};
@@ -365,6 +370,11 @@ HumanActivityMonitorManager.prototype.stop = function(type) {
{name: 'type', type: types_.ENUM, values: Object.keys(HumanActivityType)}
]);
+ if (HumanActivityType.WRIST_UP === args.type) {
+ utils_.warn('DEPRECATION WARNING: HumanActivityType.WRIST_UP is deprecated since Tizen 4.0. '
+ + 'Use GestureType and addGestureRecognitionListener to monitor WRIST_UP gesture');
+ }
+
if (HumanActivityType.PEDOMETER === args.type) {
stopListener('HumanActivityMonitor_PEDOMETER',
'HumanActivityMonitorManager_stop',
diff --git a/src/humanactivitymonitor/humanactivitymonitor_instance.cc b/src/humanactivitymonitor/humanactivitymonitor_instance.cc
index b035f9a0..39fceb7b 100644
--- a/src/humanactivitymonitor/humanactivitymonitor_instance.cc
+++ b/src/humanactivitymonitor/humanactivitymonitor_instance.cc
@@ -155,6 +155,12 @@ void HumanActivityMonitorInstance::HumanActivityMonitorManagerStart(const picojs
CHECK_PRIVILEGE_ACCESS(kPrivilegeLocation, &out);
}
+ if ("WRIST_UP" == type) {
+ LoggerW(
+ "DEPRECATION WARNING: HumanactivityType.WRIST_UP is deprecated since Tizen 4.0. "
+ "Use GestureType and addGestureRecognitionListener to monitor WRIST_UP gesture");
+ }
+
PlatformResult result = Init();
if (!result) {
LogAndReportError(result, &out, ("Failed: Init()"));
@@ -197,6 +203,12 @@ void HumanActivityMonitorInstance::HumanActivityMonitorManagerStop(const picojso
CHECK_PRIVILEGE_ACCESS(kPrivilegeLocation, &out);
}
+ if ("WRIST_UP" == type) {
+ LoggerW(
+ "DEPRECATION WARNING: HumanactivityType.WRIST_UP is deprecated since Tizen 4.0. "
+ "Use GestureType and addGestureRecognitionListener to monitor WRIST_UP gesture");
+ }
+
PlatformResult result = Init();
if (!result) {
LogAndReportError(result, &out, ("Failed: Init()"));
diff --git a/src/notification/notification_api.js b/src/notification/notification_api.js
index 1b8bc526..8e186f1e 100644
--- a/src/notification/notification_api.js
+++ b/src/notification/notification_api.js
@@ -94,6 +94,10 @@ NotificationManager.prototype.post = function(notification) {
{name: 'notification', type: types_.PLATFORM_OBJECT, values: Notification}
]);
+ if (args.notification instanceof tizen.StatusNotification) {
+ utils_.warn('DEPRECATION WARNING: StatusNotification is deprecated since Tizen 4.0. Use UserNotification instead.');
+ }
+
var data = {
//add marker for UserNotification implementation
newImpl: (args.notification instanceof tizen.UserNotification),
@@ -126,6 +130,10 @@ NotificationManager.prototype.update = function(notification) {
throw new WebAPIException(WebAPIException.UNKNOWN_ERR);
}
+ if (args.notification instanceof tizen.StatusNotification) {
+ utils_.warn('DEPRECATION WARNING: StatusNotification is deprecated since Tizen 4.0. Use UserNotification instead.');
+ }
+
var data = {
//add marker for UserNotification implementation
newImpl: (args.notification instanceof tizen.UserNotification),
@@ -172,6 +180,8 @@ NotificationManager.prototype.get = function(id) {
{name: 'id', type: types_.STRING}
]);
+ utils_.warn('DEPRECATION WARNING: get() is deprecated since Tizen 4.0. Use getNotification() instead.');
+
if (!arguments.length) {
throw new WebAPIException(WebAPIException.NOT_FOUND_ERR);
}
@@ -226,6 +236,8 @@ NotificationManager.prototype.getNotification = function(id) {
};
NotificationManager.prototype.getAll = function() {
+ utils_.warn('DEPRECATION WARNING: getAll() is deprecated since Tizen 4.0. Use getAllNotifications() instead.');
+
var result = native_.callSync('NotificationManager_getAll', {});
if (native_.isFailure(result)) {
@@ -652,6 +664,8 @@ function StatusNotification(statusType, title, notificationInitDict) {
NotificationInitDict.call(this, notificationInitDict);
Notification.call(this, notificationInitDict);
+ utils_.warn('DEPRECATION WARNING: StatusNotification is deprecated since Tizen 4.0. Use UserNotification instead.');
+
var _statusType = (Object.keys(StatusNotificationType)).indexOf(statusType) >= 0
? statusType : StatusNotificationType.SIMPLE;
diff --git a/src/notification/notification_instance.cc b/src/notification/notification_instance.cc
index 433830a3..32471a19 100644
--- a/src/notification/notification_instance.cc
+++ b/src/notification/notification_instance.cc
@@ -79,7 +79,9 @@ void NotificationInstance::NotificationManagerPost(const picojson::value& args,
LoggerD("New implementation");
impl = std::bind(&NotificationManager::PostUserNoti, manager_, _1, _2);
} else {
- LoggerW("Deprecated object used");
+ LoggerW(
+ "DEPRECATION WARNING: StatusNotification is deprecated since Tizen 4.0. Use "
+ "UserNotification instead.");
impl = std::bind(&NotificationManager::Post, manager_, _1, _2);
}
@@ -103,7 +105,9 @@ void NotificationInstance::NotificationManagerUpdate(const picojson::value& args
LoggerD("New implementation");
impl = std::bind(&NotificationManager::UpdateUserNoti, manager_, _1);
} else {
- LoggerW("Deprecated object used");
+ LoggerW(
+ "DEPRECATION WARNING: StatusNotification is deprecated since Tizen 4.0. Use "
+ "UserNotification instead.");
impl = std::bind(&NotificationManager::Update, manager_, _1);
}
@@ -147,6 +151,9 @@ void NotificationInstance::NotificationManagerRemoveAll(const picojson::value& a
void NotificationInstance::NotificationManagerGet(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: get() is deprecated since Tizen 4.0. Use getNotifications() instead.");
+
picojson::value val{picojson::object{}};
PlatformResult status =
@@ -163,6 +170,10 @@ void NotificationInstance::NotificationManagerGet(const picojson::value& args,
void NotificationInstance::NotificationManagerGetAll(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: getAll() is deprecated since Tizen 4.0. Use getAllNotifications() "
+ "instead.");
+
picojson::value val{picojson::array{}};
PlatformResult status = manager_->GetAll(