From d7bc239b135e68a98e9c960f09d020962e64bfb8 Mon Sep 17 00:00:00 2001
From: Pawel Kaczmarczyk
Date: Wed, 8 Aug 2018 14:32:16 +0200
Subject: [PATCH] [SystemInfo][Bluetooth][Push] Add misssing deprecation
warnings since Tizen 3.0
[Verification]
Code compiles
tct-systeminfo-tizen-tests passrate 100%
Change-Id: I41db5325ac94ca042069551a41161e5b968e51d3
Signed-off-by: Pawel Kaczmarczyk
---
src/bluetooth/bluetooth_adapter.cc | 3 +++
src/bluetooth/bluetooth_api.js | 3 +++
src/push/push_instance.cc | 12 ++++++++++++
src/systeminfo/systeminfo_api.js | 12 +++++++++---
4 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/bluetooth/bluetooth_adapter.cc b/src/bluetooth/bluetooth_adapter.cc
index 9fbf87e..0da34d5 100644
--- a/src/bluetooth/bluetooth_adapter.cc
+++ b/src/bluetooth/bluetooth_adapter.cc
@@ -641,6 +641,9 @@ void BluetoothAdapter::SetPowered(const picojson::value& data, picojson::object&
void BluetoothAdapter::SetVisible(const picojson::value& data, picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: setVisible() is deprecated and will be removed from next release. "
+ "Let the user change the Bluetooth visibility through the Settings application instead.");
CHECK_BACKWARD_COMPABILITY_PRIVILEGE_ACCESS(Privilege::kBluetooth, Privilege::kBluetoothManager,
&out);
diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js
index 09979b3..9fb4266 100755
--- a/src/bluetooth/bluetooth_api.js
+++ b/src/bluetooth/bluetooth_api.js
@@ -2078,6 +2078,9 @@ BluetoothAdapter.prototype.setPowered = function() {
// This method is deprecated since Tizen 2.3 and will be removed in Tizen 3.0.
BluetoothAdapter.prototype.setVisible = function() {
privUtils_.log('Entered BluetoothAdapter.setVisible()');
+ privUtils_.warn('DEPRECATION WARNING: setVisible() is deprecated and will be removed from next release. '
+ + 'Let the user change the Bluetooth visibility through the Settings application instead.');
+
var args = AV.validateMethod(arguments, [
{
name : 'visible',
diff --git a/src/push/push_instance.cc b/src/push/push_instance.cc
index f7b277d..f05e04b 100644
--- a/src/push/push_instance.cc
+++ b/src/push/push_instance.cc
@@ -64,6 +64,9 @@ PushInstance::PushInstance() {
void PushInstance::registerService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: registerService() is deprecated and will be removed from next release. "
+ "Use register() instead.");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
common::PlatformResult result = impl->registerService(args.get("callbackId").get());
@@ -88,6 +91,9 @@ void PushInstance::registerApplication(const picojson::value& args, picojson::ob
void PushInstance::unregisterService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: unregisterService() is deprecated and will be removed from next "
+ "release. Use unregister() instead.");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
@@ -114,6 +120,9 @@ void PushInstance::unregisterApplication(const picojson::value& args, picojson::
void PushInstance::connectService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: connectService() is deprecated and will be removed from next release. "
+ "Use connect() instead.");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
@@ -140,6 +149,9 @@ void PushInstance::connect(const picojson::value& args, picojson::object& out) {
void PushInstance::disconnectService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ LoggerW(
+ "DEPRECATION WARNING: disconnectService() is deprecated and will be removed from next "
+ "release. Use disconnect() instead.");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js
index 63b3e5e..a14be23 100644
--- a/src/systeminfo/systeminfo_api.js
+++ b/src/systeminfo/systeminfo_api.js
@@ -441,6 +441,8 @@ function SystemInfoCpu(data) {
//class SystemInfoStorageUnit ////////////////////////////////////////////////////
function SystemInfoStorageUnit(data) {
+ var _isRemovable = data.isRemovable;
+
Object.defineProperties(this, {
type : {
value: data.type,
@@ -463,9 +465,13 @@ function SystemInfoStorageUnit(data) {
enumerable : true
},
isRemoveable : {
- value : data.isRemovable,
- writable : false,
- enumerable : true
+ enumerable : true,
+ get: function() {
+ privUtils_.warn('DEPRECATION WARNING: SystemInfoStorageUnit.isRemoveable is is deprecated and will be '
+ + 'removed from next release. Use SystemInfoStorageUnit.isRemovable instead.');
+ return _isRemovable;
+ },
+ set: function() {}
}
});
}
--
2.7.4