From: taekeun.kang Date: Mon, 21 Nov 2016 06:21:40 +0000 (+0900) Subject: [Convergence] Fix Bugs X-Git-Tag: submit/tizen_3.0/20161123.043947~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f70e69d97b2b1ea232bf75127b4f9d48a04dbd7;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Convergence] Fix Bugs Change-Id: I3a1df053f4ca7601fdef77efdbd05584162dd589 Signed-off-by: taekeun.kang --- diff --git a/src/convergence/convergence_api.js b/src/convergence/convergence_api.js index 87644437..eac42b96 100644 --- a/src/convergence/convergence_api.js +++ b/src/convergence/convergence_api.js @@ -82,11 +82,11 @@ function getServiceConnectionStateName(connectionStateNumber) { } } -function Device(id, name, profile, services) { +function Device(id, name, type, services) { validator_.isConstructorCall(this, Device); this.id = id; this.name = name; - this.profile = profile; + this.type = type; this.services = services; } @@ -307,7 +307,7 @@ RemoteAppControlService.prototype.connect = function(successCallback, errorCallb } ]); - if (this.serviceState == ConnectionState.CONNECTED) + if (this.connectionState == ConnectionState.CONNECTED) throw new WebAPIException('InvalidStateError', 'Service is connected already.'); var lid = this._serviceId; @@ -345,7 +345,7 @@ RemoteAppControlService.prototype.disconnect = function(successCallback, errorCa } ]); - if (this.serviceState != ConnectionState.CONNECTED) { + if (this.connectionsState != ConnectionState.CONNECTED) { throw new WebAPIException('InvalidStateError', 'Service is not connected yet.'); } @@ -360,7 +360,7 @@ RemoteAppControlService.prototype.disconnect = function(successCallback, errorCa if (native_.isFailure(result)) { throw native_.getErrorObject(result); } else { - connectionState = ConnectionState.DISCONNECTED; + this.connectionState = ConnectionState.DISCONNECTED; } native_.callIfPossible(successCallback, this); @@ -466,7 +466,7 @@ RemoteAppControlService.prototype.launch = function(appId, successCallback, erro } ]); - if (this.serviceState == ConnectionState.CONNECTED) + if (this.connectionState == ConnectionState.CONNECTED) throw new WebAPIException('InvalidStateError', 'Service is connected already.'); var lid = this._serviceId; @@ -934,7 +934,7 @@ AppCommunicationClientService.prototype.connect = function(successCallback, erro } ]); - if (this.serviceState == ConnectionState.CONNECTED) + if (this.connectionState == ConnectionState.CONNECTED) throw new WebAPIException('InvalidStateError', 'Service is connected already.'); var lid = this._serviceId; @@ -973,7 +973,7 @@ AppCommunicationClientService.prototype.disconnect = function(successCallback, e nullable: true } ]); - if (this.serviceState != ConnectionState.CONNECTED) + if (this.connectionState != ConnectionState.CONNECTED) throw new WebAPIException('InvalidStateError', 'Service is not connected yet.'); var result = native_.call('AppCommunicationClientService_disconnect', { @@ -983,10 +983,11 @@ AppCommunicationClientService.prototype.disconnect = function(successCallback, e native_.callIfPossible(errorCallback, native_.getErrorObject(result)); } }); + if (native_.isFailure(result)) { throw native_.getErrorObject(result); } else { - connectionState = ConnectionState.DISCONNECTED; + this.connectionState = ConnectionState.DISCONNECTED; } native_.callIfPossible(successCallback, this); diff --git a/src/convergence/convergence_device.cc b/src/convergence/convergence_device.cc index 6e82033c..34d36637 100644 --- a/src/convergence/convergence_device.cc +++ b/src/convergence/convergence_device.cc @@ -34,7 +34,7 @@ namespace { // Service keys static const std::string kId = "id"; static const std::string kName = "name"; //-- -static const std::string kDeviceType = "profile"; +static const std::string kDeviceType = "type"; static const std::string kDeviceServices = "services"; } // namespace