[Notification] Added privilege checks to LED methods.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Thu, 27 Aug 2015 10:00:33 +0000 (12:00 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Thu, 27 Aug 2015 10:00:33 +0000 (12:00 +0200)
[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 <p.andruszkie@samsung.com>
src/notification/notification_api.js

index 33a36cbc3ca8ded033d67494e1a0a5bf06349fcc..aefbeffaf1e5b849abeafb5c56c1ef6e64f9b611 100644 (file)
@@ -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);