From 5ec6695b864ffecb4e55d30e9988c420c2cf1e2a Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Thu, 6 Oct 2016 10:38:41 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 b35c1c57c2fa43046ac09dfb94efbc43587970fa Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Tue, 11 Oct 2016 18:10:03 +0900 Subject: [PATCH 05/16] replace product.h with internal.h Change-Id: Ibcef05c7862adba0cf17e885cc27fb90eeed0a17 --- src/playerutil/playerutil_utils.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playerutil/playerutil_utils.h b/src/playerutil/playerutil_utils.h index ad31e3f..50c13d1 100644 --- a/src/playerutil/playerutil_utils.h +++ b/src/playerutil/playerutil_utils.h @@ -19,7 +19,8 @@ #include -#include +#include +#include #include "common/tizen_instance.h" #include "common/tizen_result.h" -- 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 06/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 f499ef8df7d470169a7c94e58045a1717a5e798f Mon Sep 17 00:00:00 2001 From: "jk.pu" Date: Wed, 12 Oct 2016 13:12:09 +0900 Subject: [PATCH 07/16] [widgetservice] fix bug in Widget.addStateChangeListener, wrong parameters Change-Id: I85aa9b41f68430f113d1b50ed9a026313e88045f Signed-off-by: jk.pu --- packaging/webapi-plugins.spec | 2 +- src/widgetservice/widgetservice_api.js | 6 +++--- src/widgetservice/widgetservice_instance.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 src/widgetservice/widgetservice_api.js mode change 100755 => 100644 src/widgetservice/widgetservice_instance.cc diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 001bde7..23d63b8 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.42 +Version: 1.43 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries diff --git a/src/widgetservice/widgetservice_api.js b/src/widgetservice/widgetservice_api.js old mode 100755 new mode 100644 index fa358f4..e043c96 --- a/src/widgetservice/widgetservice_api.js +++ b/src/widgetservice/widgetservice_api.js @@ -110,7 +110,7 @@ function WidgetInstance(data, widget) { enumerable: true }, id: { - value: data.id, + value: data, writable: false, enumerable: true }, @@ -326,7 +326,7 @@ function ListenerManager(native, listenerName) { ListenerManager.prototype.onListenerCalled = function(msg) { for (var watchId in this.listeners) { - if (this.listeners.hasOwnProperty(watchId) && this.listeners[watchId][msg.action]) { + if (this.listeners.hasOwnProperty(watchId) ) { this.listeners[watchId](this.native.getResultObject(msg)); } } @@ -369,7 +369,7 @@ Widget.prototype.addStateChangeListener = function() { var func = function(msg) { if (msg.widgetId === this.id) { - args.eventCallback(msg.instanceId, msg.event); + args.eventCallback(new WidgetInstance(msg, this), msg.event); } }.bind(this); diff --git a/src/widgetservice/widgetservice_instance.cc b/src/widgetservice/widgetservice_instance.cc old mode 100755 new mode 100644 index 3832981..c3c56c3 --- a/src/widgetservice/widgetservice_instance.cc +++ b/src/widgetservice/widgetservice_instance.cc @@ -125,7 +125,7 @@ int WidgetLifecycleCb(const char* widget_id, widget_lifecycle_event_e lifecycle_ auto& obj = response.get(); obj.insert(std::make_pair(kWidgetId, picojson::value(widget_id))); - obj.insert(std::make_pair(kInstanceId, picojson::value(widget_instance_id))); + obj.insert(std::make_pair(kId, picojson::value(widget_instance_id))); obj.insert(std::make_pair(kEvent, picojson::value(WidgetServiceUtils::FromEventType(lifecycle_event)))); instance->CallWidgetLifecycleListener(widget_id, response); -- 2.7.4 From d6bf83aec01343e1a1021abcbdcb26fb66415516 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Wed, 12 Oct 2016 20:02:23 +0900 Subject: [PATCH 08/16] [version] 1.44 Change-Id: Ie3f4f6c2e7bb3d87d43d889f3494d053dbd6be30 --- 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 23d63b8..08e406a 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.43 +Version: 1.44 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 23a3bf575344a3aeb00bb8e0d54500671e0121af Mon Sep 17 00:00:00 2001 From: Jeongkyun Pu Date: Wed, 12 Oct 2016 08:24:14 -0700 Subject: [PATCH 09/16] Revert "replace product.h with internal.h" This reverts commit b35c1c57c2fa43046ac09dfb94efbc43587970fa. Change-Id: I6d6e43ee6d08ee587ecc39394770aeb8fb8355ca --- src/playerutil/playerutil_utils.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/playerutil/playerutil_utils.h b/src/playerutil/playerutil_utils.h index 50c13d1..ad31e3f 100644 --- a/src/playerutil/playerutil_utils.h +++ b/src/playerutil/playerutil_utils.h @@ -19,8 +19,7 @@ #include -#include -#include +#include #include "common/tizen_instance.h" #include "common/tizen_result.h" -- 2.7.4 From 103a188e57ce3cda0e9ba68b13255e6584005061 Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Wed, 12 Oct 2016 16:55:24 +0200 Subject: [PATCH 10/16] [WidgetService] - Fixing addChangeStateListener crash Change-Id: Id8cd5505b3809b1902f836465bcc2ae1f4f65e1f Signed-off-by: Andrzej Popowski Signed-off-by: jk.pu --- src/widgetservice/widgetservice_api.js | 2 +- src/widgetservice/widgetservice_instance.cc | 51 +++++++++++++++++++---------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/src/widgetservice/widgetservice_api.js b/src/widgetservice/widgetservice_api.js index e043c96..0ec0275 100644 --- a/src/widgetservice/widgetservice_api.js +++ b/src/widgetservice/widgetservice_api.js @@ -110,7 +110,7 @@ function WidgetInstance(data, widget) { enumerable: true }, id: { - value: data, + value: data.id, writable: false, enumerable: true }, diff --git a/src/widgetservice/widgetservice_instance.cc b/src/widgetservice/widgetservice_instance.cc index c3c56c3..a37ac19 100644 --- a/src/widgetservice/widgetservice_instance.cc +++ b/src/widgetservice/widgetservice_instance.cc @@ -99,7 +99,9 @@ int WidgetInstanceCb(const char* widget_id, const char* instance_id, void* data) return WIDGET_ERROR_NONE; } - array->push_back(picojson::value(instance_id)); + picojson::object obj; + obj.insert(std::make_pair(kId, picojson::value(instance_id))); + array->push_back(picojson::value(obj)); return WIDGET_ERROR_NONE; } @@ -109,7 +111,7 @@ int WidgetLifecycleCb(const char* widget_id, widget_lifecycle_event_e lifecycle_ ScopeLogger(); //WIDGET_LIFE_CYCLE_EVENT_MAX event is not supported - if (WIDGET_LIFE_CYCLE_EVENT_RESUME < lifecycle_event) { + if (WIDGET_LIFE_CYCLE_EVENT_RESUME < lifecycle_event || WIDGET_LIFE_CYCLE_EVENT_APP_DEAD == lifecycle_event) { LoggerW("Unknown event type"); return WIDGET_ERROR_NONE; } @@ -124,8 +126,18 @@ int WidgetLifecycleCb(const char* widget_id, widget_lifecycle_event_e lifecycle_ picojson::value response = picojson::value(picojson::object()); auto& obj = response.get(); - obj.insert(std::make_pair(kWidgetId, picojson::value(widget_id))); - obj.insert(std::make_pair(kId, picojson::value(widget_instance_id))); + if (widget_id) { + obj.insert(std::make_pair(kWidgetId, picojson::value(widget_id))); + } else { + obj.insert(std::make_pair(kWidgetId, picojson::value(""))); + } + + if (widget_instance_id) { + obj.insert(std::make_pair(kId, picojson::value(widget_instance_id))); + } else { + obj.insert(std::make_pair(kId, picojson::value(""))); + } + obj.insert(std::make_pair(kEvent, picojson::value(WidgetServiceUtils::FromEventType(lifecycle_event)))); instance->CallWidgetLifecycleListener(widget_id, response); @@ -133,6 +145,12 @@ int WidgetLifecycleCb(const char* widget_id, widget_lifecycle_event_e lifecycle_ return WIDGET_ERROR_NONE; } +void bundleIterator(const char *key, const char *val, void *data) { + LOGD("Entered, adding key-pair value: (%s) - (%s)", key, val); + auto obj = static_cast(data); + obj->insert(std::make_pair(key, picojson::value(val))); +} + } // namespace WidgetServiceInstance::WidgetServiceInstance() { @@ -515,6 +533,11 @@ TizenResult WidgetServiceInstance::ChangeUpdatePeriod(picojson::object const& ar const auto& instance_id = args.find(kInstanceId)->second.get(); const double seconds = args.find(kSeconds)->second.get(); + if(seconds <= 0){ + int err = WIDGET_ERROR_INVALID_PARAMETER; + LogAndReturnTizenError(common::InvalidValuesError(err), ("period second should be greater than zero")); + } + int ret = widget_service_change_period(widget_id.c_str(), instance_id.c_str(), seconds); if (WIDGET_ERROR_NONE != ret) { @@ -592,22 +615,16 @@ TizenResult WidgetServiceInstance::GetContent(picojson::object const& args, cons return; } - char* data_str = nullptr; - ret = bundle_get_str(bundle_data, kData.c_str(), &data_str); - if (BUNDLE_ERROR_NONE != ret) { - LoggerE("bundle_get_str() failed"); - this->Post(token, common::AbortError(ret)); + picojson::value response = picojson::value(picojson::object()); + auto& obj = response.get(); + if (!bundle_data) { + LoggerE("bundle_data is null"); + obj.insert(std::make_pair("", picojson::value(""))); + this->Post(token, TizenSuccess{response}); return; } - picojson::value response; - std::string err; - picojson::parse(response, data_str, data_str + strlen(data_str), &err); - if (!err.empty()) { - LoggerE("Failed to parse bundle data() failed [%s]", err.c_str()); - this->Post(token, common::AbortError()); - return; - } + bundle_iterate(bundle_data, bundleIterator, &obj); this->Post(token, TizenSuccess{response}); }; -- 2.7.4 From ecd5e3c524104afe68fc81df276ad6c0f72d83a0 Mon Sep 17 00:00:00 2001 From: Jeongkyun Pu Date: Thu, 13 Oct 2016 18:11:40 -0700 Subject: [PATCH 11/16] replace product.h with internal.h This reverts commit 23a3bf575344a3aeb00bb8e0d54500671e0121af. Change-Id: I8c9becc5218e84746674762424a96a01f8e450c1 --- src/playerutil/playerutil_utils.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playerutil/playerutil_utils.h b/src/playerutil/playerutil_utils.h index ad31e3f..50c13d1 100644 --- a/src/playerutil/playerutil_utils.h +++ b/src/playerutil/playerutil_utils.h @@ -19,7 +19,8 @@ #include -#include +#include +#include #include "common/tizen_instance.h" #include "common/tizen_result.h" -- 2.7.4 From af213f50ef98b8dc6d44013a60dfee7fd893c056 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 14 Oct 2016 13:56:53 +0900 Subject: [PATCH 12/16] [version] 1.45 Change-Id: I1f7a5570c35e4cb00c060da6bdf0cdbc69d6a0b2 --- 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 08e406a..da94165 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.44 +Version: 1.45 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 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 13/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 From 6683a609ceaec6731a4bba8a6d5ed8f76c247140 Mon Sep 17 00:00:00 2001 From: Mateusz Bruno-Kaminski Date: Wed, 19 Oct 2016 12:22:57 +0200 Subject: [PATCH 14/16] [Spec file] Missing files in devel package [Details] Added plugins.json and *.so files into devel package. Change-Id: I15a0812ee75a8f920ef4f9040a72ddec96f2b9cc Signed-off-by: Mateusz Bruno-Kaminski --- packaging/webapi-plugins.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index da94165..f0223eb 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -652,3 +652,5 @@ install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/plugins. %files devel %{_includedir}/* %{_libdir}/pkgconfig/* +%{crosswalk_extensions_path}/libtizen*.so +%{crosswalk_extensions_path}/plugins.json -- 2.7.4 From 44bca676d0fb46bafe4789a27e37824e663d4c33 Mon Sep 17 00:00:00 2001 From: "jk.pu" Date: Tue, 25 Oct 2016 20:07:07 +0900 Subject: [PATCH 15/16] [iotcon] fix fail to retrieve platform info if some device or platform value is null . it return error callback. fix to return empty string. Change-Id: I9eb890d752055a0e4e664b345bb8b237b3e06c24 Signed-off-by: jk.pu --- src/iotcon/iotcon_utils.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/iotcon/iotcon_utils.cc b/src/iotcon/iotcon_utils.cc index fce0426..9624049 100644 --- a/src/iotcon/iotcon_utils.cc +++ b/src/iotcon/iotcon_utils.cc @@ -1783,11 +1783,13 @@ common::TizenResult IotconUtils::PlatformInfoGetProperty(iotcon_platform_info_h &property)); if (!result) { LogAndReturnTizenError(result, ("iotcon_platform_info_get_property() failed")); - } else if (!property) { - // TODO check if it should be an error or rather it should be ignored and used some default value - LogAndReturnTizenError(common::AbortError("iotcon_platform_info_get_property() returned no result")); } - out->insert(std::make_pair(name, picojson::value{property})); + + if (!property) { + out->insert(std::make_pair(name, picojson::value{""})); + }else{ + out->insert(std::make_pair(name, picojson::value{property})); + } return TizenSuccess(); } @@ -1907,10 +1909,15 @@ common::TizenResult IotconUtils::DeviceInfoGetProperty(iotcon_device_info_h devi auto result = ConvertIotconError(iotcon_device_info_get_property(device, property_e, &property)); - if (!result || !property) { + if (!result ) { LogAndReturnTizenError(result, ("iotcon_device_info_get_property() failed")); } - out->insert(std::make_pair(name, picojson::value{property})); + + if (!property) { + out->insert(std::make_pair(name, picojson::value{""})); + }else{ + out->insert(std::make_pair(name, picojson::value{property})); + } return TizenSuccess(); } -- 2.7.4 From 8c58cbf864edeceae93563318b3300c1f43f4ce9 Mon Sep 17 00:00:00 2001 From: "jk.pu" Date: Wed, 26 Oct 2016 17:53:16 +0900 Subject: [PATCH 16/16] [iotcon] enable iotcon at mobile/wearable/tv profile. Change-Id: I32409bad5fc13118b9fa10d61e34ea520e8ad4d1 Signed-off-by: jk.pu --- packaging/webapi-plugins.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index f0223eb..09df259 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.45 +Version: 1.46 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 0 +%define tizen_feature_iotcon_support 1 %define tizen_feature_location_batch 0 %define tizen_feature_key_manager_support 1 %define tizen_feature_media_controller_support 1 @@ -225,7 +225,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_filesystem_support 1 %define tizen_feature_fm_radio_support 0 %define tizen_feature_ham_support 1 -%define tizen_feature_iotcon_support 0 +%define tizen_feature_iotcon_support 1 %define tizen_feature_location_batch 0 %define tizen_feature_media_controller_support 1 @@ -314,7 +314,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_filesystem_support 1 %define tizen_feature_fm_radio_support 0 %define tizen_feature_ham_support 0 -%define tizen_feature_iotcon_support 0 +%define tizen_feature_iotcon_support 1 %define tizen_feature_key_manager_support 1 %define tizen_feature_media_controller_support 0 %define tizen_feature_media_key_support 1 -- 2.7.4