From af8db1f6397c5b5ede9daf5773f6438e77490bd0 Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Tue, 22 Nov 2016 19:20:02 +0900 Subject: [PATCH] [Convergence] - Adding service attribute "type" Change-Id: I8be40a3467d6472880bef7f4028c217515a1561a Signed-off-by: Andrzej Popowski --- src/convergence/convergence_api.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/convergence/convergence_api.js b/src/convergence/convergence_api.js index 614e4d1d..215c0429 100644 --- a/src/convergence/convergence_api.js +++ b/src/convergence/convergence_api.js @@ -45,6 +45,12 @@ var DeviceProfile = { TV: 'TV' }; +var ServiceType = { + APP_COMM_CLIENT: 'APP_COMM_CLIENT', + APP_COMM_SERVER: 'APP_COMM_SERVER', + REMOTE_APP_CONTROL: 'REMOTE_APP_CONTROL' +}; + function SetReadOnlyProperty(obj, n, v) { if (arguments.length > 2) Object.defineProperty( @@ -276,6 +282,8 @@ function RemoteAppControlService() { } }); + this.type = ServiceType.REMOTE_APP_CONTROL; + // Registering the service in the table of issued services convergenceServices[this._serviceId] = this; } @@ -461,9 +469,6 @@ RemoteAppControlService.prototype.launch = function(appId, successCallback, erro } ]); - if (this.connectionState == ConnectionState.CONNECTED) - throw new WebAPIException('InvalidStateError', 'Service is connected already.'); - var lid = this._serviceId; // TODO In fact it must be a list of callbacks // But untill D2D FW suppurts transaction management, it is meaningless to @@ -934,6 +939,7 @@ function AppCommunicationServerService() { validator_.isConstructorCall(this, AppCommunicationServerService); this.connectionState = ConnectionState.NOT_CONNECTED; + this.type = ServiceType.APP_COMM_SERVER; native_.callSync('AppCommunicationServerService_constructLocal', { deviceId: this._deviceId @@ -948,6 +954,7 @@ function AppCommunicationClientService() { validator_.isConstructorCall(this, AppCommunicationClientService); this.connectionState = ConnectionState.NOT_CONNECTED; + this.type = ServiceType.APP_COMM_CLIENT; } AppCommunicationClientService.prototype = new AppCommunicationService(); @@ -1045,7 +1052,5 @@ function ClientInfo(isHost, clientId, connectionTime) { } exports = new ConvergenceManager(); -tizen.RemoteAppControlService = RemoteAppControlService; tizen.AppCommunicationServerService = AppCommunicationServerService; -tizen.AppCommunicationClientService = AppCommunicationClientService; tizen.ChannelInfo = ChannelInfo; -- 2.34.1