merge latest tizen_2.1
authorYoung Ik Cho <youngik.cho@samsung.com>
Mon, 25 Mar 2013 01:23:14 +0000 (10:23 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Mon, 25 Mar 2013 01:23:14 +0000 (10:23 +0900)
Change-Id: Iff113806fb8e8f57ad71337e83fa02bc2568c485
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
40 files changed:
inc/AppService.h
inc/FApp_CommunicationDispatcher.h
inc/FApp_ICommunicationRequestListener.h
inc/FSys_AccessoryManagerService.h
inc/FSys_DeviceManagerService.h
inc/FSys_SettingService.h
inc/FSys_SystemService.h
plugins/accessory-condition-handler/AccessoryMonitor.cpp
plugins/accessory-condition-handler/AccessoryMonitor.h
plugins/message-condition-handler/MessageConditionHandler.cpp
plugins/message-condition-handler/MessageConditionHandler.h
src/AppService.cpp
src/FApp_CommunicationDispatcher.cpp
src/FSys_AccessoryManagerService.cpp
src/FSys_DeviceManagerService.cpp
src/FSys_SettingService.cpp
src/FSys_SystemService.cpp
src/setting/FSys_ISettingProvider.h
src/setting/FSys_SettingApplicationProvider.cpp
src/setting/FSys_SettingApplicationProvider.h
src/setting/FSys_SettingFontProvider.cpp
src/setting/FSys_SettingFontProvider.h
src/setting/FSys_SettingGeneralProvider.cpp
src/setting/FSys_SettingGeneralProvider.h
src/setting/FSys_SettingLocaleProvider.cpp
src/setting/FSys_SettingLocaleProvider.h
src/setting/FSys_SettingLocationProvider.cpp
src/setting/FSys_SettingLocationProvider.h
src/setting/FSys_SettingNetworkProvider.cpp
src/setting/FSys_SettingNetworkProvider.h
src/setting/FSys_SettingScreenProvider.cpp
src/setting/FSys_SettingScreenProvider.h
src/setting/FSys_SettingSoundProvider.cpp
src/setting/FSys_SettingSoundProvider.h
src/setting/FSys_SettingSpeechProvider.cpp
src/setting/FSys_SettingSpeechProvider.h
src/setting/FSys_SettingStorageProvider.cpp
src/setting/FSys_SettingStorageProvider.h
src/setting/FSys_SettingVibrationProvider.cpp
src/setting/FSys_SettingVibrationProvider.h

index 8170039..bdfc30b 100644 (file)
@@ -98,6 +98,7 @@ private:
        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);
index dd7a2e1..f7d16cb 100644 (file)
@@ -25,7 +25,7 @@
 #include <FBase.h>
 #include <FIo.h>
 
-#include <FApp_IAppManagerEventListener.h>
+#include <FApp_IAppEventListener.h>
 #include <FIo_IIpcServerEventListener.h>
 #include "FApp_ICommunicationRequestListener.h"
 
@@ -59,15 +59,18 @@ namespace Tizen { namespace App {
  */
 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) {}
@@ -75,28 +78,23 @@ public:
        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
index ca41216..e59aa4f 100644 (file)
@@ -38,8 +38,8 @@ class _ICommunicationRequestListener
 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
 
index b529f8a..a3a2c74 100644 (file)
@@ -34,8 +34,8 @@ class Library;
 }}}
 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
@@ -51,11 +51,11 @@ private:
 
 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);
@@ -63,6 +63,9 @@ private:
        Tizen::App::_CommunicationDispatcher*   __pCommunicationDispatcher;
        OnRequestOccuredFunction                __pOnRequestOccuredFunction;
        RemoveOwnerApplicationFunction          __pRemoveOwnerApplicationFunction;
+
+private:
+       static _AccessoryManagerService*        __pAccessoryManagerService;
 };     //_AccessoryManagerService
 
 }} //Tizen::System
index d2a8155..7243806 100644 (file)
@@ -45,9 +45,9 @@ private:
        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);
@@ -58,11 +58,11 @@ private:
        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
 
index 8db9cc9..38933dc 100644 (file)
@@ -48,13 +48,13 @@ private:
        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);
