From 4cb7aa3a45e39da36b893f315a8bcb23e1c4b155 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Wed, 6 Jul 2016 21:23:45 +0900 Subject: [PATCH 01/16] [version] 1.10 Change-Id: Ifca8f412246799facf60de7c52df741d65ac5d0e --- 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 2e9adad..1080859 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.9 +Version: 1.10 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 51fbc9e1c98647f5a1ae5bd56d9506bda42fde0f Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Thu, 7 Jul 2016 09:49:32 +0200 Subject: [PATCH 02/16] [Filesystem][Systeminfo] Changed storage handling [Feature] Deviced is used for handling only removable devices, internal storages are handled with storage api. [Verification] Code compiles without error. TCT for filesystem, systeminfo and archive 100% passrate (Auto and Manual) Change-Id: If5609ff4f22383efd018a445f6a56760983b9818 Signed-off-by: Piotr Kosko --- src/common/filesystem/filesystem_provider.cc | 5 ---- src/common/filesystem/filesystem_provider.h | 2 -- .../filesystem/filesystem_provider_deviced.cc | 14 ++++++----- .../filesystem/filesystem_provider_deviced.h | 1 - .../filesystem/filesystem_provider_storage.cc | 28 ++++----------------- .../filesystem/filesystem_provider_storage.h | 2 -- src/systeminfo/systeminfo_properties_manager.cc | 29 ++++++++-------------- 7 files changed, 23 insertions(+), 58 deletions(-) diff --git a/src/common/filesystem/filesystem_provider.cc b/src/common/filesystem/filesystem_provider.cc index 7cb6c1a..ff6c26e 100644 --- a/src/common/filesystem/filesystem_provider.cc +++ b/src/common/filesystem/filesystem_provider.cc @@ -71,11 +71,6 @@ VirtualStorages FilesystemProvider::GetAllStorages() { return provider_.GetAllStorages(); } -std::shared_ptr< Storage > FilesystemProvider::GetInternalStorage(){ - LoggerD("Entered"); - return provider_.GetInternalStorage(); -} - std::string FilesystemProvider::GetRealPath( const std::string& path_or_uri) { LoggerD("Entered"); diff --git a/src/common/filesystem/filesystem_provider.h b/src/common/filesystem/filesystem_provider.h index 69030d5..1b3dd92 100644 --- a/src/common/filesystem/filesystem_provider.h +++ b/src/common/filesystem/filesystem_provider.h @@ -36,7 +36,6 @@ class IFilesystemProvider { virtual Storages GetStorages() = 0; virtual VirtualRoots GetVirtualPaths() = 0; virtual VirtualStorages GetAllStorages() = 0; - virtual std::shared_ptr GetInternalStorage() = 0; }; typedef IFilesystemProvider& FilesystemProviderRef; @@ -52,7 +51,6 @@ class FilesystemProvider { Storages GetStorages(); VirtualRoots GetVirtualPaths(); VirtualStorages GetAllStorages(); - std::shared_ptr GetInternalStorage(); std::string GetRealPath(const std::string& path_or_uri); std::string GetVirtualPath(const std::string& real_path) const; diff --git a/src/common/filesystem/filesystem_provider_deviced.cc b/src/common/filesystem/filesystem_provider_deviced.cc index cf6a7ad..81bb570 100644 --- a/src/common/filesystem/filesystem_provider_deviced.cc +++ b/src/common/filesystem/filesystem_provider_deviced.cc @@ -195,10 +195,6 @@ void FilesystemProviderDeviced::UnregisterDeviceChangeState() { device_changed_callback_ = nullptr; } -std::shared_ptr FilesystemProviderDeviced::GetInternalStorage() { - return virtual_roots_provider_.GetInternalStorage(); -} - std::shared_ptr FilesystemProviderDeviced::GetStorage(const DeviceListElem& elem) { LoggerD("Entered"); return std::make_shared(GetIdFromUUID(elem.fs_uuid_enc), @@ -230,7 +226,6 @@ int FilesystemProviderDeviced::GetIdFromUUID(const char* const char_uuid) { Storages FilesystemProviderDeviced::GetStorages() { LoggerD("Entered"); - if(!is_initialized_) { LoggerE("DeviceD Core api not initialized"); return Storages(); @@ -253,7 +248,14 @@ Storages FilesystemProviderDeviced::GetStorages() { LoggerE("Failed to call GetDeviceList method - %s", message.c_str()); return Storages(); } - return GetStoragesFromGVariant(variant); + // internal storages are gathered with storage api + Storages internal = virtual_roots_provider_.GetStorages(); + // external storages are gathered using deviced implementation + Storages result = GetStoragesFromGVariant(variant); + + // merging internal and external results together, but internal on the beginning + result.insert(result.begin(), internal.begin(), internal.end()); + return result; } Storages FilesystemProviderDeviced::GetStoragesFromGVariant(GVariant* variant) { diff --git a/src/common/filesystem/filesystem_provider_deviced.h b/src/common/filesystem/filesystem_provider_deviced.h index bae0ea5..388e6c5 100644 --- a/src/common/filesystem/filesystem_provider_deviced.h +++ b/src/common/filesystem/filesystem_provider_deviced.h @@ -44,7 +44,6 @@ class FilesystemProviderDeviced : public IFilesystemProvider { virtual VirtualRoots GetVirtualPaths(); virtual Storages GetStorages(); virtual VirtualStorages GetAllStorages(); - virtual std::shared_ptr< Storage > GetInternalStorage(); static FilesystemProviderDeviced& Create(); private: diff --git a/src/common/filesystem/filesystem_provider_storage.cc b/src/common/filesystem/filesystem_provider_storage.cc index d58d644..a26cc3f 100644 --- a/src/common/filesystem/filesystem_provider_storage.cc +++ b/src/common/filesystem/filesystem_provider_storage.cc @@ -90,22 +90,10 @@ bool OnForeachStorage(int storage_id, storage_type_e type, FilesystemProviderStorage* provider = static_cast(user_data); - int err = storage_set_state_changed_cb(storage_id, OnStorageChange, provider); - if (STORAGE_ERROR_NONE != err) { - LoggerW("Failed to add listener"); - } - - StorageType type_ = - type == STORAGE_TYPE_INTERNAL ? - StorageType::kInternal : StorageType::kMmc; - - provider->AddStorage( - std::make_shared(storage_id, type_, TranslateCoreStorageState(state), path)); - if (type_ == StorageType::kInternal) { - // TODO check internal storage - //provider->internal_storage_ = std::make_shared(Storage(storage_id, type_, state_, path, kVirtualRootMedia)); - // if internal storage is supported, we can add also virtual paths: - // downloads, documents etc + // handling only internal storages (external are handled with deviced api) + if (STORAGE_TYPE_INTERNAL == type) { + provider->AddStorage( + std::make_shared(storage_id, StorageType::kInternal, TranslateCoreStorageState(state), path)); provider->FillVirtualPaths(storage_id); } return true; @@ -119,8 +107,7 @@ DeviceChangeStateFun FilesystemProviderStorage::GetListener() { return listener_; } -FilesystemProviderStorage::FilesystemProviderStorage() : - internal_storage_(nullptr) { +FilesystemProviderStorage::FilesystemProviderStorage() { LoggerD("Entered"); int err = storage_foreach_device_supported(OnForeachStorage, this); if (err != STORAGE_ERROR_NONE) { @@ -209,11 +196,6 @@ std::string FilesystemProviderStorage::GetRealPath( return realpath; } -std::shared_ptr< Storage > FilesystemProviderStorage::GetInternalStorage(){ - LoggerD("Entered"); - return internal_storage_; -} - std::string FilesystemProviderStorage::GetVirtualPath( const std::string& real_path) const { LoggerD("Enter"); diff --git a/src/common/filesystem/filesystem_provider_storage.h b/src/common/filesystem/filesystem_provider_storage.h index 133f801..2198200 100644 --- a/src/common/filesystem/filesystem_provider_storage.h +++ b/src/common/filesystem/filesystem_provider_storage.h @@ -35,7 +35,6 @@ class FilesystemProviderStorage : public IFilesystemProvider { virtual Storages GetStorages(); virtual VirtualRoots GetVirtualPaths(); virtual VirtualStorages GetAllStorages(); - virtual std::shared_ptr< Storage > GetInternalStorage(); std::string GetRealPath(const std::string& path_or_uri); std::string GetVirtualPath(const std::string& real_path) const; @@ -54,7 +53,6 @@ class FilesystemProviderStorage : public IFilesystemProvider { DeviceChangeStateFun listener_; Storages storages_; VirtualRoots virtual_paths_; - std::shared_ptr internal_storage_; }; } // namespace common diff --git a/src/systeminfo/systeminfo_properties_manager.cc b/src/systeminfo/systeminfo_properties_manager.cc index 94b4fa5..33b639d 100644 --- a/src/systeminfo/systeminfo_properties_manager.cc +++ b/src/systeminfo/systeminfo_properties_manager.cc @@ -1167,6 +1167,8 @@ static void CreateStorageInfo(const std::string& type, struct statfs& fs, picojs static std::string FromStorageTypeToStringType(common::StorageType type) { switch(type) { + case common::StorageType::kInternal: + return kTypeInternal; case common::StorageType::kUsbDevice: return kTypeUsbDevice; case common::StorageType::kUsbHost: @@ -1185,18 +1187,7 @@ PlatformResult SysteminfoPropertiesManager::ReportStorage(picojson::object* out) picojson::value result = picojson::value(picojson::array()); picojson::array& array = result.get(); - // handling internal storage - array.push_back(picojson::value(picojson::object())); - picojson::object& internal_obj = array.back().get(); - - if (statfs(kStorageInternalPath.c_str(), &fs) < 0) { - return LogAndCreateResult( - ErrorCode::UNKNOWN_ERR, "There are no storage units detected"); - } - CreateStorageInfo(kTypeInternal, fs, &internal_obj); - manager_.SetAvailableCapacityInternal(fs.f_bavail); - - // handling external storages + // handling storages from provider common::FilesystemProvider& provider(common::FilesystemProvider::Create()); auto storages = provider.GetStorages(); LoggerD("Storages found %d", storages.size()); @@ -1209,13 +1200,13 @@ PlatformResult SysteminfoPropertiesManager::ReportStorage(picojson::object* out) array.push_back(picojson::value(picojson::object())); picojson::object& external_obj = array.back().get(); CreateStorageInfo(FromStorageTypeToStringType(storage->type()), fs, &external_obj); -#ifdef TIZEN_TV - // TODO some tracking of available capacity of usb storages should be applied -#else - // Only one storage would be tracked, if more than one SD card would be supported on device - // different mechanism should be applied - manager_.SetAvailableCapacityMmc(fs.f_bavail); -#endif + + //TODO change implementation to support all types of storages and not limited number + if (common::StorageType::kInternal == storage->type()) { + manager_.SetAvailableCapacityInternal(fs.f_bavail); + } else if (common::StorageType::kMmc == storage->type()) { + manager_.SetAvailableCapacityMmc(fs.f_bavail); + } } } -- 2.7.4 From 53d4b08dc571564da59f0400a0a7acaa738eeefd Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Thu, 7 Jul 2016 17:41:49 +0900 Subject: [PATCH 03/16] [version] 1.11 Change-Id: I28985dc3ae75efa18f9515f046591ecc579aa93a --- 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 1080859..3557d8b 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.10 +Version: 1.11 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From c7dbbf166ae0d8157431d1a048ed36626b89913a Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Thu, 7 Jul 2016 11:14:31 +0200 Subject: [PATCH 04/16] [NBS] Added checking is service available Change-Id: I4238b53dbe09646966308f213a6c397e2d921bfd Signed-off-by: Lukasz Bardeli --- .../networkbearerselection_instance.cc | 7 ++++ .../networkbearerselection_manager.cc | 40 ++++++++++++++++++++++ .../networkbearerselection_manager.h | 3 ++ 3 files changed, 50 insertions(+) diff --git a/src/networkbearerselection/networkbearerselection_instance.cc b/src/networkbearerselection/networkbearerselection_instance.cc index 809c836..babbebf 100644 --- a/src/networkbearerselection/networkbearerselection_instance.cc +++ b/src/networkbearerselection/networkbearerselection_instance.cc @@ -80,6 +80,13 @@ void NetworkBearerSelectionInstance::NetworkBearerSelectionRequestRouteToHost( CHECK_EXIST(args, "domainName", out) CHECK_EXIST(args, "id", out) + const auto status = NetworkBearerSelectionManager::GetInstance()->getCellularState(); + + if (!status) { + LogAndReportError(status, &out, ("Failed to request route to host")); + return; + } + const std::string& domainName = args.get("domainName").get(); const int listenerId = static_cast(args.get("id").get()); diff --git a/src/networkbearerselection/networkbearerselection_manager.cc b/src/networkbearerselection/networkbearerselection_manager.cc index c77a37a..9d145ca 100644 --- a/src/networkbearerselection/networkbearerselection_manager.cc +++ b/src/networkbearerselection/networkbearerselection_manager.cc @@ -191,6 +191,27 @@ void NetworkBearerSelectionManager::connection_closed_callback( } } +common::PlatformResult NetworkBearerSelectionManager::getCellularState() { + + connection_cellular_state_e state; + + int ret = connection_get_cellular_state(m_connection_handle_, &state); + + if (ret != CONNECTION_ERROR_NONE) { + LoggerE("Fail to get connection state. %d", ret); + return common::PlatformResult(GetNBSErrorCode(ret), + "Fail to get connection state."); + } + + if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE) { + LoggerE("Network cellular have no service. %d", state); + return common::PlatformResult(common::ErrorCode::NOT_SUPPORTED_ERR, + "Fail to get connection state."); + } + return common::PlatformResult(common::ErrorCode::NO_ERROR); +} + + void NetworkBearerSelectionManager::requestRouteToHost( const std::string& domain_name) { LoggerD("NetworkBearerSelectionManager::requestRouteToHost"); @@ -486,5 +507,24 @@ ReleaseEventPtr NetworkBearerSelectionManager::getReleaseEvent(NetworkBearerSele return nullptr; } +common::ErrorCode NetworkBearerSelectionManager::GetNBSErrorCode(int error_code) { + + common::ErrorCode error = common::ErrorCode::UNKNOWN_ERR; + + switch (error_code) { + case CONNECTION_ERROR_OPERATION_FAILED: + error = common::ErrorCode::UNKNOWN_ERR; + break; + case CONNECTION_ERROR_NOT_SUPPORTED: + error = common::ErrorCode::NOT_SUPPORTED_ERR; + break; + default: + error = common::ErrorCode::UNKNOWN_ERR; + break; + } + + return error; +} + } // namespace networkbearerselection } // namespace extension diff --git a/src/networkbearerselection/networkbearerselection_manager.h b/src/networkbearerselection/networkbearerselection_manager.h index baddec5..7e45a58 100644 --- a/src/networkbearerselection/networkbearerselection_manager.h +++ b/src/networkbearerselection/networkbearerselection_manager.h @@ -67,6 +67,8 @@ class NetworkBearerSelectionManager { common::PlatformResult releaseRouteToHost(const std::string& domain_name, const ReleaseReplyCallback& reply_cb); + common::PlatformResult getCellularState(); + static NetworkBearerSelectionManager* GetInstance(); NetworkBearerSelectionManager(const NetworkBearerSelectionManager&) = delete; @@ -89,6 +91,7 @@ class NetworkBearerSelectionManager { void makeErrorCallback(const std::string& domain_name, const char* info); void makeErrorCallback(const std::string& domain_name, const std::string& info); + common::ErrorCode GetNBSErrorCode(int error_code); void makeDisconnectCallback(const std::string& domain_name); void destroyProfileHandle(); RequestEventPtr getRequestEvent(NetworkBearerSelectionRequestEvent* event); -- 2.7.4 From 1e19cccd8429fea5e00d8b8d56885b77b718e646 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Thu, 7 Jul 2016 19:40:29 +0900 Subject: [PATCH 05/16] [version] 1.12 Change-Id: I6f74a582c72e61ead241926fe2affb46d12b4179 --- 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 3557d8b..14d7984 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.11 +Version: 1.12 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 0016441dc1f374f9f08aadf9ebe6ba84fd8f6b9b Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 8 Jul 2016 11:49:59 +0900 Subject: [PATCH 06/16] [application] remove useless code to check presence when send replycallback Change-Id: I491579a5786c7e657de93cca6c23bce7801a83f7 --- src/application/requested_application_control.cc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/application/requested_application_control.cc b/src/application/requested_application_control.cc index 79bbf43..04adbc4 100755 --- a/src/application/requested_application_control.cc +++ b/src/application/requested_application_control.cc @@ -107,14 +107,6 @@ void RequestedApplicationControl::ReplyResult(const picojson::value& args, picoj return; } - // code to check caller liveness - result = VerifyCallerPresence(); - if (result.IsError()) { - LogAndReportError(result, out, - ("Failed VerifyCallerPresence()")); - return; - } - // create reply app_control_h reply; app_control_create(&reply); @@ -159,13 +151,6 @@ void RequestedApplicationControl::ReplyFailure(picojson::object* out) { return; } - // code to check caller liveness - result = VerifyCallerPresence(); - if (result.IsError()) { - LogAndReportError(result, out, ("Failed VerifyCallerPresence()")); - return; - } - // create reply app_control_h reply; app_control_create(&reply); -- 2.7.4 From d55dc5604b6a7821337f25b0a7b7fae61c91062c Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Fri, 8 Jul 2016 17:28:45 +0900 Subject: [PATCH 07/16] [Application] - Fixing undefined iconPath attribute issue TCT result: 99.47% (190/189/0/1/0) Change-Id: I79471656580973c1d22964e4c5caaed7270cf5af Signed-off-by: Andrzej Popowski --- src/application/application_utils.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/application/application_utils.cc b/src/application/application_utils.cc index 9cf23d5..1c39776 100644 --- a/src/application/application_utils.cc +++ b/src/application/application_utils.cc @@ -39,6 +39,7 @@ void ApplicationUtils::CreateApplicationInformation(const pkgmgrinfo_appinfo_h h ret = pkgmgrinfo_appinfo_get_appid(handle, &tmp_str); if ((PMINFO_R_OK != ret) || (nullptr == tmp_str)) { LoggerE("Failed to get appid: %d (%s)", ret, get_error_message(ret)); + app_info->insert(std::make_pair("id", picojson::value(""))); } else { app_info->insert(std::make_pair("id", picojson::value(tmp_str))); } @@ -57,6 +58,7 @@ void ApplicationUtils::CreateApplicationInformation(const pkgmgrinfo_appinfo_h h ret = pkgmgrinfo_appinfo_get_icon(handle, &tmp_str); if ((PMINFO_R_OK != ret) || (nullptr == tmp_str)) { LoggerE("Failed to get icon path: %d (%s)", ret, get_error_message(ret)); + app_info->insert(std::make_pair("iconPath", picojson::value(""))); } else { app_info->insert(std::make_pair("iconPath", picojson::value(tmp_str))); } @@ -67,6 +69,7 @@ void ApplicationUtils::CreateApplicationInformation(const pkgmgrinfo_appinfo_h h ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &no_display); if (PMINFO_R_OK != ret) { LoggerE("Failed to get nodisplay: %d (%s)", ret, get_error_message(ret)); + app_info->insert(std::make_pair("show", picojson::value(false))); } else { app_info->insert(std::make_pair("show", picojson::value(!no_display))); } -- 2.7.4 From e70dd941d819ab7555a41fc2c6e9a30a9b8d4a5e Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 8 Jul 2016 17:58:42 +0900 Subject: [PATCH 08/16] [version] 1.13 Change-Id: I7e765b0c482c8296bfb403bd2e643bb6aab00b80 --- 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 14d7984..441ed80 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.12 +Version: 1.13 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From d4edef757216de89a5b237253f4876d6d1e5d649 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 8 Jul 2016 19:10:41 +0900 Subject: [PATCH 09/16] [version] 1.14 Change-Id: I249a6b07892ba8d348d249c49612ac9b5befd6dc --- 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 441ed80..b5ce1eb 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.13 +Version: 1.14 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From e2cbe720924344b0cd43000f1f1394a1df798e9e Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Fri, 8 Jul 2016 12:46:53 +0200 Subject: [PATCH 10/16] [Preference] Improved behaviour on removing key [Feature] Removing listener also when key was removed. [Verification] Code compiles without errors. TCT passrate is 100%. Change-Id: I4aa9c6f4ffea08b526dad26e39fe67c8fd076fb0 Signed-off-by: Piotr Kosko --- src/preference/preference_manager.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/preference/preference_manager.cc b/src/preference/preference_manager.cc index 2461f3f..e24be80 100644 --- a/src/preference/preference_manager.cc +++ b/src/preference/preference_manager.cc @@ -214,8 +214,14 @@ common::TizenResult PreferenceManager::GetValue(const std::string& key) { common::TizenResult PreferenceManager::Remove(const std::string& key) { ScopeLogger(); - int ret = preference_remove(key.c_str()); + // unsetting listener if it is registered for key to be removed + auto res = UnsetChangeListener(key); + if (!res) { + //only log an error - listener could not be set + LoggerD("unsetting listener for given key failed, ignore error"); + } + int ret = preference_remove(key.c_str()); if (ret == PREFERENCE_ERROR_NONE) { return common::TizenSuccess(); } else { @@ -227,8 +233,9 @@ common::TizenResult PreferenceManager::RemoveAll() { ScopeLogger(); int ret = preference_remove_all(); - if (ret == PREFERENCE_ERROR_NONE) { + //only clear vector (listeners are removed natively in preference_remove_all function) + key_listeners_.clear(); return common::TizenSuccess(); } else { return MakeErrResult(ret, "preference_remove_all function error"); -- 2.7.4 From 8d11ea4eebcddd7989ce2002a885a318e8a3b37e Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Fri, 8 Jul 2016 20:01:40 +0900 Subject: [PATCH 11/16] [version] 1.15 Change-Id: Ia8dbadfc1557f5265eefa097d06c4aa3bfede987 --- 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 b5ce1eb..495a605 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.14 +Version: 1.15 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 0550028f26a3cbb6b42d778e86b00f4dfb06b638 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Mon, 11 Jul 2016 15:34:44 +0900 Subject: [PATCH 12/16] disable telephony feature due to beta release - this fix is related with capability TC ( NBS, callhistory ) Change-Id: I13016ab476e371704d7c867f3a5ab29d03a1f75e --- packaging/webapi-plugins.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 495a605..46638a6 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.15 +Version: 1.16 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries @@ -149,7 +149,11 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_sound_support 1 %define tizen_feature_system_info_support 1 %define tizen_feature_system_setting_support 1 +%if 0%{?tizen_is_emulator} +%define tizen_feature_telephony_support 0 +%else %define tizen_feature_telephony_support 1 +%endif %define tizen_feature_time_support 1 %define tizen_feature_web_setting_support 1 %define tizen_feature_widget_service_support 1 -- 2.7.4 From d7e21726c2e9f1a138682dda2815c80bf9e276b3 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Wed, 13 Jul 2016 10:34:05 +0200 Subject: [PATCH 13/16] [Messaging] Fixed SVACE issues [Bug] Fixed issues 107586, 107587 [Verification] Code compiles without errors. Change-Id: I9ef9bea7b189174726dfc9d993df5234c88122a8 Signed-off-by: Piotr Kosko --- src/messaging/email_manager.cc | 2 +- src/messaging/message.cc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/messaging/email_manager.cc b/src/messaging/email_manager.cc index cd275db..6fa77de 100755 --- a/src/messaging/email_manager.cc +++ b/src/messaging/email_manager.cc @@ -1433,7 +1433,7 @@ std::string EmailManager::getMessageStatus(int id) { MessageStatus status = MessageStatus::STATUS_UNDEFINED; int ret = email_get_mail_data(id, &mail); - if (EMAIL_ERROR_NONE != ret ) { + if (EMAIL_ERROR_NONE != ret || !mail) { LoggerD("Failed to get data %d (%s)", ret, get_error_message(ret)); return ""; } diff --git a/src/messaging/message.cc b/src/messaging/message.cc index 196bf07..3f77486 100755 --- a/src/messaging/message.cc +++ b/src/messaging/message.cc @@ -496,7 +496,10 @@ PlatformResult Message::convertPlatformEmail(std::shared_ptr message, } if(message->is_id_set()) { - email_get_mail_data(message->getId(), &mail_data); + int ret = email_get_mail_data(message->getId(), &mail_data); + if (EMAIL_ERROR_NONE != ret || !mail_data) { + return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Failed to get mail data."); + } } else { mail_data = (email_mail_data_t*)malloc(sizeof(email_mail_data_t)); if (!mail_data) { @@ -505,7 +508,7 @@ PlatformResult Message::convertPlatformEmail(std::shared_ptr message, memset(mail_data, 0x00, sizeof(email_mail_data_t)); } - std::unique_ptr mail_data_ptr( + std::unique_ptr mail_data_ptr( mail_data, [](email_mail_data_t* mail) {email_free_mail_data(&mail, 1);}); if(!message->getFrom().empty()) { -- 2.7.4 From 0d2cf2c5b5c463b7cca026f097df2227a9ac04ba Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Wed, 13 Jul 2016 18:00:22 +0900 Subject: [PATCH 14/16] [version] 1.17 Change-Id: Iae85ae7fcf4bd11362b6ccb70802b4960ea8176f --- 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 46638a6..cc0668f 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.16 +Version: 1.17 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries -- 2.7.4 From 9ba5758fe819754c1bc077759af821790c95bf96 Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Wed, 13 Jul 2016 18:20:58 +0900 Subject: [PATCH 15/16] [nfc] disable nfc module on emulator Change-Id: I74995e2d111e54a871b2c8fd45be9e04fb45389c --- packaging/webapi-plugins.spec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index cc0668f..bc2e616 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.17 +Version: 1.18 Release: 0 License: Apache-2.0 and BSD-2.0 and MIT Group: Development/Libraries @@ -128,13 +128,13 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_message_port_support 1 %define tizen_feature_messaging_support 1 -%if 0%{?tizen_is_emulator} -%define tizen_feature_nfc_emulation_support 0 -%define tizen_feature_nfc_support 1 -%else +#%if 0%{?tizen_is_emulator} +#%define tizen_feature_nfc_emulation_support 0 +#%define tizen_feature_nfc_support 1 +#%else %define tizen_feature_nfc_emulation_support 0 %define tizen_feature_nfc_support 0 -%endif +#%endif %define tizen_feature_notification_support 1 %define tizen_feature_package_support 1 %define tizen_feature_power_support 1 @@ -232,7 +232,11 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_message_port_support 1 %define tizen_feature_messaging_support 0 %define tizen_feature_nfc_emulation_support 0 +%if 0%{?tizen_is_emulator} +%define tizen_feature_nfc_support 0 +%else %define tizen_feature_nfc_support 1 +%endif %define tizen_feature_notification_support 1 %define tizen_feature_package_support 1 %define tizen_feature_power_support 1 -- 2.7.4 From 075eb7c4017ee2e6377831c49f3a9df7f296deac Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Wed, 13 Jul 2016 14:20:19 +0200 Subject: [PATCH 16/16] [NFC] fix for setReceiveNDEFListener Change-Id: I10c9691f8fe92207a665d08c14f54d4471406c34 Signed-off-by: Lukasz Bardeli --- src/nfc/nfc_adapter.cc | 2 +- src/nfc/nfc_api.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/nfc/nfc_adapter.cc b/src/nfc/nfc_adapter.cc index 911f34d..88fc88d 100644 --- a/src/nfc/nfc_adapter.cc +++ b/src/nfc/nfc_adapter.cc @@ -755,7 +755,7 @@ static void targetReceivedCallback(nfc_p2p_target_h /*target*/, picojson::object& obj = event.get(); obj.insert(make_pair("listenerId", picojson::value("ReceiveNDEFListener"))); obj.insert(make_pair("id", picojson::value(static_cast(NFCAdapter::GetInstance()->GetPeerId())))); - + obj.insert(make_pair("action",picojson::value("onsuccess"))); NFCMessageUtils::ReportNdefMessageFromData(raw_data, size, obj); NFCAdapter::GetInstance()->RespondAsync(event.serialize().c_str()); diff --git a/src/nfc/nfc_api.js b/src/nfc/nfc_api.js index 641a4ee..5f94a95 100644 --- a/src/nfc/nfc_api.js +++ b/src/nfc/nfc_api.js @@ -1231,9 +1231,9 @@ function NFCPeer(peerid) { var listener = function(msg) { var data = undefined; if ('onsuccess' === msg.action && _my_id === msg.id) { - data = new NDEFMessage(msg); + data = new tizen.NDEFMessage(toRecordsArray(msg.records)); } - args.listener[msg.action](data); + args.listener(data); }; var result = native_.callSync('NFCPeer_setReceiveNDEFListener', {'id' : _my_id}); @@ -1306,7 +1306,6 @@ var isArrayOfType = function(array, type) { tizen.NDEFMessage = function(data) { validator_.isConstructorCall(this, tizen.NDEFMessage); var records_ = []; - try { if (arguments.length >= 1) { if (type_.isArray(data)) { @@ -1442,7 +1441,7 @@ tizen.NDEFRecordText = function(text, languageCode, encoding, internal_) { languageCode_ = converter_.toString(languageCode); if (!type_.isNullOrUndefined(internal_) && (internal_ instanceof InternalRecordData)) { - tizen.NDEFRecord.call(this, internal_.tnf_, internal_.type_, internal_.payload_, internal_.id_); + tizen.NDEFRecord.call(this, internal_.tnf, internal_.type, internal_.payload, internal_.id); } else { var result = native_.callSync( 'NDEFRecordText_constructor', { @@ -1487,7 +1486,7 @@ tizen.NDEFRecordURI = function(uri, internal_) { uri_ = converter_.toString(uri); if (!type_.isNullOrUndefined(internal_) && (internal_ instanceof InternalRecordData)) { - tizen.NDEFRecord.call(this, internal_.tnf_, internal_.type_, internal_.payload_, internal_.id_); + tizen.NDEFRecord.call(this, internal_.tnf, internal_.type, internal_.payload, internal_.id); } else { var result = native_.callSync( 'NDEFRecordURI_constructor', { @@ -1528,7 +1527,7 @@ tizen.NDEFRecordMedia = function(mimeType, data, internal_) { data_ = toByteArray(data, Math.pow(2, 32) - 1); if (!type_.isNullOrUndefined(internal_) && (internal_ instanceof InternalRecordData)) { - tizen.NDEFRecord.call(this, internal_.tnf_, internal_.type_, internal_.payload_, internal_.id_); + tizen.NDEFRecord.call(this, internal_.tnf, internal_.type, internal_.payload, internal_.id); } else { var result = native_.callSync( 'NDEFRecordMedia_constructor', { -- 2.7.4