[Convergence] Fix Bugs 95/98895/3
authortaekeun.kang <taekeun.kang@samsung.com>
Mon, 21 Nov 2016 06:21:40 +0000 (15:21 +0900)
committertaekeun.kang <taekeun.kang@samsung.com>
Mon, 21 Nov 2016 06:57:16 +0000 (15:57 +0900)
Change-Id: I3a1df053f4ca7601fdef77efdbd05584162dd589
Signed-off-by: taekeun.kang <taekeun.kang@samsung.com>
src/convergence/convergence_api.js
src/convergence/convergence_device.cc

index 8764443795bdf81d81b2a9db12fb944db20559cc..eac42b9613247cd106b59ee3bcfda734342d20ab 100644 (file)
@@ -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);
index 6e82033c5fa2aa8d59abecad5e3f099739e2bd76..34d3663798babb52701f9a4f755f0d3b920a0bf2 100644 (file)
@@ -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