projects
/
platform
/
core
/
api
/
webapi-plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11704ca
)
[SystemInfo] Added validation of setBrightness value
author
Wojciech Kosowicz
<w.kosowicz@samsung.com>
Mon, 14 Sep 2015 12:14:23 +0000
(14:14 +0200)
committer
JeongKyun Pu
<jk.pu@samsung.com>
Tue, 15 Sep 2015 06:08:39 +0000
(15:08 +0900)
Change-Id: I8cd6135f7ec4abc5d2a1c6bc0847204715ae5b8f
Signed-off-by: Wojciech Kosowicz <w.kosowicz@samsung.com>
src/systeminfo/systeminfo_api.js
patch
|
blob
|
history
diff --git
a/src/systeminfo/systeminfo_api.js
b/src/systeminfo/systeminfo_api.js
index
17ce10f
..
7294898
100644
(file)
--- a/
src/systeminfo/systeminfo_api.js
+++ b/
src/systeminfo/systeminfo_api.js
@@
-709,6
+709,9
@@
SystemInfoCameraFlash.prototype.setBrightness = function(brightness) {
var args = validator_.validateArgs(arguments, [
{name: 'brightness', type: types_.DOUBLE}
]);
+ if (args.brightness < 0 || args.brightness > 1)
+ throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
+ 'Value is not between 0 and 1');
args.brightness = args.brightness * this.levels;
var result = native_.callSync('SystemInfo_setBrightness', args);