From 0555dc4a379a195c455a08c5dc5bb866ba3fa276 Mon Sep 17 00:00:00 2001 From: "sangrae.kim" Date: Thu, 29 Sep 2016 13:06:08 +0900 Subject: [PATCH 01/16] [convergence] Fix bug listener method name add,remove->set,unset Change-Id: Iafde157f24c2f4d14ca332896953c29a846b2c81 Signed-off-by: sangrae.kim --- src/convergence/convergence_api.js | 12 ++++++------ src/convergence/convergence_instance.cc | 8 ++++---- src/convergence/convergence_instance.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/convergence/convergence_api.js b/src/convergence/convergence_api.js index e570e07..dd7be5c 100644 --- a/src/convergence/convergence_api.js +++ b/src/convergence/convergence_api.js @@ -737,8 +737,8 @@ AppCommunicationService.prototype.send = function(channel, payload, successCallb throw native_.getErrorObject(result); }; -AppCommunicationService.prototype.addListener = function(listenerCallback) { - console.log('Entered AppCommunicationService.addListener()'); +AppCommunicationService.prototype.setListener = function(listenerCallback) { + console.log('Entered AppCommunicationService.setListener()'); var args = validator_.validateArgs(arguments, [ {name: 'listenerCallback', type: types_.FUNCTION} ]); @@ -753,7 +753,7 @@ AppCommunicationService.prototype.addListener = function(listenerCallback) { console.log('AppCommunicationServiceCommandListeners ADDED [' + lid + ']'); console.log(''); - var result = native_.callSync('AppCommunicationService_addListener', { + var result = native_.callSync('AppCommunicationService_setListener', { deviceId: this._deviceId, curListenerId: lid }); @@ -763,13 +763,13 @@ AppCommunicationService.prototype.addListener = function(listenerCallback) { return args.curListenerId; // TODO return proper index of listener }; -AppCommunicationService.prototype.removeListener = function(id) { - console.log('Entered AppCommunicationService.removeListener()'); +AppCommunicationService.prototype.unsetListener = function(id) { + console.log('Entered AppCommunicationService.unsetListener()'); var args = validator_.validateArgs(arguments, [ {name: 'id', type: types_.LONG, optional: false} ]); - var result = native_.callSync('AppCommunicationService_removeListener', { + var result = native_.callSync('AppCommunicationService_unsetListener', { deviceId: this._deviceId //curListenerId: id // not needed in below layers }); diff --git a/src/convergence/convergence_instance.cc b/src/convergence/convergence_instance.cc index 48b589b..e4221b2 100644 --- a/src/convergence/convergence_instance.cc +++ b/src/convergence/convergence_instance.cc @@ -67,8 +67,8 @@ ConvergenceInstance::ConvergenceInstance() { REGISTER_SYNC("ConvergenceManager_stopDiscovery", ConvergenceManagerStopDiscovery); - REGISTER_SYNC("AppCommunicationService_addListener", AppCommunicationServiceAddListener); - REGISTER_SYNC("AppCommunicationService_removeListener", AppCommunicationServiceRemoveListener); + REGISTER_SYNC("AppCommunicationService_setListener", AppCommunicationServiceSetListener); + REGISTER_SYNC("AppCommunicationService_unsetListener", AppCommunicationServiceUnsetListener); //REGISTER_SYNC("Service_createLocalService", ServiceCreateLocal); #undef REGISTER_SYNC #define REGISTER_ASYNC(c,x) \ @@ -509,7 +509,7 @@ void ConvergenceInstance::AppCommunicationServiceStop( ReportSuccess(out); } -void ConvergenceInstance::AppCommunicationServiceAddListener( +void ConvergenceInstance::AppCommunicationServiceSetListener( const picojson::value& args, picojson::object& out) { ScopeLogger(); @@ -537,7 +537,7 @@ void ConvergenceInstance::AppCommunicationServiceAddListener( ReportSuccess(out); } -void ConvergenceInstance::AppCommunicationServiceRemoveListener( +void ConvergenceInstance::AppCommunicationServiceUnsetListener( const picojson::value& args, picojson::object& out) { ScopeLogger(); diff --git a/src/convergence/convergence_instance.h b/src/convergence/convergence_instance.h index b38f631..cd0ead6 100644 --- a/src/convergence/convergence_instance.h +++ b/src/convergence/convergence_instance.h @@ -70,8 +70,8 @@ class ConvergenceInstance : public common::ParsedInstance { void AppCommunicationServiceStart(const picojson::value& args, picojson::object& out); void AppCommunicationServiceStop(const picojson::value& args, picojson::object& out); void AppCommunicationServiceSend(const picojson::value& args, picojson::object& out); - void AppCommunicationServiceAddListener(const picojson::value& args, picojson::object& out); - void AppCommunicationServiceRemoveListener(const picojson::value& args, picojson::object& out); + void AppCommunicationServiceSetListener(const picojson::value& args, picojson::object& out); + void AppCommunicationServiceUnsetListener(const picojson::value& args, picojson::object& out); // App Communication Server Service void AppCommunicationServerServiceConstructLocal(const picojson::value& args, picojson::object& out); -- 2.7.4 From b332c0e120415a71a1a62e860493e07d4e00a431 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Thu, 29 Sep 2016 13:29:50 +0900 Subject: [PATCH 02/16] [version] 1.37 Change-Id: Id057df5fd16d0a7a343a4857afac502371f20acd --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index f06c1b1..88974a1 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.36 +Version: 1.37 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From e802e9937e7f7ab0120871638b35920667d73415 Mon Sep 17 00:00:00 2001 From: "jk.pu" Date: Tue, 27 Sep 2016 15:23:24 +0900 Subject: [PATCH 03/16] [iotcon] fix set deviceName, set/get timeInterval Change-Id: I491d892c953f3df3109be5c328c438870be17215 Signed-off-by: jk.pu --- src/iotcon/iotcon_api.js | 10 +--------- src/iotcon/iotcon_instance.cc | 6 +----- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/iotcon/iotcon_api.js b/src/iotcon/iotcon_api.js index 10f5a54..4cd400b 100644 --- a/src/iotcon/iotcon_api.js +++ b/src/iotcon/iotcon_api.js @@ -691,10 +691,7 @@ function RemoteResource(data) { }, timeInterval: { get: function() { - /* TODO Uncomment when the interface of the function iotcon_remote_resource_get_time_interval is changed var callArgs = prepareResourceInfo(this, true); - */ - var callArgs = {}; var result = native.callSync('IotconRemoteResource_getTimeInterval', callArgs); if (native.isSuccess(result)) { @@ -703,13 +700,8 @@ function RemoteResource(data) { return null; }.bind(this), set: function(val) { - /* TODO Uncomment when the interface of the function iotcon_remote_resource_set_time_interval is changed var callArgs = prepareResourceInfo(this, true); callArgs[timeInterval] = converter.toLong(val); - */ - var callArgs = { - timeInterval: converter.toLong(val) - }; native.callSync('IotconRemoteResource_setTimeInterval', callArgs); }.bind(this), @@ -1222,7 +1214,7 @@ function Server() { }, set: function(v) { if (v) { - var deviceName = converter.toString(v); + var deviceName = v; var callArgs = { deviceName: deviceName diff --git a/src/iotcon/iotcon_instance.cc b/src/iotcon/iotcon_instance.cc index 8476d4d..46d618e 100644 --- a/src/iotcon/iotcon_instance.cc +++ b/src/iotcon/iotcon_instance.cc @@ -1122,7 +1122,6 @@ common::TizenResult IotconInstance::RemoteResourceGetTimeInterval(const picojson if (!res) { LogAndReturnTizenError(res, ("iotcon_remote_resource_get_checking_interval() failed")); } - return common::TizenSuccess{picojson::value(static_cast(time_interval))}; } @@ -1145,10 +1144,7 @@ common::TizenResult IotconInstance::RemoteResourceSetTimeInterval(const picojson LogAndReturnTizenError(res, ("iotcon_remote_resource_set_checking_interval() failed")); } - // TODO Uncomment when the interface of the function iotcon_remote_resource_set_time_interval is changed - // return common::TizenSuccess{IotconClientManager::GetInstance().StoreRemoteResource(ptr)}; - - return common::TizenSuccess{}; + return common::TizenSuccess{IotconClientManager::GetInstance().StoreRemoteResource(ptr)}; } bool IotconInstance::ResourceFoundCallback(iotcon_remote_resource_h resource, -- 2.7.4 From f7a9babca1163854c8cd72d4ec0847fc029b71ae Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 30 Sep 2016 18:59:10 +0900 Subject: [PATCH 04/16] disable IotCon due to release schedule Change-Id: I97baa26895bd7d1e24bb3916cd80cfbaa11f5e1d --- packaging/webapi-plugins.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 88974a1..09c50af 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.37 +Version: 1.38 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries @@ -117,7 +117,7 @@ Source0: %{name}-%{version}.tar.gz %else %define tizen_feature_ham_support 0 %endif -%define tizen_feature_iotcon_support 1 +%define tizen_feature_iotcon_support 0 %define tizen_feature_location_batch 0 %define tizen_feature_key_manager_support 1 %define tizen_feature_media_controller_support 1 -- 2.7.4 From 2b6ee05e9d2cc5c062727eb09d6a9fa956470db9 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Fri, 30 Sep 2016 13:13:16 +0200 Subject: [PATCH 05/16] [Sensor] Fix for GyroscopeRotationVectorSensor. [Verification] Code compiles. TCT pass rate: wearable - 100% (97/97/0/0/0) mobile - 100% (93/93/0/0/0) Change-Id: Idd2c87a1fbbfc82af7807c86d6521bda9a9a4d84 Signed-off-by: Tomasz Marciniak --- src/sensor/sensor_api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sensor/sensor_api.js b/src/sensor/sensor_api.js index 9c810e8..f30b58d 100755 --- a/src/sensor/sensor_api.js +++ b/src/sensor/sensor_api.js @@ -552,7 +552,7 @@ GyroscopeSensor.prototype.getGyroscopeSensorData = function() { //// GyroscopeRotationVectorSensor var GyroscopeRotationVectorSensor = function(data) { - Sensor.call(this, SensorType.GYROSCOPE); + Sensor.call(this, SensorType.GYROSCOPE_ROTATION_VECTOR); }; GyroscopeRotationVectorSensor.prototype = new Sensor(); -- 2.7.4 From ae2abcd0e25f44bfd9b1e7a9dc950c5643c20ad0 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 30 Sep 2016 20:30:42 +0900 Subject: [PATCH 06/16] [version] 1.39 Change-Id: I82e04b1a1a569276806c0f63f974a75ad0bec514 --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 09c50af..6aba3c0 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.38 +Version: 1.39 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 4e08b69e81ae37ac18b6c60e7e50a6b6a4b9b4e8 Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Tue, 4 Oct 2016 11:43:00 +0200 Subject: [PATCH 07/16] [Filesystem] - update position and eof attributes of fileStream in read [Verification] - TCT results 100% Change-Id: If03b99e8b3ef0619f981353a096c1c5c414cabc8 Signed-off-by: Andrzej Popowski --- src/filesystem/js/file_stream.js | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/filesystem/js/file_stream.js b/src/filesystem/js/file_stream.js index 2036254..2abc68f 100644 --- a/src/filesystem/js/file_stream.js +++ b/src/filesystem/js/file_stream.js @@ -134,9 +134,17 @@ function read() { if (native_.isFailure(result)) { throw new WebAPIException(WebAPIException.IO_ERR, 'Could not read'); } - var encoded = native_.getResultObject(result); + var decoded = Base64.decodeString(native_.getResultObject(result)); + + if (decoded.length) { + can_change_size = true; + this.position += decoded.length; + can_change_size = false; + } else { + this.position += 1; // Set EOF + } - return Base64.decodeString(encoded); + return decoded; }; FileStream.prototype.read = function() { @@ -171,9 +179,18 @@ function readBytes() { if (native_.isFailure(result)) { throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Could not read'); } - var encoded = native_.getResultObject(result); - return Base64.decode(encoded); + var decoded = Base64.decode(native_.getResultObject(result)); + + if (decoded.length) { + can_change_size = true; + this.position += decoded.length; + can_change_size = false; + } else { + this.position += 1; // Set EOF + } + + return decoded; }; FileStream.prototype.readBytes = function() { @@ -221,6 +238,15 @@ function readBase64() { throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Could not read'); } var encoded = native_.getResultObject(result); + var decoded = Base64.decode(encoded); + + if (decoded.length) { + can_change_size = true; + this.position += decoded.length; + can_change_size = false; + } else { + this.position += 1; // Set EOF + } return encoded; }; @@ -338,6 +364,12 @@ function writeBase64() { if (native_.isFailure(result)) { throw new WebAPIException(WebAPIException.IO_ERR, 'Could not write'); } + + var decoded = Base64.decode(args.base64Data); + + can_change_size = true; + this.position += decoded.length; + can_change_size = false; }; FileStream.prototype.writeBase64 = function() { -- 2.7.4 From f29a412258da749b962729cf0062528f4526b901 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Tue, 4 Oct 2016 20:01:56 +0900 Subject: [PATCH 08/16] [version] 1.40 Change-Id: Iaf0f83e1764de4d53654b8fe945ed2f6457a39de --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 6aba3c0..98d6d90 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.39 +Version: 1.40 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 5100832f58eeab3ec280f5795a03a8d646347749 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Wed, 5 Oct 2016 13:42:53 +0200 Subject: [PATCH 09/16] [Content] Fix for crash in createThumbnail(). [Verification] Code compiles. Creating thumbnail does not cause crash. Success callback is called and callback id is correctly retrieved. Change-Id: I1094730ded85f57bb0088f2f088e50f45d675a95 Signed-off-by: Tomasz Marciniak --- src/content/content_manager.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/content/content_manager.cc b/src/content/content_manager.cc index bda7506..1f2b001 100644 --- a/src/content/content_manager.cc +++ b/src/content/content_manager.cc @@ -665,6 +665,10 @@ void CreateThumbnailCallback(media_content_error_e err, const char* path, void* LoggerD("Enter"); unsigned int* callbackId = (unsigned int*) user_data; + if (nullptr == callbackId) { + LoggerD("Callback id is null"); + return; + } if (!(ContentManager::getInstance()->getContentInstance())) { // There is not instance already @@ -1656,7 +1660,7 @@ common::PlatformResult ContentManager::createThumbnail(const picojson::value& ar ("Getting media is failed: %d (%s)", ret, get_error_message(ret))); } - ret = media_info_create_thumbnail(media, CreateThumbnailCallback, /* (void*) callbackId */ nullptr); + ret = media_info_create_thumbnail(media, CreateThumbnailCallback, (void*)callbackId); media_info_destroy(media); if(MEDIA_CONTENT_ERROR_NONE != ret) { delete callbackId; @@ -1664,8 +1668,6 @@ common::PlatformResult ContentManager::createThumbnail(const picojson::value& ar ("Creating thumbnail failed: %d (%s)", ret, get_error_message(ret))); } - delete callbackId; - return PlatformResult(ErrorCode::NO_ERROR); } -- 2.7.4 From afa492aad4d8908a3baea06d8f89dc275bed88d9 Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Wed, 5 Oct 2016 15:11:15 +0200 Subject: [PATCH 10/16] [WidgetService] - calling errorCallback on empty widget list Change-Id: Ib823e3693a2665b889effda57b28ad9011e491c9 Signed-off-by: Andrzej Popowski --- src/widgetservice/widgetservice_instance.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgetservice/widgetservice_instance.cc b/src/widgetservice/widgetservice_instance.cc index 00599f1..91a4759 100755 --- a/src/widgetservice/widgetservice_instance.cc +++ b/src/widgetservice/widgetservice_instance.cc @@ -227,6 +227,8 @@ TizenResult WidgetServiceInstance::GetWidgets(const picojson::object& args, if (WIDGET_ERROR_NONE > ret) { LoggerE("widget_service_get_widget_list() failed"); result = WidgetServiceUtils::ConvertErrorCode(ret); + } else if (array->empty()) { + result = WidgetServiceUtils::ConvertErrorCode(WIDGET_ERROR_NOT_EXIST); } else { result = TizenSuccess{response}; } -- 2.7.4 From 5ec6695b864ffecb4e55d30e9988c420c2cf1e2a Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Thu, 6 Oct 2016 10:38:41 +0900 Subject: [PATCH 11/16] [version] 1.41 Change-Id: I8892674c4b70b27ac931b2380ff204903298cf43 --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 98d6d90..6611194 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.40 +Version: 1.41 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From c6b7f70dd7b4c5a61bc6c721af31a965a640194a Mon Sep 17 00:00:00 2001 From: "jk.pu" Date: Fri, 7 Oct 2016 14:11:51 +0900 Subject: [PATCH 12/16] [WidgetService] fix getInstance error issue only negative ret value is error. positive value is instance count. Change-Id: I6fcd37209edcf6833693dd87ab6162d8a7d84363 Signed-off-by: jk.pu --- src/widgetservice/widgetservice_instance.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgetservice/widgetservice_instance.cc b/src/widgetservice/widgetservice_instance.cc index 91a4759..3832981 100755 --- a/src/widgetservice/widgetservice_instance.cc +++ b/src/widgetservice/widgetservice_instance.cc @@ -327,7 +327,7 @@ TizenResult WidgetServiceInstance::GetInstances(picojson::object const& args, co TizenResult result = TizenSuccess(); - if (WIDGET_ERROR_NONE != ret) { + if (WIDGET_ERROR_NONE != ret && ret < 0) { LoggerE("widget_service_get_widget_instance_list() failed"); result = WidgetServiceUtils::ConvertErrorCode(ret); } else { -- 2.7.4 From 1d1964fa4cc58592966520a8bee2f60a6542cb0c Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 7 Oct 2016 14:46:53 +0900 Subject: [PATCH 13/16] [version] 1.42 Change-Id: Iba4c50cc4c478ca31ad29557e64d087daec1b852 --- packaging/webapi-plugins.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 6611194..001bde7 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -10,7 +10,7 @@ %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} Name: webapi-plugins -Version: 1.41 +Version: 1.42 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From cc424855cb5fba3347d9b4af5d483ee22006ede5 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Mon, 10 Oct 2016 11:57:51 +0200 Subject: [PATCH 14/16] [SystemInfo] Added ADS property. [Verification] Code compiles. Change-Id: I16494361f81ab119d72d6a9c6602e966398a00a3 Signed-off-by: Tomasz Marciniak --- src/systeminfo/systeminfo_api.js | 18 ++++++++++++++++-- src/systeminfo/systeminfo_properties_manager.cc | 15 +++++++++++++++ src/systeminfo/systeminfo_properties_manager.h | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js index dad6383..d6b9634 100644 --- a/src/systeminfo/systeminfo_api.js +++ b/src/systeminfo/systeminfo_api.js @@ -42,7 +42,8 @@ var SystemInfoPropertyId = { SIM : 'SIM', PERIPHERAL : 'PERIPHERAL', MEMORY : 'MEMORY', - CAMERA_FLASH : 'CAMERA_FLASH' + CAMERA_FLASH : 'CAMERA_FLASH', + ADS : 'ADS' }; //class SystemInfoDeviceCapability //////////////////////////////////////////////////// @@ -708,6 +709,13 @@ function SystemInfoCameraFlash(data) { }); } +//class SystemInfoADS //////////////////////////////////////////////////// +function SystemInfoADS(data) { + Object.defineProperties(this, { + id : {value: data.id, writable: false, enumerable: true}, + }); +} + SystemInfoCameraFlash.prototype.setBrightness = function(brightness) { var args = validator_.validateArgs(arguments, [ {name: 'brightness', type: types_.DOUBLE} @@ -1197,7 +1205,13 @@ var _propertyContainer = { constructor : SystemInfoCameraFlash, broadcastFunction : _systeminfoCameraFlashListenerCallback, signalLabel : 'SystemInfoCameraFlashChangeBroadcast' - } + }, + 'ADS' : { + callbacks : {}, //adding callbacks for ADS is not possible + constructor : SystemInfoADS, + broadcastFunction : function(){}, + signalLabel : '' + } }; /// It common function to be called when listener would be triggered diff --git a/src/systeminfo/systeminfo_properties_manager.cc b/src/systeminfo/systeminfo_properties_manager.cc index 33b639d..8a0fef8 100644 --- a/src/systeminfo/systeminfo_properties_manager.cc +++ b/src/systeminfo/systeminfo_properties_manager.cc @@ -181,6 +181,8 @@ PlatformResult SysteminfoPropertiesManager::ReportProperty(const std::string& pr return ReportMemory(res_obj); } else if ("CAMERA_FLASH" == property) { return ReportCameraFlash(res_obj, index); + } else if ("ADS" == property) { + return ReportAds(res_obj); } return LogAndCreateResult( ErrorCode::NOT_SUPPORTED_ERR, "Property with given id is not supported"); @@ -1229,6 +1231,19 @@ PlatformResult SysteminfoPropertiesManager::ReportCameraFlash(picojson::object* return PlatformResult(ErrorCode::NO_ERROR); } +/// ADS +PlatformResult SysteminfoPropertiesManager::ReportAds(picojson::object* out) { + LoggerD("Entered"); + std::string ads_id = ""; + PlatformResult ret = SysteminfoUtils::GetRuntimeInfoString( + SYSTEM_SETTINGS_KEY_ADS_ID, &ads_id); + if (ret.IsError()) { + return ret; + } + + out->insert(std::make_pair("id", picojson::value(ads_id))); + return PlatformResult(ErrorCode::NO_ERROR); +} } // namespace systeminfo } // namespace webapi diff --git a/src/systeminfo/systeminfo_properties_manager.h b/src/systeminfo/systeminfo_properties_manager.h index c18078a..d16116f 100644 --- a/src/systeminfo/systeminfo_properties_manager.h +++ b/src/systeminfo/systeminfo_properties_manager.h @@ -53,6 +53,7 @@ class SysteminfoPropertiesManager { common::PlatformResult ReportCameraFlash(picojson::object* out, unsigned long count); common::PlatformResult ReportMemory(picojson::object* out); common::PlatformResult ReportStorage(picojson::object* out); + common::PlatformResult ReportAds(picojson::object* out); common::PlatformResult FetchIsAutoRotation(bool* result); common::PlatformResult FetchStatus(std::string* result); -- 2.7.4 From 19269471e7a640c476812384f9af22e1cca8bec8 Mon Sep 17 00:00:00 2001 From: Jeongkyun Pu Date: Tue, 11 Oct 2016 21:07:07 -0700 Subject: [PATCH 15/16] Revert "[SystemInfo] Added ADS property." Native ACR is no completed. this make build error. This reverts commit cc424855cb5fba3347d9b4af5d483ee22006ede5. Change-Id: I7248dc2ed7944a23cd62c3a1d9adf37516568825 --- src/systeminfo/systeminfo_api.js | 18 ++---------------- src/systeminfo/systeminfo_properties_manager.cc | 15 --------------- src/systeminfo/systeminfo_properties_manager.h | 1 - 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js index d6b9634..dad6383 100644 --- a/src/systeminfo/systeminfo_api.js +++ b/src/systeminfo/systeminfo_api.js @@ -42,8 +42,7 @@ var SystemInfoPropertyId = { SIM : 'SIM', PERIPHERAL : 'PERIPHERAL', MEMORY : 'MEMORY', - CAMERA_FLASH : 'CAMERA_FLASH', - ADS : 'ADS' + CAMERA_FLASH : 'CAMERA_FLASH' }; //class SystemInfoDeviceCapability //////////////////////////////////////////////////// @@ -709,13 +708,6 @@ function SystemInfoCameraFlash(data) { }); } -//class SystemInfoADS //////////////////////////////////////////////////// -function SystemInfoADS(data) { - Object.defineProperties(this, { - id : {value: data.id, writable: false, enumerable: true}, - }); -} - SystemInfoCameraFlash.prototype.setBrightness = function(brightness) { var args = validator_.validateArgs(arguments, [ {name: 'brightness', type: types_.DOUBLE} @@ -1205,13 +1197,7 @@ var _propertyContainer = { constructor : SystemInfoCameraFlash, broadcastFunction : _systeminfoCameraFlashListenerCallback, signalLabel : 'SystemInfoCameraFlashChangeBroadcast' - }, - 'ADS' : { - callbacks : {}, //adding callbacks for ADS is not possible - constructor : SystemInfoADS, - broadcastFunction : function(){}, - signalLabel : '' - } + } }; /// It common function to be called when listener would be triggered diff --git a/src/systeminfo/systeminfo_properties_manager.cc b/src/systeminfo/systeminfo_properties_manager.cc index 8a0fef8..33b639d 100644 --- a/src/systeminfo/systeminfo_properties_manager.cc +++ b/src/systeminfo/systeminfo_properties_manager.cc @@ -181,8 +181,6 @@ PlatformResult SysteminfoPropertiesManager::ReportProperty(const std::string& pr return ReportMemory(res_obj); } else if ("CAMERA_FLASH" == property) { return ReportCameraFlash(res_obj, index); - } else if ("ADS" == property) { - return ReportAds(res_obj); } return LogAndCreateResult( ErrorCode::NOT_SUPPORTED_ERR, "Property with given id is not supported"); @@ -1231,19 +1229,6 @@ PlatformResult SysteminfoPropertiesManager::ReportCameraFlash(picojson::object* return PlatformResult(ErrorCode::NO_ERROR); } -/// ADS -PlatformResult SysteminfoPropertiesManager::ReportAds(picojson::object* out) { - LoggerD("Entered"); - std::string ads_id = ""; - PlatformResult ret = SysteminfoUtils::GetRuntimeInfoString( - SYSTEM_SETTINGS_KEY_ADS_ID, &ads_id); - if (ret.IsError()) { - return ret; - } - - out->insert(std::make_pair("id", picojson::value(ads_id))); - return PlatformResult(ErrorCode::NO_ERROR); -} } // namespace systeminfo } // namespace webapi diff --git a/src/systeminfo/systeminfo_properties_manager.h b/src/systeminfo/systeminfo_properties_manager.h index d16116f..c18078a 100644 --- a/src/systeminfo/systeminfo_properties_manager.h +++ b/src/systeminfo/systeminfo_properties_manager.h @@ -53,7 +53,6 @@ class SysteminfoPropertiesManager { common::PlatformResult ReportCameraFlash(picojson::object* out, unsigned long count); common::PlatformResult ReportMemory(picojson::object* out); common::PlatformResult ReportStorage(picojson::object* out); - common::PlatformResult ReportAds(picojson::object* out); common::PlatformResult FetchIsAutoRotation(bool* result); common::PlatformResult FetchStatus(std::string* result); -- 2.7.4 From 5033f6073d7727792bba405f51ac2b82bf24efd3 Mon Sep 17 00:00:00 2001 From: Jeongkyun Pu Date: Mon, 17 Oct 2016 23:51:29 -0700 Subject: [PATCH 16/16] [SystemInfo] Added ADS property. This reverts commit 19269471e7a640c476812384f9af22e1cca8bec8. Change-Id: If3a876c71aff92dc4856007dfe99fa185125cdd7 --- src/systeminfo/systeminfo_api.js | 18 ++++++++++++++++-- src/systeminfo/systeminfo_properties_manager.cc | 15 +++++++++++++++ src/systeminfo/systeminfo_properties_manager.h | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/systeminfo/systeminfo_api.js b/src/systeminfo/systeminfo_api.js index dad6383..d6b9634 100644 --- a/src/systeminfo/systeminfo_api.js +++ b/src/systeminfo/systeminfo_api.js @@ -42,7 +42,8 @@ var SystemInfoPropertyId = { SIM : 'SIM', PERIPHERAL : 'PERIPHERAL', MEMORY : 'MEMORY', - CAMERA_FLASH : 'CAMERA_FLASH' + CAMERA_FLASH : 'CAMERA_FLASH', + ADS : 'ADS' }; //class SystemInfoDeviceCapability //////////////////////////////////////////////////// @@ -708,6 +709,13 @@ function SystemInfoCameraFlash(data) { }); } +//class SystemInfoADS //////////////////////////////////////////////////// +function SystemInfoADS(data) { + Object.defineProperties(this, { + id : {value: data.id, writable: false, enumerable: true}, + }); +} + SystemInfoCameraFlash.prototype.setBrightness = function(brightness) { var args = validator_.validateArgs(arguments, [ {name: 'brightness', type: types_.DOUBLE} @@ -1197,7 +1205,13 @@ var _propertyContainer = { constructor : SystemInfoCameraFlash, broadcastFunction : _systeminfoCameraFlashListenerCallback, signalLabel : 'SystemInfoCameraFlashChangeBroadcast' - } + }, + 'ADS' : { + callbacks : {}, //adding callbacks for ADS is not possible + constructor : SystemInfoADS, + broadcastFunction : function(){}, + signalLabel : '' + } }; /// It common function to be called when listener would be triggered diff --git a/src/systeminfo/systeminfo_properties_manager.cc b/src/systeminfo/systeminfo_properties_manager.cc index 33b639d..8a0fef8 100644 --- a/src/systeminfo/systeminfo_properties_manager.cc +++ b/src/systeminfo/systeminfo_properties_manager.cc @@ -181,6 +181,8 @@ PlatformResult SysteminfoPropertiesManager::ReportProperty(const std::string& pr return ReportMemory(res_obj); } else if ("CAMERA_FLASH" == property) { return ReportCameraFlash(res_obj, index); + } else if ("ADS" == property) { + return ReportAds(res_obj); } return LogAndCreateResult( ErrorCode::NOT_SUPPORTED_ERR, "Property with given id is not supported"); @@ -1229,6 +1231,19 @@ PlatformResult SysteminfoPropertiesManager::ReportCameraFlash(picojson::object* return PlatformResult(ErrorCode::NO_ERROR); } +/// ADS +PlatformResult SysteminfoPropertiesManager::ReportAds(picojson::object* out) { + LoggerD("Entered"); + std::string ads_id = ""; + PlatformResult ret = SysteminfoUtils::GetRuntimeInfoString( + SYSTEM_SETTINGS_KEY_ADS_ID, &ads_id); + if (ret.IsError()) { + return ret; + } + + out->insert(std::make_pair("id", picojson::value(ads_id))); + return PlatformResult(ErrorCode::NO_ERROR); +} } // namespace systeminfo } // namespace webapi diff --git a/src/systeminfo/systeminfo_properties_manager.h b/src/systeminfo/systeminfo_properties_manager.h index c18078a..d16116f 100644 --- a/src/systeminfo/systeminfo_properties_manager.h +++ b/src/systeminfo/systeminfo_properties_manager.h @@ -53,6 +53,7 @@ class SysteminfoPropertiesManager { common::PlatformResult ReportCameraFlash(picojson::object* out, unsigned long count); common::PlatformResult ReportMemory(picojson::object* out); common::PlatformResult ReportStorage(picojson::object* out); + common::PlatformResult ReportAds(picojson::object* out); common::PlatformResult FetchIsAutoRotation(bool* result); common::PlatformResult FetchStatus(std::string* result); -- 2.7.4