[Common] Async calls performed by sendSyncMessage
authorRafal Galka <r.galka@samsung.com>
Mon, 12 Jan 2015 10:04:29 +0000 (11:04 +0100)
committerRafal Galka <r.galka@samsung.com>
Wed, 11 Mar 2015 10:18:05 +0000 (19:18 +0900)
[Message] This allows to handle exceptions thrown
before async operation starts (eg. SecurityException).

This patch replaces:
http://168.219.209.56/gerrit/#/c/14446/
http://168.219.209.56/gerrit/#/c/14479/

Change-Id: Ifac6f168580fa4209741ff5f8b4f8a219820d7ef

src/utils/utils_api.js

index 87c2f71b855f56d68668cbda1841c3281bbcfccc..87f189e9e725bdfed35fc841ab11ac3525260ec4 100644 (file)
@@ -778,12 +778,7 @@ NativeManager.prototype.call = function(cmd, args, callback) {
   args[this.CALLBACK_ID_KEY] = replyId;
   this.callbacks_[replyId] = callback;
 
-  var request = JSON.stringify({
-    cmd: cmd,
-    args: args
-  });
-
-  this.extension.postMessage(request);
+  return this.callSync(cmd, args);
 };
 
 NativeManager.prototype.callSync = function(cmd, args) {