@@ -70,6 +70,7 @@ private:
        static _SettingService*                 __pSettingService;
 
 private:
+
        class _StringHashProvider
                : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
        {
index e318e1d..70d89e0 100644 (file)
@@ -48,8 +48,8 @@ private:
        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);
 
index 1c71ead..e6cb4aa 100644 (file)
@@ -44,14 +44,16 @@ namespace{
 }
 
 
-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)
 {
 }
 
@@ -59,30 +61,6 @@ AccessoryMonitor::~AccessoryMonitor()
 {
 }
 
-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
 {
@@ -98,7 +76,6 @@ AccessoryMonitor::Construct(AccessoryConditionHandler* pConditionHandler)
        __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.");
@@ -109,24 +86,24 @@ AccessoryMonitor::Construct(AccessoryConditionHandler* pConditionHandler)
 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;
        }
 }
 
@@ -145,7 +122,7 @@ AccessoryMonitor::OnDataRouterDataReceivedN(const char* buffer, int length)
        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();
@@ -169,8 +146,8 @@ AccessoryMonitor::OnDataRouterDataReceivedN(const char* buffer, int length)
 
                        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);
@@ -191,6 +168,17 @@ AccessoryMonitor::OnDataRouterStateChanged(_DataRouterState state)
        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
@@ -205,24 +193,26 @@ RegisterSendData(SendDataFunction function)
 }
 
 _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));
 
@@ -233,15 +223,15 @@ OnRequestOccured(AppId appId, ArrayList* pRequest, ArrayList* pResponse)
        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");
@@ -267,18 +257,18 @@ OnRequestOccured(AppId appId, ArrayList* pRequest, ArrayList* pResponse)
                                        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:
index 8234f93..33ea002 100644 (file)
@@ -42,20 +42,24 @@ private:
 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
index 4ce5907..0a6afb5 100644 (file)
@@ -356,68 +356,9 @@ _MessageConditionHandler::GetWapConditions(const Tizen::Base::String& condition,
        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);
@@ -498,22 +439,6 @@ _MessageConditionHandler::IncomingWapPushMessageCallback(const char* pHeader, co
        // 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);
@@ -525,6 +450,8 @@ _MessageConditionHandler::IncomingWapPushMessageCallback(const char* pHeader, co
 
        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.");
index 6879eb5..db56032 100644 (file)
@@ -48,7 +48,6 @@ public:
                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);
index 84011ff..a2b16f2 100644 (file)
@@ -161,6 +161,7 @@ AppService::OnAppInitialized(void)
        LaunchSecurityService();
        LaunchChannelService();
        LaunchCommonService();
+       ReadySystemServices();
 //     LaunchSystemServices();
 //     LaunchUserServices();
 //     InitializeServices();
@@ -210,7 +211,7 @@ AppService::InitializeIpc(void)
 
        __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));
@@ -218,7 +219,7 @@ AppService::InitializeIpc(void)
 
        __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));
@@ -226,7 +227,7 @@ AppService::InitializeIpc(void)
 
        __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;
@@ -244,39 +245,43 @@ CATCH:
        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));
@@ -284,7 +289,7 @@ AppService::InitializeServices(void)
 
        __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));
@@ -342,7 +347,7 @@ AppService::LaunchSystemServices(void)
        //      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;
        }
 
@@ -536,8 +541,8 @@ AppService::OnPackageInstallationCompleted(const PackageId& packageId, Tizen::Ap
 
                        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));
                }
@@ -591,7 +596,7 @@ AppService::OnApplicationLaunched(const AppId& appId, Tizen::App::_AppType type)
        {
                _AppManagerImpl::GetInstance()->RemoveEventListener(*this);
                InitializeServices();
-               
+
                LaunchSystemServices();
 
                Tizen::App::Package::_PackageManagerImpl::GetInstance()->AddEventListener(this, 0);
index 4d8ecb7..98f3ae0 100644 (file)
@@ -37,149 +37,34 @@ namespace
        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);
@@ -189,273 +74,38 @@ _CommunicationDispatcher::~_CommunicationDispatcher()
 {
        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
@@ -466,7 +116,7 @@ _CommunicationDispatcher::OnIpcRequestReceived(_IpcServer& server, const IPC::Me
        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)
@@ -476,90 +126,74 @@ _CommunicationDispatcher::OnIpcRequestReceived(_IpcServer& server, const IPC::Me
 }
 
 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;
 }
 
 
