From b04ebc5964d122c7a66eac703a1233320f628ec6 Mon Sep 17 00:00:00 2001 From: Hokwon Song Date: Tue, 25 Jun 2013 10:28:50 +0000 Subject: [PATCH] Revert "Split powermanager into system-server.so" This reverts commit 58c0db4ac12846e4e12a3db23af3704da42966a6 Change-Id: I63a38678c92591a846bc0812d40b711811cc932b --- src/system-server/CMakeLists.txt | 3 - src/system-server/inc/FSys_IPowerManager.h | 45 ----------- src/system-server/inc/FSys_PowerManager.h | 48 ------------ src/system-server/power/FSys_PowerManager.cpp | 104 -------------------------- src/system/FSys_PowerManagerImpl.cpp | 7 +- 5 files changed, 2 insertions(+), 205 deletions(-) delete mode 100644 src/system-server/inc/FSys_IPowerManager.h delete mode 100644 src/system-server/inc/FSys_PowerManager.h delete mode 100644 src/system-server/power/FSys_PowerManager.cpp diff --git a/src/system-server/CMakeLists.txt b/src/system-server/CMakeLists.txt index 81fe5d5..c9cae01 100644 --- a/src/system-server/CMakeLists.txt +++ b/src/system-server/CMakeLists.txt @@ -13,14 +13,12 @@ INCLUDE_DIRECTORIES ( SET (${this_target}_SOURCE_FILES system/FSys_SystemInfo.cpp dev/FSys_DeviceManager.cpp - power/FSys_PowerManager.cpp ) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED capi-system-media-key capi-network-bluetooth - capi-system-device ) FOREACH(flag ${pkgs_CFLAGS}) @@ -47,7 +45,6 @@ ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) TARGET_LINK_LIBRARIES(${this_target} osp-appfw) TARGET_LINK_LIBRARIES(${this_target} capi-network-bluetooth) TARGET_LINK_LIBRARIES(${this_target} capi-system-media-key) -TARGET_LINK_LIBRARIES(${this_target} capi-system-device) SET_TARGET_PROPERTIES(${this_target} PROPERTIES diff --git a/src/system-server/inc/FSys_IPowerManager.h b/src/system-server/inc/FSys_IPowerManager.h deleted file mode 100644 index 4a2fc05..0000000 --- a/src/system-server/inc/FSys_IPowerManager.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FSys_IPowerManager.h - * @brief This is the header file of the _IPowerManager class. - * - * This header file contains the declarations of the _IPowerManager class. - */ -#include -#include - -#ifndef _FSYS_INTERNAL_IPOWER_MANAGER_H_ -#define _FSYS_INTERNAL_IPOWER_MANAGER_H_ - -namespace Tizen { namespace System { - -/** - * @class _IPowerManager - * @brief This class contains implementaion of device control. - * @since 2.1 - */ -class _OSP_EXPORT_ _IPowerManager -{ -protected: - virtual ~_IPowerManager(void) {}; -public: - virtual result ChangeBrightness(int brightness) = 0; -}; //_IPowerManager - -}} //Tizen::System -#endif /* _FSYS_INTERNAL_IPOWER_MANAGER_H_ */ diff --git a/src/system-server/inc/FSys_PowerManager.h b/src/system-server/inc/FSys_PowerManager.h deleted file mode 100644 index f790ae7..0000000 --- a/src/system-server/inc/FSys_PowerManager.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FSys_PowerManager.h - * @brief This is the header file for the _PowerManager class. - */ - -#ifndef _FSYS_SERVICE_SYS_POWER_MANAGER_H_ -#define _FSYS_SERVICE_SYS_POWER_MANAGER_H_ - -#include -#include -#include "FSys_IPowerManager.h" - -namespace Tizen { namespace System -{ -class _PowerManager - : public _IPowerManager -{ -public: - static _PowerManager* GetInstance(void); - result ChangeBrightness(int brightness); - -private: - _PowerManager(); - virtual ~_PowerManager(); - -private: - static _PowerManager* __pPowerManager; -}; - -} } // Tizen::System - -#endif // _FSYS_SERVICE_SYS_POWER_MANAGER_H_ diff --git a/src/system-server/power/FSys_PowerManager.cpp b/src/system-server/power/FSys_PowerManager.cpp deleted file mode 100644 index 16ca17c..0000000 --- a/src/system-server/power/FSys_PowerManager.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FSys_PowerManager.cpp - * @brief This is the implementation file for _PowerManager class. - */ -#include -#include - -#include -#include - -#include - -#include "FSys_PowerManager.h" - -using namespace std; - -using namespace Tizen::App; -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; -using namespace Tizen::Base::Utility; -using namespace Tizen::Io; - -namespace { - static const int _POWER_COMMAND_ID = 1; -} - -namespace Tizen { namespace System -{ - -_PowerManager* _PowerManager::__pPowerManager = null; - -_PowerManager::_PowerManager() -{ -} - -_PowerManager::~_PowerManager() -{ -} - -_PowerManager* -_PowerManager::GetInstance() -{ - - if(__pPowerManager == null) - { - __pPowerManager = new (std::nothrow) _PowerManager(); - } - - return __pPowerManager; -} - -result -_PowerManager::ChangeBrightness(int brightness) -{ - - int ret = DEVICE_ERROR_NONE; - result r = E_OBJ_NOT_FOUND; - - if (brightness > 0) - { - SysLog(NID_SYS, "Brightness is [%d]", brightness); - ret = device_set_brightness(0, brightness); - if(ret == DEVICE_ERROR_NONE) - { - r = E_SUCCESS; - } - else - { - SysLogException(NID_SYS, E_SYSTEM, "It is failed to change brightness."); - r = E_SYSTEM; - } - } - else if (brightness == 0) - { - SysLog(NID_SYS, "Current Active App does not have brightness."); - ret = device_set_brightness_from_settings(0); - r = E_SUCCESS; - } - - return r; -} - - -extern "C" _OSP_EXPORT_ _IPowerManager* PowerManager_CreateInstance() -{ - return _PowerManager::GetInstance(); -} -} } // Tizen::System diff --git a/src/system/FSys_PowerManagerImpl.cpp b/src/system/FSys_PowerManagerImpl.cpp index d0e6d72..5e6f5fb 100644 --- a/src/system/FSys_PowerManagerImpl.cpp +++ b/src/system/FSys_PowerManagerImpl.cpp @@ -65,8 +65,6 @@ static const int _APPID_LENGTH = 10; static const int _DEACTIVATED_BRIGHTNESS_CONTROL = -1; static const float _BRIGHTNESS_RESOLUTION = 10.0; -static const wchar_t* _POWER_MANAGER_SERVICE_ID = L"osp.sys.ipcserver.powermanager"; - #ifndef VCONFKEY_SERVICE_READY #define VCONFKEY_SERVICE_READY "memory/deviced/boot_power_on" #endif @@ -475,10 +473,9 @@ _PowerManagerImpl::RestoreScreenBrightness(void) SysTryReturn(NID_SYS, IsActive() == true, E_SUCCESS, r, "It is not active app."); unique_ptr<_IpcClient> pIpcClient (new (std::nothrow) _IpcClient()); - SysTryReturn(NID_SYS, pIpcClient != null, E_OUT_OF_MEMORY, r, "It is failed to create IPC instance."); - r = pIpcClient->Construct(_POWER_MANAGER_SERVICE_ID); + r = pIpcClient->Construct(_COMMUNICATION_DISPATCHER_IPC_ID); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] It failed to create IpcClient", GetErrorMessage(r)); requestMessage.Construct(); @@ -530,7 +527,7 @@ _PowerManagerImpl::SetScreenBrightness(int brightness) unique_ptr<_IpcClient> pIpcClient (new (std::nothrow) _IpcClient()); SysTryReturn(NID_SYS, pIpcClient != null, E_OUT_OF_MEMORY, r, "It is failed to create IPC instance."); - r = pIpcClient->Construct(_POWER_MANAGER_SERVICE_ID); + r = pIpcClient->Construct(_COMMUNICATION_DISPATCHER_IPC_ID); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] It failed to create IpcClient", GetErrorMessage(r)); requestMessage.Construct(); -- 2.7.4