From: Pawel Andruszkiewicz
Date: Thu, 27 Aug 2015 10:00:33 +0000 (+0200)
Subject: [Notification] Added privilege checks to LED methods.
X-Git-Tag: submit/tizen/20151026.073646^2^2~158^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33c8e806af460f0d5903c3e7e1b65073a31d75de;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Notification] Added privilege checks to LED methods.
[Verification] TCT pass rate (r36) has decreased, since TCT app does not specify the 'http://tizen.org/privilege/led' privilege:
93.55% (93/87/6/0/0)
Change-Id: I11f9bed4a3efb5127f614609dbb2c160f3c21798
Signed-off-by: Pawel Andruszkiewicz
---
diff --git a/src/notification/notification_api.js b/src/notification/notification_api.js
index 33a36cbc..aefbeffa 100644
--- a/src/notification/notification_api.js
+++ b/src/notification/notification_api.js
@@ -226,6 +226,8 @@ NotificationManager.prototype.getAll = function() {
* @param flags Array
*/
NotificationManager.prototype.playLEDCustomEffect = function(timeOn, timeOff, color, flags) {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.LED);
+
var args = validator_.validateArgs(arguments, [
{name: 'timeOn', type: types_.LONG},
{name: 'timeOff', type: types_.LONG},
@@ -250,6 +252,8 @@ NotificationManager.prototype.playLEDCustomEffect = function(timeOn, timeOff, co
* Stops the custom effect of the service LED that is located to the front of a device.
*/
NotificationManager.prototype.stopLEDCustomEffect = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.LED);
+
var result = native_.callSync('NotificationManager_stopLEDCustomEffect');
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);