index b285344..6bc991b 100644 (file)
@@ -39,27 +39,27 @@ namespace {
        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()
@@ -73,23 +73,23 @@ _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);
 
@@ -104,7 +104,7 @@ _AccessoryManagerService::~_AccessoryManagerService()
        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);
@@ -112,11 +112,11 @@ CATCH:
 }
 
 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
@@ -126,25 +126,25 @@ _AccessoryManagerService::GetId(void)
 }
 
 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);
 }
index 6d05083..1ef5b95 100644 (file)
@@ -60,7 +60,7 @@ Tizen::System::_DeviceManagerService* Tizen::System::_DeviceManagerService::__pD
 
 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();
 
@@ -115,9 +115,9 @@ void app_media_key_handler(media_key_e key, media_key_event_e status, void* pUse
                                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);
                }
@@ -133,13 +133,13 @@ _DeviceManagerService::_DeviceManagerService()
        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);
 }
@@ -155,20 +155,20 @@ _DeviceManagerService::~_DeviceManagerService()
                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);
@@ -193,10 +193,10 @@ _DeviceManagerService::GetId(void)
 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);
@@ -209,23 +209,23 @@ _DeviceManagerService::SendEvent(String 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.");
        }
 }
 
@@ -233,7 +233,7 @@ void
 _DeviceManagerService::OnBluetoothEventOccured(int code)
 {
        int count = 0;
-       AppId* pAppId = null;
+       Integer* pPid = null;
 
        String command = DEVICE_MANAGER_COMMAND_EVENT;
        String device = DEVICE_MANAGER_BLUETOOTH;
@@ -241,33 +241,29 @@ _DeviceManagerService::OnBluetoothEventOccured(int code)
 
        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.");
                }
        }
 
@@ -276,15 +272,13 @@ CATCH:
 }
 
 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;
                }
@@ -298,42 +292,40 @@ _DeviceManagerService::AddInterestedApp(AppId appId)
                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;
@@ -357,7 +349,7 @@ _DeviceManagerService::OnRequestOccured(AppId appId, ArrayList* request, ArrayLi
                if(cmp == 0)
                {
                        SysLog(NID_SYS, "Bluetooth headset event is required");
-                       AddInterestedApp(appId);
+                       AddInterestedApp(pid);
                }
        }
 
@@ -367,7 +359,7 @@ _DeviceManagerService::OnRequestOccured(AppId appId, ArrayList* request, ArrayLi
                strComparer.Compare(*device, DEVICE_MANAGER_BLUETOOTH, cmp);
                if(cmp == 0)
                {
-                       RemoveInterestedApp(appId);
+                       RemoveInterestedApp(pid);
                }
        }
 
@@ -406,9 +398,9 @@ CATCH:
 }
 
 void
-_DeviceManagerService::OnApplicationTerminated(const AppId& appId, _AppType type)
+_DeviceManagerService::OnApplicationTerminated(const AppId& appId, int pid)
 {
-       RemoveInterestedApp(appId);
+       RemoveInterestedApp(pid);
 }
 
 bool
index dd550ea..af9078a 100644 (file)
@@ -186,7 +186,7 @@ _SettingService::UnregisterSettingProvider(_ISettingProvider& settingProvider)
 }
 
 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;
@@ -195,6 +195,7 @@ _SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* re
        String* value = null;
        String requiredKey;
        String requiredProvider;
+       Integer processId(pid);
 
        if(__firstRequest == true)
        {
@@ -218,10 +219,11 @@ _SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* re
        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
@@ -233,10 +235,10 @@ _SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* re
        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
@@ -303,7 +305,7 @@ _SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* re
                                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));
                                }
                        }
@@ -352,7 +354,7 @@ _SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* re
                                        {
                                                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
@@ -426,7 +428,7 @@ _SettingService::OnRequestOccured(AppId appId, ArrayList* request, ArrayList* re
                                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)
@@ -501,8 +503,8 @@ _SettingService::SendEvent(String key)
        __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);
@@ -512,14 +514,14 @@ _SettingService::SendEvent(String key)
                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();
