From 9445a0b521b2a884d5b42d84d50e488c9b985fb4 Mon Sep 17 00:00:00 2001 From: Rafal Galka Date: Fri, 12 Jun 2015 10:52:08 +0200 Subject: [PATCH] [Build] Tizen 3.0 mobile - re-enable features Change-Id: I646a67bc061038a5a022c1c603f0dbac168b7879 --- packaging/webapi-plugins.spec | 13 +++--- src/application/application_manager.cc | 45 +++++++++---------- .../requested_application_control.cc | 4 +- src/notification/notification.gyp | 1 + src/notification/notification_manager.cc | 5 +-- src/notification/status_notification.cc | 1 - src/systeminfo/systeminfo-utils.cpp | 36 +++++++-------- 7 files changed, 51 insertions(+), 54 deletions(-) diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index d6510069..d12d2d47 100755 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -30,7 +30,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_feature_badge_support 1 %ifarch %{arm} # ARM -%define tizen_feature_bluetooth_support 0 +%define tizen_feature_bluetooth_support 1 %else # I586 %define tizen_feature_bluetooth_support 0 @@ -54,10 +54,10 @@ Source0: %{name}-%{version}.tar.gz %endif %define tizen_feature_location_batch 0 %define tizen_feature_key_manager_support 1 -%define tizen_feature_media_controller_support 0 +%define tizen_feature_media_controller_support 1 %ifarch %{arm} # ARM -%define tizen_feature_media_key_support 0 +%define tizen_feature_media_key_support 1 %else # I586 %define tizen_feature_media_key_support 1 @@ -67,14 +67,14 @@ Source0: %{name}-%{version}.tar.gz %if 0%{?model_build_feature_nfc} %define tizen_feature_nfc_emulation_support 0 -%define tizen_feature_nfc_support 0 +%define tizen_feature_nfc_support 1 %else %define tizen_feature_nfc_emulation_support 0 %define tizen_feature_nfc_support 0 %endif -%define tizen_feature_notification_support 0 +%define tizen_feature_notification_support 1 %define tizen_feature_package_support 1 -%define tizen_feature_power_support 0 +%define tizen_feature_power_support 1 %define tizen_feature_push_support 0 %ifarch %{arm} # ARM @@ -433,6 +433,7 @@ BuildRequires: pkgconfig(message-port) %if 0%{?tizen_feature_notification_support} BuildRequires: pkgconfig(notification) +BuildRequires: pkgconfig(capi-appfw-app-control) %endif %if 0%{?tizen_feature_sound_support} diff --git a/src/application/application_manager.cc b/src/application/application_manager.cc index b6714434..409e4e70 100755 --- a/src/application/application_manager.cc +++ b/src/application/application_manager.cc @@ -514,29 +514,28 @@ void ApplicationManager::LaunchAppControl(const picojson::value& args) { } } - // TODO(r.galka) temporarily removed - not supported by platform - //if (!launch_mode_str.empty()) { - // app_control_launch_mode_e launch_mode; - // - // if ("SINGLE" == launch_mode_str) { - // launch_mode = APP_CONTROL_LAUNCH_MODE_SINGLE; - // } else if ("GROUP" == launch_mode_str) { - // launch_mode = APP_CONTROL_LAUNCH_MODE_GROUP; - // } else { - // LoggerE("Invalid parameter passed."); - // ReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."), - // &response->get()); - // return; - // } - // - // int ret = app_control_set_launch_mode(app_control_ptr.get(), launch_mode); - // if (APP_CONTROL_ERROR_NONE != ret) { - // LoggerE("Setting launch mode failed."); - // ReportError(PlatformResult(ErrorCode::NOT_FOUND_ERR, "Setting launch mode failed."), - // &response->get()); - // return; - // } - //} + if (!launch_mode_str.empty()) { + app_control_launch_mode_e launch_mode; + + if ("SINGLE" == launch_mode_str) { + launch_mode = APP_CONTROL_LAUNCH_MODE_SINGLE; + } else if ("GROUP" == launch_mode_str) { + launch_mode = APP_CONTROL_LAUNCH_MODE_GROUP; + } else { + LoggerE("Invalid parameter passed."); + ReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."), + &response->get()); + return; + } + + int ret = app_control_set_launch_mode(app_control_ptr.get(), launch_mode); + if (APP_CONTROL_ERROR_NONE != ret) { + LoggerE("Setting launch mode failed."); + ReportError(PlatformResult(ErrorCode::NOT_FOUND_ERR, "Setting launch mode failed."), + &response->get()); + return; + } + } app_control_reply_cb callback = nullptr; struct ReplayCallbackData { diff --git a/src/application/requested_application_control.cc b/src/application/requested_application_control.cc index bb51d9f7..7928ce89 100755 --- a/src/application/requested_application_control.cc +++ b/src/application/requested_application_control.cc @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + #include "requested_application_control.h" #include #include #include -//#include +#include #include "common/logger.h" #include "application/application_utils.h" diff --git a/src/notification/notification.gyp b/src/notification/notification.gyp index 9c219a8c..b78fe2cf 100755 --- a/src/notification/notification.gyp +++ b/src/notification/notification.gyp @@ -25,6 +25,7 @@ 'variables': { 'packages': [ 'notification', + 'capi-appfw-app-control', 'capi-system-device', ] }, diff --git a/src/notification/notification_manager.cc b/src/notification/notification_manager.cc index c45a19fe..97c7b7c4 100644 --- a/src/notification/notification_manager.cc +++ b/src/notification/notification_manager.cc @@ -18,7 +18,6 @@ #include #include -#include #include "common/converter.h" #include "common/logger.h" @@ -72,14 +71,14 @@ PlatformResult NotificationManager::Remove(const picojson::object& args) { PlatformResult NotificationManager::RemoveAll() { LoggerD("Enter"); - int ret = notification_delete_all(NOTIFICATION_TYPE_NOTI); + int ret = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI); if (ret != NOTIFICATION_ERROR_NONE) { LoggerE("Notification remove all failed: %d", ret); return PlatformResult(ErrorCode::UNKNOWN_ERR, "Notification noti remove all failed"); } - ret = notification_delete_all(NOTIFICATION_TYPE_ONGOING); + ret = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_ONGOING); if (ret != NOTIFICATION_ERROR_NONE) { LoggerE("Notification remove all failed: %d", ret); return PlatformResult(ErrorCode::UNKNOWN_ERR, diff --git a/src/notification/status_notification.cc b/src/notification/status_notification.cc index c523a273..c971366c 100644 --- a/src/notification/status_notification.cc +++ b/src/notification/status_notification.cc @@ -17,7 +17,6 @@ #include "notification/status_notification.h" #include -#include #include #include "common/converter.h" diff --git a/src/systeminfo/systeminfo-utils.cpp b/src/systeminfo/systeminfo-utils.cpp index d0f4ebe7..46d1a321 100644 --- a/src/systeminfo/systeminfo-utils.cpp +++ b/src/systeminfo/systeminfo-utils.cpp @@ -1081,30 +1081,28 @@ PlatformResult SystemInfoListeners::UnregisterMemoryListener() PlatformResult SystemInfoListeners::RegisterCameraFlashListener(const SysteminfoUtilsCallback& callback, SysteminfoInstance& instance) { - // TODO(r.galka) temporarily removed - not supported by platform - //if (nullptr == m_camera_flash_listener) { - // if (DEVICE_ERROR_NONE != device_add_callback(DEVICE_CALLBACK_FLASH_BRIGHTNESS, - // OnBrightnessChangedCb, static_cast(&instance))) { - // return PlatformResult(ErrorCode::UNKNOWN_ERR); - // } - // m_camera_flash_listener = callback; - //} + if (nullptr == m_camera_flash_listener) { + if (DEVICE_ERROR_NONE != device_add_callback(DEVICE_CALLBACK_FLASH_BRIGHTNESS, + OnBrightnessChangedCb, static_cast(&instance))) { + return PlatformResult(ErrorCode::UNKNOWN_ERR); + } + m_camera_flash_listener = callback; + } return PlatformResult(ErrorCode::NO_ERROR); } PlatformResult SystemInfoListeners::UnregisterCameraFlashListener() { - // TODO(r.galka) temporarily removed - not supported by platform - //if (nullptr != m_camera_flash_listener) { - // PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR); - // int value = 0; - // if (DEVICE_ERROR_NONE != device_remove_callback(DEVICE_CALLBACK_FLASH_BRIGHTNESS, - // OnBrightnessChangedCb)) { - // return PlatformResult(ErrorCode::UNKNOWN_ERR); - // } - // LoggerD("Removed callback for camera_flash"); - // m_camera_flash_listener = nullptr; - //} + if (nullptr != m_camera_flash_listener) { + PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR); + int value = 0; + if (DEVICE_ERROR_NONE != device_remove_callback(DEVICE_CALLBACK_FLASH_BRIGHTNESS, + OnBrightnessChangedCb)) { + return PlatformResult(ErrorCode::UNKNOWN_ERR); + } + LoggerD("Removed callback for camera_flash"); + m_camera_flash_listener = nullptr; + } return PlatformResult(ErrorCode::NO_ERROR); } -- 2.34.1