From c0dbbc9bcd38f914cac08409e5ecfe8bcf4cea2f Mon Sep 17 00:00:00 2001 From: "Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics" Date: Tue, 7 Feb 2023 12:04:53 +0100 Subject: [PATCH] [PPM] Deprecate whole module PPM module was required by mobile and wearable profiles, now it is not needed. [ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-290 [Verification] Code compiles witout errors. Deprecation warnings checked in chrome console. Change-Id: Ice28c351ac5f40cf835fe89dad1ddbf6d0a184db --- src/ppm/ppm_api.js | 27 ++++++++++++++++++++++++--- src/ppm/ppm_instance.cc | 12 ++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/ppm/ppm_api.js b/src/ppm/ppm_api.js index 9f0dfcff..5adb1b97 100644 --- a/src/ppm/ppm_api.js +++ b/src/ppm/ppm_api.js @@ -17,6 +17,7 @@ var validator_ = xwalk.utils.validator; var type_ = xwalk.utils.type; var types_ = validator_.Types; +var utils_ = xwalk.utils; var native_ = new xwalk.utils.NativeManager(extension); function PPMManager() {} @@ -29,6 +30,11 @@ function RequestStatus(privilege, result_) { } PPMManager.prototype.checkPermission = function() { + utils_.deprecationWarn( + 'checkPermission() is deprecated and will be ' + + 'removed from next release without any alternatives. ', + '7.5' + ); var args = validator_.validateArgs(arguments, [ { name: 'privilege', type: types_.STRING } ]); @@ -46,7 +52,12 @@ PPMManager.prototype.checkPermission = function() { return native_.getResultObject(result); }; -PPMManager.prototype.checkPermissions = function() { +PPMManager.prototype.checkPermissions = function () { + utils_.deprecationWarn( + 'checkPermissions() is deprecated and will be ' + + 'removed from next release without any alternatives. ', + '7.5' + ); var args = validator_.validateArgs(arguments, [ { name: 'privileges', type: types_.ARRAY, values: types_.STRING } ]); @@ -72,7 +83,12 @@ PPMManager.prototype.checkPermissions = function() { return data; }; -PPMManager.prototype.requestPermission = function() { +PPMManager.prototype.requestPermission = function () { + utils_.deprecationWarn( + 'requestPermission() is deprecated and will be ' + + 'removed from next release without any alternatives. ', + '7.5' + ); var args = validator_.validateArgs(arguments, [ { name: 'privilege', type: types_.STRING }, { name: 'successCallback', type: types_.FUNCTION }, @@ -98,7 +114,12 @@ PPMManager.prototype.requestPermission = function() { } }; -PPMManager.prototype.requestPermissions = function() { +PPMManager.prototype.requestPermissions = function () { + utils_.deprecationWarn( + 'requestPermissions() is deprecated and will be ' + + 'removed from next release without any alternatives. ', + '7.5' + ); var args = validator_.validateArgs(arguments, [ { name: 'privileges', type: types_.ARRAY, values: types_.STRING }, { name: 'successCallback', type: types_.FUNCTION }, diff --git a/src/ppm/ppm_instance.cc b/src/ppm/ppm_instance.cc index 3796c2b3..93f7e1ea 100644 --- a/src/ppm/ppm_instance.cc +++ b/src/ppm/ppm_instance.cc @@ -163,6 +163,9 @@ void PPMInstance::ResponseMultipleCallback(ppm_call_cause_e cause, void PPMInstance::PPMManagerCheckPermission(const picojson::value& args, picojson::object& out) { ScopeLogger(); + DEPRECATION_WARN( + "checkPermission() is deprecated and will be removed from next release without any alternatives.", + "7.5"); const std::string& privilege = args.get("privilege").get(); LoggerD("Checking privilege: %s ", privilege.c_str()); @@ -181,6 +184,9 @@ void PPMInstance::PPMManagerCheckPermission(const picojson::value& args, picojso void PPMInstance::PPMManagerCheckPermissions(const picojson::value& args, picojson::object& out) { ScopeLogger(); + DEPRECATION_WARN( + "checkPermissions() is deprecated and will be removed from next release without any alternatives.", + "7.5"); const picojson::array& privileges = args.get("privileges").get(); std::vector privilege_array; @@ -219,6 +225,9 @@ void PPMInstance::PPMManagerCheckPermissions(const picojson::value& args, picojs void PPMInstance::PPMManagerRequestPermission(const picojson::value& args, picojson::object& out) { ScopeLogger(); + DEPRECATION_WARN( + "requestPermission() is deprecated and will be removed from next release without any alternatives.", + "7.5"); const double callback_id = args.get("callbackId").get(); @@ -243,6 +252,9 @@ void PPMInstance::PPMManagerRequestPermission(const picojson::value& args, picoj void PPMInstance::PPMManagerRequestPermissions(const picojson::value& args, picojson::object& out) { ScopeLogger(); + DEPRECATION_WARN( + "requestPermissions() is deprecated and will be removed from next release without any alternatives.", + "7.5"); const double callback_id = args.get("callbackId").get(); const picojson::array& privileges = args.get("privileges").get(); -- 2.34.1