@@ -527,7 +529,7 @@ _SettingService::SendEvent(String key)
 }
 
 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.");
 
@@ -540,18 +542,19 @@ _SettingService::SendResponse(AppId appId, String responseId, String key, String
        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));
 }
 
 }}
index 3be5b77..66d9a54 100644 (file)
@@ -150,7 +150,7 @@ _SystemService::OnActiveAppChanged(const AppId& appId)
 }
 
 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;
@@ -295,7 +295,7 @@ CATCH:
 }
 
 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)
index 520817c..060d727 100644 (file)
@@ -39,17 +39,17 @@ public:
 
        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;
index 850f7bc..c745eb5 100644 (file)
@@ -125,28 +125,33 @@ _SettingApplicationProvider::GetValue(const String& key, bool& value)
 {
        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;
 }
@@ -156,6 +161,7 @@ _SettingApplicationProvider::GetValue(const String& key, int& value)
 {
        return E_OBJ_NOT_FOUND;
 }
+
 result
 _SettingApplicationProvider::SetValue(const String& key, const int value)
 {
@@ -195,16 +201,19 @@ _SettingApplicationProvider::GetValue(const String& key, String& 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)
 {
index 2464c30..0a51dbb 100644 (file)
@@ -44,17 +44,17 @@ public:
 
        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);
index 665b1d4..89cf26b 100644 (file)
@@ -61,7 +61,7 @@ _SettingFontProvider::_SettingFontProvider()
        {
                pSettingService->RegisterSettingProvider(*this);
        }
-       
+
        errorCode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE, SettingEventSettingInfo, null);
        if(errorCode != 0)
        {
@@ -109,28 +109,33 @@ _SettingFontProvider::GetValue(const String& key, bool& value)
 {
        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;
 }
@@ -140,6 +145,7 @@ _SettingFontProvider::GetValue(const String& key, int& value)
 {
        return E_OBJ_NOT_FOUND;
 }
+
 result
 _SettingFontProvider::SetValue(const String& key, const int value)
 {
@@ -167,7 +173,7 @@ _SettingFontProvider::GetValue(const String& key, String& 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;
@@ -181,7 +187,7 @@ _SettingFontProvider::GetValue(const String& key, String& value)
                        r = E_SYSTEM;
                        break;
                }
-               
+
        }
        else if(key == _FONT_TYPE)
        {
@@ -197,6 +203,7 @@ _SettingFontProvider::GetValue(const String& key, String& value)
 
        return r;
 }
+
 result
 _SettingFontProvider::SetValue(const String& key, const String value)
 {
@@ -252,11 +259,13 @@ _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)
 {
index 7c2e501..052351c 100644 (file)
@@ -43,17 +43,17 @@ public:
 
        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);
index 105dc70..4013186 100644 (file)
@@ -247,6 +247,7 @@ _SettingGeneralProvider::GetValue(const String& key, bool& value)
        }
        return r;
 }
+
 result
 _SettingGeneralProvider::SetValue(const String& key, const bool value)
 {
@@ -310,16 +311,19 @@ _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)
 {
@@ -338,8 +342,9 @@ _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;
 }
@@ -349,6 +354,7 @@ _SettingGeneralProvider::GetValue(const String& key, int& value)
 {
        return E_OBJ_NOT_FOUND;
 }
+
 result
 _SettingGeneralProvider::SetValue(const String& key, const int value)
 {
@@ -375,6 +381,7 @@ _SettingGeneralProvider::GetValue(const String& key, String& value)
        }
        return r;
 }
+
 result
 _SettingGeneralProvider::SetValue(const String& key, const String value)
 {
@@ -396,11 +403,13 @@ _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)
 {
index bdb663c..0989fb3 100644 (file)
@@ -45,17 +45,17 @@ public:
 
        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);
index 55054b9..24458f7 100644 (file)
@@ -228,6 +228,7 @@ _SettingLocaleProvider::GetValue(const String& key, bool& value)
        }
        return r;
 }
+
 result
 _SettingLocaleProvider::SetValue(const String& key, const bool value)
 {
@@ -250,23 +251,27 @@ _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;
 }
