From: Piotr Kosko
Date: Fri, 27 Apr 2018 06:18:39 +0000 (+0200)
Subject: [Common] Disabled error log in case of Power special message
X-Git-Tag: submit/tizen/20180427.125243~1
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F177328%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Common] Disabled error log in case of Power special message
[Verification] Code compiles without errors.
Below code works without any JS errors (special Power
chromium message is ignored):
tizen.power.request("SCREEN", "SCREEN_NORMAL");
tizen.power.release("SCREEN");
TCT passrate for Power module is 100% (A & M).
Change-Id: I2b2cf3d97442389b722db8a9943e5c98f1a0d0cf
Signed-off-by: Piotr Kosko
---
diff --git a/src/utils/utils_api.js b/src/utils/utils_api.js
index c6f0c6dc..90f7a5c8 100644
--- a/src/utils/utils_api.js
+++ b/src/utils/utils_api.js
@@ -1029,7 +1029,18 @@ var NativeManager = function(extension) {
try {
var msg = JSON_.parse(json);
} catch (error) {
+ // Because of special handling of power lock in chromium, the special signals:
+ // - __DisableChromiumInternalPowerLock
+ // - __EnableChromiumInternalPowerLock
+ // could occur. In such cases we are silently ignroing those messages.
+ // TODO This is workaround for missing patch in chromium-efl package which should handle
+ // this special message and don't forward it to webapi JS. After chromium-efl will
+ // be updated, below checking should be removed.
+ if (json.substring(0,2) === '__') {
+ return;
+ }
xwalk.utils.error('Invalid JSON received: ' + json);
+ return;
}
var id;