[HAM][Notification][Alarm] Add missing deprecation warnings since Tizen 4.0 46/186446/1
authorPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Thu, 9 Aug 2018 08:40:58 +0000 (10:40 +0200)
committerPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Thu, 9 Aug 2018 12:46:26 +0000 (14:46 +0200)
[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 <p.kaczmarczy@samsung.com>
src/alarm/alarm_api.js
src/humanactivitymonitor/humanactivitymonitor_api.js
src/humanactivitymonitor/humanactivitymonitor_instance.cc
src/notification/notification_api.js
src/notification/notification_instance.cc

index e8507f694765c4f34d859012f1336d7a2a1d1702..626756df887f8f4df4f9e64ae0b9b813cb6b2180 100755 (executable)
@@ -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);
                 }
index 691b9533606b77fd1bf8dfeb04f683a1a661c2df..5c7daf64a3e1cc5abb75ca99bcb7d951ad916aad 100755 (executable)
@@ -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',
index b035f9a0e0577de224f04d644c01fcb9075f8b32..39fceb7bbf60c197a2e70c0e2fb2eebdf87af1ba 100644 (file)
@@ -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()"));
index 1b8bc526baa06d2628846d410aa5564a309ce84a..8e186f1ee2fb440ac83c0d2411c2850d60e5e58f 100644 (file)
@@ -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;
 
index 433830a344a127e557c9dd0af2f0f9bf72eb1b34..32471a19a3860255d16c9fcc26078ad6288f42de 100644 (file)
@@ -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(