@@ -276,6 +281,7 @@ _SettingLocaleProvider::GetValue(const String& key, int& value)
 {
        return E_OBJ_NOT_FOUND;
 }
+
 result
 _SettingLocaleProvider::SetValue(const String& key, const int value)
 {
@@ -488,6 +494,7 @@ _SettingLocaleProvider::GetValue(const String& key, String& value)
        }
        return r;
 }
+
 result
 _SettingLocaleProvider::SetValue(const String& key, const String value)
 {
@@ -580,11 +587,13 @@ _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)
 {
index e45342a..d3b3b53 100644 (file)
@@ -46,17 +46,17 @@ public:
 
        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);
index 291dcdd..c2bcdc9 100644 (file)
@@ -157,21 +157,25 @@ _SettingLocationProvider::GetValue(const String& key, bool& value)
        }
        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)
 {
@@ -221,8 +225,9 @@ _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;
 }
@@ -232,6 +237,7 @@ _SettingLocationProvider::GetValue(const String& key, int& value)
 {
        return E_OBJ_NOT_FOUND;
 }
+
 result
 _SettingLocationProvider::SetValue(const String& key, const int value)
 {
@@ -243,16 +249,19 @@ _SettingLocationProvider::GetValue(const String& key, String& 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)
 {
index 63dd701..2eaf7be 100644 (file)
@@ -44,17 +44,17 @@ public:
 
        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);
index c593fbb..6b72092 100644 (file)
@@ -563,7 +563,7 @@ _SettingNetworkProvider::SetValue(const String& key, const bool value)
 }
 
 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;
@@ -575,7 +575,7 @@ _SettingNetworkProvider::SetValueAsync(const Tizen::App::AppId appId, const Stri
                r = E_SUCCESS;
                __networkBluetoothEnabled = value;
 
-               __appIdOfBluetooth = appId;
+               __pidOfBluetooth = pid;
                errorCode = pthread_create(&__networkBluetoothThreadId, null, &BluetoothEnabler, (void*)this);
                if(errorCode < 0)
                {
@@ -618,7 +618,7 @@ _SettingNetworkProvider::SetValueForPrivilegedKey(const String& key, bool value)
 }
 
 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;
@@ -627,9 +627,9 @@ _SettingNetworkProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId a
        {
                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);
@@ -637,7 +637,7 @@ _SettingNetworkProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId a
                }
                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)
@@ -647,7 +647,7 @@ _SettingNetworkProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId a
                r = E_SUCCESS;
                __networkWifiEnabled = value;
 
-               __appIdOfWifi = appId;
+               __pidOfWifi = pid;
                errorCode = pthread_create(&__networkWifiThreadId, null, &WifiEnabler, (void*)this);
                if(errorCode < 0)
                {
@@ -662,7 +662,7 @@ _SettingNetworkProvider::SetValueAsyncForPrivilegedKey(const Tizen::App::AppId a
                r = E_SUCCESS;
                __networkWifiDirectEnabled = value;
 
-               __appIdOfWifiDirect = appId;
+               __pidOfWifiDirect = pid;
                errorCode = pthread_create(&__networkWifiDirectThreadId, null, &WifiDirectEnabler, (void*)this);
                if(errorCode < 0)
                {
@@ -731,7 +731,7 @@ _SettingNetworkProvider::SetValue(const String& key, const String value)
 }
 
 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;
 }
@@ -1013,7 +1013,10 @@ _SettingNetworkProvider::SettingEventFlightMode(TapiHandle* handle, int res, voi
 {
        _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;
@@ -1046,10 +1049,8 @@ _SettingNetworkProvider::SettingEventFlightMode(TapiHandle* handle, int res, voi
                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*
@@ -1064,7 +1065,12 @@ _SettingNetworkProvider::WifiEnabler(void* data)
                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;
@@ -1095,8 +1101,8 @@ _SettingNetworkProvider::WifiEnabler(void* data)
                }
        }
 
-       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;
 }
@@ -1113,7 +1119,7 @@ _SettingNetworkProvider::WifiDirectEnabler(void* data)
                return null;
        }
 
-       AppId appId = pProvider->__appIdOfWifiDirect;
+       int pid = pProvider->__pidOfWifiDirect;
        String settingKey(_SETTING_PREFIX);
        settingKey.Append(_NETWORK_WIFI_DIRECT);
        String returnValue = _NETWORK_RESULT_SUCCESS;
