bool LaunchChannelService(void);
bool LaunchCommonService(void);
bool LaunchSecurityService(void);
+ void ReadySystemServices(void);
Tizen::Base::Collection::ArrayList* GetPackageEventArgsN(const Tizen::App::PackageId& packageId);
virtual void OnApplicationLaunched(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
#include <FBase.h>
#include <FIo.h>
-#include <FApp_IAppManagerEventListener.h>
+#include <FApp_IAppEventListener.h>
#include <FIo_IIpcServerEventListener.h>
#include "FApp_ICommunicationRequestListener.h"
*/
class _CommunicationDispatcher
: public Tizen::Io::_IIpcServerEventListener
- , public _IAppManagerEventListener
+ , public _IAppEventListener
, virtual public Tizen::Base::Runtime::IEventListener
{
+private:
+ _CommunicationDispatcher(void);
+ virtual ~_CommunicationDispatcher(void);
public:
static _CommunicationDispatcher* GetInstance(void);
- result AddCommunicationEventListener(Tizen::App::_ICommunicationRequestListener& listener);
- result RemoveCommunicationEventListener(Tizen::App::_ICommunicationRequestListener& listener);
+ result AddCommunicationEventListener(_ICommunicationRequestListener& listener);
+ result RemoveCommunicationEventListener(_ICommunicationRequestListener& listener);
virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server) {}
virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server) {}
virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer& server, int clientId) {}
virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
- virtual void OnApplicationLaunched(const AppId& appId, _AppType type);
- virtual void OnApplicationTerminated(const AppId& appId, _AppType type);
+ virtual void OnApplicationLaunched(const AppId& appId, int pid);
+ virtual void OnApplicationTerminated(const AppId& appId, int pid);
bool OnRequestOccured(const Tizen::Base::Collection::ArrayList& request, Tizen::Base::Collection::ArrayList* response);
- result SendData(const Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList& data);
-
-private:
- _CommunicationDispatcher(void);
- virtual ~_CommunicationDispatcher(void);
- Tizen::Base::Integer* GetClientId(const Tizen::App::AppId& appId, const Tizen::Base::String& componentId) const;
- result AddClientId(Tizen::App::AppId appId, Tizen::Base::String componentId, Tizen::Base::Integer clientId);
- result RemoveClientId(Tizen::App::AppId appId, Tizen::Base::String componentId, Tizen::Base::Integer clientId);
- result RemoveClientId(Tizen::App::AppId appId, Tizen::Base::String componentId);
- result RemoveClientId(Tizen::App::AppId appId);
+ result SendData(const int pid, Tizen::Base::Collection::ArrayList& data);
private:
Tizen::Io::_IpcServer* __pIpcServer;
- Tizen::Base::Collection::ArrayList* __pRegisteredAppList;
- Tizen::App::AppId __currentAppId;
- Tizen::Base::Integer __currentClientId;
- Tizen::Base::Runtime::Mutex __Mutex;
_AppManagerImpl* __pAppManagerImpl;
+ Tizen::Base::Runtime::Mutex __Mutex;
+ Tizen::Base::Collection::HashMapT<Tizen::Base::String, _ICommunicationRequestListener*> __serviceProviderMap;
+ static _CommunicationDispatcher* __pCommunicationDispatcher;
+ Tizen::App::AppId __currentAppId;
+ int __currentPid;
+
+ Tizen::Base::ComparerT<Tizen::Base::String> __comparer;
+ Tizen::Base::StringHashCodeProvider __strHashCodeProvider;
}; //_CommunicationDispatcher
}} //Tizen::App
public:
virtual ~_ICommunicationRequestListener(void) {}
virtual Tizen::Base::String GetId(void) = 0;
- virtual void OnRequestOccured(AppId appId, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response) = 0;
- virtual void OnApplicationTerminated(const AppId& appId, _AppType type) = 0;
+ virtual void OnRequestOccured(AppId appId, int pid, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response) = 0;
+ virtual void OnApplicationTerminated(const AppId& appId, int pid) = 0;
}; // _ICommunicationRequestListener
}}}
namespace Tizen { namespace System {
-typedef void (*OnRequestOccuredFunction)(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
-typedef void (*RemoveOwnerApplicationFunction)(const Tizen::App::AppId appId, const Tizen::Base::String& executableName);
+typedef void (*OnRequestOccuredFunction)(Tizen::App::AppId appId, int pid, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
+typedef void (*RemoveOwnerApplicationFunction)(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& executableName);
/**
* @class _AccessoryManagerService
public:
virtual Tizen::Base::String GetId(void);
- virtual void OnRequestOccured(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
- virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
- result SendData(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* data);
+ virtual void OnRequestOccured(Tizen::App::AppId appId, int pid, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
+ virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, int pid);
+ result SendData(int pid, Tizen::Base::Collection::ArrayList* data);
static _AccessoryManagerService* GetInstance(void);
-
+ static result SendDataFunc(int pid, Tizen::Base::Collection::ArrayList* data);
private:
_AccessoryManagerService(const _AccessoryManagerService& value);
_AccessoryManagerService& operator =(const _AccessoryManagerService& value);
Tizen::App::_CommunicationDispatcher* __pCommunicationDispatcher;
OnRequestOccuredFunction __pOnRequestOccuredFunction;
RemoveOwnerApplicationFunction __pRemoveOwnerApplicationFunction;
+
+private:
+ static _AccessoryManagerService* __pAccessoryManagerService;
}; //_AccessoryManagerService
}} //Tizen::System
virtual ~_DeviceManagerService(void);
public:
virtual Tizen::Base::String GetId(void);
- virtual void OnRequestOccured(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
- virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
- virtual void OnBluetoothEventOccured(int code);
+ void OnRequestOccured(Tizen::App::AppId appId, int pid, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
+ void OnApplicationTerminated(const Tizen::App::AppId& appId, int pid);
+ void OnBluetoothEventOccured(int code);
void SendEvent(Tizen::Base::String event);
void SetBluetoothStatus(bool status);
bool GetBluetoothStatus(void);
Tizen::App::_CommunicationDispatcher* __pCommunicationDispatcher;
bool isBluetoothHeadSetConnected;
bool isInitBluetooth;
- Tizen::Base::Collection::ArrayList __interestedAppList;
+ Tizen::Base::Collection::ArrayList __interestedPidList;
private:
- void AddInterestedApp(Tizen::App::AppId appId);
- void RemoveInterestedApp(Tizen::App::AppId appId);
+ void AddInterestedApp(int pid);
+ void RemoveInterestedApp(int pid);
}; //_DeviceManagerService
virtual ~_SettingService(void);
public:
virtual Tizen::Base::String GetId(void);
- virtual void OnRequestOccured(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
- virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
+ virtual void OnRequestOccured(Tizen::App::AppId appId, int pid, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
+ virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, int pid);
result RegisterSettingProvider(_ISettingProvider& settingProvider);
result UnregisterSettingProvider(_ISettingProvider& settingProvider);
result SendEvent(Tizen::Base::String key);
- result SendResponse(Tizen::App::AppId appId, Tizen::Base::String responseId, Tizen::Base::String key, Tizen::Base::String value);
+ result SendResponse(int pid, Tizen::Base::String responseId, Tizen::Base::String key, Tizen::Base::String value);
public:
static _SettingService* GetInstance(void);
static _SettingService* __pSettingService;
private:
+
class _StringHashProvider
: public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
{
virtual ~_SystemService(void);
public:
virtual Tizen::Base::String GetId(void);
- virtual void OnRequestOccured(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
- virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
+ virtual void OnRequestOccured(Tizen::App::AppId appId, int pid, Tizen::Base::Collection::ArrayList* request, Tizen::Base::Collection::ArrayList* response);
+ virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, int pid);
static _SystemService* GetInstance(void);
virtual void OnActiveAppChanged(const Tizen::App::AppId& appId);
}
-typedef result (*SendDataFunction)(AppId appId, ArrayList* data);
+typedef result (*SendDataFunction)(int pid, ArrayList* data);
SendDataFunction sendFunction = null;
-static AccessoryMonitor* gpAccessoryMonitor = null;
-static int gReferenceCount = 0;
+
+AccessoryMonitor* AccessoryMonitor::__pAccessoryMonitor = null;
+int AccessoryMonitor::__referenceCount = 0;
AccessoryMonitor::AccessoryMonitor()
: __pAccessoryConditionHandler(null)
, __pDataRouter(null)
+, __currentPid(0)
{
}
{
}
-AppId
-AccessoryMonitor::GetClientId(void) const
-{
- return __clientAppId;
-}
-
-void
-AccessoryMonitor::SetClientId(AppId appId)
-{
- __clientAppId = appId;
-}
-
-void
-AccessoryMonitor::RemoveClientId(AppId appId)
-{
- StringComparer strComparer;
- int cmp = 0;
- strComparer.Compare(appId, __clientAppId, cmp);
- if(cmp == 0)
- {
- __clientAppId = "";
- }
-}
-
_DataRouter*
AccessoryMonitor::GetDataRouter(void) const
{
__pAccessoryConditionHandler = pConditionHandler;
SysTryReturnResult(NID_APP, __pDataRouter == null, E_INVALID_STATE, "AccessoryMonitor is already constructed.");
- __clientAppId = "";
__pDataRouter = _DataRouter::GetInstance();
r = __pDataRouter->Construct(*this);
SysTryReturnResult(NID_APP, r == E_SUCCESS, E_SYSTEM, "DataRouter is not constructed.");
AccessoryMonitor*
AccessoryMonitor::GetInstance(void)
{
- if(gpAccessoryMonitor == null)
- gpAccessoryMonitor = new (std::nothrow) AccessoryMonitor();
+ if(__pAccessoryMonitor == null)
+ __pAccessoryMonitor = new (std::nothrow) AccessoryMonitor();
- gReferenceCount ++;
- return gpAccessoryMonitor;
+ __referenceCount ++;
+ return __pAccessoryMonitor;
}
void
AccessoryMonitor::ReleaseInstance(void)
{
- if(gReferenceCount == 0)
+ if(__referenceCount == 0)
return;
- gReferenceCount --;
- if(gReferenceCount == 0)
+ __referenceCount --;
+ if(__referenceCount == 0)
{
- delete gpAccessoryMonitor;
- gpAccessoryMonitor = null;
+ delete __pAccessoryMonitor;
+ __pAccessoryMonitor = null;
}
}
if(primitiveCommand == false)
{
SysLog(NID_IO, "Requested data is not command. it will be forwarded to current application");
- if(__clientAppId.GetLength() > 0)
+ if(__currentPid > 0)
{
ArrayList* pDataList = new (std::nothrow) ArrayList();
ByteBuffer* pByteBuffer = new (std::nothrow) ByteBuffer();
if(sendFunction!=null)
{
- SysLog(NID_IO, "Data is forwarded to [%ls]", __clientAppId.GetPointer());
- sendFunction(__clientAppId, pDataList);
+ SysLog(NID_IO, "Data is forwarded to [%d]", __currentPid);
+ sendFunction(__currentPid, pDataList);
}
pDataList->RemoveAll(true);
SysLog(NID_IO, "STATE is changed %d", (int)state);
}
+int
+AccessoryMonitor::GetClientPid()
+{
+ return __currentPid;
+}
+
+void
+AccessoryMonitor::SetClientPid(int pid)
+{
+ __currentPid = pid;
+}
/////////////////////////////////////////////////////////////////////////
// Exported functions for _CommunicationDispatcher
}
_OSP_EXPORT_ void
-RemoveOwnerApplication(const AppId appId, const String& executableName)
+RemoveOwnerApplication(const AppId appId, int pid, const String& executableName)
{
- if(gpAccessoryMonitor != null)
+ AccessoryMonitor* pAccessoryMonitor = AccessoryMonitor::GetInstance();
+ if(pAccessoryMonitor != null)
{
- SysLog(NID_IO, "Accessory Owner is removed [%ls, %ls]", appId.GetPointer(), executableName.GetPointer());
- gpAccessoryMonitor->RemoveClientId(appId);
+ SysLog(NID_IO, "Accessory Owner is removed [%ls, %d, %ls]", appId.GetPointer(), pid, executableName.GetPointer());
+ pAccessoryMonitor->SetClientPid(0);
}
}
_OSP_EXPORT_ bool
-OnRequestOccured(AppId appId, ArrayList* pRequest, ArrayList* pResponse)
+OnRequestOccured(AppId appId, int pid, ArrayList* pRequest, ArrayList* pResponse)
{
String* pCommand = null;
+ AccessoryMonitor* pAccessoryMonitor = AccessoryMonitor::GetInstance();
result r = E_SUCCESS;
SysTryCatch(NID_APP, pRequest != null, r = E_SYSTEM, E_SYSTEM, "There is no pRequest");
SysTryCatch(NID_APP, pResponse != null, r = E_SYSTEM, E_SYSTEM, "There is no pResponse");
- SysTryCatch(NID_APP, gpAccessoryMonitor != null, r = E_SYSTEM, E_SYSTEM, "AccessoryMonitor is not ready");
+ SysTryCatch(NID_APP, pAccessoryMonitor != null, r = E_SYSTEM, E_SYSTEM, "AccessoryMonitor is not ready");
pCommand = static_cast< String* > (pRequest->GetAt(SERIAL_DATA_HEAD));
if(pCommand->Equals(SERIAL_COMMAND_OPEN, true))
{
SysLog(NID_IO, "Serial open is required");
- SysTryCatch(NID_APP, gpAccessoryMonitor->GetClientId().GetLength() == 0, , E_SYSTEM, "Serial port is already used by [%ls]", gpAccessoryMonitor->GetClientId().GetPointer());
- gpAccessoryMonitor->SetClientId(appId);
+ SysTryCatch(NID_APP, pAccessoryMonitor->GetClientPid() == 0, , E_SYSTEM, "Serial port is already used by [%d]", pAccessoryMonitor->GetClientPid());
+ pAccessoryMonitor->SetClientPid(pid);
String* pResult = new (std::nothrow) String(SERIAL_COMMAND_OK);
pResponse->Add(*pResult);
}
else
{
- SysTryCatch(NID_APP, gpAccessoryMonitor->GetClientId().GetLength() > 0, , E_SYSTEM, "Serial port is not created");
+ SysTryCatch(NID_APP, pAccessoryMonitor->GetClientPid() > 0, , E_SYSTEM, "Serial port is not created");
if(pCommand->Equals(SERIAL_COMMAND_WRITE, true))
{
SysLog(NID_IO, "Serial write is required");
length++;
}
}
- gpAccessoryMonitor->GetDataRouter()->Write(buffer, length);
+ pAccessoryMonitor->GetDataRouter()->Write(buffer, length);
delete [] buffer;
}
else if(pCommand->Equals(SERIAL_COMMAND_CLOSE, true))
{
SysLog(NID_IO, "Serial close is required");
- gpAccessoryMonitor->RemoveClientId(appId);
+ pAccessoryMonitor->SetClientPid(0);
}
else
{
- SysLogException(NID_APP, E_SYSTEM, "Undefined command is pRequested by [%ls]", gpAccessoryMonitor->GetClientId().GetPointer());
+ SysLogException(NID_APP, E_SYSTEM, "Undefined command is pRequested by [%d]", pAccessoryMonitor->GetClientPid());
}
}
CATCH:
public:
result Construct(AccessoryConditionHandler* pConditionHandler);
result SendData(char* buffer, int length);
- Tizen::App::AppId GetClientId(void) const;
- void SetClientId(Tizen::App::AppId appId);
- void RemoveClientId(Tizen::App::AppId appId);
Tizen::Io::_DataRouter* GetDataRouter(void) const;
virtual void OnDataRouterDataReceivedN(const char* buffer, int length);
virtual void OnDataRouterStateChanged(Tizen::Io::_DataRouterState state);
+ int GetClientPid();
+ void SetClientPid(int pid);
static AccessoryMonitor* GetInstance(void);
static void ReleaseInstance(void);
+public:
+ static int __referenceCount;
+
+private:
+ AccessoryConditionHandler* __pAccessoryConditionHandler;
+ Tizen::Io::_DataRouter* __pDataRouter;
+ int __currentPid;
private:
- AccessoryConditionHandler* __pAccessoryConditionHandler;
- Tizen::Io::_DataRouter* __pDataRouter;
- Tizen::App::AppId __clientAppId;
+ static AccessoryMonitor* __pAccessoryMonitor;
};
#endif //AccessoryMonitor
return E_SUCCESS;
}
-result
-_MessageConditionHandler::ParseWapHeader(const Tizen::Base::String& header, Tizen::Base::String& wapApplicationId, Tizen::Base::String& contentType)
-{
- ////////////////////////////////////////////////////////////////////////////////
- // header format: Content-Type: text/vnd.wap.si\r\nX-Wap-Application-Id: x-wap-appliation-wml:ua\r\n
- ////////////////////////////////////////////////////////////////////////////////
-
- result r = E_SUCCESS;
- String delim(L"\r\n"); // to get each field
- StringTokenizer strTok(header, delim);
- String token;
-
- // clear outparams
- contentType.Clear();
- wapApplicationId.Clear();
-
- while (strTok.HasMoreTokens())
- {
- // get a field
- r = strTok.GetNextToken(token);
- SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Failed to get a token.");
- SysLog(NID_APP, "token [%ls]", token.GetPointer());
-
- String delim2(L" "); // to get each value
- StringTokenizer strTok2(token, delim2);
- String key;
-
- // get a key
- r = strTok2.GetNextToken(key);
- SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Failed to get a key.");
- SysLog(NID_APP, "key [%ls]", key.GetPointer());
-
- if (key.Equals(String(L"Content-Type:")))
- {
- // Content-Type part
- r = strTok2.GetNextToken(contentType);
- SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Failed to get a content type.");
- SysLog(NID_APP, "Content-Type: [%ls]", contentType.GetPointer());
- }
- else if (key.Equals(String(L"X-Wap-Application-Id:")))
- {
- // X-Wap-Application-Id part
- r = strTok2.GetNextToken(wapApplicationId);
- SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Failed to get a wap application id.");
- SysLog(NID_APP, "X-Wap-Application-Id: [%ls]", wapApplicationId.GetPointer());
- }
-
- if (!contentType.IsEmpty() && !wapApplicationId.IsEmpty())
- {
- SysLog(NID_APP, "Succeeded to find Content-Type and X-Wap-Application-Id.");
- break;
- }
- }
-
- return r;
-}
-
void
_MessageConditionHandler::IncomingSmsMessageCallback(messages_message_h incomingMsg, void* pUserParam)
{
- SysLog(NID_APP, "Called.");
-
SysTryReturnVoidResult(NID_APP, incomingMsg != null, E_INVALID_ARG, "the incoming message is null.");
_AppLaunchCondition* pAppLaunchCondition = static_cast<_AppLaunchCondition*>(pUserParam);
// get header
String* pStrHeader = new String(pHeader);
- // check the condition using header
- result r = E_SUCCESS;
- String wapApplicationId, contentType;
- r = pHandler->ParseWapHeader(*pStrHeader, wapApplicationId, contentType);
- SysTryReturnVoidResult(NID_APP, r == E_SUCCESS, r, "Failed to get content type and wap application id from header.");
-
- if (pHandler->__wapApplicationId != wapApplicationId || pHandler->__wapContentType != contentType)
- {
- SysLog(NID_APP, "An WAP Push message received. But not matched with launch condition.");
- SysLog(NID_APP, "<X-Wap-Appliation-Id> Registered: [%ls] Received: [%ls]"
- , pHandler->__wapApplicationId.GetPointer(), wapApplicationId.GetPointer());
- SysLog(NID_APP, "<Content-Type> Registered: [%ls] Received: [%ls]"
- , pHandler->__wapContentType.GetPointer(), contentType.GetPointer());
- return;
- }
-
// get body
int size = sizeof(char) * bodyLength;
char* pTemp = (char*)malloc(size + 1);
HashMap map(SingleObjectDeleter);
+ result r = E_SUCCESS;
+
// hash map
r = map.Construct();
SysTryReturnVoidResult(NID_APP, r == E_SUCCESS, r, "Failed to construct a hash map.");
int GetPortNumber(const Tizen::Base::String& condition);
result GetWapConditions(const Tizen::Base::String& condition, Tizen::Base::String& wapApplicationId, Tizen::Base::String& contentType);
_MessageType GetMessageType(const Tizen::Base::String& condition);
- result ParseWapHeader(const Tizen::Base::String& header, Tizen::Base::String& wapApplicationId, Tizen::Base::String& contentType);
static void IncomingSmsMessageCallback(messages_message_h incomingMsg, void* pUserParam);
static void IncomingWapPushMessageCallback(const char* pHeader, const char* pBody, int bodyLength, void* pUserParam);
LaunchSecurityService();
LaunchChannelService();
LaunchCommonService();
+ ReadySystemServices();
// LaunchSystemServices();
// LaunchUserServices();
// InitializeServices();
__pContextMgr = new (std::nothrow) _ContextManager();
SysAssert(__pContextMgr != null);
- SysTryCatch(NID_APP, __pContextMgr != null,, E_OUT_OF_MEMORY, "failed to _ContextManager creation.");
+ SysTryCatch(NID_APP, __pContextMgr != null,, E_OUT_OF_MEMORY, "It is failed to _ContextManager creation.");
r = __pContextMgr->Construct();
SysAssert(!IsFailed(r));
__pAppManagerStub = new (std::nothrow) _AppManagerStub();
SysAssert(__pAppManagerStub != null);
- SysTryCatch(NID_APP, __pAppManagerStub != null,, E_OUT_OF_MEMORY, "failed to _AppManagerStub creation.");
+ SysTryCatch(NID_APP, __pAppManagerStub != null,, E_OUT_OF_MEMORY, "It is failed to _AppManagerStub creation.");
r = __pAppManagerStub->Construct(__pContextMgr);
SysAssert(!IsFailed(r));
__pCommunicationDispatcher = _CommunicationDispatcher::GetInstance();
SysAssert(__pCommunicationDispatcher != null);
- SysTryCatch(NID_APP, __pCommunicationDispatcher != null,, E_OUT_OF_MEMORY, "failed to _CommunicationDispatcher creation.");
+ SysTryCatch(NID_APP, __pCommunicationDispatcher != null,, E_OUT_OF_MEMORY, "It is failed to _CommunicationDispatcher creation.");
SysLog(NID_APP, "Exit.");
return true;
return false;
}
-bool
-AppService::InitializeServices(void)
+void
+AppService::ReadySystemServices(void)
{
- SysLog(NID_APP, "Enter.");
- result r = E_SUCCESS;
-
- __pConditionManagerStub = new (std::nothrow) _ConditionManagerStub();
- SysAssert(__pConditionManagerStub != null);
- SysTryCatch(NID_APP, __pConditionManagerStub != null,, E_OUT_OF_MEMORY, "failed to _ConditionManagerStub creation.");
-
- r = __pConditionManagerStub->Construct();
- SysAssert(!IsFailed(r));
- SysTryCatch(NID_APP, !IsFailed(r),, r, "[%s] Propagated.", GetErrorMessage(r));
-
__pDeviceManagerService = _DeviceManagerService::GetInstance();
SysAssert( __pDeviceManagerService != null);
- SysTryCatch(NID_APP, __pDeviceManagerService != null,, E_OUT_OF_MEMORY, "failed to _DeviceManagerService creation.");
+ SysTryReturnVoidResult(NID_APP, __pDeviceManagerService != null, E_OUT_OF_MEMORY, "It is failed to _DeviceManagerService creation.");
__pSystemService = _SystemService::GetInstance();
SysAssert( __pSystemService != null);
- SysTryCatch(NID_APP, __pSystemService != null,, E_OUT_OF_MEMORY, "failed to _SystemService creation.");
+ SysTryReturnVoidResult(NID_APP, __pSystemService != null, E_OUT_OF_MEMORY, "It is failed to _SystemService creation.");
__pSettingService = _SettingService::GetInstance();
SysAssert( __pSettingService != null);
- SysTryCatch(NID_APP, __pSettingService != null,, E_OUT_OF_MEMORY, "failed to SettingService creation.");
+ SysTryReturnVoidResult(NID_APP, __pSettingService != null, E_OUT_OF_MEMORY, "It is failed to SettingService creation.");
__pAccessoryManagerService = _AccessoryManagerService::GetInstance();
SysAssert( __pAccessoryManagerService != null);
- SysTryCatch(NID_APP, __pAccessoryManagerService != null,, E_OUT_OF_MEMORY, "failed to _AccessoryManagerService creation.");
+ SysTryReturnVoidResult(NID_APP, __pAccessoryManagerService != null, E_OUT_OF_MEMORY, "It is failed to _AccessoryManagerService creation.");
+}
+
+bool
+AppService::InitializeServices(void)
+{
+ SysLog(NID_APP, "Enter.");
+ result r = E_SUCCESS;
+
+ __pConditionManagerStub = new (std::nothrow) _ConditionManagerStub();
+ SysAssert(__pConditionManagerStub != null);
+ SysTryCatch(NID_APP, __pConditionManagerStub != null,, E_OUT_OF_MEMORY, "It is failed to _ConditionManagerStub creation.");
+
+ r = __pConditionManagerStub->Construct();
+ SysAssert(!IsFailed(r));
+ SysTryCatch(NID_APP, !IsFailed(r),, r, "[%s] Propagated.", GetErrorMessage(r));
__pPackageManagerStub = new (std::nothrow) _PackageManagerStub();
SysAssert(__pPackageManagerStub != null);
- SysTryCatch(NID_APP, __pPackageManagerStub != null,, E_OUT_OF_MEMORY, "failed to _PackageManagerStub creation.");
+ SysTryCatch(NID_APP, __pPackageManagerStub != null,, E_OUT_OF_MEMORY, "It is failed to _PackageManagerStub creation.");
r = __pPackageManagerStub->Construct();
SysAssert(!IsFailed(r));
__pMmcStorageManagerStub = new (std::nothrow) _MmcStorageManagerStub();
SysAssert(__pMmcStorageManagerStub != null);
- SysTryCatch(NID_APP, __pMmcStorageManagerStub != null,, E_OUT_OF_MEMORY, "failed to __pMmcStorageManagerStub creation.");
+ SysTryCatch(NID_APP, __pMmcStorageManagerStub != null,, E_OUT_OF_MEMORY, "It is failed to __pMmcStorageManagerStub creation.");
r = __pMmcStorageManagerStub->Construct();
SysAssert(!IsFailed(r));
// SysTryReturn(NID_APP, !IsFailed(r), r, r, "");
if (IsFailed(r))
{
- SysLog(NID_APP, "failed to open registry '%ls'", systemListPath.GetPointer());
+ SysLog(NID_APP, "It is failed to open registry '%ls'", systemListPath.GetPointer());
return true;
}
pArray->Add(new (std::nothrow) String(packageId));
pArray->Add(new (std::nothrow) String(pPackageAppInfo->GetAppName()));
- pArray->Add(new (std::nothrow) String(pPackageAppInfo->GetAppId()));
-
+ pArray->Add(new (std::nothrow) String(pPackageAppInfo->GetAppId()));
+
result r = __handlerThread.SendUserEvent(HANDLER_REQUEST_INSTALL_COMPLETE, pArray);
SysTryLog(NID_APP, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
}
{
_AppManagerImpl::GetInstance()->RemoveEventListener(*this);
InitializeServices();
-
+
LaunchSystemServices();
Tizen::App::Package::_PackageManagerImpl::GetInstance()->AddEventListener(this, 0);
const String COMMUNICATION_MUTEX_ID = L"osp.app.ipcserver.communicationdispatcher";
}
-typedef struct communicationListener
-{
- _ICommunicationRequestListener* requestListener;
- struct communicationListener* prev;
- struct communicationListener* next;
-}listener;
-
-communicationListener* gp_CommunicationListener = null;
-_CommunicationDispatcher* gp_CommunicationDispatcher = null;
-
-void
-ReleaseCommunicationListener(void)
-{
- communicationListener* pIter = gp_CommunicationListener;
- communicationListener* pTemp = null;
-
- while (pIter != null)
- {
- pTemp = pIter;
- pIter = pIter->next;
- free(pTemp);
- }
- gp_CommunicationListener = null;
-}
-
-communicationListener*
-GetCommunicationListener(String key)
-{
- communicationListener* pIter = gp_CommunicationListener;
- if (pIter == null)
- {
- return null;
- }
-
- while (pIter != null)
- {
- if (pIter->requestListener != null)
- {
- StringComparer strComparer;
- int cmp = 0;
- strComparer.Compare(pIter->requestListener->GetId(), key, cmp);
- if (cmp == 0)
- {
- return pIter;
- }
- }
- pIter = pIter->next;
- }
- return null;
-}
-
-bool
-AddCommunicationListener(_ICommunicationRequestListener* pListener)
-{
- if (pListener == null)
- {
- return false;
- }
-
- if (GetCommunicationListener(pListener->GetId()) == null)
- {
- communicationListener* pTemp = (communicationListener*)malloc(sizeof(communicationListener));
- SysTryReturn(NID_APP, pTemp != null, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
-
- memset(pTemp, 0, sizeof(communicationListener));
- pTemp->requestListener = pListener;
-
- if (gp_CommunicationListener == null)
- {
- gp_CommunicationListener = pTemp;
- }
- else
- {
- communicationListener* pIter = gp_CommunicationListener;
-
- while (pIter->next != null)
- {
- pIter = pIter->next;
- }
- pIter->next = pTemp;
- pTemp->prev = pIter;
- }
- return true;
- }
- return false;
-}
-
-bool
-RemoveCommunicationListener(_ICommunicationRequestListener* pListener)
-{
- if (pListener == null)
- {
- return false;
- }
- communicationListener* pIter = GetCommunicationListener(pListener->GetId());
-
- if (pIter == null)
- {
- return false;
- }
-
- if (pIter == gp_CommunicationListener)
- {
- gp_CommunicationListener = pIter->next;
- free(pIter);
- }
- else
- {
- pIter->prev->next = pIter->next;
- pIter->next->prev = pIter->prev;
- }
- return true;
-}
+_CommunicationDispatcher* _CommunicationDispatcher::__pCommunicationDispatcher = null;
_CommunicationDispatcher::_CommunicationDispatcher()
: __pIpcServer(null)
-, __pRegisteredAppList(null)
, __pAppManagerImpl(null)
+, __currentAppId("")
+, __currentPid(0)
{
result r = E_SUCCESS;
- __currentAppId= "";
- __currentClientId.value = 0;
-
__pIpcServer = new (std::nothrow) _IpcServer();
r = __pIpcServer->Construct(COMMUNICATION_DISPATCHER_IPC_ID, *this);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to IPC server initialize. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to IPC server initialize. [%s] Propaged.", r);
r = __pIpcServer->Start();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to start IPC server. [%s] Propaged.", r);
-
- __pRegisteredAppList = new (std::nothrow) ArrayList();
- r =__pRegisteredAppList->Construct();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to create registered app list. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to start IPC server. [%s] Propaged.", r);
r = __Mutex.Create(COMMUNICATION_MUTEX_ID);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to create mutex. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to create mutex. [%s] Propaged.", r);
__pAppManagerImpl = _AppManagerImpl::GetInstance();
- SysTryCatch(NID_APP, __pAppManagerImpl != null, r = E_SYSTEM, r, "Failed to get _AppManagerImpl instance");
+ SysTryCatch(NID_APP, __pAppManagerImpl != null, r = E_SYSTEM, r, "It is failed to get _AppManagerImpl instance");
- r = __pAppManagerImpl->AddEventListener(*this);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to add event listener. [%s] Propaged.", r);
+ r = __pAppManagerImpl->AddAppEventListener(*this);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to add event listener. [%s] Propaged.", r);
+
+ __serviceProviderMap.Construct(0, 0, __strHashCodeProvider, __comparer);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to initialize provider's map. [%s] Propaged.", r);
CATCH:
SetLastResult(r);
{
result r = E_SUCCESS;
r = __pIpcServer->Stop();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to stop IPC server. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to stop IPC server. [%s] Propaged.", r);
r = __Mutex.Release();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to release mutex. [%s] Propaged.", r);
-
- r = __pAppManagerImpl->RemoveEventListener(*this);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "Failed to remove event listener. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to release mutex. [%s] Propaged.", r);
- ReleaseCommunicationListener();
+ r = __pAppManagerImpl->RemoveAppEventListener(*this);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to remove event listener. [%s] Propaged.", r);
CATCH:
delete __pIpcServer;
-
- __pRegisteredAppList->RemoveAll(true);
- delete __pRegisteredAppList;
-
SetLastResult(r);
}
_CommunicationDispatcher*
_CommunicationDispatcher::GetInstance()
{
- if (gp_CommunicationDispatcher == null)
- {
- gp_CommunicationDispatcher = new (std::nothrow) _CommunicationDispatcher();
- }
-
- return gp_CommunicationDispatcher;
-}
-
-Integer*
-_CommunicationDispatcher::GetClientId(const AppId& appId, const String& componentId) const
-{
- int index = 0;
- int numOfAppList = 0;
- SysLog(NID_APP, "AppId: %ls, ComponentId %ls", appId.GetPointer(), componentId.GetPointer());
- SysTryCatch(NID_APP, __pRegisteredAppList != null, , E_SYSTEM, "Registered app list is not ready");
- numOfAppList = __pRegisteredAppList->GetCount();
-
- while (index < numOfAppList)
- {
- AppId* currentAppId = null;
- currentAppId = (AppId*)__pRegisteredAppList->GetAt(index);
- if (currentAppId != null)
- {
- StringComparer strComparer;
- int cmp = 0;
-
- strComparer.Compare(appId, *currentAppId, cmp);
- if (cmp == 0)
- {
- String* currentComponentId = (String*)__pRegisteredAppList->GetAt(index+1);
- if (currentComponentId != null)
- {
- strComparer.Compare(componentId, *currentComponentId, cmp);
- if (cmp == 0)
- {
- SysLog(NID_APP, "Registered information is found.");
-
- Integer* pClientId = (Integer*)__pRegisteredAppList->GetAt(index+2);
- if (pClientId != null)
- {
- return pClientId;
- }
- }
- }
- }
-
- }
- index += 3;
- }
- SysLog(NID_APP, "There is no registered information.");
-CATCH:
- return null;
-}
-
-result
-_CommunicationDispatcher::RemoveClientId(AppId appId)
-{
- int index = 0;
- int numOfAppList = 0;
- SysTryCatch(NID_APP, __pRegisteredAppList != null, , E_SYSTEM, "Registered app list is not ready");
- numOfAppList = __pRegisteredAppList->GetCount();
-
- while (index < numOfAppList)
- {
- AppId* currentAppId = null;
-
- currentAppId = (AppId*)__pRegisteredAppList->GetAt(index);
- if (currentAppId != null)
- {
- StringComparer strComparer;
- int cmp = 0;
-
- strComparer.Compare(appId, *currentAppId, cmp);
- if (cmp == 0)
- {
- SysLog(NID_APP, "Registered information is found.");
- __pRegisteredAppList->RemoveAt(index+2, true);
- __pRegisteredAppList->RemoveAt(index+1, true);
- __pRegisteredAppList->RemoveAt(index, true);
- index -= 3;
- numOfAppList -= 3;
- }
-
- }
- index += 3;
- }
- SysLog(NID_APP, "There is no registered information.");
-CATCH:
- return null;
-}
-
-result
-_CommunicationDispatcher::RemoveClientId(AppId appId, String componentId)
-{
- int index = 0;
- int numOfAppList = 0;
- SysTryCatch(NID_APP, __pRegisteredAppList != null, , E_SYSTEM, "Registered app list is not ready");
- numOfAppList = __pRegisteredAppList->GetCount();
-
- while (index < numOfAppList)
+ if (__pCommunicationDispatcher == null)
{
- AppId* currentAppId = null;
- currentAppId = (AppId*)__pRegisteredAppList->GetAt(index);
- if (currentAppId != null)
- {
- StringComparer strComparer;
- int cmp = 0;
-
- strComparer.Compare(appId, *currentAppId, cmp);
- if (cmp == 0)
- {
- String* currentComponentId = (String*)__pRegisteredAppList->GetAt(index+1);
- if (currentComponentId != null)
- {
- strComparer.Compare(componentId, *currentComponentId, cmp);
- if (cmp == 0)
- {
- SysLog(NID_APP, "Registered information is found.");
- __pRegisteredAppList->RemoveAt(index+2, true);
- __pRegisteredAppList->RemoveAt(index+1, true);
- __pRegisteredAppList->RemoveAt(index, true);
- }
- }
- }
-
- }
- index += 3;
+ __pCommunicationDispatcher = new (std::nothrow) _CommunicationDispatcher();
}
- SysLog(NID_APP, "There is no registered information.");
-CATCH:
- return null;
-}
-
-result
-_CommunicationDispatcher::RemoveClientId(AppId appId, String componentId, Integer clientId)
-{
- int index = 0;
- int numOfAppList = 0;
- SysTryCatch(NID_APP, __pRegisteredAppList != null, , E_SYSTEM, "Registered app list is not ready");
- numOfAppList = __pRegisteredAppList->GetCount();
-
- while (index < numOfAppList)
- {
- AppId* currentAppId = null;
- currentAppId = (AppId*)__pRegisteredAppList->GetAt(index);
- if (currentAppId != null)
- {
- StringComparer strComparer;
- int cmp = 0;
-
- strComparer.Compare(appId, *currentAppId, cmp);
- if (cmp == 0)
- {
- String* currentComponentId = (String*)__pRegisteredAppList->GetAt(index+1);
- if (currentComponentId != null)
- {
- strComparer.Compare(componentId, *currentComponentId, cmp);
- if (cmp == 0)
- {
- SysLog(NID_APP, "Registered information is found.");
- Integer* pClientId = (Integer*)__pRegisteredAppList->GetAt(index+2);
- if (pClientId != null)
- {
- if (pClientId->value == clientId.value)
- {
- __pRegisteredAppList->RemoveAt(index+2, true);
- __pRegisteredAppList->RemoveAt(index+1, true);
- __pRegisteredAppList->RemoveAt(index, true);
- }
- }
- }
- }
- }
- }
- index += 3;
- }
- SysLog(NID_APP, "There is no registered information.");
-CATCH:
- return null;
+ return __pCommunicationDispatcher;
}
result
-_CommunicationDispatcher::AddClientId(AppId appId, String componentId, Integer clientId)
+_CommunicationDispatcher::SendData(const int pid, ArrayList& data)
{
- Integer* currentClientId = null;
-
- SysTryReturnResult(NID_APP, __pRegisteredAppList != null, E_SYSTEM, "Registered app list is not ready");
-
- currentClientId = GetClientId(appId, componentId);
- if(currentClientId != NULL)
- {
- if(currentClientId->ToInt() != clientId.ToInt())
- {
- RemoveClientId(appId, componentId);
- currentClientId = NULL;
- }
- }
-
- SysTryReturnResult(NID_APP, currentClientId == null, E_KEY_ALREADY_EXIST, "This is already registered. AppId: %ls, ComponentId: %ls, ClientId: %d", appId.GetPointer(), componentId.GetPointer(), clientId.value);
-
- SysLog(NID_SYS, "AppId: %ls, ComponentId: %ls, ClientId: %d", appId.GetPointer(), componentId.GetPointer(), clientId.value);
-
- AppId* pAppId = new (std::nothrow) AppId(appId);
- String* pComponentId = new (std::nothrow) String(componentId);
- Integer* pClientId = new (std::nothrow) Integer();
- pClientId->value = clientId.value;
-
- __pRegisteredAppList->Add(*pAppId);
- __pRegisteredAppList->Add(*pComponentId);
- __pRegisteredAppList->Add(*pClientId);
-
- return E_SUCCESS;
-}
-
-result
-_CommunicationDispatcher::SendData(const Tizen::App::AppId appId, ArrayList& data)
-{
- Integer* clientId = null;
result r = E_SUCCESS;
- String* communicationId = null;
-
- SysTryReturnResult(NID_APP, __pRegisteredAppList != null, E_SYSTEM, "_CommunicationDispatcher is not ready");
-
- communicationId = (String*)data.GetAt(0);
- SysTryReturnResult(NID_APP, communicationId != null, E_SYSTEM, "There is no communicationId");
+ SysTryReturnResult(NID_SYS, __pIpcServer != null, E_SYSTEM, "IPC server is not ready.");
+ r = __pIpcServer->SendResponse(pid, new (std::nothrow) IoService_Data(data));
- clientId = GetClientId(appId, *communicationId);
-
- if (clientId!=null)
- {
- SysLog(NID_APP, "ClientId: %d", clientId->ToInt());
-
- int client = clientId->ToInt();
- //IpcServer Send
- r = __pIpcServer->SendResponse(client, new (std::nothrow) IoService_Data(data));
-
- if (r != E_SUCCESS)
- {
- SysLog(NID_APP, "Send Result %s.", GetErrorMessage(r));
- return r;
- }
- return E_SUCCESS;
- }
- return E_OBJ_NOT_FOUND;
+ return r;
}
void
SysLog(NID_APP, "(appId:%ls, clientId:%d)\n", server.GetClientApplicationId().GetPointer(), server.GetClientId());
__currentAppId = server.GetClientAppId();
- __currentClientId.value = server.GetClientId();
+ __currentPid = server.GetClientProcessId();
IPC_BEGIN_MESSAGE_MAP(_CommunicationDispatcher, message)
IPC_MESSAGE_HANDLER_EX(IoService_Request, &server, OnRequestOccured)
}
bool
-_CommunicationDispatcher::OnRequestOccured(const Tizen::Base::Collection::ArrayList& request, Tizen::Base::Collection::ArrayList* response)
+_CommunicationDispatcher::OnRequestOccured(const ArrayList& request, ArrayList* response)
{
+ result r = E_SUCCESS;
SysLog(NID_APP, "Application is requested by IPC, currentAppId is %ls", __currentAppId.GetPointer());
String* componentId = (String*)request.GetAt(0);
- _ICommunicationRequestListener* plistener = null;
- if (componentId == null)
+ if(componentId == null)
{
- SysLog(NID_APP, "there is no componentId");
+ SysLogException(NID_SYS, E_SYSTEM, "There is no required service provider.");
+ return false;
}
+ SysLog(NID_SYS, "[%ls] service provider is required.", componentId->GetPointer());
- if (componentId != null)
- {
- AddClientId(__currentAppId, *componentId, __currentClientId);
- SysLog(NID_APP, "Requested componentId is %ls", componentId->GetPointer());
-
- communicationListener* pTemp = GetCommunicationListener(*componentId);
+ _ICommunicationRequestListener* pServiceProvider = null;
+ r = __serviceProviderMap.GetValue(*componentId, pServiceProvider);
- if (pTemp != null)
- {
- plistener = pTemp->requestListener;
-
- if (plistener!=null)
- {
- plistener->OnRequestOccured(__currentAppId, const_cast <ArrayList*> (&request), response);
- }
- }
- else
- {
- SysLog(NID_APP, "Requested module is not exist.");
- }
+ if(r != E_SUCCESS && pServiceProvider != null)
+ {
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to find proper service provider.");
+ return false;
}
+ pServiceProvider->OnRequestOccured(__currentAppId, __currentPid, const_cast<ArrayList*>(&request), response);
+
return true;
}
result
_CommunicationDispatcher::AddCommunicationEventListener(_ICommunicationRequestListener& listener)
{
- bool added = false;
- added = AddCommunicationListener(&listener);
- SysLog(NID_APP, "%ls", listener.GetId().GetPointer());
- SysTryReturnResult(NID_APP, added == true, E_KEY_ALREADY_EXIST, "listner is already registed for key [%ld]", listener.GetId().GetPointer());
-
- return E_SUCCESS;
+ return __serviceProviderMap.Add(listener.GetId(), &listener);
}
result
_CommunicationDispatcher::RemoveCommunicationEventListener(_ICommunicationRequestListener& listener)
{
- bool removed = false;
- removed = RemoveCommunicationListener(&listener);
- SysTryReturnResult(NID_APP, removed == true, E_KEY_NOT_FOUND, "listner is already registed for key [%ld]", listener.GetId().GetPointer());
-
- return E_SUCCESS;
+ return __serviceProviderMap.Remove(listener.GetId());
}
void
-_CommunicationDispatcher::OnApplicationLaunched(const AppId& appId, _AppType type)
+_CommunicationDispatcher::OnApplicationLaunched(const AppId& appId, int pid)
{
}
void
-_CommunicationDispatcher::OnApplicationTerminated(const AppId& appId, _AppType type)
+_CommunicationDispatcher::OnApplicationTerminated(const AppId& appId, int pid)
{
- SysLog(NID_APP, "App[%ls] terminate event is forwarded", appId.GetPointer());
+ SysLog(NID_APP, "App[%ls] pid[%d] terminate event is forwarded", appId.GetPointer(), pid);
+ result r = E_SUCCESS;
+ IMapEnumeratorT<String, _ICommunicationRequestListener*>* pMapEnum = __serviceProviderMap.GetMapEnumeratorN();
__Mutex.Acquire();
- communicationListener* pIter = gp_CommunicationListener;
- SysLog(NID_APP, "App[%ls] terminate event is forwarded", appId.GetPointer());
- RemoveClientId(appId);
+ _ICommunicationRequestListener* pServiceProvider = null;
- while (pIter != null)
+ while(pMapEnum->MoveNext() == E_SUCCESS)
{
- if (pIter->requestListener != null)
+ r = pMapEnum->GetValue(pServiceProvider);
+ if(r == E_SUCCESS && pServiceProvider != null)
{
- SysLog(NID_APP, "listener is [%ls]", pIter->requestListener->GetId().GetPointer());
- pIter->requestListener->OnApplicationTerminated(appId, type);
+ SysLog(NID_SYS, "%ls provider is found.", pServiceProvider->GetId().GetPointer());
+ pServiceProvider->OnApplicationTerminated(appId, pid);
}
- pIter = pIter->next;
}
+
__Mutex.Release();
+ delete pMapEnum;
}
const String ACCESSORY_PLUGIN_LIBRARY_PATH = L"/opt/apps/aospd00043/lib/libosp-cond-accessory.so";
}
-typedef result (*SendDataFunction)(Tizen::App::AppId appId, Tizen::Base::Collection::ArrayList* data);
+typedef result (*SendDataFunction)(int pid, Tizen::Base::Collection::ArrayList* data);
typedef void (*RegisterSendDataFunction)(SendDataFunction function);
-_AccessoryManagerService* gpAccessoryManagerService = null;
+_AccessoryManagerService* _AccessoryManagerService::__pAccessoryManagerService = null;
result
-SendDataFunc(AppId appId, ArrayList* data)
+_AccessoryManagerService::SendDataFunc(int pid, ArrayList* data)
{
SysLog(NID_SYS, "Request to send data");
- SysTryReturnResult(NID_SYS, gpAccessoryManagerService != null, E_SYSTEM, "AccessoryManagerService is not ready");
- return gpAccessoryManagerService->SendData(appId, data);
+ SysTryReturnResult(NID_SYS, __pAccessoryManagerService != null, E_SYSTEM, "AccessoryManagerService is not ready");
+ return __pAccessoryManagerService->SendData(pid, data);
}
_AccessoryManagerService*
_AccessoryManagerService::GetInstance()
{
- if(gpAccessoryManagerService == null)
+ if(__pAccessoryManagerService == null)
{
- gpAccessoryManagerService = new (std::nothrow) _AccessoryManagerService();
+ __pAccessoryManagerService = new (std::nothrow) _AccessoryManagerService();
}
- return gpAccessoryManagerService;
+ return __pAccessoryManagerService;
}
_AccessoryManagerService::_AccessoryManagerService()
RegisterSendDataFunction pRegisterSendDataFunction;
__pCommunicationDispatcher = _CommunicationDispatcher::GetInstance();
- SysTryCatch(NID_SYS, __pCommunicationDispatcher != null, r = E_SYSTEM, E_SYSTEM, "Failed to get _CommunicationDispatcher");
+ SysTryCatch(NID_SYS, __pCommunicationDispatcher != null, r = E_SYSTEM, E_SYSTEM, "It is failed to get _CommunicationDispatcher");
r = __pCommunicationDispatcher->AddCommunicationEventListener(*this);
- SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Failed to add event listener on _CommunicationDispatcher");
+ SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "It is failed to add event listener on _CommunicationDispatcher");
__pLib = new Library();
r = __pLib->Construct(ACCESSORY_PLUGIN_LIBRARY_PATH);
- SysTryCatch(NID_APP, !IsFailed(r),, r, "dlopen fails (%s)", GetErrorMessage(r));
+ SysTryCatch(NID_APP, !IsFailed(r),, r, "dlopen is failed(%s).", GetErrorMessage(r));
pRegisterSendDataFunction = (RegisterSendDataFunction)__pLib->GetProcAddress(L"RegisterSendData");
- SysTryCatch(NID_APP, pRegisterSendDataFunction != null, r = E_SYSTEM, E_SYSTEM, "Failed to find RegisterSendDataFunction");
+ SysTryCatch(NID_APP, pRegisterSendDataFunction != null, r = E_SYSTEM, E_SYSTEM, "It is failed to find RegisterSendDataFunction");
__pOnRequestOccuredFunction = (OnRequestOccuredFunction)__pLib->GetProcAddress(L"OnRequestOccured");
- SysTryCatch(NID_APP, __pOnRequestOccuredFunction != null, r = E_SYSTEM, E_SYSTEM, "Failed to find OnRequestOccuredFunction");
+ SysTryCatch(NID_APP, __pOnRequestOccuredFunction != null, r = E_SYSTEM, E_SYSTEM, "It is failed to find OnRequestOccuredFunction");
__pRemoveOwnerApplicationFunction = (RemoveOwnerApplicationFunction)__pLib->GetProcAddress(L"RemoveOwnerApplication");
- SysTryCatch(NID_APP, __pRemoveOwnerApplicationFunction != null, r = E_SYSTEM, E_SYSTEM, "Failed to find OnRequestOccuredFunction");
+ SysTryCatch(NID_APP, __pRemoveOwnerApplicationFunction != null, r = E_SYSTEM, E_SYSTEM, "It is failed to find OnRequestOccuredFunction");
pRegisterSendDataFunction(SendDataFunc);
SysTryCatch(NID_SYS, __pCommunicationDispatcher != null, r = E_SYSTEM, E_SYSTEM, "_CommunicationDispatcher is not initiated.");
r = __pCommunicationDispatcher->RemoveCommunicationEventListener(*this);
- SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Failed to remove event listener on _CommunicationDispatcher");
+ SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "It is failed to remove event listener on _CommunicationDispatcher");
CATCH:
SetLastResult(r);
}
result
-_AccessoryManagerService::SendData(AppId appId, ArrayList* data)
+_AccessoryManagerService::SendData(int pid, ArrayList* data)
{
SysTryReturnResult(NID_SYS, __pCommunicationDispatcher != null, E_SYSTEM, "_CommunicationDispatcher is not initiated.");
- return __pCommunicationDispatcher->SendData(appId, *data);
+ return __pCommunicationDispatcher->SendData(pid, *data);
}
String
}
void
-_AccessoryManagerService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* response)
+_AccessoryManagerService::OnRequestOccured(AppId appId, int pid, ArrayList* request, ArrayList* response)
{
result r = E_SUCCESS;
SysTryCatch(NID_SYS, __pOnRequestOccuredFunction != null, r = E_SYSTEM, E_SYSTEM, "There is no OnRequestOccuredFunction");
SysLog(NID_SYS, "AppId is [%ls]", appId.GetPointer());
- __pOnRequestOccuredFunction(appId, request, response);
+ __pOnRequestOccuredFunction(appId, pid, request, response);
CATCH:
SetLastResult(r);
}
void
-_AccessoryManagerService::OnApplicationTerminated(const AppId& appId, _AppType type)
+_AccessoryManagerService::OnApplicationTerminated(const AppId& appId, int pid)
{
result r = E_SUCCESS;
SysTryCatch(NID_SYS, __pRemoveOwnerApplicationFunction != null, r = E_SYSTEM, E_SYSTEM, "There is no RemoveOwnerApplicationFunction");
- __pRemoveOwnerApplicationFunction(appId, L"");
+ __pRemoveOwnerApplicationFunction(appId, pid, L"");
CATCH:
SetLastResult(r);
}
void bluetooth_connection_state_changed(int result, bool connected, const char* remote_address, bt_audio_profile_type_e type, void* user_data)
{
- SysLog(NID_SYS, "Bluetooth headset connection event, %s,%d", remote_address, connected);
+ SysLog(NID_SYS, "Bluetooth headset[%s] connection[%d] event", remote_address, connected);
String bt_event;
_DeviceManagerService* pDeviceManagerService = _DeviceManagerService::GetInstance();
event = BLUETOOTH_A2DP_REWIND;
break;
case MEDIA_KEY_UNKNOWN:
- break;
default:
- SysLog(NID_SYS, "default");
+ SysLog(NID_SYS, "Unsupported key[%d] is occured.", key);
+ return;
}
pDeviceManagerService->SendEvent(event);
}
result r = E_SUCCESS;
__pCommunicationDispatcher = _CommunicationDispatcher::GetInstance();
- SysTryCatch(NID_SYS, __pCommunicationDispatcher != null, r = E_SYSTEM, E_SYSTEM, "_CommunicationDispatcher initiate is failed");
+ SysTryCatch(NID_SYS, __pCommunicationDispatcher != null, r = E_SYSTEM, E_SYSTEM, "_CommunicationDispatcher initiate is failed.");
r = __pCommunicationDispatcher->AddCommunicationEventListener(*this);
- SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "fail to add event listener");
+ SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "It is failed to add event listener.");
- r = __interestedAppList.Construct();
- SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "fail to initiate bluetooth headset application list");
+ r = __interestedPidList.Construct();
+ SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "It is failed to initiate bluetooth headset application list.");
CATCH:
SetLastResult(r);
}
SysLog(NID_SYS, "Bluetooth headset event is released.");
media_key_release();
btResult = bt_audio_unset_connection_state_changed_cb();
- SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "Failed to unregister bluetooth headset connection event");
+ SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "It is failed to unregister bluetooth headset connection event");
btResult = bt_audio_deinitialize();
- SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "Failed to close bluetooth");
+ SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "It is failed to close bluetooth");
btResult = bt_deinitialize();
- SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "Failed to init bluetooth module");
+ SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "It is failed to init bluetooth module");
isInitBluetooth = false;
}
SysTryCatch(NID_SYS, __pCommunicationDispatcher != null, r = E_SYSTEM, E_SYSTEM, "_CommunicationDispatcher is not ready");
r = __pCommunicationDispatcher->RemoveCommunicationEventListener(*this);
- SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "fail to remove event listener");
+ SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "It is failed to remove event listener");
CATCH:
SetLastResult(r);
void
_DeviceManagerService::SendEvent(String event)
{
- if(__interestedAppList.GetCount() > 0)
+ if(__interestedPidList.GetCount() > 0)
{
int count = 0;
- AppId* pAppId = null;
+ Integer* pPid = null;
ArrayList data;
String serviceId(DEVICE_MANAGER_SERVICE_ID);
String commandId(DEVICE_MANAGER_COMMAND_EVENT);
data.Add(deviceId);
data.Add(eventId);
- for(count = 0 ; count < __interestedAppList.GetCount() ; count++)
+ for(count = 0 ; count < __interestedPidList.GetCount() ; count++)
{
- pAppId = (AppId*)__interestedAppList.GetAt(count);
- if(pAppId == null)
+ pPid = (Integer*)__interestedPidList.GetAt(count);
+ if(pPid == null)
{
- SysLogException(NID_SYS, E_SYSTEM, "fail to get appid from bluetooth headset app list");
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to get appid from bluetooth headset app list");
return;
}
- __pCommunicationDispatcher->SendData(*pAppId, data);
- SysLog(NID_SYS, "Bluetooth headset event is sended to %ls", pAppId->GetPointer());
+ __pCommunicationDispatcher->SendData(pPid->value, data);
+ SysLog(NID_SYS, "Bluetooth headset event is sended to %d.", pPid->value);
}
}
else
{
- SysLog(NID_SYS, "Bluetooth Headset Event is not required by any application");
+ SysLog(NID_SYS, "Bluetooth Headset Event is not required by any application.");
}
}
_DeviceManagerService::OnBluetoothEventOccured(int code)
{
int count = 0;
- AppId* pAppId = null;
+ Integer* pPid = null;
String command = DEVICE_MANAGER_COMMAND_EVENT;
String device = DEVICE_MANAGER_BLUETOOTH;
result r = E_SUCCESS;
- if(__interestedAppList.GetCount() == 0)
+ if(__interestedPidList.GetCount() == 0)
{
- SysLog(NID_SYS, "Bluetooth Headset Event is not required by any application");
+ SysLog(NID_SYS, "Bluetooth Headset Event is not required by any application.");
return;
}
ArrayList eventData;
r = eventData.Construct();
- SysTryCatch(NID_SYS, r == E_SUCCESS, , E_SYSTEM, "fail to create eventData, [%s] Propagated.", GetErrorMessage(r));
+ SysTryCatch(NID_SYS, r == E_SUCCESS, , E_SYSTEM, "It is failed to create eventData, [%s] Propagated.", GetErrorMessage(r));
eventData.Add(command);
eventData.Add(device);
eventData.Add(event);
- for(count = 0 ; count < __interestedAppList.GetCount() ; count++)
+ for(count = 0 ; count < __interestedPidList.GetCount() ; count++)
{
- pAppId = (AppId*)__interestedAppList.GetAt(count);
- if(pAppId == null)
- {
- SysLogException(NID_SYS, E_SYSTEM, "fail to get appid from bluetooth headset app list");
- return;
- }
+ pPid = (Integer*)__interestedPidList.GetAt(count);
+ SysTryReturnVoidResult(NID_SYS, pPid != null, E_SYSTEM, "It is failed to get appid from bluetooth headset app list.");
- r = __pCommunicationDispatcher->SendData(*pAppId, eventData);
+ r = __pCommunicationDispatcher->SendData(pPid->value, eventData);
if(r != E_SUCCESS)
{
- SysLogException(NID_SYS, E_SYSTEM, "fail to send bluetooth event data");
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to send bluetooth event data.");
}
}
}
void
-_DeviceManagerService::AddInterestedApp(AppId appId)
+_DeviceManagerService::AddInterestedApp(int pid)
{
int count = 0;
- for(count = 0; count < __interestedAppList.GetCount(); count++)
+ for(count = 0; count < __interestedPidList.GetCount(); count++)
{
- AppId* pAppId = null;
-
- pAppId = (AppId*)__interestedAppList.GetAt(count);
- if(*pAppId == appId)
+ Integer* pPid = (Integer*)__interestedPidList.GetAt(count);
+ if(pPid->value == pid)
{
return;
}
int btResult = 0;
btResult = bt_initialize();
- SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "Failed to init bluetooth module");
+ SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "It is failed to init bluetooth module");
btResult = bt_audio_initialize();
- SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "Failed to init bluetooth audio module");
+ SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "It is failed to init bluetooth audio module");
btResult = bt_audio_set_connection_state_changed_cb(bluetooth_connection_state_changed, null);
- SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "Failed to register bluetooth audio event");
+ SysTryReturnVoidResult(NID_SYS, btResult == BT_ERROR_NONE, E_SYSTEM, "It is failed to register bluetooth audio event");
isInitBluetooth = true;
}
- AppId* pNewAppId = new AppId(appId);
- __interestedAppList.Add(*pNewAppId);
+ Integer* pPid = new (std::nothrow) Integer(pid);
+ __interestedPidList.Add(*pPid);
}
void
-_DeviceManagerService::RemoveInterestedApp(AppId appId)
+_DeviceManagerService::RemoveInterestedApp(int pid)
{
int count = 0;
- for(count = 0; count < __interestedAppList.GetCount(); count++)
+ for(count = 0; count < __interestedPidList.GetCount(); count++)
{
- AppId* pAppId = null;
-
- pAppId = (AppId*)__interestedAppList.GetAt(count);
- if(*pAppId == appId)
+ Integer* pPid = (Integer*)__interestedPidList.GetAt(count);
+ SysTryReturnVoidResult(NID_SYS, pPid != null, E_SYSTEM, "It is failed to get integerested PID.");
+ if(pPid->value == pid)
{
- __interestedAppList.RemoveAt(count, true);
+ __interestedPidList.RemoveAt(count, true);
return;
}
}
-
}
void
-_DeviceManagerService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* response)
+_DeviceManagerService::OnRequestOccured(AppId appId, int pid, ArrayList* request, ArrayList* response)
{
StringComparer strComparer;
int cmp = 0;
if(cmp == 0)
{
SysLog(NID_SYS, "Bluetooth headset event is required");
- AddInterestedApp(appId);
+ AddInterestedApp(pid);
}
}
strComparer.Compare(*device, DEVICE_MANAGER_BLUETOOTH, cmp);
if(cmp == 0)
{
- RemoveInterestedApp(appId);
+ RemoveInterestedApp(pid);
}
}
}
void
-_DeviceManagerService::OnApplicationTerminated(const AppId& appId, _AppType type)
+_DeviceManagerService::OnApplicationTerminated(const AppId& appId, int pid)
{
- RemoveInterestedApp(appId);
+ RemoveInterestedApp(pid);
}
bool
}
void
-_SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* response)
+_SettingService::OnRequestOccured(AppId appId, int pid, ArrayList* request, ArrayList* response)
{
result r = E_SYSTEM;
int index = 0;
String* value = null;
String requiredKey;
String requiredProvider;
+ Integer processId(pid);
if(__firstRequest == true)
{
if(*command == _SETTING_COMMAND_ADD_EVENT)
{
SysLog(NID_SYS, "Setting Event subscription is required.");
- if(__eventListenerList.Contains(appId) == false)
+
+ if(__eventListenerList.Contains(processId) == false)
{
__eventProtect.Acquire();
- r = __eventListenerList.Add(new (std::nothrow) AppId(appId));
+ r = __eventListenerList.Add(new (std::nothrow) Integer(pid));
__eventProtect.Release();
}
else
else if(*command == _SETTING_COMMAND_REMOVE_EVENT)
{
SysLog(NID_SYS, "Setting Event un-subscription is required.");
- if(__eventListenerList.Contains(appId) == true)
+ if(__eventListenerList.Contains(processId) == true)
{
__eventProtect.Acquire();
- r = __eventListenerList.Remove(appId, true);
+ r = __eventListenerList.Remove(processId, true);
__eventProtect.Release();
}
else
if(requiredValue != null)
{
bool tValue = Boolean::Parse(*requiredValue, false);
- r = pProvider->SetValueAsync(appId, requiredKey, tValue);
+ r = pProvider->SetValueAsync(appId, pid, requiredKey, tValue);
SysLog(NID_SYS, "RequiredKey[%ls] value is %d and result is %s.", requiredKey.GetPointer(), tValue, GetErrorMessage(r));
}
}
{
bool tValue = Boolean::Parse(*requiredValue, false);
SysLog(NID_SYS, "RequiredKey[%ls] value is %d and result is %s.", requiredKey.GetPointer(), tValue, GetErrorMessage(r));
- r = pProvider->SetValueAsyncForPrivilegedKey(appId, requiredKey, tValue);
+ r = pProvider->SetValueAsyncForPrivilegedKey(appId, pid, requiredKey, tValue);
}
}
else
if(requiredValue != null)
{
SysLog(NID_SYS, "RequiredKey[%ls] value is %ls", requiredKey.GetPointer(), requiredValue->GetPointer());
- r = pProvider->SetValueAsync(appId, requiredKey, *requiredValue);
+ r = pProvider->SetValueAsync(appId, pid, requiredKey, *requiredValue);
}
}
else if(*command == _SETTING_COMMAND_SUPPORTED)
__eventProtect.Acquire();
while(pEnum->MoveNext() == E_SUCCESS)
{
- AppId* pAppId = (AppId*)pEnum->GetCurrent();
- SysTryReturnResult(NID_SYS, pAppId != null, E_SYSTEM, "There is no listener id.");
+ Integer* pProcessId = (Integer*)pEnum->GetCurrent();
+ SysTryReturnResult(NID_SYS, pProcessId != null, E_SYSTEM, "There is no listener id.");
String serviceId(_SETTING_SERVICE_ID);
String eventId(_SETTING_SERVICE_TYPE_EVENT);
data.Add(serviceId);
data.Add(eventId);
data.Add(key);
- r = __pCommunicationDispatcher->SendData(*pAppId, data);
+ r = __pCommunicationDispatcher->SendData(pProcessId->value, data);
if(r != E_SUCCESS)
{
- SysLog(NID_SYS, "Required Key[%ls] is failed to delivered to application[%ls]. [%s]", key.GetPointer(), pAppId->GetPointer(), GetErrorMessage(r));
+ SysLog(NID_SYS, "Required Key[%ls] is failed to delivered to application[%d]. [%s]", key.GetPointer(), pProcessId->value, GetErrorMessage(r));
}
else
{
- SysLog(NID_SYS, "Required Key[%ls] is delivered to application[%ls] successfully.", key.GetPointer(), pAppId->GetPointer());
+ SysLog(NID_SYS, "Required Key[%ls] is delivered to application[%d] successfully.", key.GetPointer(), pProcessId->value);
}
}
__eventProtect.Release();
}
result
-_SettingService::SendResponse(AppId appId, String responseId, String key, String value)
+_SettingService::SendResponse(int pid, String responseId, String key, String value)
{
SysTryReturnResult(NID_SYS, __pCommunicationDispatcher != null, E_SYSTEM, "Communication Dispatcher is not ready.");
data.Add(key);
data.Add(value);
- return __pCommunicationDispatcher->SendData(appId, data);
+ return __pCommunicationDispatcher->SendData(pid, data);
}
void
-_SettingService::OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type)
+_SettingService::OnApplicationTerminated(const Tizen::App::AppId& appId, int pid)
{
result r = E_SUCCESS;
__eventProtect.Acquire();
- r = __eventListenerList.Remove(appId);
+ Integer processId(pid);
+ r = __eventListenerList.Remove(processId, true);
__eventProtect.Release();
- SysLog(NID_SYS, "Application[%ls] is terminated. And remove event listener [%s]", appId.GetPointer(), GetErrorMessage(r));
+ SysLog(NID_SYS, "Application[%ls, %d] is terminated. And remove event listener [%s]", appId.GetPointer(), pid, GetErrorMessage(r));
}
}}
}
void
-_SystemService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* response)
+_SystemService::OnRequestOccured(AppId appId, int pid, ArrayList* request, ArrayList* response)
{
int ret = 0;
result r = E_SUCCESS;
}
void
-_SystemService::OnApplicationTerminated(const AppId& appId, _AppType type)
+_SystemService::OnApplicationTerminated(const AppId& appId, int pid)
{
SysLog(NID_SYS, "Application (%ls) is terminated.", appId.GetPointer());
if(__pPowerManager != null)
virtual result GetValue(const Tizen::Base::String& key, bool& value) = 0;
virtual result SetValue(const Tizen::Base::String& key, const bool value) = 0;
- virtual result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value) = 0;
+ virtual result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value) = 0;
virtual result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value) = 0;
virtual result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value) = 0;
- virtual result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value) = 0;
+ virtual result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value) = 0;
virtual result GetValue(const Tizen::Base::String& key, int& value) = 0;
virtual result SetValue(const Tizen::Base::String& key, const int value) = 0;
virtual result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value) = 0;
virtual result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value) = 0;
- virtual result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value) = 0;
+ virtual result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value) = 0;
virtual result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value) = 0;
virtual bool HasKey(const Tizen::Base::String& key) = 0;
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingApplicationProvider::SetValue(const String& key, const bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingApplicationProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingApplicationProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingApplicationProvider::GetValueForPrivilegedKey(const String& key, bool& value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingApplicationProvider::SetValueForPrivilegedKey(const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingApplicationProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingApplicationProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingApplicationProvider::SetValue(const String& key, const int value)
{
return r;
}
+
result
_SettingApplicationProvider::SetValue(const String& key, const String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingApplicationProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingApplicationProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingApplicationProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
{
pSettingService->RegisterSettingProvider(*this);
}
-
+
errorCode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE, SettingEventSettingInfo, null);
if(errorCode != 0)
{
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingFontProvider::SetValue(const String& key, const bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingFontProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingFontProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingFontProvider::GetValueForPrivilegedKey(const String& key, bool& value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingFontProvider::SetValueForPrivilegedKey(const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingFontProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingFontProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingFontProvider::SetValue(const String& key, const int value)
{
break;
case _FONT_SIZE_HUGE_VCONF:
value.Append(_FONT_SIZE_HUGE);
- break;
+ break;
case _FONT_SIZE_LARGE_VCONF:
value.Append(_FONT_SIZE_LARGE);
break;
r = E_SYSTEM;
break;
}
-
+
}
else if(key == _FONT_TYPE)
{
return r;
}
+
result
_SettingFontProvider::SetValue(const String& key, const String value)
{
}
return r;
}
+
result
-_SettingFontProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingFontProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingFontProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
return r;
}
+
result
_SettingGeneralProvider::SetValue(const String& key, const bool value)
{
}
return r;
}
+
result
-_SettingGeneralProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingGeneralProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingGeneralProvider::GetValueForPrivilegedKey(const String& key, bool& value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingGeneralProvider::SetValueForPrivilegedKey(const String& key, bool value)
{
}
return r;
}
+
result
-_SettingGeneralProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingGeneralProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingGeneralProvider::SetValue(const String& key, const int value)
{
}
return r;
}
+
result
_SettingGeneralProvider::SetValue(const String& key, const String value)
{
}
return r;
}
+
result
-_SettingGeneralProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingGeneralProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingGeneralProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
return r;
}
+
result
_SettingLocaleProvider::SetValue(const String& key, const bool value)
{
}
return r;
}
+
result
-_SettingLocaleProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingLocaleProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocaleProvider::GetValueForPrivilegedKey(const String& key, bool& value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocaleProvider::SetValueForPrivilegedKey(const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingLocaleProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingLocaleProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocaleProvider::SetValue(const String& key, const int value)
{
}
return r;
}
+
result
_SettingLocaleProvider::SetValue(const String& key, const String value)
{
}
return r;
}
+
result
-_SettingLocaleProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingLocaleProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocaleProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
return r;
}
+
result
_SettingLocationProvider::SetValue(const String& key, const bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingLocationProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingLocationProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocationProvider::GetValueForPrivilegedKey(const String& key, bool& value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocationProvider::SetValueForPrivilegedKey(const String& key, bool value)
{
}
return r;
}
+
result
-_SettingLocationProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingLocationProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocationProvider::SetValue(const String& key, const int value)
{
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocationProvider::SetValue(const String& key, const String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingLocationProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingLocationProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingLocationProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
result
-_SettingNetworkProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingNetworkProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
int errorCode = 0;
result r = E_OBJ_NOT_FOUND;
r = E_SUCCESS;
__networkBluetoothEnabled = value;
- __appIdOfBluetooth = appId;
+ __pidOfBluetooth = pid;
errorCode = pthread_create(&__networkBluetoothThreadId, null, &BluetoothEnabler, (void*)this);
if(errorCode < 0)
{
}
result
-_SettingNetworkProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingNetworkProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
int errorCode = 0;
result r = E_OBJ_NOT_FOUND;
{
SysTryReturnResult(NID_SYS, HasKey(key) == true, E_UNSUPPORTED_OPERATION, "Current device does not support flightmode feature.");
r = E_SUCCESS;
- SysTryReturnResult(NID_SYS, __appIdOfFlightMode.IsEmpty() == true, E_IN_PROGRESS, "Flightmode is under changing procedure.");
+ SysTryReturnResult(NID_SYS, __pidOfFlightMode == 0, E_IN_PROGRESS, "Flightmode is under changing procedure.");
- __appIdOfFlightMode = appId;
+ __pidOfFlightMode = pid;
if(__tapiHandle == null)
{
__tapiHandle = tel_init(null);
}
errorCode = tel_set_flight_mode(__tapiHandle,
value ? TAPI_POWER_FLIGHT_MODE_ENTER : TAPI_POWER_FLIGHT_MODE_LEAVE,
- SettingEventFlightMode, (void*)&__appIdOfFlightMode);
+ SettingEventFlightMode, (void*)this);
SysTryReturnResult(NID_SYS, errorCode == 0, E_SYSTEM, "It is failed to set on Network Flight mode");
}
else if(key == _NETWORK_WIFI)
r = E_SUCCESS;
__networkWifiEnabled = value;
- __appIdOfWifi = appId;
+ __pidOfWifi = pid;
errorCode = pthread_create(&__networkWifiThreadId, null, &WifiEnabler, (void*)this);
if(errorCode < 0)
{
r = E_SUCCESS;
__networkWifiDirectEnabled = value;
- __appIdOfWifiDirect = appId;
+ __pidOfWifiDirect = pid;
errorCode = pthread_create(&__networkWifiDirectThreadId, null, &WifiDirectEnabler, (void*)this);
if(errorCode < 0)
{
}
result
-_SettingNetworkProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingNetworkProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
{
_SettingService* pSettingService = _SettingService::GetInstance();
SysTryReturnVoidResult(NID_SYS, pSettingService != null, E_SYSTEM, "SettingService is not ready.");
- AppId* pAppId = (AppId*)user_data;
+ _SettingNetworkProvider* pProvider = (_SettingNetworkProvider*)user_data;
+
+ int pid = pProvider->__pidOfFlightMode;
+ SysTryReturnVoidResult(NID_SYS, pid > 0, E_SYSTEM, "There is no pid[%d].", pid);
String settingKey(_SETTING_PREFIX);
settingKey.Append(_NETWORK_FLIGHTMODE);
int errorCode = 0;
SysLogException(NID_SYS, E_SYSTEM, "It is failed to change flight mode");
returnValue = _NETWORK_RESULT_SYSTEM;
}
-
- pSettingService->SendResponse(*pAppId, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
-
- pAppId->Clear();
+ pSettingService->SendResponse(pid, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
+ pProvider->__pidOfFlightMode = 0;
}
void*
return null;
}
- AppId appId = (pProvider->__appIdOfWifi);
+ int pid = (pProvider->__pidOfWifi);
+ if(pid <= 0)
+ {
+ SysLogException(NID_SYS, E_SYSTEM, "There is no pid[%d].", pid);
+ return null;
+ }
String settingKey(_SETTING_PREFIX);
settingKey.Append(_NETWORK_WIFI);
String returnValue = _NETWORK_RESULT_SUCCESS;
}
}
- pSettingService->SendResponse(appId, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
- pProvider->__appIdOfWifi.Clear();
+ pSettingService->SendResponse(pid, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
+ pProvider->__pidOfWifi = 0;
pProvider->__networkWifiThreadId = _INIT_THREAD_ID;
return null;
}
return null;
}
- AppId appId = pProvider->__appIdOfWifiDirect;
+ int pid = pProvider->__pidOfWifiDirect;
String settingKey(_SETTING_PREFIX);
settingKey.Append(_NETWORK_WIFI_DIRECT);
String returnValue = _NETWORK_RESULT_SUCCESS;
returnValue = _NETWORK_RESULT_SYSTEM;
}
- pSettingService->SendResponse(appId, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
- pProvider->__appIdOfWifiDirect.Clear();
+ pSettingService->SendResponse(pid, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
+ pProvider->__pidOfWifiDirect = 0;
pProvider->__networkWifiDirectThreadId = _INIT_THREAD_ID;
return null;
}
return null;
}
+ int pid = pProvider->__pidOfBluetooth;
+ if(pid <= 0)
+ {
+ SysLogException(NID_SYS, E_SYSTEM, "There is no pid [%d].", pid);
+ return null;
+ }
+
int bluetoothStatus = 0;
int errorCode = vconf_get_int(VCONFKEY_BT_STATUS, &bluetoothStatus);
- AppId appId = pProvider->__appIdOfBluetooth;
+
String settingKey(_SETTING_PREFIX);
settingKey.Append(_NETWORK_BLUETOOTH);
String returnValue = _NETWORK_RESULT_SUCCESS;
}
else
{
- SysLogException(NID_SYS, E_SYSTEM, "It is failed to load wifi library.");
+ SysLogException(NID_SYS, E_SYSTEM, "It is failed to load bluetooth library.");
returnValue = _NETWORK_RESULT_SYSTEM;
}
returnValue = _NETWORK_RESULT_SYSTEM;
}
- pSettingService->SendResponse(appId, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
- pProvider->__appIdOfWifiDirect.Clear();
- pProvider->__networkWifiDirectThreadId = _INIT_THREAD_ID;
+ pSettingService->SendResponse(pid, L"osp.setting.command.set.bool.async.priv", settingKey, returnValue);
+ pProvider->__pidOfBluetooth = 0;
+ pProvider->__networkBluetoothThreadId = _INIT_THREAD_ID;
return null;
}
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
void* __pWifiDllHandle;
void* __pBluetoothDllHandle;
tethering_h __tetheringHandle;
- Tizen::App::AppId __appIdOfFlightMode;
- Tizen::App::AppId __appIdOfWifi;
- Tizen::App::AppId __appIdOfWifiDirect;
- Tizen::App::AppId __appIdOfBluetooth;
+
+ int __pidOfFlightMode;
+ int __pidOfWifi;
+ int __pidOfWifiDirect;
+ int __pidOfBluetooth;
pthread_t __networkWifiThreadId;
pthread_t __networkWifiDirectThreadId;
}
return r;
}
+
result
_SettingScreenProvider::SetValue(const String& key, const bool value)
{
}
return r;
}
+
result
-_SettingScreenProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingScreenProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingScreenProvider::GetValueForPrivilegedKey(const String& key, bool& value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingScreenProvider::SetValueForPrivilegedKey(const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingScreenProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingScreenProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
return r;
}
+
result
_SettingScreenProvider::SetValue(const String& key, const int value)
{
}
return r;
}
+
result
_SettingScreenProvider::SetValue(const String& key, const String value)
{
}
return r;
}
+
result
-_SettingScreenProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingScreenProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingScreenProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
result
-_SettingSoundProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingSoundProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingSoundProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingSoundProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingSoundProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingSoundProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
result
-_SettingSpeechProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingSpeechProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingSpeechProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingSpeechProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingSpeechProvider::SetValue(const String& key, const String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
-_SettingSpeechProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingSpeechProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
+
result
_SettingSpeechProvider::SetValueForPrivilegedKey(const String& key, String value)
{
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
result
-_SettingStorageProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingStorageProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingStorageProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingStorageProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingStorageProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingStorageProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);
}
result
-_SettingVibrationProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingVibrationProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingVibrationProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const String& key, bool value)
+_SettingVibrationProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const String& key, bool value)
{
return E_OBJ_NOT_FOUND;
}
}
result
-_SettingVibrationProvider::SetValueAsync(const Tizen::App::AppId appId, const String& key, String value)
+_SettingVibrationProvider::SetValueAsync(const Tizen::App::AppId appId, int pid, const String& key, String value)
{
return E_OBJ_NOT_FOUND;
}
result GetValue(const Tizen::Base::String& key, bool& value);
result SetValue(const Tizen::Base::String& key, const bool value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
- result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, const Tizen::Base::String& key, bool value);
+ result SetValueAsyncForPrivilegedKey(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, bool value);
result GetValue(const Tizen::Base::String& key, int& value);
result SetValue(const Tizen::Base::String& key, const int value);
result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
- result SetValueAsync(const Tizen::App::AppId appId, const Tizen::Base::String& key, Tizen::Base::String value);
+ result SetValueAsync(const Tizen::App::AppId appId, int pid, const Tizen::Base::String& key, Tizen::Base::String value);
result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
bool HasKey(const Tizen::Base::String& key);