@@ -1142,8 +1148,8 @@ _SettingNetworkProvider::WifiDirectEnabler(void* data)
                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;
 }
@@ -1161,11 +1167,18 @@ _SettingNetworkProvider::BluetoothEnabler(void* data)
                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;
@@ -1192,7 +1205,7 @@ _SettingNetworkProvider::BluetoothEnabler(void* data)
                }
                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;
                }
 
@@ -1202,9 +1215,9 @@ _SettingNetworkProvider::BluetoothEnabler(void* data)
                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;
 }
 
index 5cc53a6..ce4b7f9 100644 (file)
@@ -50,17 +50,17 @@ public:
 
        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);
@@ -86,10 +86,11 @@ private:
        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;
index 4c6fcd8..16e87dd 100644 (file)
@@ -216,6 +216,7 @@ _SettingScreenProvider::GetValue(const String& key, bool& value)
        }
        return r;
 }
+
 result
 _SettingScreenProvider::SetValue(const String& key, const bool value)
 {
@@ -245,23 +246,27 @@ _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;
 }
@@ -291,6 +296,7 @@ _SettingScreenProvider::GetValue(const String& key, int& value)
        }
        return r;
 }
+
 result
 _SettingScreenProvider::SetValue(const String& key, const int value)
 {
@@ -360,6 +366,7 @@ _SettingScreenProvider::GetValue(const String& key, String& value)
        }
        return r;
 }
+
 result
 _SettingScreenProvider::SetValue(const String& key, const String value)
 {
@@ -414,11 +421,13 @@ _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)
 {
index 912ecfd..688a46d 100644 (file)
@@ -45,17 +45,17 @@ public:
 
        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);
index bd28723..5048548 100644 (file)
@@ -234,7 +234,7 @@ _SettingSoundProvider::SetValue(const String& key, const bool value)
 }
 
 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;
 }
@@ -252,7 +252,7 @@ _SettingSoundProvider::SetValueForPrivilegedKey(const String& key, bool value)
 }
 
 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;
 }
@@ -506,7 +506,7 @@ _SettingSoundProvider::SetValue(const String& key, const String value)
 }
 
 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;
 }
index d82362b..7d26382 100644 (file)
@@ -47,17 +47,17 @@ public:
 
        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);
index 29f5a34..cb48058 100644 (file)
@@ -138,7 +138,7 @@ _SettingSpeechProvider::SetValue(const String& key, const bool value)
 }
 
 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;
 }
@@ -173,7 +173,7 @@ _SettingSpeechProvider::SetValueForPrivilegedKey(const String& key, bool value)
 }
 
 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;
 }
@@ -217,16 +217,19 @@ _SettingSpeechProvider::GetValue(const String& key, String& value)
 {
        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)
 {
index ebf81cd..6df1241 100644 (file)
@@ -44,17 +44,17 @@ public:
 
        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);
index b0a5c13..2595070 100644 (file)
@@ -156,7 +156,7 @@ _SettingStorageProvider::SetValue(const String& key, const bool value)
 }
 
 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;
 }
@@ -174,7 +174,7 @@ _SettingStorageProvider::SetValueForPrivilegedKey(const String& key, bool value)
 }
 
 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;
 }
@@ -450,7 +450,7 @@ _SettingStorageProvider::SetValue(const String& key, const String value)
 }
 
 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;
 }
index e2c6a03..c6712dc 100644 (file)
@@ -45,17 +45,17 @@ public:
 
        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);
index fbc7ef5..0b23a77 100644 (file)
@@ -150,7 +150,7 @@ _SettingVibrationProvider::SetValue(const String& key, const bool value)
 }
 
 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;
 }
@@ -168,7 +168,7 @@ _SettingVibrationProvider::SetValueForPrivilegedKey(const String& key, bool valu
 }
 
 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;
 }
@@ -240,7 +240,7 @@ _SettingVibrationProvider::SetValue(const String& key, const String value)
 }
 
 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;
 }
index 9066590..cbdb946 100644 (file)
@@ -43,17 +43,17 @@ public:
 
        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);