Merge "Update PackageAppFilter API" into tizen_2.1
authorDuyoung Jang <duyoung.jang@samsung.com>
Thu, 11 Apr 2013 01:55:16 +0000 (10:55 +0900)
committerGerrit Code Review <gerrit2@kim11>
Thu, 11 Apr 2013 01:55:16 +0000 (10:55 +0900)
50 files changed:
inc/FAppAppManager.h
inc/FAppPkgPackageLicenseManager.h [deleted file]
inc/FIoMmcStorageManager.h
inc/FLocales.h
inc/FSysAlarm.h
inc/FSysDeviceManager.h
inc/FSysIAlarmEventListener.h
inc/FSysIBatteryEventListener.h
inc/FSysIScreenEventListener.h
inc/FSysISettingInfoSetValueAsyncResultListener.h
inc/FSysSettingInfo.h
inc/FSysSystemInfo.h
packaging/osp-appfw.spec
res/arm/usr/etc/media-capability.xml
res/x86/usr/etc/media-capability.xml
src/CMakeLists.txt
src/app/CMakeLists.txt
src/app/FApp_AppArg.cpp
src/app/FApp_AppControlImpl.cpp
src/app/FApp_AppControlManager.cpp
src/app/FApp_AppControlRegistry.cpp
src/app/FApp_AppControlRegistry.h
src/app/FApp_AppImpl.cpp
src/app/FApp_DataControlManager.cpp [new file with mode: 0644]
src/app/FApp_DataControlManager.h [new file with mode: 0644]
src/app/FApp_DataControlProviderManagerImpl.cpp
src/app/FApp_MapDataControlImpl.cpp
src/app/FApp_SqlDataControlImpl.cpp
src/app/inc/FApp_AppArg.h
src/app/inc/FApp_AppControlManager.h
src/app/package/FAppPkgPackageLicenseManager.cpp [deleted file]
src/base/FBaseInt8.cpp
src/io/FIo_DataControlResultSetImpl.cpp
src/io/FIo_DataSetEnumeratorImpl.cpp
src/io/FIo_DataSetImpl.cpp
src/io/FIo_RegistryCore.cpp
src/io/inc/FIo_DataSetEnumeratorImpl.h [changed mode: 0644->0755]
src/io/inc/FIo_DataSetImpl.h
src/locales/FLcl_LocaleImpl.cpp
src/security/FSec_PrivacyInfoImpl.cpp
src/security/FSec_PrivacyManagerImpl.cpp
src/system/FSysSettingInfo.cpp
src/system/FSysSystemInfo.cpp
src/system/FSys_AlarmImpl.cpp
src/system/FSys_AlarmManager.cpp
src/system/FSys_RuntimeInfoImpl.cpp
src/system/FSys_SettingClient.cpp
src/system/FSys_SettingClient.h
src/system/FSys_SettingInfoImpl.cpp
src/system/inc/FSys_SettingInfoImpl.h

index 92f8ad5..8de4ddc 100755 (executable)
@@ -263,7 +263,8 @@ public:
        * @exception    E_SUCCESS                       The method is successful.
        * @exception    E_APP_NOT_INSTALLED     The expected shared directory cannot be found
        *                                                                       because the application specified with @c appId cannot be installed.
-       * @remarks              The specific error code can be accessed using the GetLastResult() method.
+       * @remarks              The returned path can be invalid when the application with specified with @c appId is uninstalled. @n
+       *                               The specific error code can be accessed using the GetLastResult() method.
        */
        static Tizen::Base::String GetAppSharedPath(const AppId& appId);
 
diff --git a/inc/FAppPkgPackageLicenseManager.h b/inc/FAppPkgPackageLicenseManager.h
deleted file mode 100755 (executable)
index 263ead1..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// Open Service Platform
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file       FAppPkgPackageLicenseManager.h
- * @brief      This is the header file for the %PackageLicenseManager class.
- *
- * This header file contains the declarations of the %PackageLicenseManager class.
- */
-
-#ifndef _FAPP_PKG_PACKAGE_LICENSE_MANAGER_H_
-#define _FAPP_PKG_PACKAGE_LICENSE_MANAGER_H_
-
-#include <FBase.h>
-#include <FAppTypes.h>
-
-namespace Tizen { namespace App { namespace Package
-{
-
-/**
- * @class   PackageLicenseManager
- * @brief   This class gets the information of a package's license and manages its installation.
- *
- * @since 2.1
- *
- * @remarks  Do not use this class without obtaining prior permissions from the %Tizen platform team.
- *
- * The %PackageLicenseManager class gets the information of a package's license and manages its installation.
- */
-class _OSP_EXPORT_ PackageLicenseManager
-{
-public:
-
-       /**
-       * Generates a license request and URL.
-       *
-       * @since 2.1
-       * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/packagelicensemanager
-       *
-       * @return               An error code
-       * @param[in]    licenseRequestInfo      The string buffer of license request information
-       * @param[out]   licenseRequest          The string buffer of Package DRM license request
-       * @param[out]   licenseUrl                      The URL for Package DRM license
-       * @exception    E_SUCCESS                       The method is successful.
-       * @exception    E_INVALID_ARG           A specified input parameter is invalid.
-       * @exception    E_INVALID_DATA          A specified XML field of input string is invalid. @n
-       *                                                                       For example, the requested ID is invalid.
-       * @exception    E_PARSING_FAILED        An error has occurred when parsing the input string.
-       * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
-       * @remarks      Do not use this method without obtaining prior permissions from the %Tizen platform team.
-       */
-       static result GenerateDrmLicenseRequest(const Tizen::Base::String& licenseRequestInfo, Tizen::Base::String& licenseRequest, Tizen::Base::String& licenseUrl);
-
-       /**
-       * Saves a Package DRM license(right object) to a DRM repository. @n
-       * It stores the DRM license (right object) when it does not exist in the DRM repository.
-       * When the same @c packgeId of DRM license(right object) already exists in the DRM repository, it is overwritten.
-       *
-       * @since 2.1
-       * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/packagelicensemanager
-       *
-       * @return               An error code
-       * @param[in]    rightObject                     The Package DRM license (right object)
-       * @exception    E_SUCCESS                       The method is successful.
-       * @exception    E_INVALID_ARG           The specified input parameter is invalid.
-       * @exception    E_DATABASE                      An error has occurred when handling the rights object repository.
-       * @exception    E_INVALID_BINDING       The input right object is not binded to the device.
-       * @exception    E_INVALID_SIGNATURE             The signature verification of the input string has failed.
-       * @exception    E_INVALID_CERTIFICATE   The certificate chain verification of the input string has failed.
-       * @exception    E_INVALID_DATA          A specified XML field of input string is invalid. @n
-       *                                                                       For example, the @c appId field is empty.
-       * @exception    E_PARSING_FAILED        An error has occurred when parsing the input string.
-       * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
-       * @remarks      Do not use this method without obtaining prior permissions from the %Tizen platform team.
-       */
-       static result SaveDrmLicense(const Tizen::Base::String& rightObject);
-
-       /**
-       * Gets the remaining time of the package until the DRM license expiration.
-       *
-       * @since 2.1
-       * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/packagelicensemanager
-       *
-       * @return               The remaining time of the DRM license @n
-       *                               If the remaining time is unlimited, the return value of Tizen::Base::TimeSpan's days will be set to @c 9999.
-       * @param[in]    pkgId                           The package ID with which to get the information of time-based constraint
-       * @exception    E_SUCCESS                       The method is successful.
-       * @exception    E_INVALID_ARG           The specified input parameter is invalid.
-       * @exception    E_DATABASE                      An error has occurred when handling the rights object repository.
-       * @exception    E_OBJ_NOT_FOUND         The specified @c pkgId does not exist in the rights management repository.
-       * @exception    E_RIGHT_EXPIRED         The DRM license has expired.
-       * @exception    E_RIGHT_UNLIMITED       The DRM license is unlimited.
-       * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
-       * @remarks              The specific error code can be accessed using the GetLastResult() method.
-       * @remarks      Do not use this method without obtaining prior permissions from the %Tizen platform team.
-       */
-       static Tizen::Base::TimeSpan GetRemainingTimeUntilDrmExpiration(const Tizen::App::PackageId& pkgId);
-
-       /**
-       * Saves a CEK (Contents Encryption Key) to a DRM repository. @n
-       * It stores the CEK when it does not exist in the DRM repository.
-       * When the same @c PackageId of CEK already exists in the DRM repository, it is overwritten.
-       *
-       * @since 2.1
-       * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/packagelicensemanager
-       *
-       * @return               An error code
-       * @param[in]    licenseInfo                     The CEK (Contents Encryption Key)
-       * @exception    E_SUCCESS                       The method is successful.
-       * @exception    E_INVALID_ARG           The specified input parameter is invalid.
-       * @exception    E_INVALID_DATA          A specified XML field of input string is invalid. @n
-       *                                                                       For example, the @c appId field is empty.
-       * @exception    E_DATABASE                      An error has occurred when handling the rights object repository.
-       * @exception    E_PARSING_FAILED        An error has occurred when parsing the input string.
-       * @exception    E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
-       * @remarks      Do not use this method without obtaining prior permissions from the %Tizen platform team.
-       */
-       static result SaveLicenseInfoForPackage(const Tizen::Base::String& licenseInfo);
-
-private:
-       PackageLicenseManager(void);
-       ~PackageLicenseManager(void);
-
-       PackageLicenseManager(const PackageLicenseManager& rhs);
-       PackageLicenseManager& operator = (const PackageLicenseManager);
-
-}; // PackageLicenseManager
-
-}}} // Tizen::App::Package
-
-#endif // _FAPP_PKG_PACKAGE_LICENSE_MANAGER_H_
index b21970b..b5182d6 100644 (file)
@@ -69,7 +69,8 @@ public:
        *
        * @since                2.0
        * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/systemsetting.read
+       * @privilege    %http://tizen.org/privilege/settingmanager.write @n
+       *                               (%http://tizen.org/privilege/systemsetting.read is deprecated.)
        *
        * @return               An error code
        * @exception    E_SUCCESS                       Mount operation is successfully started.
@@ -87,7 +88,8 @@ public:
        *
        * @since                2.0
        * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/systemsetting.read
+       * @privilege    %http://tizen.org/privilege/settingmanager.write @n
+       *                               (%http://tizen.org/privilege/systemsetting.read is deprecated.)
        *
        * @return               An error code
        * @exception    E_SUCCESS                       Unmount operation is successfully started.
@@ -103,7 +105,8 @@ public:
        *
        * @since                2.0
        * @privlevel    platform
-       * @privilege    %http://tizen.org/privilege/systemsetting.read
+       * @privilege    %http://tizen.org/privilege/settingmanager.write @n
+       *                               (%http://tizen.org/privilege/systemsetting.read is deprecated.)
        *
        * @return               An error code
        * @exception    E_SUCCESS                       Format operation is successfully started.
index a9d627d..68a452b 100644 (file)
@@ -49,6 +49,8 @@
  *
  * The %Locales namespace contains classes representing a specific cultural region (locale) and the classes for manipulating and formatting locale-sensitive information, such as dates, times, numbers, and time zones.
  *
+ * Even if the list of all the available languages supported by the device is different, the localized information by the %Locales namespace should be represented properly.
+ *
  * For more information on the %Locales namespace features, see <a href="../org.tizen.native.appprogramming/html/guide/locales/locales_namespace.htm">Locales Guide</a>.
  *
  * The following diagram illustrates the relationships between the classes belonging to the %Locales namespace.
index fa48cb4..902fd9b 100644 (file)
@@ -86,12 +86,12 @@ public:
         * @privilege   %http://tizen.org/privilege/alarm
         *
         * @return      An error code
-        * @param[in]   duetime                 The time for the alarm to ring
+        * @param[in]   duetime                 The time for the alarm to ring. @n Any value with a unit that is less than a second is ignored.
         * @exception   E_SUCCESS               The method is successful.
         * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
         * @exception   E_INVALID_ARG           The specified @c duetime is invalid.
         * @exception   E_SYSTEM                A system error has occurred.
-        * @remarks     If this Alarm instance is already registered by this method, exist alarm is cancelled automatically.
+        * @remarks     If this %Alarm instance is already registered by this method, existing alarm is cancelled automatically.
         */
        result Set(const Tizen::Base::DateTime& duetime);
 
@@ -103,9 +103,9 @@ public:
         * @privilege   %http://tizen.org/privilege/alarm
         *
         * @return      An error code
-        * @param[in]   start                   The time for the alarm to ring first
-        * @param[in]   period                  The interval in minutes between consecutive alarm rings
-        * @param[in]   pEnd                    The time for the alarm ring to end
+        * @param[in]   start                   The time for the alarm to ring first. @n Any value with a unit that is less than a second is ignored.
+        * @param[in]   period                  The interval in minutes between consecutive alarm rings.
+        * @param[in]   pEnd                    The time for the alarm ring to end. @n Any value with a unit that is less than a second is ignored.
         * @exception   E_SUCCESS               The method is successful.
         * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
         * @exception   E_INVALID_ARG           A specified input parameter is invalid.
index d567f89..cb4fe2d 100644 (file)
@@ -148,7 +148,7 @@ public:
         * Implementation of this method in OSP compatible applications has the following issue: @n
         * This AddDeviceEventListener() method does not return E_DEVICE_UNAVAILABLE anymore. The E_DEVICE_UNAVAILABLE exception is removed.
         * @section DeviceManagerAddDeviceEventListenerPageIssueSection Resolutions
-        * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE exception.
+        * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE.
         * @endif
         */
 
@@ -175,7 +175,7 @@ public:
         * Implementation of this method in OSP compatible applications has the following issue: @n
         * This RemoveDeviceEventListener() method does not return E_DEVICE_UNAVAILABLE anymore. The E_DEVICE_UNAVAILABLE exception is removed.
         * @section DeviceManagerRemoveDeviceEventListenerPageIssueSection Resolutions
-        * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE exception.
+        * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE.
         * @endif
         */
 
index 40331fc..1fc1fd8 100644 (file)
@@ -40,7 +40,7 @@ class Alarm;
  *
  * @since      2.0
  *
- * The %IAlarmEventListener interface must be registered and implemented by an application to receive Alarm events from the system.
+ * The %IAlarmEventListener interface must be registered and implemented by an application to receive alarm events from the system.
  *
  */
 class _OSP_EXPORT_ IAlarmEventListener
@@ -64,11 +64,12 @@ public:
        virtual void OnAlarmExpired(Alarm& alarm) = 0;
 
 protected:
-       // The following methods are reserved, and the name of methods can be changed at any time without prior notice.
        //
        // This method is for internal use only.
        // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
        //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
        // @since 2.0
        //
        virtual void OnIAlarmEventListener_Reserved1(void) {};
@@ -77,6 +78,8 @@ protected:
        // This method is for internal use only.
        // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
        //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
        // @since 2.0
        virtual void OnIAlarmEventListener_Reserved2(void) {};
 
@@ -84,6 +87,8 @@ protected:
        // This method is for internal use only.
        // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
        //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
        // @since 2.0
        virtual void OnIAlarmEventListener_Reserved3(void) {};
 
index b592198..68fd0d3 100644 (file)
@@ -37,7 +37,7 @@ namespace Tizen { namespace System
  *
  * @since      2.0
  *
- * The %IBatteryEventListener interface must be registered and implemented by an application to receive Battery events from the system.
+ * The %IBatteryEventListener interface must be registered and implemented by an application to receive battery events from the system.
  */
 
 class _OSP_EXPORT_ IBatteryEventListener
index ff9ae4c..1e8786a 100644 (file)
@@ -55,8 +55,8 @@ public:
        /**
         * Called when the screen turns off. @n
         * Unless there is a strong reason to do otherwise, release resources (such as 3D, media, and sensors) to allow the device to enter the sleep mode to save the battery.
-        *Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a callback before the device enters the sleep mode.
-        *Similarly, do not perform lengthy operations in this listener method. All operations must be quick ones.
+        * Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a callback before the device enters the sleep mode.
+        * Similarly, do not perform lengthy operations in this listener method. All operations must be quick ones.
         *
        *@since 2.0
         */
index e3ca52d..59b993a 100644 (file)
@@ -52,7 +52,7 @@ public:
        virtual ~ISettingInfoSetValueAsyncResultListener(void) {}
        
        /**
-        *Called when a result is received for an asynchronous setting change method call.
+        * Called when a result is received for an asynchronous setting change method call.
         *
         * @since 2.0
         *
index 4766602..db0874c 100644 (file)
@@ -355,7 +355,7 @@ public:
         * @since 2.0
         *
         * @privlevel   platform
-        * @privilege   %http://tizen.org/privilege/systemsetting.read
+        * @privilege   %http://tizen.org/privilege/settingmanager.read
         *
         * @return      An error code
         * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/settings_info.htm">key name</a> of the setting information
@@ -374,7 +374,7 @@ public:
         * @since 2.0
         *
         * @privlevel   platform
-        * @privilege   %http://tizen.org/privilege/systemsetting.write
+        * @privilege   %http://tizen.org/privilege/settingmanager.write
         *
         * @return      An error code
         * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/settings_info.htm">key name</a> of the setting information
@@ -393,7 +393,7 @@ public:
         *
         * @since 2.0
         * @privlevel   platform
-        * @privilege   %http://tizen.org/privilege/systemsetting.write
+        * @privilege   %http://tizen.org/privilege/settingmanager.write
         *
         * @return      An error code
         * @param[in]   key                     The <a href="../org.tizen.native.appprogramming/html/guide/system/settings_info.htm">key name</a> of the setting information
@@ -404,17 +404,40 @@ public:
         * @exception   E_INVALID_ARG           The specified @c value is invalid value.
         * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
         * @exception   E_UNSUPPORTED_OPERATION The specified @c key is existed, However it is not supported by this device.
+        * @exception   E_IN_PROGRESS           The specified key is under processing or invalid state.
         * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
         */
        static result SetValueAsyncForPrivilegedKey(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
 
        /**
+        * Sets the specific @c bool type sett   * @exception   E_IN_PROGRESS           The specified key is under processing or invalid state.ing information based on the specified designators (key) asynchronously.
+        *
+        * @since 2.0
+        * @privlevel   platform
+        * @privilege   %http://tizen.org/privilege/setting
+        *
+        * @return      An error code
+        * @param[in]   key                     The <a href="../org.tizen.native.appprogramming/html/guide/system/settings_info.htm">key name</a> of the setting information
+        * @param[in]   value                   The setting information of type bool
+        * @param[in]   listener                The result listener.
+        * @exception   E_SUCCESS               The method is successful.
+        * @exception   E_PRIVILEGED_DENIED     The application does not have the privilege to call this method.
+        * @exception   E_INVALID_ARG           The specified @c value is invalid value.
+        * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
+        * @exception   E_UNSUPPORTED_OPERATION The specified @c key is existed, However it is not supported by this device.
+        * @exception   E_IN_PROGRESS           The specified key is under processing or invalid state.
+        * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
+        */
+       static result SetValueAsync(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
+
+
+       /**
         * Sets the specific Tizen::Base::String type setting information based on the specified designators (key).
         *
         * @since 2.0
         *
         * @privlevel   platform
-        * @privilege   %http://tizen.org/privilege/systemsetting.write
+        * @privilege   %http://tizen.org/privilege/settingmanager.write
         *
         * @return      An error code
         * @param[in]   key                     The <a href="../org.tizen.native.appprogramming/html/guide/system/settings_info.htm">key name</a> of the setting information
@@ -435,7 +458,7 @@ public:
         * @since 2.0
         *
         * @privlevel   platform
-        * @privilege   %http://tizen.org/privilege/systemsetting.write
+        * @privilege   %http://tizen.org/privilege/settingmanager.write
         *
         * @return      An error code
         * @exception   E_SUCCESS               The method is successful.
index 5c8e8eb..3504067 100644 (file)
@@ -212,7 +212,7 @@ public:
         * @since 2.0
         *
         * @privlevel   public
-        * @privilege   %http://tizen.org/privilege/platforminfo
+        * @privilege   %http://tizen.org/privilege/system
         *
         * @return      An error code
         * @param[out]  platformVersion         The platform version
@@ -228,7 +228,7 @@ public:
         * @since 2.0
         *
         * @privlevel   public
-        * @privilege   %http://tizen.org/privilege/platforminfo
+        * @privilege   %http://tizen.org/privilege/system
         *
         * @return      An error code
         * @param[out]  nativeApiVersion        The Native API version
@@ -244,7 +244,7 @@ public:
         * @since 2.0
         *
         * @privlevel   public
-        * @privilege   %http://tizen.org/privilege/platforminfo
+        * @privilege   %http://tizen.org/privilege/system
         *
         * @return      An error code
         * @param[out]  webApiVersion           The %Tizen API version
@@ -260,7 +260,7 @@ public:
         * @since 2.1
         *
         * @privlevel   public
-        * @privilege   %http://tizen.org/privilege/platforminfo
+        * @privilege   %http://tizen.org/privilege/system
         *
         * @return      An error code
         * @param[out]  buildInfo               The %Tizen build information
@@ -276,7 +276,7 @@ public:
         * @since       2.0
         *
         * @privlevel   partner
-        * @privilege   %http://tizen.org/privilege/useridentity
+        * @privilege   %http://tizen.org/privilege/systemmanager
         *
         * @return      An error code
         * @param[out]  imei                    The IMEI of the device
index 6a734fd..4a56bb3 100755 (executable)
@@ -18,6 +18,7 @@ BuildRequires:  pkgconfig(capi-system-device)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(capi-system-power)
 BuildRequires:  pkgconfig(capi-system-runtime-info)
+BuildRequires:  pkgconfig(capi-system-system-settings)
 BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(appsvc)
 BuildRequires:  pkgconfig(aul)
@@ -49,7 +50,6 @@ BuildRequires:  pkgconfig(sqlite3)
 BuildRequires:  pkgconfig(uuid)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(zlib)
-BuildRequires:  pkgconfig(drm-service-core-intel)
 BuildRequires:  pkgconfig(haptic)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  privacy-manager-client-devel
@@ -145,24 +145,6 @@ mkdir -p /opt/usr/media/Camera
 
 mkdir -p /tmp/osp
 
-if [ -f /usr/lib/rpm-plugins/msm.so ]
-then
-       chsmack -a "osp::compat" /opt/usr/share/.osp-compat/share/AppControl
-       chsmack -t /opt/usr/share/.osp-compat/share/AppControl
-       chsmack -a "osp::root-certs" /opt/usr/share/certs/rootcert
-       chsmack -t /opt/usr/share/certs/rootcert
-       chsmack -a "osp::root-certs" /opt/usr/share/certs/rootcert
-       chsmack -t /opt/usr/share/certs/rootcert
-       chsmack -a "osp::user-certs" /opt/usr/share/certs/usercert
-       chsmack -t /opt/usr/share/certs/usercert
-       chsmack -a "osp::user-certs" /opt/usr/share/certs/usercert/key
-       chsmack -t /opt/usr/share/certs/usercert/key
-       chsmack -a "*" /opt/usr/media/*
-       chsmack -t /opt/usr/media/*
-       chsmack -a "*" /tmp/osp
-       chsmack -t /tmp/osp
-fi
-
 chmod -R 707 /opt/usr/share/.osp-compat/share/AppControl
 chmod -R 705 /opt/usr/share/certs
 chmod -R 700 /opt/usr/share/certs/usercert/key
index 94548e3..2ad2ba3 100755 (executable)
       <value>MIDI</value>\r
       <value>PCM</value>\r
     </AudioCodec>\r
-    <CountMax>8</CountMax>\r
+    <CountMax>64</CountMax>\r
     <Protocol>\r
       <value>RTSP</value>\r
       <value>HTTP</value>\r
index c9f9b2c..8a615e0 100755 (executable)
@@ -98,7 +98,7 @@
       <value>MIDI</value>\r
       <value>PCM</value>\r
     </AudioCodec>\r
-    <CountMax>8</CountMax>\r
+    <CountMax>64</CountMax>\r
     <Protocol>\r
       <value>RTSP</value>\r
       <value>HTTP</value>\r
index 0604dd7..a1bc491 100755 (executable)
@@ -10,7 +10,6 @@ pkg_check_modules(pkgs REQUIRED
        dbus-glib-1
        devman
        dlog
-       drm-service-core-intel
        dukgenerator
        ecore
        glib-2.0
@@ -39,6 +38,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-system-runtime-info
        capi-system-device
        capi-system-power
+       capi-system-system-settings
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index 26f22d0..c6cfd4a 100644 (file)
@@ -7,8 +7,8 @@ INCLUDE_DIRECTORIES (
        ${CMAKE_SOURCE_DIR}/src/base/inc
        ${CMAKE_SOURCE_DIR}/src/io/inc
        ${CMAKE_SOURCE_DIR}/src/system/inc
-  ${CMAKE_SOURCE_DIR}/src/security/inc
-  inc
+       ${CMAKE_SOURCE_DIR}/src/security/inc
+       inc
        )
 
 SET (${this_target}_SOURCE_FILES
@@ -18,7 +18,6 @@ SET (${this_target}_SOURCE_FILES
        package/FAppPkg_PackageAppInfoImpl.cpp
        package/FAppPkg_PackageInfoImpl.cpp
        package/FAppPkg_PackageManagerImpl.cpp
-       package/FAppPkgPackageLicenseManager.cpp
        package/FAppPkg_PackageParser.cpp
        FAppApp.cpp
        FApp_AppImpl.cpp
@@ -60,6 +59,7 @@ SET (${this_target}_SOURCE_FILES
        FAppAppControlProviderManager.cpp
        FApp_AppControlProviderManagerImpl.cpp
        FApp_AppControlManager.cpp
+       FApp_DataControlManager.cpp
        FApp_AppMessageImpl.cpp
        FAppAppSetting.cpp
        FApp_AppSettingImpl.cpp
index 40567ac..e3fb502 100644 (file)
@@ -1121,7 +1121,12 @@ _AppArg::UpdateAppId(bundle* b, const AppId& appId)
        std::unique_ptr<char[]> pId(_StringConverter::CopyToCharArrayN(appId));
        SysTryReturnVoidResult(NID_APP, pId != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Converting %ls failed.", appId.GetPointer());
 
-       bundle_add(b, OSP_K_APPID, pId.get());
+       int res = bundle_add(b, OSP_K_APPID, pId.get());
+       if (res < 0 && errno == EPERM) // key exists
+       {
+               bundle_del(b, OSP_K_APPID);
+               bundle_add(b, OSP_K_APPID, pId.get());
+       }
 
        appsvc_set_appid(b, pId.get());
 }
@@ -1140,9 +1145,28 @@ _AppArg::UpdateRequestId(bundle* pBundle, int reqId)
 
        char buffer[32] = {0, };
        snprintf(buffer, 32, "%d", reqId);
-       bundle_add(pBundle, OSP_K_REQUEST_ID, buffer);
+       int res = bundle_add(pBundle, OSP_K_REQUEST_ID, buffer);
+       if (res < 0 && errno == EPERM) // key exists
+       {
+               bundle_del(pBundle, OSP_K_REQUEST_ID);
+               bundle_add(pBundle, OSP_K_REQUEST_ID, buffer);
+       }
 }
 
+void
+_AppArg::UpdateKeyValue(bundle* pBundle, const char* pKey, const String& value)
+{
+       SysTryReturnVoidResult(NID_APP, pBundle != null, E_INVALID_STATE, "[E_INVALID_STATE] Improper bundle state.");
+
+       char pBuffer[128] = {0, };
+       snprintf(pBuffer, 128, "%ls", value.GetPointer());
+       int res = bundle_add(pBundle, pKey, pBuffer);
+       if (res < 0 && errno == EPERM) // key exists
+       {
+               bundle_del(pBundle, pKey);
+               bundle_add(pBundle, pKey, pBuffer);
+       }
+}
 
 int
 _AppArg::GetRequestIdFromBundle(bundle* pBundle)
index eb6139a..080a101 100755 (executable)
@@ -416,7 +416,7 @@ _AppControlImpl::AppControlCbLegacy(void* data, _AppArg* pArg, _AppArg* pResArg,
 
        if (prop & _APPCONTROL_PROPERTY_ALIAS)
        {
-               _AppControlRegistry::_AppControlAliasEntry* pEntry = null;
+               const _AppControlRegistry::_AppControlAliasEntry* pEntry = null;
                pEntry = _AppControlRegistry::GetInstance()->GetReverseAppControlAliasEntry(provider, oId);
                if (pEntry)
                {
@@ -481,7 +481,7 @@ _AppControlImpl::AppControlCb(void* data, _AppArg* pArg, _AppArg* pResArg, servi
 
        if (prop & _APPCONTROL_PROPERTY_ALIAS)
        {
-               _AppControlRegistry::_AppControlAliasEntry* pEntry = null;
+               const _AppControlRegistry::_AppControlAliasEntry* pEntry = null;
                pEntry = _AppControlRegistry::GetInstance()->GetReverseAppControlAliasEntry(provider, oId);
                if (pEntry)
                {
index 09b5d33..efeb4b0 100644 (file)
@@ -224,7 +224,7 @@ _AppControlManager::OnAppControlEventReceivedN(int reqId, int res, const IMap* p
 
                if (pInfo->property & _APPCONTROL_PROPERTY_ALIAS)
                {
-                       _AppControlRegistry::_AppControlAliasEntry* pEntry = null;
+                       const _AppControlRegistry::_AppControlAliasEntry* pEntry = null;
                        pEntry = _AppControlRegistry::GetInstance()->GetReverseAppControlAliasEntry(aId, oId);
                        if (pEntry)
                        {
@@ -385,6 +385,8 @@ _AppControlManager::LaunchPkg(_AppMessageImpl& msg, const char* pkg_name, const
 
        return r;
 }
+
+
 int
 _AppControlManager::Launch(_AppMessageImpl& msg, const char* pkg_name, const char* op, const char* mime, const char* uri, AppSvcResFn pCb, void* data)
 {
@@ -438,6 +440,33 @@ _AppControlManager::Launch(_AppMessageImpl& msg, const char* pkg_name, const cha
 
 
 result
+_AppControlManager::LaunchPkg(_AppMessageImpl& msg, const String& package, const String& opId, const String* pUri, const String* pMime, AppSvcResFn pCb, void* data)
+{
+       std::unique_ptr<char[]> pPackage(_StringConverter::CopyToCharArrayN(package));
+       std::unique_ptr<char[]> pOperation(_StringConverter::CopyToCharArrayN(opId));
+
+       const char* pUriData = null;
+       if (pUri)
+       {
+               pUriData =  _StringConverter::CopyToCharArrayN(*pUri);
+       }
+
+       const char* pMimeData = null;
+       if (pMime)
+       {
+               pMimeData = _StringConverter::CopyToCharArrayN(*pMime);
+       }
+
+       result r = LaunchPkg(msg, pPackage.get(), pOperation.get(), pMimeData, pUriData, pCb, data);
+
+       delete [] pUriData;
+       delete [] pMimeData;
+
+       return r;
+}
+
+
+result
 _AppControlManager::LaunchPkg(const char* pkg_name, const char* op, const char* mime, const char* uri, AppSvcResFn pCb, void* data)
 {
        _AppMessageImpl msg;
@@ -794,4 +823,11 @@ _AppControlManager::IsAllowedAppControl(const wchar_t aTable[][2][64], int count
        return false;
 }
 
+
+AppId
+_AppControlManager::GetAliasAppId(const AppId& appId)
+{
+       return _AppControlRegistry::GetInstance()->GetAliasAppId(appId);
+}
+
 }} // Tizen::App
index e2b56bf..9ca8ef3 100644 (file)
@@ -82,6 +82,8 @@ _AppControlRegistry::_AppControlRegistry(void)
 {
        __nativeList.Construct();
 
+       __tizenList.Construct();
+
        __aliasList.Construct();
 
        __aliasAppId.Construct();
@@ -106,6 +108,8 @@ _AppControlRegistry::GetInstance(void)
 
                __pSelf->LoadRegistry();
 
+               __pSelf->LoadTizenAppControlRegistry();
+
                __pSelf->LoadLegacyList();
 
                __pSelf->LoadAliasList();
@@ -255,6 +259,75 @@ _AppControlRegistry::LoadRegistry(void)
 }
 
 result
+_AppControlRegistry::LoadTizenAppControlRegistry(void)
+{
+       _RegistryImpl reg;
+
+       const String regPath = ACTL_DEFAULT_FILE;
+
+       result r = reg.Construct(regPath, REG_OPEN_READ_ONLY, null);
+       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       const int secCount = reg.GetAllSectionCount();
+       SysTryReturnResult(NID_APP, !(secCount <= 0), E_OBJ_NOT_FOUND, "Registry contains no data.");
+
+       SysLog(NID_APP, "Loading %d sections from %ls", secCount, regPath.GetPointer());
+
+       int index = 0;
+       int size = 0;
+       //int num = 0;
+       String path;
+
+       for (int i = 0; i < secCount; i++)
+       {
+               ///////////////////////////////////////////////////////////////////////
+               // appcontrol Id
+               String sec_name(reg.GetSectionName(i));
+               sec_name.Trim();
+
+               if (sec_name.IsEmpty())
+               {
+                       continue;
+               }
+
+#if 0
+               int public_open = 0;
+
+               ///////////////////////////////////////////////////////////////////////
+               // Plubic
+               index = reg.GetEntryIndex(i, ACTL_REGISTRY_PUBLIC);
+               if (index >= 0)
+               {
+                       size = sizeof(size);
+                       num = 0;
+
+                       reg.GetEntryValue(i, index, REG_VALUE_TYPE_INT, &num, &size);
+                       if (num == 1)
+                       {
+                               // public
+                               public_open = 1;
+                       }
+               }
+#endif
+
+               ///////////////////////////////////////////////////////////////////////
+               // Path
+               index = reg.GetEntryIndex(i, ACTL_REGISTRY_PATH);
+               if (index >= 0)
+               {
+                       size = REG_VALUE_BUFFER_LEN;
+                       reg.GetEntryValue(i, index, REG_VALUE_TYPE_STRING, &path, &size);
+               }
+
+               __tizenList.Add(sec_name, path);
+       }
+
+       SysLog(NID_APP, "Finished loading %d tizen AppControl entries", __tizenList.GetCount());
+
+       return E_SUCCESS;
+}
+
+result
 _AppControlRegistry::LoadLegacyList(void)
 {
        _RegistryImpl reg;
@@ -378,6 +451,80 @@ CATCH:
 
 
 AppControl*
+_AppControlRegistry::GetTizenAppControlN(const String& aId, const String& oId) const
+{
+       const _AppControlAliasEntry* pEntry = null;
+       int count = 0;
+
+       do
+       {
+               const _AppControlAliasEntry* pTempEntry = GetAppControlAliasEntry(aId, oId);
+               // number does not matter
+               if (count >= 5 || pTempEntry == null)
+               {
+                       break;
+               }
+
+               pEntry = pTempEntry;
+               count++;
+       }
+       while (true);
+
+
+       const String* pAppId = null;
+       const String* pOperation = null;
+
+       if (count == 0)
+       {
+               // if count is 0, then no alias is found
+               pAppId = &aId;
+               pOperation = &oId;
+       }
+       else if (pEntry == null)
+       {
+               // no "TIZEN" AppControl
+               return null;
+       }
+       else
+       {
+               pAppId = &pEntry->provider2;
+               pOperation = &pEntry->operation2;
+       }
+
+       SysAssert(pAppId != null);
+       SysAssert(pOperation != null);
+
+       SysLog(NID_APP, "Found matching AppControl (%ls, %ls)", pAppId->GetPointer(), pOperation->GetPointer());
+
+       const String& soName = GetTizenAppControlProvider(*pAppId, *pOperation);
+
+       if (soName.IsEmpty())
+       {
+               SysLog(NID_APP, "No AppControl stub found for (%ls, %ls)", pAppId->GetPointer(), pOperation->GetPointer());
+               return null;
+       }
+
+       return _AppControlImpl::CreateN(soName, *pAppId, *pOperation, L"", _APPCONTROL_PROPERTY_PUBLIC | _APPCONTROL_PROPERTY_SLP);
+}
+
+
+String
+_AppControlRegistry::GetTizenAppControlProvider(const String& appId, const String& oId) const
+{
+       String val;
+       result r = __tizenList.GetValue(appId, val);
+       if (r == E_SUCCESS)
+       {
+               SysLog(NID_APP, "Found TIZEN AppControl stub %ls for %ls.", val.GetPointer(), appId.GetPointer());
+               return val;
+       }
+
+       SysLog(NID_APP, "No platform AppControl and use custom AppControl instead.");
+       return L"";
+}
+
+
+AppControl*
 _AppControlRegistry::GetNativeAppControlN(const String& aId, const String& oId) const
 {
        std::unique_ptr< IEnumeratorT<AppControl*> > pEnum(__nativeList.GetEnumeratorN());
@@ -487,7 +634,7 @@ _AppControlRegistry::FindAppControlListN(const String* pOid, const String* pUri,
        return pList;
 }
 
-_AppControlRegistry::_AppControlAliasEntry*
+const _AppControlRegistry::_AppControlAliasEntry*
 _AppControlRegistry::GetAppControlAliasEntry(const String& aId, const String& oId) const
 {
        std::unique_ptr< IEnumeratorT<_AppControlAliasEntry*> > pEnum(__aliasList.GetValuesN(aId));
@@ -512,7 +659,7 @@ _AppControlRegistry::GetAppControlAliasEntry(const String& aId, const String& oI
        return null;
 }
 
-_AppControlRegistry::_AppControlAliasEntry*
+const _AppControlRegistry::_AppControlAliasEntry*
 _AppControlRegistry::GetReverseAppControlAliasEntry(const String& aId, const String& oId) const
 {
        std::unique_ptr< IMapEnumeratorT<String, _AppControlAliasEntry*> > pEnum(__aliasList.GetMapEnumeratorN());
@@ -535,7 +682,7 @@ _AppControlRegistry::GetReverseAppControlAliasEntry(const String& aId, const Str
 AppControl*
 _AppControlRegistry::GetAliasAppControlN(const String& aId, const String& oId) const
 {
-       _AppControlAliasEntry* pEntry = GetAppControlAliasEntry(aId, oId);
+       const _AppControlAliasEntry* pEntry = GetAppControlAliasEntry(aId, oId);
 
        if (pEntry)
        {
@@ -574,9 +721,9 @@ _AppControlRegistry::GetAppControlN(const String& appId, const String& operation
        String actualAppId = appId;
        if (appId.StartsWith(TIZEN_ALIAS_APPID_PREFIX, 0))
        {
-               String tmp;
-               result r = __aliasAppId.GetValue(appId, tmp);
-               if (r == E_SUCCESS)
+               const String& tmp = GetAliasAppId(appId);
+
+               if (tmp.IsEmpty())
                {
                        actualAppId = tmp;
                        SysLog(NID_APP, "Found alias appId (%ls -> %ls).", appId.GetPointer(), tmp.GetPointer());
@@ -591,6 +738,21 @@ _AppControlRegistry::GetAppControlN(const String& appId, const String& operation
        return _AppControlImpl::CreateN(actualAppId, operationId, changeAppId);
 }
 
+
+AppId
+_AppControlRegistry::GetAliasAppId(const AppId& appId) const
+{
+       String tmp;
+       result r = __aliasAppId.GetValue(appId, tmp);
+       if (r != E_SUCCESS)
+       {
+               tmp.Clear();
+       }
+
+       return tmp;
+}
+
+
 AppId
 _AppControlRegistry::GetReverseAliasAppId(const AppId& appId) const
 {
index 4b6e447..e953f4a 100644 (file)
@@ -86,6 +86,8 @@ public:
 
        static _AppControlRegistry* GetInstance(void);
 
+       AppControl* GetTizenAppControlN(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
+
        AppControl* GetNativeAppControlN(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
 
        AppControl* GetSlpAppControlN(const Tizen::Base::String& packageName, const Tizen::Base::String& oId) const;
@@ -96,9 +98,11 @@ public:
 
        Tizen::Base::Collection::ArrayList* FindAppControlListN(const Tizen::Base::String* pOid, const Tizen::Base::String* pUri, const Tizen::Base::String* pMimeType, const Tizen::Base::String* pCategory) const;
 
-       _AppControlAliasEntry* GetAppControlAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
+       const _AppControlAliasEntry* GetAppControlAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
+
+       const _AppControlAliasEntry* GetReverseAppControlAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
 
-       _AppControlAliasEntry* GetReverseAppControlAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
+       AppId GetAliasAppId(const AppId& appId) const;
 
        AppId GetReverseAliasAppId(const AppId& appId) const;
 
@@ -109,13 +113,19 @@ private:
 
        result LoadRegistry(void);
 
+       result LoadTizenAppControlRegistry(void);
+
        result LoadLegacyList(void);
 
        result LoadAliasList(void);
 
+       Tizen::Base::String GetTizenAppControlProvider(const Tizen::Base::String& appId, const Tizen::Base::String& opId) const;
+
 private:
        AppControlList __nativeList;
 
+       AliasMapType __tizenList;
+
        AppControlAliasList __aliasList;
 
        AliasMapType __aliasAppId;
index d942872..0d2e32f 100644 (file)
@@ -80,16 +80,19 @@ namespace Tizen { namespace App
 
 _AppImpl* _AppImpl::__pAppImpl = null;
 bool _AppImpl::__isTerminationRequested = false;
+#if 0
 static const int _DATACONTROL_PACKET_INDEX_APPID = 0;
 static const int _DATACONTROL_PACKET_INDEX_REQUESTTYPE = 1;
 static const int _DATACONTROL_PACKET_INDEX_REQID = 2;
 static const int _DATACONTROL_PACKET_INDEX_PROVIDERID = 3;
-static const int _DATACONTROL_PACKET_INDEX_DATAID = 4;
-static const int _DATACONTROL_PACKET_INDEX_COLUMNCOUNT = 5;
-static const int _DATACONTROL_PACKET_INDEX_DELETEWHERE = 5;
-static const int _DATACONTROL_PACKET_INDEX_COLUMNLIST = 6;
-static const int _DATACONTROL_PACKET_INDEX_INSERTMAP = 6;
-static const int _DATACONTROL_PACKET_INDEX_UPDATEMAP = 6;
+#endif
+static const int _DATACONTROL_PACKET_INDEX_DATAID = 0;
+static const int _DATACONTROL_PACKET_INDEX_COLUMNCOUNT = 1;
+static const int _DATACONTROL_PACKET_INDEX_DELETEWHERE = 1;
+static const int _DATACONTROL_PACKET_INDEX_MAPKEY = 1;
+static const int _DATACONTROL_PACKET_INDEX_COLUMNLIST = 2;
+static const int _DATACONTROL_PACKET_INDEX_INSERTMAP = 2;
+static const int _DATACONTROL_PACKET_INDEX_UPDATEMAP = 2;
 
 struct charDeleter
 {
@@ -746,11 +749,11 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
        ArrayList* pColumnList = null;
        HashMap* pInsertMap = null;
        HashMap* pUpdateMap = null;
-       String* pAppId = null;
-       String* pRequestType = null;
-       String* pProviderId = null;
+       String appId;
+       String reqType;
+       String providerId;
        String* pDataId = null;
-       String* pReqId = null;
+       String callerReqId;
        String* pColumnCount = null;
        String* pColumn = null;
        String* pValue = null;
@@ -760,13 +763,6 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
        String* pNo = null;
        String* pCount = null;
        String empty(L"NULL");
-#if 0
-       _DataControlResultSetImpl* pResultSetImpl = null;
-       String* pResult = null;
-       String* pObject = null;
-       String* pTempObject = null;
-       String* pTempFilePath = null;
-#endif
        _AppArg resultArg;
        int type = 0;
        _DataControlRequestType requestType = _DATACONTROL_REQUEST_TYPE_UNDEFINED;
@@ -775,41 +771,31 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
        int countPerPage = 0;
        int i = 0;
        int index = 0;
-       //ArrayList* pResultArgList = null;
        result r = E_SUCCESS;
        result res = E_SUCCESS;
        ArrayList* pList = null;
        String* pKey = null;
        String* pNewValue = null;
        String* pOldValue = null;
-#if 0
-       String* pResultCount = null;
-       String* pResultValue = null;
-#endif
-
-       SysLog(NID_APP, "[DC_PROVIDER] Data control request is received.");
-       //arg.Print();
 
-       pList = arg.GetArgListN(0);
-       SysTryCatch(NID_APP, pList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+       SysLog(NID_APP, "[DC_PROV_RECV] Data control request is received.");
+       //arg.Print(); // request info
 
-       // key-based
-       pAppId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_APPID)); // key(0)
-       SysTryCatch(NID_APP, pAppId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+       // key-based request
+       appId = arg.GetCallerAppId();
 
-       pRequestType = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_REQUESTTYPE)); // key(1)
-       SysTryCatch(NID_APP, pRequestType, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
-       Integer::Parse(*pRequestType, type);
+       reqType = arg.GetValue(OSP_K_DATACONTROL_REQUEST_TYPE);
+       Integer::Parse(reqType, type);
        requestType = static_cast< _DataControlRequestType >(type);
 
-       pReqId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_REQID)); // key(2)
-       SysTryCatch(NID_APP, pReqId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+       callerReqId = arg.GetValue(OSP_K_REQUEST_ID);
+       providerId = arg.GetValue(OSP_K_DATACONTROL_PROVIDER);
 
-       pProviderId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_PROVIDERID)); // key(3)
-       SysTryCatch(NID_APP, pProviderId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+       // list-based request
+       pList = _AppArg::GetListN(arg.GetBundle(), OSP_K_ARG);
+       SysTryCatch(NID_APP, pList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
 
-       // list-based
-       pDataId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_DATAID));// list(0): data ID
+       pDataId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_DATAID));// request list[0]: data ID
        SysTryCatch(NID_APP, pDataId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
        if (requestType >= _DATACONTROL_REQUEST_TYPE_SQL_QUERY && requestType <= _DATACONTROL_REQUEST_TYPE_SQL_DELETE)
@@ -819,7 +805,7 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
        }
        else if (requestType >= _DATACONTROL_REQUEST_TYPE_MAP_QUERY && requestType <= _DATACONTROL_REQUEST_TYPE_MAP_DELETE)
        {
-               pKey = dynamic_cast< String* >(pList->GetAt(5)); // list[1]
+               pKey = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_MAPKEY)); // request list[1]
                SysTryCatch(NID_APP, pKey, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
                pMapListener = __pMapDataControlProviderEventListener;
@@ -834,9 +820,9 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
        switch (requestType)
        {
        case _DATACONTROL_REQUEST_TYPE_SQL_QUERY:
-               SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl SELECT");
+               SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl SELECT");
 
-               // list(1): selected column count
+               // request list[1]: selected column count
                pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
                SysTryCatch(NID_APP, pColumnCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
@@ -850,22 +836,22 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
                        pColumnList = new (std::nothrow) ArrayList();
                        SysTryReturnVoidResult(NID_APP, pColumnList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
                        pColumnList->Construct();
-                       SysLog(NID_APP, "[DC_PROVIDER] selected column count: %d", columnCount);
+                       SysLog(NID_APP, "[DC_PROV_RECV] selected column count: %d", columnCount);
 
                        i = 0;
-                       while (i < columnCount) // list(2): column list
+                       while (i < columnCount) // request list[2]: column list
                        {
                                pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNLIST + i));
                                SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
                                pColumnList->Add(*(new String(*pColumn)));
-                               SysLog(NID_APP, "[DC_PROVIDER] column[%d]: %ls", i, pColumn->GetPointer());
+                               SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %ls", i, pColumn->GetPointer());
                                i++;
                        }
                }
 
                i += _DATACONTROL_PACKET_INDEX_COLUMNLIST;
-               pWhere = dynamic_cast< String* >(pList->GetAt(i)); // list(3): where clause
+               pWhere = dynamic_cast< String* >(pList->GetAt(i)); // request list: where clause
                SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
                if (pWhere->Equals(empty) == true)
@@ -874,11 +860,11 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
                }
                else
                {
-                       SysLog(NID_APP, "[DC_PROVIDER] pWhere: %ls", pWhere->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] pWhere: %ls", pWhere->GetPointer());
                }
 
                i++;
-               pOrder = dynamic_cast< String* >(pList->GetAt(i)); // list(4): order clause
+               pOrder = dynamic_cast< String* >(pList->GetAt(i)); // request list: order clause
                SysTryCatch(NID_APP, pOrder, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
                if (pOrder->Equals(empty) == true)
@@ -887,35 +873,35 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
                }
                else
                {
-                       SysLog(NID_APP, "[DC_PROVIDER] pOrder: %ls", pOrder->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] pOrder: %ls", pOrder->GetPointer());
                }
 
                i++;
-               pNo = dynamic_cast <String*>(pList->GetAt(i)); // list(5): page number
+               pNo = dynamic_cast <String*>(pList->GetAt(i)); // request list: page number
                SysTryCatch(NID_APP, pNo, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
                Integer::Parse(*pNo, pageNo);
 
                i++;
-               pCount = dynamic_cast <String*>(pList->GetAt(i)); // list(6): count per page
+               pCount = dynamic_cast <String*>(pList->GetAt(i)); // request list: count per page
                SysTryCatch(NID_APP, pCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
                Integer::Parse(*pCount, countPerPage);
 
-               pSqlListener->OnSqlDataControlSelectRequestReceived(reqId, *pProviderId, *pDataId, pColumnList,
+               pSqlListener->OnSqlDataControlSelectRequestReceived(reqId, providerId, *pDataId, pColumnList,
                                pWhere, pOrder);
 
-               SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pColumnList: 0x%0x, pWhere: 0x%x, pOrder: 0x%x, pageNo: %d, countPerPage: %d",
-                               pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, pColumnList: 0x%0x, pWhere: 0x%x, pOrder: 0x%x, pageNo: %d, countPerPage: %d",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
                                pDataId->GetPointer(), pColumnList, pWhere, pOrder, pageNo, countPerPage);
                break;
        case _DATACONTROL_REQUEST_TYPE_SQL_INSERT:
-               SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl INSERT");
+               SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl INSERT");
 
-               // list(1): insert column count
+               // request list[1]: insert column count
                pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
                SysTryCatch(NID_APP, pColumnCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
                Integer::Parse(*pColumnCount, columnCount);
-               SysLog(NID_APP, "[DC_PROVIDER] inserted column count: %d", columnCount);
+               SysLog(NID_APP, "[DC_PROV_RECV] inserted column count: %d", columnCount);
 
                pInsertMap = new (std::nothrow) HashMap();
                SysTryReturnVoidResult(NID_APP, pInsertMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
@@ -923,35 +909,35 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
 
                i = 0;
                index = 0;
-               while (i < columnCount * 2) // list(2): column-value pairs
+               while (i < columnCount * 2) // request list[2]: column-value pairs
                {
                        pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_INSERTMAP + i++));
                        SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
-                       SysLog(NID_APP, "[DC_PROVIDER] column[%d]: %ls", index, pColumn->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %ls", index, pColumn->GetPointer());
 
                        pValue = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_INSERTMAP + i++));
                        SysTryCatch(NID_APP, pValue != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
-                       SysLog(NID_APP, "[DC_PROVIDER] value[%d]: %ls", index, pValue->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] value[%d]: %ls", index, pValue->GetPointer());
 
                        pInsertMap->Add(*(new String(*pColumn)), *(new String(*pValue)));
                        index++;
                }
 
-               pSqlListener->OnSqlDataControlInsertRequestReceived(reqId, *pProviderId, *pDataId, *pInsertMap);
+               pSqlListener->OnSqlDataControlInsertRequestReceived(reqId, providerId, *pDataId, *pInsertMap);
 
-               SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pInsertMap: 0x%x",
-                               pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, pInsertMap: 0x%x",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
                                pDataId->GetPointer(), pInsertMap);
                break;
        case _DATACONTROL_REQUEST_TYPE_SQL_UPDATE:
-               SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl UPDATE");
+               SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl UPDATE");
 
-               // list(1): updated column count
+               // request list[1]: updated column count
                pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
                SysTryCatch(NID_APP, pColumnCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
                Integer::Parse(*pColumnCount, columnCount);
-               SysLog(NID_APP, "[DC_PROVIDER] updated column count: %d", columnCount);
+               SysLog(NID_APP, "[DC_PROV_RECV] updated column count: %d", columnCount);
 
                pUpdateMap = new (std::nothrow) HashMap();
                SysTryReturnVoidResult(NID_APP, pUpdateMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
@@ -959,21 +945,21 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
 
                i = 0;
                index = 0;
-               while (i < columnCount * 2) // list(2): column-value pairs
+               while (i < columnCount * 2) // request list[2]: column-value pairs
                {
                        pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i++));
                        SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
-                       SysLog(NID_APP, "[DC_PROVIDER] column[%d]: %ls", index, pColumn->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %ls", index, pColumn->GetPointer());
 
                        pValue = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i++));
                        SysTryCatch(NID_APP, pValue != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
-                       SysLog(NID_APP, "[DC_PROVIDER] value[%d]: %ls", index, pValue->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] value[%d]: %ls", index, pValue->GetPointer());
 
                        pUpdateMap->Add(*(new String(*pColumn)), *(new String(*pValue)));
                        index++;
                }
 
-               // list(3): where clause
+               // request list: where clause
                pWhere = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i));
                SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
@@ -983,19 +969,19 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
                }
                else
                {
-                       SysLog(NID_APP, "[DC_PROVIDER] pWhere: %ls", pWhere->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] pWhere: %ls", pWhere->GetPointer());
                }
 
-               pSqlListener->OnSqlDataControlUpdateRequestReceived(reqId, *pProviderId, *pDataId, *pUpdateMap, pWhere);
+               pSqlListener->OnSqlDataControlUpdateRequestReceived(reqId, providerId, *pDataId, *pUpdateMap, pWhere);
 
-               SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pUpdateMap: 0x%x, pWhere: 0x%x",
-                               pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, pUpdateMap: 0x%x, pWhere: 0x%x",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
                                pDataId->GetPointer(), pUpdateMap, pWhere);
                break;
        case _DATACONTROL_REQUEST_TYPE_SQL_DELETE:
-               SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl DELETE");
+               SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl DELETE");
 
-               // list(1): where clause
+               // request list[1]: where clause
                pWhere = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_DELETEWHERE));
                SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
@@ -1005,59 +991,76 @@ _AppImpl::OnDataControlRequestReceived(const _AppArg& arg, RequestId reqId)
                }
                else
                {
-                       SysLog(NID_APP, "[DC_PROVIDER] pWhere: %ls", pWhere->GetPointer());
+                       SysLog(NID_APP, "[DC_PROV_RECV] pWhere: %ls", pWhere->GetPointer());
                }
 
-               pSqlListener->OnSqlDataControlDeleteRequestReceived(reqId, *pProviderId, *pDataId, pWhere);
+               pSqlListener->OnSqlDataControlDeleteRequestReceived(reqId, providerId, *pDataId, pWhere);
 
-               SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pWhere: 0x%x",
-                               pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, pWhere: 0x%x",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
                                pDataId->GetPointer(), pWhere);
                break;
        case _DATACONTROL_REQUEST_TYPE_MAP_QUERY:
-               pNo = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+               SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl GetValue");
+
+               pNo = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
                SysTryCatch(NID_APP, pNo, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
                Integer::Parse(*pNo, pageNo);
 
-               pCount = dynamic_cast <String*>(pList->GetAt(7)); //list[3]
+               pCount = dynamic_cast <String*>(pList->GetAt(3)); // request list[3]
                SysTryCatch(NID_APP, pCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
                Integer::Parse(*pCount, countPerPage);
 
-               pMapListener->OnMapDataControlGetValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey);
+               pMapListener->OnMapDataControlGetValueRequestReceived(reqId, providerId, *pDataId, *pKey);
+
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, key: %ls, pageNo: %d, countPerPage: %d",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+                               pDataId->GetPointer(), pKey->GetPointer(), pageNo, countPerPage);
                break;
        case _DATACONTROL_REQUEST_TYPE_MAP_INSERT:
-               pValue = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+               SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl AddValue");
+
+               pValue = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
                SysTryCatch(NID_APP, pValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
-               pMapListener->OnMapDataControlAddValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey, *pValue);
+               pMapListener->OnMapDataControlAddValueRequestReceived(reqId, providerId, *pDataId, *pKey, *pValue);
+
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, key: %ls, value: %ls",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+                               pDataId->GetPointer(), pKey->GetPointer(), pValue->GetPointer());
                break;
        case _DATACONTROL_REQUEST_TYPE_MAP_UPDATE:
-               pOldValue = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+               SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl SetValue");
+
+               pOldValue = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
                SysTryCatch(NID_APP, pOldValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
-               pNewValue = dynamic_cast <String*>(pList->GetAt(7)); // list[3]
+               pNewValue = dynamic_cast <String*>(pList->GetAt(3)); // request list[3]
                SysTryCatch(NID_APP, pNewValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
-               pMapListener->OnMapDataControlSetValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey, *pOldValue, *pNewValue);
+               pMapListener->OnMapDataControlSetValueRequestReceived(reqId, providerId, *pDataId, *pKey, *pOldValue, *pNewValue);
+
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, key: %ls, oldValue: %ls, newValue: %ls",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+                               pDataId->GetPointer(), pKey->GetPointer(), pOldValue->GetPointer(), pNewValue->GetPointer());
                break;
        case _DATACONTROL_REQUEST_TYPE_MAP_DELETE:
-               pValue = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+               SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl RemoveValue");
+
+               pValue = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
                SysTryCatch(NID_APP, pValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
 
-               pMapListener->OnMapDataControlRemoveValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey, *pValue);
+               pMapListener->OnMapDataControlRemoveValueRequestReceived(reqId, providerId, *pDataId, *pKey, *pValue);
+
+               SysLog(NID_APP, "[DC_PROV_RECV] caller appId: %ls, requestType: %d, caller reqId: %ls, providerId: %ls, dataId: %ls, key: %ls, value: %ls",
+                               appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+                               pDataId->GetPointer(), pKey->GetPointer(), pValue->GetPointer());
                break;
        default:
                SysTryCatch(NID_APP, false, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
                break;
        }
 
-       if (requestType >= _DATACONTROL_REQUEST_TYPE_MAP_QUERY && requestType <= _DATACONTROL_REQUEST_TYPE_MAP_DELETE)
-       {
-               SysLog(NID_APP, "caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, key: %ls",
-                               pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
-                               pDataId->GetPointer(), pKey->GetPointer());
-       }
-
        if (pColumnList)
        {
                pColumnList->RemoveAll(true);
diff --git a/src/app/FApp_DataControlManager.cpp b/src/app/FApp_DataControlManager.cpp
new file mode 100644 (file)
index 0000000..b485314
--- /dev/null
@@ -0,0 +1,121 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       FApp_DataControlManager.cpp
+ * @brief      This is the implementation for the _DataControlManager class.
+ */
+
+#include <new>
+#include <cstdlib>
+#include <pthread.h>
+#include <typeinfo>
+
+#include <FBaseInteger.h>
+#include <FBaseSysLog.h>
+
+#include "FApp_DataControlManager.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+
+namespace Tizen { namespace App
+{
+
+_DataControlManager* _DataControlManager::__pDataControlManagerInstance = null;
+
+_DataControlManager::_DataControlManager(void)
+       : __pDataControlRequestList(null)
+{
+       __pDataControlRequestList = new (std::nothrow) HashMap(SingleObjectDeleter);
+       SysTryReturnVoidResult(NID_APP, __pDataControlRequestList != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+
+       __pDataControlRequestList->Construct();
+}
+
+_DataControlManager::~_DataControlManager(void)
+{
+       delete __pDataControlRequestList;
+}
+
+void
+_DataControlManager::InitSingleton(void)
+{
+       _DataControlManager* pInst = new (std::nothrow) _DataControlManager();
+       SysTryReturnVoidResult(NID_APP, pInst != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+
+       __pDataControlManagerInstance = pInst;
+               
+       std::atexit(DestroySingleton);
+       return;
+}
+
+void
+_DataControlManager::DestroySingleton(void)
+{
+       delete __pDataControlManagerInstance;
+}
+
+_DataControlManager*
+_DataControlManager::GetInstance(void)
+{
+       static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
+       
+       if (__pDataControlManagerInstance == null)
+       {
+               ClearLastResult();
+               pthread_once(&onceBlock, InitSingleton);
+               result r = GetLastResult();
+               if (IsFailed(r))
+               {
+                       onceBlock = PTHREAD_ONCE_INIT;
+                       SysPropagate(NID_APP, r);
+               }
+       }
+
+       return __pDataControlManagerInstance;
+}
+
+result
+_DataControlManager::AddRequestInfo(Integer* pReqId, _DataControlRequestInfo* pReqInfo)
+{
+       //SysLog(NID_APP, "DataControl request list count: %d", __pDataControlRequestList->GetCount());
+       return __pDataControlRequestList->Add(pReqId, pReqInfo);
+}
+
+_DataControlRequestInfo*
+_DataControlManager::GetRequestInfo(Integer& reqId) 
+{
+       result r = E_SUCCESS;
+
+       Object* pObj = __pDataControlRequestList->GetValue(reqId);
+       SysTryReturn(NID_APP, pObj != null, null, GetLastResult(), "[%s] Propagating to caller...", GetErrorMessage(GetLastResult()));
+
+       _DataControlRequestInfo* pReqInfo = dynamic_cast< _DataControlRequestInfo* >(pObj);
+       SysTryReturn(NID_APP, pReqInfo != null, null, r, "[E_SYSTEM] invalid request info");
+
+       return pReqInfo;
+}
+
+void
+_DataControlManager::RemoveRequestInfo(Integer& reqId)
+{
+       __pDataControlRequestList->Remove(reqId);
+}
+
+}} // Tizen::App
+
diff --git a/src/app/FApp_DataControlManager.h b/src/app/FApp_DataControlManager.h
new file mode 100644 (file)
index 0000000..9d1e232
--- /dev/null
@@ -0,0 +1,89 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       FApp_DataControlManager.h
+ * @brief      This is the header file for the _DataControlManager class.
+ */
+
+#ifndef _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
+#define _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
+
+#include <FBaseObject.h>
+#include <FBaseColHashMap.h>
+#include <FBaseRtEvent.h>
+
+namespace Tizen { namespace App
+{
+
+class _DataControlRequestInfo
+       : public Tizen::Base::Object
+{
+public:
+       _DataControlRequestInfo(Tizen::Base::Runtime::Event* pEvent)
+       {
+               __pEvent = pEvent;
+       }
+
+       virtual ~_DataControlRequestInfo(void)
+       {
+       }
+
+       Tizen::Base::Runtime::Event* GetEvent(void)
+       {
+               return __pEvent;
+       }
+private:
+       _DataControlRequestInfo(void)
+               : __pEvent(null)
+       {
+       }
+private:
+       Tizen::Base::Runtime::Event* __pEvent;
+};
+
+class _DataControlManager
+       : public Tizen::Base::Object
+{
+public:
+       static _DataControlManager* GetInstance(void);
+
+       result AddRequestInfo(Tizen::Base::Integer* pReqId, _DataControlRequestInfo* pReqInfo);
+
+       _DataControlRequestInfo* GetRequestInfo(Tizen::Base::Integer& reqId);
+
+       void RemoveRequestInfo(Tizen::Base::Integer& reqId);
+
+private:
+       _DataControlManager(void);
+
+       virtual ~_DataControlManager(void);
+
+       static void InitSingleton(void);
+
+       static void DestroySingleton(void);
+
+private:
+       static _DataControlManager* __pDataControlManagerInstance;
+       Tizen::Base::Collection::HashMap* __pDataControlRequestList;
+
+}; // _DataControlManager
+
+}} // Tizen::App
+
+#endif // _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
+
index d4ab5a4..b0d431d 100644 (file)
@@ -80,12 +80,12 @@ _DataControlProviderManagerImpl::SendDataControlResult(RequestId reqId, _DataCon
                IDbEnumerator* pDbEnum, IList* pResultValueList, long long insertRowId, bool providerResult, const String* pErrorMsg)
 {
        ArrayList* pList = null;
-       String* pAppId = null;
-       String* pRequestType = null;
+       String appId;
+       String reqType;
        int type = 0;
        _DataControlRequestType requestType = _DATACONTROL_REQUEST_TYPE_UNDEFINED;
-       String* pProviderId = null;
-       String* pReqId = null;
+       String providerId;
+       String callerReqId;
        ArrayList* pResultArgList = null;
        String* pResult = null;
        String* pErrorMessage = null;
@@ -97,29 +97,22 @@ _DataControlProviderManagerImpl::SendDataControlResult(RequestId reqId, _DataCon
        String* pResultCount = null;
        String* pResultValue = null;
        _AppArg resultArg;
+       String* pDataId = null;
        result r = E_SUCCESS;
 
        _AppControlManager* pAppMgr = _AppControlManager::GetInstance();
        SysTryReturnResult(NID_APP, pAppMgr, E_SYSTEM, "Failed to get instance.");
 
-       _ResultInfo* pResultInfo = pAppMgr->__resultManager.FindItem(static_cast< int >(reqId));
+       _ResultInfo* pResultInfo = pAppMgr->__resultManager.FindItem(static_cast< int >(reqId)); // provider reqId
        SysTryReturnResult(NID_APP, pResultInfo, E_OBJ_NOT_FOUND,
                        "The data control request specified with the reqId (%ld) did not exist.", reqId);
 
-       const _AppArg& arg = pResultInfo->arg;
-
-       pList = arg.GetArgListN(0);
-       SysTryCatch(NID_APP, pList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
+       const _AppArg& arg = pResultInfo->arg; // request info
 
        // key-based request
-       pAppId = dynamic_cast< String* >(pList->GetAt(0)); // request key[0]
-       SysTryCatch(NID_APP, pAppId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
-
-       pRequestType = dynamic_cast< String* >(pList->GetAt(1)); // request key[1]
-       SysTryCatch(NID_APP, pRequestType, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
-       Integer::Parse(*pRequestType, type);
+       reqType = arg.GetValue(OSP_K_DATACONTROL_REQUEST_TYPE);
+       Integer::Parse(reqType, type);
        requestType = static_cast< _DataControlRequestType >(type);
-
        if (providerResult == true && apiType != requestType)
        {
                if ((apiType == _DATACONTROL_REQUEST_TYPE_SQL_UPDATE /*UpdateDelete*/ && requestType == _DATACONTROL_REQUEST_TYPE_SQL_DELETE) ||
@@ -135,13 +128,21 @@ _DataControlProviderManagerImpl::SendDataControlResult(RequestId reqId, _DataCon
                }
        }
 
-       pReqId = dynamic_cast< String* >(pList->GetAt(2)); // request key[2]
-       SysTryCatch(NID_APP, pReqId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
+       appId = arg.GetCallerAppId();
+       callerReqId = arg.GetValue(OSP_K_REQUEST_ID);
+       providerId = arg.GetValue(OSP_K_DATACONTROL_PROVIDER);
+
+       // list-based request
+       pList = _AppArg::GetListN(arg.GetBundle(), OSP_K_ARG);
+       SysTryCatch(NID_APP, pList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
+
+       pDataId = dynamic_cast< String* >(pList->GetAt(0)); // request list[0]
+       SysTryCatch(NID_APP, pDataId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
 
-       pProviderId = dynamic_cast< String* >(pList->GetAt(3)); // request key[3]
-       SysTryCatch(NID_APP, pProviderId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
+       SysLog(NID_APP, "[DC_PROV_SEND] > appId: %ls, requestType: %d, callerReqId: %ls, providerId: %ls, dataId: %ls",
+                       appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(), pDataId->GetPointer());
 
-       // Serializes the result
+       // Serializes result
        pResultArgList = new (std::nothrow) ArrayList();
        SysTryCatch(NID_APP, pResultArgList, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
                        "[E_OUT_OF_MEMORY] The memory was insufficient.");
@@ -182,8 +183,8 @@ _DataControlProviderManagerImpl::SendDataControlResult(RequestId reqId, _DataCon
                                        "[E_SYSTEM] The method cannot proceed due to a severe system error.");
 
                        String tempFilePath(_DATACONTROL_RESULTSET_DIR);
-                       tempFilePath.Append(*pAppId);
-                       tempFilePath.Append(*pReqId);
+                       tempFilePath.Append(appId);
+                       tempFilePath.Append(callerReqId);
                        pTempFilePath = new (std::nothrow) String(tempFilePath);
                }
                else
@@ -213,13 +214,14 @@ _DataControlProviderManagerImpl::SendDataControlResult(RequestId reqId, _DataCon
                if (pResultValueList)
                {
                        // list-based request
-                       pNo = dynamic_cast< String* >(pList->GetAt(6)); // request list[2]
+                       pNo = dynamic_cast< String* >(pList->GetAt(2)); // request list[2]
                        SysTryCatch(NID_APP, pNo, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
                        Integer::Parse(*pNo, pageNo);
 
-                       pCount = dynamic_cast< String* >(pList->GetAt(7)); // request list[3]
+                       pCount = dynamic_cast< String* >(pList->GetAt(3)); // request list[3]
                        SysTryCatch(NID_APP, pCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
                        Integer::Parse(*pCount, countPerPage);
+                       SysLog(NID_APP, "[DC_PROV_SEND] pageNo: %d, countPerPage: %d", pageNo, countPerPage);
 
                        String resultCount;
                        int num = pResultValueList->GetCount();
@@ -269,6 +271,10 @@ _DataControlProviderManagerImpl::SendDataControlResult(RequestId reqId, _DataCon
 
        r = resultArg.ConstructResult(arg, pResultArgList);
        SysTryCatch(NID_APP, !IsFailed(r), r = E_SYSTEM, r, "[%s] Propagating.", GetErrorMessage(r));
+       resultArg.UpdateKeyValue(OSP_K_REQUEST_ID, callerReqId);
+       resultArg.UpdateKeyValue(OSP_K_DATACONTROL_REQUEST_TYPE, reqType);
+       resultArg.UpdateKeyValue(OSP_K_DATACONTROL_PROVIDER, providerId);
+       resultArg.UpdateKeyValue(OSP_K_DATACONTROL_DATA, *pDataId);
 
        //resultArg.Print();
        r = _Aul::SendResult(resultArg.GetBundle(), static_cast< appsvc_result_val >(0));
index 6b2e2d6..5382812 100644 (file)
@@ -37,6 +37,7 @@
 #include "FApp_AppControlManager.h"
 #include "FApp_MapDataControlImpl.h"
 #include "FApp_AppArg.h"
+#include "FApp_DataControlManager.h"
 
 using namespace std;
 
@@ -157,6 +158,8 @@ _MapDataControlImpl::GetInstance(const MapDataControl& dc)
 result
 _MapDataControlImpl::StartMapDataControl(int type, const IList* pDataList, int* pReq)
 {
+       Integer* pReqId = null;
+       _DataControlRequestInfo* pReqInfo = null;
        result r = E_SUCCESS;
 
        int req = -1;
@@ -176,11 +179,34 @@ _MapDataControlImpl::StartMapDataControl(int type, const IList* pDataList, int*
        if (__pMapDataControlEvent)
        {
                // reqId is system-wide id because the bundle is system-wide.
+#if 0
                _AppControlManager::_RequestGuard reqObj = _AppControlManager::_RequestGuard(*pAppManagerImpl, pArg, MapDataControlCallback, __pMapDataControlEvent, -1);
                req = reqObj.GetRequestNumber();
+#else
+               _DataControlManager* pDcMgr = _DataControlManager::GetInstance();
+               _AppControlManager::_RequestGuard reqObj = _AppControlManager::_RequestGuard(*pAppManagerImpl, pArg, MapDataControlCallback, pDcMgr, -1);
+               req = reqObj.GetRequestNumber();
+#endif
+               pReqId = new (std::nothrow) Integer(req);
+               SysTryCatch(NID_APP, pReqId != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+                               "[E_OUT_OF_MEMORY] The memory is insufficient");
+
+               pReqInfo = new (std::nothrow) _DataControlRequestInfo(__pMapDataControlEvent);
+               SysTryCatch(NID_APP, pReqId != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+                               "[E_OUT_OF_MEMORY] The memory is insufficient");
+
+               r = pDcMgr->AddRequestInfo(pReqId, pReqInfo);
+               SysTryCatch(NID_APP, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] Failed to add request info", GetErrorMessage(r));
 
                r = pAppManagerImpl->LaunchApp(__appId, pArg, req);
-               SysTryCatch(NID_APP, r == E_SUCCESS, reqObj.Invalidate(), r, "[%s] Propgated.", GetErrorMessage(r));
+               if (IsFailed(r))
+               {
+                       SysPropagate(NID_APP, r);
+                       reqObj.Invalidate();
+                       pDcMgr->RemoveRequestInfo(*pReqId);
+                       delete pArg;
+                       return r;
+               }
 
                if (pReq)
                {
@@ -190,10 +216,16 @@ _MapDataControlImpl::StartMapDataControl(int type, const IList* pDataList, int*
        else
        {
                r = pAppManagerImpl->LaunchApp(__appId, pArg);
+               SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
                delete pArg;
        }
 
+       return E_SUCCESS;
+
 CATCH:
+       delete pArg;
+       delete pReqId;
+       delete pReqInfo;
        return r;
 }
 
@@ -234,7 +266,7 @@ _MapDataControlImpl::GetValue(const String& dataId, const String& key,
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "dataId: %ls, key: %ls, reqId: %d, pageNo: %d, countPerPage: %d",
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, key: %ls, reqId: %d, pageNo: %d, countPerPage: %d",
                        dataId.GetPointer(), key.GetPointer(), reqId, pageNo, countPerPage);
 
        // fall through
@@ -249,10 +281,7 @@ result
 _MapDataControlImpl::MapDataControlCallback(void* data, _AppArg* pArg, _AppArg* pResArg, service_result_e res, int prop)
 {
        ArrayList* pResultList = null;
-       ArrayList* pOrigList = null;
-       String* pRequestType = null;
        String* pResult = null;
-       String* pReqId = null;
        String* pProviderId = null;
        String* pDataId = null;
        String* pErrorMessage = null;
@@ -263,11 +292,13 @@ _MapDataControlImpl::MapDataControlCallback(void* data, _AppArg* pArg, _AppArg*
        int resultCount = 0;
        int requestType = 0;
        int reqId = 0;
+       int launchReqId = 0;
        int providerRes = 0;
        bool providerResult = true;
-       bundle* origBundle = null;
+       //bundle* origBundle = null;
        bundle* resBundle = null;
        _MapDataControlEventArg* pEventArg = null;
+       const char* p = null;
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_APP, pResArg != null, E_INVALID_ARG, "Empty result callback.");
@@ -276,56 +307,60 @@ _MapDataControlImpl::MapDataControlCallback(void* data, _AppArg* pArg, _AppArg*
        resBundle = pResArg->GetBundle();
        if (resBundle)
        {
-               _MapDataControlEvent* pMapDataControlEvent = static_cast< _MapDataControlEvent* >(data);
+               p = appsvc_get_data(resBundle, OSP_K_REQUEST_ID);
+               SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+               reqId = atoi(p);
+               Integer key(reqId);
+
+               _DataControlManager* pDcMgr = static_cast< _DataControlManager* >(data);
+               _DataControlRequestInfo* pReqInfo = pDcMgr->GetRequestInfo(key);
+               SysTryCatch(NID_APP, pReqInfo != null, r = E_SYSTEM, E_SYSTEM,
+                               "[E_SYSTEM] Failed to get request info");
+
+               _MapDataControlEvent* pMapDataControlEvent = dynamic_cast< _MapDataControlEvent* >(pReqInfo->GetEvent());
+               SysTryCatch(NID_APP, pMapDataControlEvent != null, r = E_SYSTEM, E_SYSTEM,
+                               "[E_SYSTEM] invalid request info");
+
+               pDcMgr->RemoveRequestInfo(key);
 
                if (pMapDataControlEvent != null && typeid(pMapDataControlEvent) == typeid(_MapDataControlEvent*))
                {
-                       const char* p = null;
 
                        // result list
                        pResultList = _AppArg::GetListN(resBundle, OSP_K_ARG);
                        SysTryCatch(NID_APP, pResultList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result");
 
-                       pResult = dynamic_cast <String*>(pResultList->GetAt(0));
+                       pResult = dynamic_cast <String*>(pResultList->GetAt(0)); // result list[0]
                        SysTryCatch(NID_APP, pResult, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result");
                        Integer::Parse(*pResult, providerRes);
                        providerResult = static_cast< bool >(providerRes);
 
-                       pErrorMessage = dynamic_cast< String* >(pResultList->GetAt(1));
+                       pErrorMessage = dynamic_cast< String* >(pResultList->GetAt(1)); // result list[1]
                        SysTryCatch(NID_APP, pErrorMessage, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result");
                        pErrorMsg = new (std::nothrow) String(*pErrorMessage);
                        SysTryCatch(NID_APP, pErrorMsg, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
                                        "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
                        // request info
-                       origBundle = pArg->GetBundle();
-
-                       p = appsvc_get_data(origBundle, OSP_K_DATACONTROL_REQUEST_TYPE);
-                       SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
-                       pRequestType = new (std::nothrow) String(p);
-                       SysTryCatch(NID_APP, pRequestType, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
-                                       "[E_OUT_OF_MEMORY] The memory is insufficient.");
-                       Integer::Parse(*pRequestType, requestType);
+                       //origBundle = pArg->GetBundle();
 
-                       p = appsvc_get_data(origBundle, OSP_K_REQUEST_ID);
+                       p = appsvc_get_data(resBundle, OSP_K_DATACONTROL_REQUEST_TYPE);
                        SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
-                       pReqId = new (std::nothrow) String(p);
-                       SysTryCatch(NID_APP, pReqId, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
-                                       "[E_OUT_OF_MEMORY] The memory is insufficient.");
-                       Integer::Parse(*pReqId, reqId);
+                       requestType = atoi(p);
 
-                       p = appsvc_get_data(origBundle, OSP_K_DATACONTROL_PROVIDER);
+                       p = appsvc_get_data(resBundle, OSP_K_DATACONTROL_PROVIDER);
                        SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
                        pProviderId = new (std::nothrow) String(p);
                        SysTryCatch(NID_APP, pProviderId, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
                                        "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
-                       pOrigList = _AppArg::GetListN(origBundle, OSP_K_ARG);
-                       SysTryCatch(NID_APP, pOrigList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
-                       pDataId = dynamic_cast <String*>(pOrigList->GetAt(0));
-                       SysTryCatch(NID_APP, pDataId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+                       p = appsvc_get_data(resBundle, OSP_K_DATACONTROL_DATA);
+                       SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+                       pDataId = new (std::nothrow) String(p);
+                       SysTryCatch(NID_APP, pDataId, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+                                       "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
-                       SysLog(NID_APP, "result: %ld, requestType: %d, reqId: %d, providerId: %ls, dataId: %ls, errorMsg: %ls ",
+                       SysLog(NID_APP, "[DC_CALLER_RECV] provider result: %ld, requestType: %d, reqId: %d, providerId: %ls, dataId: %ls, errorMsg: %ls ",
                                        providerRes, requestType, reqId, pProviderId->GetPointer(), pDataId->GetPointer(), pErrorMsg->GetPointer());
 
                        switch (static_cast< _DataControlRequestType >(requestType))
@@ -338,7 +373,7 @@ _MapDataControlImpl::MapDataControlCallback(void* data, _AppArg* pArg, _AppArg*
 
                                if (providerResult == true)
                                {
-                                       pResultCount = dynamic_cast< String* >(pResultList->GetAt(2));
+                                       pResultCount = dynamic_cast< String* >(pResultList->GetAt(2)); // result list[2]
                                        if (pResultCount == null)
                                        {
                                                SysLogException(NID_APP, E_SYSTEM, "[E_SYSTEM] invalid result");
@@ -403,19 +438,17 @@ _MapDataControlImpl::MapDataControlCallback(void* data, _AppArg* pArg, _AppArg*
 
                        pResultList->RemoveAll(true);
                        delete pResultList;
-
-                       pOrigList->RemoveAll(true);
-                       delete pOrigList;
-
-                       delete pRequestType;
-                       delete pReqId;
                        delete pProviderId;
                }
        }
 
+       p = appsvc_get_data(pArg->GetBundle(), OSP_K_REQUEST_ID);
+       SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+       launchReqId = atoi(p);
+
        // Remove the request count
-       SysLog(NID_APP, "Remove a launch request: reqId: %d", reqId);
-       _AppControlManager::GetInstance()->RemoveLaunchRequest(reqId);
+       SysLog(NID_APP, "Remove a launch request: reqId: %d", launchReqId);
+       _AppControlManager::GetInstance()->RemoveLaunchRequest(launchReqId);
 
        return E_SUCCESS;
 
@@ -425,15 +458,6 @@ CATCH:
                pResultList->RemoveAll(true);
                delete pResultList;
        }
-
-       if (pOrigList)
-       {
-               pOrigList->RemoveAll(true);
-               delete pOrigList;
-       }
-
-       delete pRequestType;
-       delete pReqId;
        delete pProviderId;
 
        return r;
@@ -467,7 +491,7 @@ _MapDataControlImpl::AddValue(const String& dataId, const String& key,
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "dataId: %ls, key: %ls, value: %ls, reqId: %d",
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, key: %ls, value: %ls, reqId: %d",
                        dataId.GetPointer(), key.GetPointer(), value.GetPointer(), reqId);
 
        // fall through
@@ -508,7 +532,7 @@ _MapDataControlImpl::SetValue(const String& dataId, const String& key,
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "dataId: %ls, key: %ls, oldValue: %ls, newValue: %ls, reqId: %d",
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, key: %ls, oldValue: %ls, newValue: %ls, reqId: %d",
                        dataId.GetPointer(), key.GetPointer(), oldValue.GetPointer(), newValue.GetPointer(), reqId);
 
        // fall through
@@ -547,7 +571,7 @@ _MapDataControlImpl::RemoveValue(const String& dataId, const String& key,
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "dataId: %ls, key: %ls, value: %ls, reqId: %d",
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, key: %ls, value: %ls, reqId: %d",
                        dataId.GetPointer(), key.GetPointer(), value.GetPointer(), reqId);
 
        // fall through
index 9aaa9d9..2da0dec 100644 (file)
@@ -44,6 +44,7 @@
 #include "FApp_AppControlManager.h"
 #include "FApp_SqlDataControlImpl.h"
 #include "FApp_AppArg.h"
+#include "FApp_DataControlManager.h"
 
 using namespace std;
 
@@ -162,6 +163,8 @@ _SqlDataControlImpl::GetInstance(const SqlDataControl& dc)
 result
 _SqlDataControlImpl::StartSqlDataControl(int type, const IList* pDataList, int* pReq)
 {
+       Integer* pReqId = null;
+       _DataControlRequestInfo* pReqInfo = null;
        result r = E_SUCCESS;
 
        int req = -1;
@@ -181,11 +184,34 @@ _SqlDataControlImpl::StartSqlDataControl(int type, const IList* pDataList, int*
        if (__pSqlDataControlEvent)
        {
                // reqId is system-wide id because the bundle is system-wide.
+#if 0
                _AppControlManager::_RequestGuard reqObj = _AppControlManager::_RequestGuard(*pAppManagerImpl, pArg, SqlDataControlCallback, __pSqlDataControlEvent, -1);
                req = reqObj.GetRequestNumber();
+#else
+               _DataControlManager* pDcMgr = _DataControlManager::GetInstance();
+               _AppControlManager::_RequestGuard reqObj = _AppControlManager::_RequestGuard(*pAppManagerImpl, pArg, SqlDataControlCallback, pDcMgr, -1);
+               req = reqObj.GetRequestNumber();
+#endif
+               pReqId = new (std::nothrow) Integer(req);
+               SysTryCatch(NID_APP, pReqId != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+                               "[E_OUT_OF_MEMORY] The memory is insufficient");
+
+               pReqInfo = new (std::nothrow) _DataControlRequestInfo(__pSqlDataControlEvent);
+               SysTryCatch(NID_APP, pReqId != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+                               "[E_OUT_OF_MEMORY] The memory is insufficient");
+
+               r = pDcMgr->AddRequestInfo(pReqId, pReqInfo);
+               SysTryCatch(NID_APP, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] Failed to add request info", GetErrorMessage(r));
 
                r = pAppManagerImpl->LaunchApp(__appId, pArg, req);
-               SysTryCatch(NID_APP, r == E_SUCCESS, reqObj.Invalidate(), r, "[%s] Propagating.", GetErrorMessage(r));
+               if (IsFailed(r))
+               {
+                       SysPropagate(NID_APP, r);
+                       reqObj.Invalidate();
+                       pDcMgr->RemoveRequestInfo(*pReqId);
+                       delete pArg;
+                       return r;
+               }
 
                if (pReq)
                {
@@ -195,10 +221,16 @@ _SqlDataControlImpl::StartSqlDataControl(int type, const IList* pDataList, int*
        else
        {
                r = pAppManagerImpl->LaunchApp(__appId, pArg);
+               SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
                delete pArg;
        }
 
+       return E_SUCCESS;
+
 CATCH:
+       delete pArg;
+       delete pReqId;
+       delete pReqInfo;
        return r;
 }
 
@@ -214,7 +246,7 @@ _SqlDataControlImpl::Select(const String& dataId, const IList* pColumnList, cons
        const String* pColumn = null;
        int id = 0;
        result r = E_SUCCESS;
-       SysLog(NID_APP, "[DC_CALLER] SqlDataControl SELECT");
+       SysLog(NID_APP, "[DC_CALLER_SEND] SqlDataControl SELECT");
 
        ArrayList* pArgList = new ArrayList();
        pArgList->Construct();
@@ -229,7 +261,7 @@ _SqlDataControlImpl::Select(const String& dataId, const IList* pColumnList, cons
                                "[E_INVALID_ARG] The specified pColumnList parameter is empty.");
 
                pArgList->Add(*(new String(Integer::ToString(columnCount)))); // list(1): selected column count
-               SysLog(NID_APP, "[DC_CALLER] selected column count: %d", columnCount);
+               SysLog(NID_APP, "[DC_CALLER_SEND] selected column count: %d", columnCount);
 
                int i = 0;
                while (i < columnCount) // list(2): column list
@@ -240,7 +272,7 @@ _SqlDataControlImpl::Select(const String& dataId, const IList* pColumnList, cons
 
                        pArgList->Add(*(new String(*pColumn)));
                        argSize += pColumn->GetLength() * sizeof(wchar_t);
-                       SysLog(NID_APP, "[DC_CALLER] column[%d]: %ls", i, pColumn->GetPointer());
+                       SysLog(NID_APP, "[DC_CALLER_SEND] column[%d]: %ls", i, pColumn->GetPointer());
                        i++;
                }
        }
@@ -253,7 +285,7 @@ _SqlDataControlImpl::Select(const String& dataId, const IList* pColumnList, cons
        {
                pArgList->Add(*(new String(*pWhere)));
                argSize += pWhere->GetLength() * sizeof(wchar_t);
-               SysLog(NID_APP, "[DC_CALLER] pWhere: %ls", pWhere->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pWhere: %ls", pWhere->GetPointer());
        }
        else
        {
@@ -264,7 +296,7 @@ _SqlDataControlImpl::Select(const String& dataId, const IList* pColumnList, cons
        {
                pArgList->Add(*(new String(*pOrder)));
                argSize += pOrder->GetLength() * sizeof(wchar_t);
-               SysLog(NID_APP, "[DC_CALLER] pOrder: %ls", pOrder->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pOrder: %ls", pOrder->GetPointer());
        }
        else
        {
@@ -282,7 +314,7 @@ _SqlDataControlImpl::Select(const String& dataId, const IList* pColumnList, cons
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "[DC_CALLER] dataId: %ls, pColumnList: 0x%x, pWhere: 0x%x, pOrder: 0x%x, reqId: %d, pageNo: %d, countPerPage: %d",
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, pColumnList: 0x%x, pWhere: 0x%x, pOrder: 0x%x, reqId: %d, pageNo: %d, countPerPage: %d",
                        dataId.GetPointer(), pColumnList, pWhere, pOrder, reqId, pageNo, countPerPage);
 
        // fall through
@@ -297,10 +329,7 @@ result
 _SqlDataControlImpl::SqlDataControlCallback(void* data, _AppArg* pArg, _AppArg* pResArg, service_result_e res, int prop)
 {
        ArrayList* pResultList = null;
-       ArrayList* pOrigList = null;
        String* pResult = null;
-       String* pRequestType = null;
-       String* pReqId = null;
        String* pProviderId = null;
        String* pDataId = null;
        String* pErrorMessage = null;
@@ -310,11 +339,13 @@ _SqlDataControlImpl::SqlDataControlCallback(void* data, _AppArg* pArg, _AppArg*
        _DataControlResultSetEnumerator* pResultSetEnum = null;
        int requestType = 0;
        int reqId = 0;
+       int launchReqId = 0;
        int providerRes = 0;
        bool providerResult = true;
-       bundle* origBundle = null;
+       //bundle* origBundle = null;
        bundle* resBundle = null;
        _SqlDataControlEventArg* pEventArg = null;
+       const char* p = null;
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_APP, pResArg != null, E_INVALID_ARG, "Empty result callback.");
@@ -323,57 +354,59 @@ _SqlDataControlImpl::SqlDataControlCallback(void* data, _AppArg* pArg, _AppArg*
        resBundle = pResArg->GetBundle();
        if (resBundle)
        {
-               //ISqlDataControlResponseListener* pListener = static_cast< ISqlDataControlResponseListener* >(data);
-       _SqlDataControlEvent* pSqlDataControlEvent = static_cast< _SqlDataControlEvent* >(data);
+               p = appsvc_get_data(resBundle, OSP_K_REQUEST_ID);
+               SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+               reqId = atoi(p);
+               Integer key(reqId);
+
+               _DataControlManager* pDcMgr = static_cast< _DataControlManager* >(data);
+               _DataControlRequestInfo* pReqInfo = pDcMgr->GetRequestInfo(key);
+               SysTryCatch(NID_APP, pReqInfo != null, r = E_SYSTEM, E_SYSTEM,
+                               "[E_SYSTEM] Failed to get request info");
+
+               _SqlDataControlEvent* pSqlDataControlEvent = dynamic_cast< _SqlDataControlEvent* >(pReqInfo->GetEvent());
+               SysTryCatch(NID_APP, pSqlDataControlEvent != null, r = E_SYSTEM, E_SYSTEM,
+                               "[E_SYSTEM] invalid request info");
+
+               pDcMgr->RemoveRequestInfo(key);
 
                if (pSqlDataControlEvent != null && typeid(pSqlDataControlEvent) == typeid(_SqlDataControlEvent*))
                {
-                       const char* p = null;
-
                        // result list
                        pResultList = _AppArg::GetListN(resBundle, OSP_K_ARG);
                        SysTryCatch(NID_APP, pResultList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result");
 
-                       pResult = dynamic_cast <String*>(pResultList->GetAt(0));
+                       pResult = dynamic_cast <String*>(pResultList->GetAt(0)); // result list[0]
                        SysTryCatch(NID_APP, pResult, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result");
                        Integer::Parse(*pResult, providerRes);
                        providerResult = static_cast< bool >(providerRes);
 
-                       pErrorMessage = dynamic_cast< String* >(pResultList->GetAt(1));
+                       pErrorMessage = dynamic_cast< String* >(pResultList->GetAt(1)); // result list[1]
                        SysTryCatch(NID_APP, pErrorMessage, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result");
                        pErrorMsg = new (std::nothrow) String(*pErrorMessage);
                        SysTryCatch(NID_APP, pErrorMsg, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
                                        "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
-                       origBundle = pArg->GetBundle();
-
                        // request info
-                       p = appsvc_get_data(origBundle, OSP_K_DATACONTROL_REQUEST_TYPE);
-                       SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
-                       pRequestType = new (std::nothrow) String(p);
-                       SysTryCatch(NID_APP, pRequestType, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
-                                       "[E_OUT_OF_MEMORY] The memory is insufficient.");
-                       Integer::Parse(*pRequestType, requestType);
+                       //origBundle = pArg->GetBundle();
 
-                       p = appsvc_get_data(origBundle, OSP_K_REQUEST_ID);
+                       p = appsvc_get_data(resBundle, OSP_K_DATACONTROL_REQUEST_TYPE);
                        SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
-                       pReqId = new (std::nothrow) String(p);
-                       SysTryCatch(NID_APP, pReqId, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
-                                       "[E_OUT_OF_MEMORY] The memory is insufficient.");
-                       Integer::Parse(*pReqId, reqId);
+                       requestType = atoi(p);
 
-                       p = appsvc_get_data(origBundle, OSP_K_DATACONTROL_PROVIDER);
+                       p = appsvc_get_data(resBundle, OSP_K_DATACONTROL_PROVIDER);
                        SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
                        pProviderId = new (std::nothrow) String(p);
                        SysTryCatch(NID_APP, pProviderId, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
                                        "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
-                       pOrigList = _AppArg::GetListN(origBundle, OSP_K_ARG);
-                       SysTryCatch(NID_APP, pOrigList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
-                       pDataId = dynamic_cast <String*>(pOrigList->GetAt(0));
-                       SysTryCatch(NID_APP, pDataId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+                       p = appsvc_get_data(resBundle, OSP_K_DATACONTROL_DATA);
+                       SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+                       pDataId = new (std::nothrow) String(p);
+                       SysTryCatch(NID_APP, pDataId, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+                                       "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
-                       SysLog(NID_APP, "providerResult: %ld, requestType: %d, reqId: %d, providerId: %ls, dataId: %ls, errorMsg: %ls ",
+                       SysLog(NID_APP, "[DC_CALLER_RECV] provider result: %ld, requestType: %d, reqId: %d, providerId: %ls, dataId: %ls, errorMsg: %ls ",
                                        providerRes, requestType, reqId, pProviderId->GetPointer(), pDataId->GetPointer(), pErrorMsg->GetPointer());
 
                        switch (static_cast <_DataControlRequestType>(requestType))
@@ -394,7 +427,7 @@ _SqlDataControlImpl::SqlDataControlCallback(void* data, _AppArg* pArg, _AppArg*
                                                goto CATCH;
                                        }
 
-                                       SysLog(NID_APP, "tempPath: %ls", pTmpPath->GetPointer());
+                                       SysLog(NID_APP, "[DC_CALLER_RECV] tempPath: %ls", pTmpPath->GetPointer());
                                        if (pTmpPath->Equals(L"NoResultSet", true) == false) // Result set exists
                                        {
                                                pResultSetEnum->SetPath(*pTmpPath);
@@ -453,19 +486,17 @@ _SqlDataControlImpl::SqlDataControlCallback(void* data, _AppArg* pArg, _AppArg*
 
                        pResultList->RemoveAll(true);
                        delete pResultList;
-
-                       pOrigList->RemoveAll(true);
-                       delete pOrigList;
-
-                       delete pRequestType;
-                       delete pReqId;
                        delete pProviderId;
                }
        }
 
+       p = appsvc_get_data(pArg->GetBundle(), OSP_K_REQUEST_ID);
+       SysTryCatch(NID_APP, p, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid bundle");
+       launchReqId = atoi(p);
+
        // Remove the request count
-       SysLog(NID_APP, "Remove a launch request: reqId: %d", reqId);
-       _AppControlManager::GetInstance()->RemoveLaunchRequest(reqId);
+       SysLog(NID_APP, "Remove a launch request: reqId: %d", launchReqId);
+       _AppControlManager::GetInstance()->RemoveLaunchRequest(launchReqId);
 
        return E_SUCCESS;
 
@@ -475,15 +506,6 @@ CATCH:
                pResultList->RemoveAll(true);
                delete pResultList;
        }
-
-       if (pOrigList)
-       {
-               pOrigList->RemoveAll(true);
-               delete pOrigList;
-       }
-
-       delete pRequestType;
-       delete pReqId;
        delete pProviderId;
 
        return r;
@@ -499,7 +521,7 @@ _SqlDataControlImpl::Insert(const String& dataId, const IMap& insertMap, Request
        int id = 0;
        int i = 0;
        result r = E_SUCCESS;
-       SysLog(NID_APP, "[DC_CALLER] SqlDataControl INSERT");
+       SysLog(NID_APP, "[DC_CALLER_SEND] SqlDataControl INSERT");
 
        columnCount = insertMap.GetCount();
        SysTryReturnResult(NID_APP, columnCount > 0, E_INVALID_ARG, "The specified insertMap parameter is empty.");
@@ -511,7 +533,7 @@ _SqlDataControlImpl::Insert(const String& dataId, const IMap& insertMap, Request
        long long argSize = dataId.GetLength() * sizeof(wchar_t);
 
        pArgList->Add(*(new String(Integer::ToString(columnCount)))); // list(1): inserted column count
-       SysLog(NID_APP, "[DC_CALLER] inserted column count: %d", columnCount);
+       SysLog(NID_APP, "[DC_CALLER_SEND] inserted column count: %d", columnCount);
 
        IMapEnumerator* pMapEnum = const_cast< IMap* >(&insertMap)->GetMapEnumeratorN();
        while (pMapEnum->MoveNext() == E_SUCCESS) // list(2): column-value pairs
@@ -521,14 +543,14 @@ _SqlDataControlImpl::Insert(const String& dataId, const IMap& insertMap, Request
                                "[E_INVALID_ARG] The object is not String class.");
 
                pArgList->Add(*(new String(*pColumn)));
-               SysLog(NID_APP, "[DC_CALLER] pColumn[%d]: %ls", i, pColumn->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pColumn[%d]: %ls", i, pColumn->GetPointer());
 
                String* pValue = dynamic_cast< String* >(pMapEnum->GetValue());
                SysTryCatch(NID_APP, pValue != null, r = E_INVALID_ARG, E_INVALID_ARG,
                                "[E_INVALID_ARG] The object is not String class.");
 
                pArgList->Add(*(new String(*pValue)));
-               SysLog(NID_APP, "[DC_CALLER] pValue[%d]: %ls", i, pValue->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pValue[%d]: %ls", i, pValue->GetPointer());
 
                argSize += pColumn->GetLength() * sizeof(wchar_t);
                argSize += pValue->GetLength() * sizeof(wchar_t);
@@ -542,13 +564,12 @@ _SqlDataControlImpl::Insert(const String& dataId, const IMap& insertMap, Request
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "[DC_CALLER] dataId: %ls, insertMap: 0x%x, reqId: %d", dataId.GetPointer(), &insertMap, reqId);
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, insertMap: 0x%x, reqId: %d", dataId.GetPointer(), &insertMap, reqId);
 
        // fall through
 CATCH:
        pArgList->RemoveAll(true);
        delete pArgList;
-
        delete pMapEnum;
 
        return r;
@@ -564,7 +585,7 @@ _SqlDataControlImpl::Update(const String& dataId, const IMap& updateMap, const S
        int id = 0;
        int i = 0;
        result r = E_SUCCESS;
-       SysLog(NID_APP, "[DC_CALLER] SqlDataControl UPDATE");
+       SysLog(NID_APP, "[DC_CALLER_SEND] SqlDataControl UPDATE");
 
        columnCount = updateMap.GetCount();
        SysTryReturnResult(NID_APP, columnCount > 0, E_INVALID_ARG, "The specified insertMap parameter is empty.");
@@ -576,7 +597,7 @@ _SqlDataControlImpl::Update(const String& dataId, const IMap& updateMap, const S
        long long argSize = dataId.GetLength() * sizeof(wchar_t);
 
        pArgList->Add(*(new String(Integer::ToString(columnCount)))); // list(1): updated column count
-       SysLog(NID_APP, "[DC_CALLER] updated column count: %d", columnCount);
+       SysLog(NID_APP, "[DC_CALLER_SEND] updated column count: %d", columnCount);
 
        IMapEnumerator* pMapEnum = const_cast< IMap* >(&updateMap)->GetMapEnumeratorN();
        while (pMapEnum->MoveNext() == E_SUCCESS) // list(2): column-value pairs
@@ -586,14 +607,14 @@ _SqlDataControlImpl::Update(const String& dataId, const IMap& updateMap, const S
                                "[E_INVALID_ARG] The object is not String class.");
 
                pArgList->Add(*(new String(*pColumn)));
-               SysLog(NID_APP, "[DC_CALLER] pColumn[%d]: %ls", i, pColumn->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pColumn[%d]: %ls", i, pColumn->GetPointer());
 
                String* pValue = dynamic_cast< String* >(pMapEnum->GetValue());
                SysTryCatch(NID_APP, pValue != null, r = E_INVALID_ARG, E_INVALID_ARG,
                                "[E_INVALID_ARG] The object is not String class.");
 
                pArgList->Add(*(new String(*pValue)));
-               SysLog(NID_APP, "[DC_CALLER] pValue[%d]: %ls", i, pValue->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pValue[%d]: %ls", i, pValue->GetPointer());
 
                argSize += pColumn->GetLength() * sizeof(wchar_t);
                argSize += pValue->GetLength() * sizeof(wchar_t);
@@ -604,7 +625,7 @@ _SqlDataControlImpl::Update(const String& dataId, const IMap& updateMap, const S
        {
                pArgList->Add(*(new String(*pWhere)));
                argSize += pWhere->GetLength() * sizeof(wchar_t);
-               SysLog(NID_APP, "[DC_CALLER] pWhere: %ls", pWhere->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pWhere: %ls", pWhere->GetPointer());
        }
        else
        {
@@ -618,14 +639,13 @@ _SqlDataControlImpl::Update(const String& dataId, const IMap& updateMap, const S
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "[DC_CALLER] dataId: %ls, updateMap: 0x%x, pWhere: 0x%x, reqId: %d",
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, updateMap: 0x%x, pWhere: 0x%x, reqId: %d",
                                dataId.GetPointer(), &updateMap, pWhere, reqId);
 
        // fall through
 CATCH:
        pArgList->RemoveAll(true);
        delete pArgList;
-
        delete pMapEnum;
 
        return r;
@@ -639,7 +659,7 @@ _SqlDataControlImpl::Delete(const String& dataId, const String* pWhere, RequestI
 
        int id = 0;
        result r = E_SUCCESS;
-       SysLog(NID_APP, "[DC_CALLER] SqlDataControl DELETE");
+       SysLog(NID_APP, "[DC_CALLER_SEND] SqlDataControl DELETE");
 
        ArrayList* pArgList = new ArrayList();
        pArgList->Construct();
@@ -651,7 +671,7 @@ _SqlDataControlImpl::Delete(const String& dataId, const String* pWhere, RequestI
        {
                pArgList->Add(*(new String(*pWhere)));
                argSize += pWhere->GetLength() * sizeof(wchar_t);
-               SysLog(NID_APP, "[DC_CALLER] pWhere: %ls", pWhere->GetPointer());
+               SysLog(NID_APP, "[DC_CALLER_SEND] pWhere: %ls", pWhere->GetPointer());
        }
        else
        {
@@ -665,7 +685,7 @@ _SqlDataControlImpl::Delete(const String& dataId, const String* pWhere, RequestI
 
        reqId = static_cast< RequestId >(id);
 
-       SysLog(NID_APP, "[DC_CALLER] dataId: %ls, pWhere: 0x%x, reqId: %d", dataId.GetPointer(), pWhere, reqId);
+       SysLog(NID_APP, "[DC_CALLER_SEND] dataId: %ls, pWhere: 0x%x, reqId: %d", dataId.GetPointer(), pWhere, reqId);
 
        // fall through
 CATCH:
index 8753d82..4e281d0 100644 (file)
@@ -64,7 +64,8 @@ enum _DataControlRequestType
 #define OSP_K_APPID         "__OSP_APPID__"
 #define OSP_K_REQUEST_ID    "__OSP_REQUEST_ID__"
 #define OSP_K_APPCONTROL_INTERNAL_OPERATION "__OSP_APPCONTROL_INTERNAL_INTERNAL_OPERATION__"
-#define OSP_K_DATACONTROL_PROVIDER      "__OSP_DATACONTROL_PROVIDER__"
+#define OSP_K_DATACONTROL_PROVIDER             "__OSP_DATACONTROL_PROVIDER__"
+#define OSP_K_DATACONTROL_DATA                 "__OSP_DATACONTROL_DATA__"
 #define OSP_K_DATACONTROL_REQUEST_TYPE  "__OSP_DATACONTROL_REQUEST_TYPE__"
 
 /**
@@ -144,6 +145,11 @@ public:
                UpdateRequestId(__pBundle, reqId);
        }
 
+       void UpdateKeyValue(const char* pKey, const Tizen::Base::String& value)
+       {
+               UpdateKeyValue(__pBundle, pKey, value);
+       }
+
        result UpdateWindowHandle(long handle)
        {
                return UpdateWindowHandle(__pBundle, handle);
@@ -169,6 +175,8 @@ public:
 
        static void UpdateRequestId(bundle* b, int reqId);
 
+       static void UpdateKeyValue(bundle* b, const char* pKey, const Tizen::Base::String& value);
+
        static result UpdateWindowHandle(bundle* b, long handle);
 
        static Tizen::Base::Collection::ArrayList* GetListN(bundle* b, const char* key);
index 634b5b6..75f94ac 100644 (file)
@@ -253,6 +253,8 @@ public:
 
        result LaunchPkg(_AppMessageImpl& msg, const char* pkg_name, const char* op, const char* mime, const char* uri, AppSvcResFn pCb, void* data);
 
+       result LaunchPkg(_AppMessageImpl& msg, const Tizen::Base::String& package, const Tizen::Base::String& opId, const Tizen::Base::String* pUri, const Tizen::Base::String* pMime, AppSvcResFn pCb, void* data);
+
        int Launch(_AppMessageImpl& msg, const char* pkg_name, const char* op, const char* mime, const char* uri, AppSvcResFn pCb, void* data);
        result LaunchAppWithCondition(const AppId& appId, const Tizen::Base::String& condition, Tizen::Base::Collection::IList* pArgs);
 
@@ -260,6 +262,8 @@ public:
 
        static bool IsAllowedAppControl(const wchar_t aTable[][2][64], int count, const Tizen::Base::String& aId, const Tizen::Base::String& oId);
 
+       static AppId GetAliasAppId(const AppId& appId);
+
        static result GetMimeFromExt(const Tizen::Base::String& ext, Tizen::Base::String& out);
 
        void RemoveLaunchRequest(int req);
diff --git a/src/app/package/FAppPkgPackageLicenseManager.cpp b/src/app/package/FAppPkgPackageLicenseManager.cpp
deleted file mode 100644 (file)
index 6d64196..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// Open Service Platform
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file       FAppPkgPackageLicenseManager.cpp
- * @brief      This is the implementation for the PackageLicenseManager class.
- */
-#include <FBaseErrorDefine.h>
-#include <FBase_StringConverter.h>
-#include <string.h>
-#include <FSec_AccessController.h>
-#include <FAppPkgPackageLicenseManager.h>
-#include <FBaseSysLog.h>
-
-#include <drm-oem-intel.h>
-
-using namespace Tizen::Base;
-using namespace Tizen::Security;
-
-namespace Tizen { namespace App { namespace Package
-{
-
-PackageLicenseManager::PackageLicenseManager(void)
-{
-}
-
-PackageLicenseManager::~PackageLicenseManager(void)
-{
-}
-
-result
-PackageLicenseManager::GenerateDrmLicenseRequest(const Tizen::Base::String& licenseRequestInfo, Tizen::Base::String& licenseRequest, Tizen::Base::String& licenseUrl)
-{
-       result r = E_SUCCESS;
-
-       r = _AccessController::CheckUserPrivilege(_PRV_PACKAGELICENSEMANAGER);
-       SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
-       return r;
-}
-
-result 
-PackageLicenseManager::SaveDrmLicense(const Tizen::Base::String& rightObject)
-{
-       result r = E_SUCCESS;
-       char*   pRo = null;
-       int     ret = 0;
-
-       r = _AccessController::CheckUserPrivilege(_PRV_PACKAGELICENSEMANAGER);
-       SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
-       pRo = _StringConverter::CopyToCharArrayN(rightObject);
-       SysAssertf(pRo != null, "[PackageLicenseManager] pRo is null");
-
-       ret = drm_oem_intel_install_license(pRo, strlen(pRo));
-
-       if(ret == 1)
-       {
-               SysLog(NID_APP, "SaveDrmLicense() called, ro successfully saved.");
-       }
-       else
-       {
-               SysLog(NID_APP, "SaveDrmLicense() called, failed.");
-               r = E_INVALID_DATA;
-       }
-
-CATCH:
-       delete [] pRo;
-       return r;
-}
-
-Tizen::Base::TimeSpan 
-PackageLicenseManager::GetRemainingTimeUntilDrmExpiration(const Tizen::App::PackageId& pkgId)
-{
-       result r = E_SUCCESS;
-
-       r = _AccessController::CheckUserPrivilege(_PRV_PACKAGELICENSEMANAGER);
-       SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
-       TimeSpan temp(9999,9999,9999);
-
-       return temp;
-}
-
-result 
-PackageLicenseManager::SaveLicenseInfoForPackage(const Tizen::Base::String& licenseInfo)
-{
-       result r = E_SUCCESS;
-       char*   pCek = null;
-       int ret = 0;
-
-       r = _AccessController::CheckUserPrivilege(_PRV_PACKAGELICENSEMANAGER);
-       SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
-       pCek = _StringConverter::CopyToCharArrayN(licenseInfo);
-       SysAssertf(pCek !=null, "[PackageLicenseManager] pCek is null");
-
-       ret = drm_oem_intel_install_cek(pCek, strlen(pCek));
-
-       if(ret == 1)
-       {
-               SysLog(NID_APP, "SaveLicenseInfoForApp() called, ro successfully saved.");
-       }
-       else
-       {
-               SysLog(NID_APP, "SaveLicenseInfoForApp() called, failed.");
-               r = E_INVALID_DATA;
-       }
-
-CATCH:
-       delete [] pCek;
-       return r;
-}
-
-}}} // Tizen::App::Package
index ecf9bd5..284df62 100644 (file)
@@ -104,20 +104,28 @@ Int8::Decode(const String& s, char& ret)
 
        long value = 0;
        int radix = 0;
+       int startIndex = 0;
+       int minLength = 2;
        wchar_t* pEnd = null;
        String str(s);
 
+       if (s[0] == L'-')
+       {
+               startIndex = 1;
+               minLength = 3;
+       }
+
        // Find radix
-       if (s[0] == L'#')
+       if (s[startIndex] == L'#')
        {
                radix = Character::RADIX_HEXADECIMAL;
 
                // Remove '#'
-               str.Remove(0, 1);
+               str.Remove(startIndex, 1);
        }
-       else if (s[0] == L'0' && (s.GetLength() >= 2))
+       else if (s[startIndex] == L'0' && (s.GetLength() >= minLength))
        {
-               if (s[1] == L'x' || s[1] == L'X')
+               if (s[startIndex + 1] == L'x' || s[startIndex + 1] == L'X')
                {
                        radix = Character::RADIX_HEXADECIMAL;
                }
index b6f7f26..8b84873 100644 (file)
@@ -55,6 +55,8 @@ const char* _DATACONTROL_RESULTSET_DIR = "/tmp/osp/DataControlResultSet/\0";
 namespace Tizen { namespace Io
 {
 
+static const int _DATACONTROL_PACKET_INDEX_COLUMNCOUNT = 1;
+
 _DataControlResultSetImpl::_DataControlResultSetImpl(RequestId reqId)
        : __constructed(true)
        , __pageNo(1)
@@ -88,9 +90,9 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
 {
        String tempFilePath(_DATACONTROL_RESULTSET_DIR);
        String columnName;
-       String* pAppId = null;
-       String* pRequestType = null;
-       String* pReqId = null;
+       String appId;
+       String reqType;
+       String callerReqId;
        String* pNo = null;
        String* pCount = null;
        String* pColumnCount = null;
@@ -110,50 +112,47 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
        SysAssertf(__constructed == true, "Not yet constructed. Construct() should be called before use.\n\n");
 
        _AppControlManager* pAppMgr = _AppControlManager::GetInstance();
-       SysTryReturnResult(NID_APP, pAppMgr, E_SYSTEM, "Failed to get instance.");
+       SysTryReturnResult(NID_IO, pAppMgr, E_SYSTEM, "Failed to get instance.");
 
-       _ResultInfo* pResultInfo = pAppMgr->__resultManager.FindItem(static_cast< int >(__reqId));
-       SysTryReturnResult(NID_APP, pResultInfo, E_OBJ_NOT_FOUND,
+       _ResultInfo* pResultInfo = pAppMgr->__resultManager.FindItem(static_cast< int >(__reqId)); // provider reqId
+       SysTryReturnResult(NID_IO, pResultInfo, E_OBJ_NOT_FOUND,
                        "The data control request specified with the reqId (%ld) did not exist.", __reqId);
 
        const _AppArg& arg = pResultInfo->arg;
 
-       std::unique_ptr<ArrayList, AllElementsDeleter> pList(arg.GetArgListN(0));
-       SysTryReturnResult(NID_APP, pList, E_SYSTEM, "Invalid result object.");
-
        // key-based request
-       pAppId = dynamic_cast< String* >(pList->GetAt(0)); // key[0]
-       SysTryReturnResult(NID_APP, pAppId, E_SYSTEM, "Invalid request.");
-
-       pRequestType = dynamic_cast< String* >(pList->GetAt(1)); // key[1]
-       SysTryReturnResult(NID_APP, pRequestType, E_SYSTEM, "Invalid request.");
-       Integer::Parse(*pRequestType, type);
+       reqType = arg.GetValue(OSP_K_DATACONTROL_REQUEST_TYPE);
+       Integer::Parse(reqType, type);
        requestType = static_cast< _DataControlRequestType >(type);
-       SysTryReturnResult(NID_APP, requestType ==  _DATACONTROL_REQUEST_TYPE_SQL_QUERY, E_INVALID_ARG,
+       SysTryReturnResult(NID_IO, requestType ==  _DATACONTROL_REQUEST_TYPE_SQL_QUERY, E_INVALID_ARG,
                        "The reqId should be for the data control query request.");
 
-       pReqId = dynamic_cast< String* >(pList->GetAt(2)); // key[2]
-       SysTryReturnResult(NID_APP, pReqId, E_SYSTEM, "Invalid request.");
+       appId = arg.GetCallerAppId();
+       callerReqId = arg.GetValue(OSP_K_REQUEST_ID);
 
        // list-based request
-       pColumnCount = dynamic_cast< String* >(pList->GetAt(5));
-       SysTryReturnResult(NID_APP, pColumnCount, E_SYSTEM, "Invalid result object.");
+       std::unique_ptr< ArrayList, AllElementsDeleter > pList(_AppArg::GetListN(arg.GetBundle(), OSP_K_ARG));
+       SysTryReturnResult(NID_IO, pList, E_SYSTEM, "Invalid result object.");
+
+       pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
+       SysTryReturnResult(NID_IO, pColumnCount, E_SYSTEM, "Invalid result object.");
        Integer::Parse(*pColumnCount, columnCount);
 
-       pageNoIndex = 5 + columnCount + 2 + 1;
+       pageNoIndex = _DATACONTROL_PACKET_INDEX_COLUMNCOUNT + columnCount + 2 + 1;
 
        pNo = dynamic_cast< String* >(pList->GetAt(pageNoIndex));
-       SysTryReturnResult(NID_APP, pNo, E_SYSTEM, "Invalid result object.");
+       SysTryReturnResult(NID_IO, pNo, E_SYSTEM, "Invalid result object.");
        Integer::Parse(*pNo, pageNo);
 
        pCount = dynamic_cast< String* >(pList->GetAt(pageNoIndex + 1));
-       SysTryReturnResult(NID_APP, pCount, E_SYSTEM, "Invalid result object.");
+       SysTryReturnResult(NID_IO, pCount, E_SYSTEM, "Invalid result object.");
        Integer::Parse(*pCount, countPerPage);
 
        this->SetCapacity(pageNo, countPerPage);
-       tempFilePath.Append(*pAppId);
-       tempFilePath.Append(*pReqId);
+       tempFilePath.Append(appId);
+       tempFilePath.Append(callerReqId);
        __tmpPath = tempFilePath;
+       SysLog(NID_IO, "[DC_PROV_SEND] temp file path: %ls", tempFilePath.GetPointer());
 
        // initialize
        r = pDbEnum->Reset();
@@ -167,7 +166,7 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
                if (r == E_OUT_OF_RANGE) // the previous pages do not exist
                {
                        __result = E_OUT_OF_RANGE;
-                       SysTryReturnResult(NID_APP, false, E_SUCCESS, "Out of range error.");
+                       SysTryReturnResult(NID_IO, false, E_SUCCESS, "Out of range error.");
                }
                SysTryReturnResult(NID_IO, !IsFailed(r), E_DATABASE,
                                   "The database engine has failed to enumerator result set.");
@@ -178,7 +177,7 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
        if (r == E_OUT_OF_RANGE) // the specific page is empty
        {
                __result = E_OUT_OF_RANGE;
-               SysTryReturnResult(NID_APP, false, E_SUCCESS, "Out of range error.");
+               SysTryReturnResult(NID_IO, false, E_SUCCESS, "Out of range error.");
        }
        SysTryReturnResult(NID_IO, !IsFailed(r), E_DATABASE,
                           "The database engine has failed to enumerate the result set.");
index c631d7f..40320e5 100755 (executable)
@@ -57,21 +57,27 @@ _DataSetEnumeratorImpl::_DataSetEnumeratorImpl(void)
        __pCurrentRow(null),
        __columnCount(0),
        __rowCount(0),
-       __currentRowIndex(-1)
+       __currentRowIndex(-1),
+       __dataSetDeleted(0)
 {
 
 }
 
 _DataSetEnumeratorImpl::~_DataSetEnumeratorImpl(void)
 {
-
+       if (__dataSetDeleted == 0)
+       {
+               __pEnumImplList->Remove(*this);
+       }
 }
 
 result
 _DataSetEnumeratorImpl::MoveNext(void)
 {
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
 
        if (__currentRowIndex +1  == __rowCount)
                return E_OUT_OF_RANGE;
@@ -89,7 +95,9 @@ result
 _DataSetEnumeratorImpl::MovePrevious(void)
 {
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
 
        if (__currentRowIndex == 0)
                return E_OUT_OF_RANGE;
@@ -107,7 +115,9 @@ result
 _DataSetEnumeratorImpl::MoveFirst(void)
 {
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
 
        __currentRowIndex = 0;
        __pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
@@ -122,7 +132,9 @@ result
 _DataSetEnumeratorImpl::MoveLast(void)
 {
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
 
        __currentRowIndex = __rowCount -1;
        __pCurrentRow = static_cast<ArrayList*>(__pDataSet->GetAt(__currentRowIndex));
@@ -137,7 +149,9 @@ result
 _DataSetEnumeratorImpl::Reset(void)
 {
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
 
        __currentRowIndex = -1;
        __pCurrentRow = null;
@@ -151,7 +165,9 @@ _DataSetEnumeratorImpl::GetIntAt(int columnIndex, int& value) const
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -181,7 +197,9 @@ _DataSetEnumeratorImpl::GetInt64At(int columnIndex, long long& value) const
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -211,7 +229,9 @@ _DataSetEnumeratorImpl::GetDoubleAt(int columnIndex, double& value) const
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -241,7 +261,9 @@ _DataSetEnumeratorImpl::GetStringAt(int columnIndex, String& value) const
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -271,7 +293,9 @@ _DataSetEnumeratorImpl::GetBlobAt(int columnIndex, ByteBuffer& value) const
        ByteBuffer* pBuffer = null;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -305,7 +329,9 @@ _DataSetEnumeratorImpl::GetBlobAt(int columnIndex, void* buffer, int size) const
        ByteBuffer* pBuffer = null;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -344,7 +370,9 @@ _DataSetEnumeratorImpl::GetDateTimeAt(int columnIndex, DateTime& value) const
        String* pStr = null;
 
        SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The instance is not constructed or the dataset is already been deleted.");
+                               "The Object is not constructed.");
+       SysTryReturnResult(NID_IO, __dataSetDeleted != 1, E_INVALID_STATE,
+                               "The dataset is already been deleted.");
        SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG,
                                "Given column index is out of range.");
        SysTryReturnResult(NID_IO, __pCurrentRow != null, E_INVALID_STATE,
@@ -372,8 +400,10 @@ CATCH:
 int
 _DataSetEnumeratorImpl::GetColumnCount(void) const
 {
-       SysTryReturnResult(NID_IO, __pDataSet != null, E_INVALID_STATE,
-                               "The Object is not constructed or the dataset is already been deleted.");
+       SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
+                               "[E_INVALID_STATE] The Object is not constructed.");
+       SysTryReturn(NID_IO, __dataSetDeleted != 1, -1, E_INVALID_STATE,
+                               "[E_INVALID_STATE] The dataset is already been deleted.");
 
        return __columnCount;
 }
@@ -384,8 +414,9 @@ _DataSetEnumeratorImpl::GetColumnType(int columnIndex) const
        DbColumnType type = DB_COLUMNTYPE_UNDEFINED;
 
        SysTryReturn(NID_IO, __pDataSet != null, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
-                               "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+                               "[E_INVALID_STATE] The instance is not constructed.");
+       SysTryReturn(NID_IO, __dataSetDeleted != 1, DB_COLUMNTYPE_UNDEFINED, E_INVALID_STATE,
+                               "[E_INVALID_STATE] The dataset is already been deleted.");
        SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, DB_COLUMNTYPE_UNDEFINED, E_INVALID_ARG,
                                "[E_INVALID_ARG] Given column index is out of range.");
 
@@ -422,8 +453,9 @@ String
 _DataSetEnumeratorImpl::GetColumnName(int columnIndex) const
 {
        SysTryReturn(NID_IO, __pDataSet != null, null, E_INVALID_STATE,
-                               "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+                               "[E_INVALID_STATE] The instance is not constructed.");
+       SysTryReturn(NID_IO, __dataSetDeleted != 1, null, E_INVALID_STATE,
+                               "[E_INVALID_STATE] The dataset is already been deleted.");
        SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, null, E_INVALID_ARG,
                                "[E_INVALID_ARG] Given column index is out of range.");
 
@@ -445,11 +477,11 @@ _DataSetEnumeratorImpl::GetColumnSize(int columnIndex) const
        int bytes = 0;
 
        SysTryReturn(NID_IO, __pDataSet != null, -1, E_INVALID_STATE,
-                               "[E_INVALID_STATE] The instance is not constructed or the dataset is already been deleted.");
-
+               "[E_INVALID_STATE] The instance is not constructed.");
+       SysTryReturn(NID_IO, __dataSetDeleted != 1, -1, E_INVALID_STATE,
+                               "[E_INVALID_STATE] The dataset is already been deleted.");
        SysTryReturn(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, -1, E_INVALID_ARG,
                                "[E_INVALID_ARG] Given column index is out of range.");
-
        SysTryReturn(NID_IO, __pCurrentRow != null, -1, E_INVALID_STATE,
                                "[E_INVALID_STATE] The method has tried to fetch the column data of a result set that is not activated.");
 
index 9670bd3..1e64390 100755 (executable)
@@ -46,6 +46,9 @@ _DataSetImpl::_DataSetImpl(void)
 
 _DataSetImpl::~_DataSetImpl(void)
 {
+       for (int i = 0; i< __enumImplList.GetCount() ; i++)
+               (static_cast<_DataSetEnumeratorImpl*>(__enumImplList.GetAt(i)))->__dataSetDeleted = 1;
+
        delete __pDataSet;
        delete __pColumnList;
        delete __pColumnTypeList;
@@ -109,6 +112,8 @@ _DataSetImpl::CreateDataRowN(void)
 DataSetEnumerator*
 _DataSetImpl::GetDataSetEnumeratorN(void)
 {
+       result r;
+
        unique_ptr<DataSetEnumerator> pDataSetEnum(_DataSetEnumeratorImpl::CreateDataSetEnumeratorInstanceN());
 
        _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pDataSet = __pDataSet;
@@ -118,6 +123,11 @@ _DataSetImpl::GetDataSetEnumeratorN(void)
 
        //SysLog(NID_IO, "row count is %d, column count is %d", __rowCount, __columnCount);
 
+       r = __enumImplList.Add(_DataSetEnumeratorImpl::GetInstance(*pDataSetEnum));
+       SysTryReturn(NID_IO, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Add to LinkedList Falied");
+
+       _DataSetEnumeratorImpl::GetInstance(*pDataSetEnum)->__pEnumImplList = &__enumImplList;
+
        return pDataSetEnum.release();
 }
 
index 5ca9166..4581a51 100644 (file)
@@ -1321,7 +1321,6 @@ _RegistryCore::GetEntryValue(int sectionIndex, int entryIndex, _RegValueType typ
 {
        _RegistrySection* pRegSection = null;
        _RegistryEntry* pRegEntry = null;
-       IEnumerator* pEntryEnum = null;
        result r = E_SUCCESS;
        int listSize = 0;
        int tmpEntryIndex = -1;
@@ -1351,7 +1350,7 @@ _RegistryCore::GetEntryValue(int sectionIndex, int entryIndex, _RegValueType typ
        SysTryReturnVoidResult(NID_IO, entryIndex < entryListSize, E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND]Entry not found.");
 
        // read the entries for this section
-       pEntryEnum = pRegSection->__entryList.GetEnumeratorN();
+       unique_ptr< IEnumerator > pEntryEnum(pRegSection->__entryList.GetEnumeratorN());
        SysTryReturnVoidResult(NID_IO, pEntryEnum != null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND]Entry list is empty.");
 
        tmpEntryIndex = entryIndex;
old mode 100644 (file)
new mode 100755 (executable)
index 9586c4a..85f1264
@@ -162,11 +162,11 @@ private:
        Tizen::Base::Collection::ArrayList* __pCurrentRow;
 
        int __columnCount;
-
        int __rowCount;
-
        int __currentRowIndex;
 
+       int __dataSetDeleted;
+       Tizen::Base::Collection::LinkedList* __pEnumImplList;
        friend class _DataSetImpl;
 
 }; // _DataSetEnumeratorImpl
index 2c4fd48..541cafd 100755 (executable)
@@ -73,6 +73,8 @@ private:
 
        int __columnCount;
        int __rowCount;
+
+       Tizen::Base::Collection::LinkedList __enumImplList;
 }; // _DataSetImpl
 
 }} // Tizen::Io
index b5f0bb5..224aea1 100644 (file)
@@ -145,9 +145,9 @@ _LocaleImpl::GetLanguageName(String& languageName) const
                {
                        U_ICU_NAMESPACE::UnicodeString icuScriptStr;
                        String languageScriptName = _LocaleData::GetOspString(__icuLocale.getDisplayScript(icuScriptStr));
-                       languageName.Append(L" (");
-                       languageName.Append(languageScriptName);
-                       languageName.Append(L")");
+                       languageName.Insert(L" (", languageName.GetLength());
+                       languageName.Insert(languageScriptName, languageName.GetLength());
+                       languageName.Insert(L")", languageName.GetLength());
                }
                return E_SUCCESS;
        }
@@ -167,9 +167,9 @@ _LocaleImpl::GetLanguageName(const _LocaleImpl& otherLocale, String& languageNam
                 {
                         U_ICU_NAMESPACE::UnicodeString icuScriptStr;
                         String languageScriptName = _LocaleData::GetOspString(__icuLocale.getDisplayScript(otherLocale.__icuLocale, icuScriptStr));
-                        languageName.Append(L" (");
-                        languageName.Append(languageScriptName);
-                        languageName.Append(L")");
+                       languageName.Insert(L" (", languageName.GetLength());
+                        languageName.Insert(languageScriptName, languageName.GetLength());
+                        languageName.Insert(L")", languageName.GetLength());
                 }
                return E_SUCCESS;
        }
index b445db8..e929e6a 100755 (executable)
@@ -76,7 +76,12 @@ _PrivacyInfoImpl::SetEnabled(bool enable)
 String
 _PrivacyInfoImpl::GetDisplayName(void) const
 {
-       return __privacyId;
+       String privacyURI = L"http://tizen.org/privacy/";
+       String displayName;
+
+       __privacyId.SubString(privacyURI.GetLength(), displayName);
+
+       return displayName;
 }
 
 String
index 7944b4e..1d333a6 100755 (executable)
@@ -54,7 +54,6 @@ _PrivacyManagerImpl::GetInstance(PrivacyManager& privacyManager)
 
 bool GetPrivacyAppPackageListNCallback(const char *package_id, void* user_data)
 {
-       result r = E_SUCCESS;
        ArrayList* pList = static_cast < ArrayList* >(user_data);
 
        pList->Add(new String(package_id));
index c1598a8..67bcdb7 100644 (file)
@@ -100,29 +100,26 @@ result
 SettingInfo::SetWallpaper(const String& filePath)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetWallpaper(filePath);
 }
 
 result
 SettingInfo::SetRingtone(const String& filePath)
 {
-        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
+       result r = E_SUCCESS;
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetRingtone(filePath);
 }
 
 result
 SettingInfo::SetVolume(const String& soundCategory, int level)
 {
-        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
+       result r = E_SUCCESS;
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetVolume(soundCategory, level);
 }
 
@@ -130,8 +127,8 @@ result
 SettingInfo::GetValueForPrivilegedKey(const String& key, bool& value)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMSETTING_READ);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTINGMANAGER_READ);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::GetValueForPrivilegedKey(key, value);
 }
 
@@ -145,9 +142,8 @@ result
 SettingInfo::SetValue(const String& key, bool value)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-       
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));       
        return _SettingInfoImpl::SetValue(key, value);
 }
 
@@ -155,9 +151,8 @@ result
 SettingInfo::SetValue(const String& key, int value)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetValue(key, value);
 }
 
@@ -165,9 +160,8 @@ result
 SettingInfo::SetValue(const String& key, String value)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
-
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetValue(key, value);
 }
 
@@ -175,8 +169,8 @@ result
 SettingInfo::SetValueForPrivilegedKey(const String& key, bool value)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMSETTING_WRITE);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTINGMANAGER_WRITE);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetValueForPrivilegedKey(key, value);
 }
 
@@ -184,8 +178,8 @@ result
 SettingInfo::SetValueForPrivilegedKey(const String& key, String value)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMSETTING_WRITE);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTINGMANAGER_WRITE);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetValueForPrivilegedKey(key, value);
 }
 
@@ -193,17 +187,24 @@ result
 SettingInfo::ResetToFactoryDefault(void)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMSETTING_WRITE);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTINGMANAGER_WRITE);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::ResetToFactoryDefault();
 }
 
 result 
+SettingInfo::SetValueAsync(const String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener)
+{
+       result r = E_SUCCESS;
+       r = _AccessController::CheckUserPrivilege(_PRV_SETTING);
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
+       return _SettingInfoImpl::SetValueAsync(key, value, listener);
+}
+
+result 
 SettingInfo::SetValueAsyncForPrivilegedKey(const String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener)
 {
        result r = E_SUCCESS;
-        r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMSETTING_WRITE);
-        SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SettingInfoImpl::SetValueAsyncForPrivilegedKey(key, value, listener);
 }
 
index ef5f86a..aa22a4b 100644 (file)
@@ -109,7 +109,7 @@ CATCH:
 result
 SystemInfo::GetPlatformVersion(String& platformVersion)
 {
-       result r = _AccessController::CheckUserPrivilege(_PRV_PLATFORMINFO);
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEM);
         SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SystemInfoImpl::GetPlatformVersion(platformVersion);
 }
@@ -117,7 +117,7 @@ SystemInfo::GetPlatformVersion(String& platformVersion)
 result
 SystemInfo::GetBuildInfo(String& buildInfo)
 {
-       result r = _AccessController::CheckUserPrivilege(_PRV_PLATFORMINFO);
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEM);
         SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SystemInfoImpl::GetBuildInfo(buildInfo);
 }
@@ -125,7 +125,7 @@ SystemInfo::GetBuildInfo(String& buildInfo)
 result
 SystemInfo::GetNativeApiVersion(String& nativeApiVersion)
 {
-       result r = _AccessController::CheckUserPrivilege(_PRV_PLATFORMINFO);
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEM);
         SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SystemInfoImpl::GetNativeApiVersion(nativeApiVersion);
 }
@@ -133,7 +133,7 @@ SystemInfo::GetNativeApiVersion(String& nativeApiVersion)
 result
 SystemInfo::GetWebApiVersion(String& webApiVersion)
 {
-       result r = _AccessController::CheckUserPrivilege(_PRV_PLATFORMINFO);
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEM);
         SysTryReturn(NID_SYS, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."));
        return _SystemInfoImpl::GetWebApiVersion(webApiVersion);
 }
index b098347..01e52d5 100644 (file)
@@ -92,6 +92,12 @@ _AlarmImpl::~_AlarmImpl(void)
        {
                Cancel();
        }
+
+       if(__pEvent != null)
+       {
+               delete __pEvent;
+               __pEvent = null;
+       }
 }
 
 result
index 11d154a..9da4f57 100644 (file)
@@ -126,11 +126,12 @@ _AlarmManager::ReserveAlarm(Tizen::Base::String appId, Tizen::Base::DateTime sta
 
        if(period > 0)
        {
+               SysLog(NID_SYS, "It is repeated alarm and period time is %d minutes", period);
                ret = alarmmgr_set_repeat_mode(pAlarmInfo, ALARM_REPEAT_MODE_REPEAT, period * _SECOND_OF_MINUTE);
                SysTryCatch(NID_SYS, ret == ALARMMGR_RESULT_SUCCESS, r = E_SYSTEM, r, "It is failed to set repeat mode");
        }
 
-       ret = alarmmgr_set_type(pAlarmInfo, 0x04/*ALARM_TYPE_NOLAUNCH*/);
+       ret = alarmmgr_set_type(pAlarmInfo, ALARM_TYPE_NOLAUNCH);
        SysTryCatch(NID_SYS, ret == ALARMMGR_RESULT_SUCCESS, r = E_SYSTEM, r, "It is failed to set repeat mode");
 
        ret = alarmmgr_add_alarm_appsvc_with_localtime(pAlarmInfo,(void *)pBundle, &reservedAlarmId);
index 73e8c23..2137e7c 100644 (file)
@@ -35,6 +35,7 @@
 #include <runtime_info.h>
 #include <vconf.h>
 
+#include <FAppApp.h>
 #include <FBaseRtEvent.h>
 #include <FBaseRtIEventArg.h>
 #include <FBaseRtIEventListener.h>
@@ -351,22 +352,62 @@ _RuntimeInfoImpl::GetDirectorySize(const char* path)
        }
 
        char command[512] = {0,};
+       char fileName[512] = {0,};
        long long size = 0;
        int ret = 0;
 
-       sprintf(command, "du -sk -P %s >> /tmp/size_of_directory.tmp", path);
+       Tizen::App::App* pApp = Tizen::App::App::GetInstance();
+       if(pApp == null)
+       {
+               return 0;
+       }
+
+       String appId(pApp->GetAppId());
+       unique_ptr <char> appIdPath(_StringConverter::CopyToCharArrayN(appId));
+
+       ret = sprintf(fileName, "/tmp/size_of_directory_%s.tmp", appIdPath.get());
+       if(ret < 1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to write file path.");
+               return 0;
+       }
+
+       ret = sprintf(command, "rm -rf %s", fileName);
+       if(ret < 1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to write remove command.");
+               return 0;
+       }
+
+       ret = system(command);
 
-       system("rm -rf /tmp/size_of_directory.tmp");
-       system(command);
+       if(ret == -1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to execute command[%s].", command);
+       }
+
+       ret = sprintf(command, "du -skb -P %s >> %s", path, fileName);
+       if(ret < 1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to write du command.");
+               return 0;
+       }
+
+       ret = system(command);
+       if(ret == -1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to execute command[%s].", command);
+               return 0;
+       }
 
        FILE* pFile = null;
-       pFile = fopen("/tmp/size_of_directory.tmp", "r");
+       pFile = fopen(fileName, "r");
        if(pFile == null)
        {
                return 0;
        }
-       ret = fscanf(pFile, "%lld", &size);
 
+       ret = fscanf(pFile, "%lld", &size);
        if(ret < 1)
        {
                if(pFile != null)
@@ -381,7 +422,21 @@ _RuntimeInfoImpl::GetDirectorySize(const char* path)
        {
                fclose(pFile);
        }
-       system("rm -rf /tmp/size_of_directory.tmp");
+
+       ret = sprintf(command, "rm -rf %s", fileName);
+       if(ret < 1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to write remove command.");
+               return 0;
+       }
+
+       ret = system(command);
+       if(ret == -1)
+       {
+               SysLogException(NID_SYS, E_SYSTEM, "It is failed to execute command[%s].", command);
+       }
+
+
        return size;
 }
 
@@ -632,8 +687,7 @@ _RuntimeInfoImpl::GetValueAsync(const String& key, IRuntimeInfoGetIntAsyncResult
        {
                if(listener != null)
                {
-                       SysLog(NID_SYS, "%x", listener);
-                       runtimeInfoEvent.AddListener(*listener, false);
+                       runtimeInfoEvent.AddListener(*listener);
                }
 
                int thr_id = 0;
@@ -714,7 +768,7 @@ _RuntimeInfoImpl::GetValueAsync(const String& key, IRuntimeInfoGetLonglongAsyncR
        {
                if(listener != null)
                {
-                       SysLog(NID_SYS, "test %x", listener);
+                       SysLog(NID_SYS, "listener instance is %x.", listener);
                        runtimeInfoEvent.AddListener(*listener);
                }
 
@@ -723,7 +777,7 @@ _RuntimeInfoImpl::GetValueAsync(const String& key, IRuntimeInfoGetLonglongAsyncR
                pEventArg->DirectoryPath = directoryPath;
 
                thr_id = pthread_create(&p_thread, null, GetDirectorySizeAsync, pEventArg);
-               SysLog(NID_SYS, "%d", thr_id);
+               SysLog(NID_SYS, "Thread id is %d.", thr_id);
                pthread_detach(p_thread);
        }
 
index e06fccf..13d9412 100644 (file)
@@ -758,6 +758,40 @@ _SettingClient::SetValueForPrivilegedKey(const String& key, String value)
        return SetOnService(_SETTING_COMMAND_SET_STRING_PRIV, key, requestValue);
 }
 
+
+result
+_SettingClient::SetValueAsync(const String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener)
+{
+       result r = E_SUCCESS;
+       String requestValue;
+
+       SysTryReturnResult(NID_SYS, __asyncEventList.ContainsKey(key) == false, E_IN_PROGRESS, "Required key[%ls] is already in progress.", key.GetPointer());
+
+       if(value == true)
+       {
+               requestValue.Append("true");
+       }
+       else
+       {
+               requestValue.Append("false");
+       }
+
+       r = SetOnService(_SETTING_COMMAND_SET_BOOL_ASYNC, key, requestValue);
+
+       if(r == E_SUCCESS)
+       {
+               if(listener != null)
+               {
+                       _SettingAsyncEvent* pEvent = new (std::nothrow) _SettingAsyncEvent();
+                       pEvent->AddListener(*listener);
+
+                       __asyncEventList.Add(new String(key), pEvent);
+               }
+       }
+
+       return r;
+}
+
 result
 _SettingClient::SetValueAsyncForPrivilegedKey(const String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener)
 {
@@ -779,10 +813,13 @@ _SettingClient::SetValueAsyncForPrivilegedKey(const String& key, bool value, ISe
 
        if(r == E_SUCCESS)
        {
-               _SettingAsyncEvent* pEvent = new (std::nothrow) _SettingAsyncEvent();
-               pEvent->AddListener(*listener);
+               if(listener != null)
+               {
+                       _SettingAsyncEvent* pEvent = new (std::nothrow) _SettingAsyncEvent();
+                       pEvent->AddListener(*listener);
 
-               __asyncEventList.Add(new String(key), pEvent);
+                       __asyncEventList.Add(new String(key), pEvent);
+               }
        }
 
        return r;
@@ -873,6 +910,7 @@ _SettingClient::HasKey(const String& key)
        String response;
        result r = GetOnService(_SETTING_COMMAND_SUPPORTED, key, response);
 
+       SysLog(NID_SYS, "HasKey result key:%ls, %ls", key.GetPointer(), response.GetPointer());
        if(response == L"1" && r == E_SUCCESS)
        {
                return true;
index f0c7816..7a94342 100644 (file)
@@ -62,6 +62,7 @@ public:
 
        result SetValue(const Tizen::Base::String& key, const bool& value);
        result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
+       result SetValueAsync(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
        result SetValueAsyncForPrivilegedKey(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
        result SetValue(const Tizen::Base::String& key, const int& value);
        result SetValue(const Tizen::Base::String& key, const Tizen::Base::String& value);
index 1f66097..17e657e 100644 (file)
  * @file               FSys_SettingInfoImpl.cpp
  * @brief              This is the implementation file for _SysSettingInfoImpl class.
  */
-
+#include <system/system_settings.h>
+#include <FBase.h>
 #include <FBaseColArrayList.h>
 #include <FBaseSysLog.h>
 
+#include <FBase_StringConverter.h>
 #include <FBase_NativeError.h>
 #include <FSys_SettingInfoImpl.h>
 #include "FSys_SettingClient.h"
@@ -31,6 +33,7 @@ using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Io;
+using namespace Tizen::Base::Utility;
 
 namespace Tizen { namespace System
 {
@@ -49,6 +52,23 @@ static const wchar_t* _SETTING_SOUND_RINGTONE_VOLUME = L"http://tizen.org/settin
 static const wchar_t* _SETTING_NOTIFICATION_SOUND_VOLUME = L"NotificationSoundVolume";
 static const wchar_t* _SETTING_SOUND_NOTIFICATION_VOLUME = L"http://tizen.org/setting/sound.notification.volume";
 
+//Font
+static const wchar_t* _FONT_SIZE = L"http://tizen.org/setting/font.size";
+static const wchar_t* _FONT_TYPE = L"http://tizen.org/setting/font.type";
+
+static const wchar_t* _FONT_SIZE_GIANT = L"giant";
+static const wchar_t* _FONT_SIZE_HUGE = L"huge";
+static const wchar_t* _FONT_SIZE_LARGE = L"large";
+static const wchar_t* _FONT_SIZE_MEDIUM = L"medium";
+static const wchar_t* _FONT_SIZE_SMALL = L"small";
+
+static const int _FONT_SIZE_GIANT_VCONF = 4;
+static const int _FONT_SIZE_HUGE_VCONF = 3;
+static const int _FONT_SIZE_LARGE_VCONF = 2;
+static const int _FONT_SIZE_MEDIUM_VCONF = 1;
+static const int _FONT_SIZE_SMALL_VCONF = 0;
+
+
 static _SettingClient* pSettingClient = null;
 
 void
@@ -62,9 +82,19 @@ _SettingInfoImpl::InitSettingClient(void)
 result
 _SettingInfoImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::String& value)
 {
-       InitSettingClient();
-       SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
-       return pSettingClient->GetValue(key, value);
+       result r = E_SUCCESS;
+
+       if (key == _FONT_SIZE || key == _FONT_TYPE)
+       {
+               r = GetValueForFont(key, value);
+       }
+       else
+       {
+               InitSettingClient();
+               SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
+               r = pSettingClient->GetValue(key, value);
+       }
+       return r;
 }
 
 result
@@ -152,9 +182,18 @@ _SettingInfoImpl::SetValue(const String& key, int value)
 result
 _SettingInfoImpl::SetValue(const String& key, String value)
 {
-       InitSettingClient();
-       SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
-       return pSettingClient->SetValue(key, value);
+       result r = E_SUCCESS;
+       if (key == _FONT_SIZE || key == _FONT_TYPE)
+        {
+               r = SetValueForFont(key, value);
+        }
+       else
+       {
+               InitSettingClient();
+               SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
+               r = pSettingClient->SetValue(key, value);
+       }
+       return r;
 }
 
 result
@@ -293,6 +332,14 @@ _SettingInfoImpl::SetSettingEventListener(ISettingEventListener* pListener)
 }
 
 result
+_SettingInfoImpl::SetValueAsync(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener)
+{
+       InitSettingClient();
+       SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
+       return pSettingClient->SetValueAsync(key, value, listener);
+}
+
+result
 _SettingInfoImpl::SetValueAsyncForPrivilegedKey(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener)
 {
        InitSettingClient();
@@ -312,4 +359,113 @@ _SettingInfoImpl::GetInstance(const SettingInfo& settinginfo)
        return settinginfo.__pSettingInfoImpl;
 }
 
+result
+_SettingInfoImpl::GetValueForFont(const Tizen::Base::String& key, Tizen::Base::String& value)
+{
+       result r = E_OBJ_NOT_FOUND;
+
+       if (key == _FONT_SIZE)
+       {
+               int fontSize = 0;
+               int res = 0;
+               res = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &fontSize);
+
+               SysTryReturnResult(NID_SYS, res == SYSTEM_SETTINGS_ERROR_NONE, E_SYSTEM, "It is failed to get font size.");
+
+               r = E_SUCCESS;
+               switch (fontSize)
+               {
+               case _FONT_SIZE_GIANT_VCONF:
+                       value.Append(_FONT_SIZE_GIANT);
+                       break;
+               case _FONT_SIZE_HUGE_VCONF:
+                       value.Append(_FONT_SIZE_HUGE);
+                       break;
+               case _FONT_SIZE_LARGE_VCONF:
+                       value.Append(_FONT_SIZE_LARGE);
+                       break;
+               case _FONT_SIZE_MEDIUM_VCONF:
+                       value.Append(_FONT_SIZE_MEDIUM);
+                       break;
+               case _FONT_SIZE_SMALL_VCONF:
+                       value.Append(_FONT_SIZE_SMALL);
+                       break;
+               default:
+                       r = E_SYSTEM;
+                       break;
+               }
+
+       }
+       else if (key == _FONT_TYPE)
+       {
+               r = E_SUCCESS;
+               char* pFontType = null;
+               int res = 0;
+               res = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &pFontType);
+               SysTryReturnResult(NID_SYS, res == SYSTEM_SETTINGS_ERROR_NONE, E_SYSTEM, "Failed to get font type");
+               r = StringUtil::Utf8ToString(pFontType, value);
+               SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::Utf8ToString failed", GetErrorMessage(r));
+               free(pFontType);
+       }
+       return r;
+}
+
+
+result
+_SettingInfoImpl::SetValueForFont(const Tizen::Base::String& key, Tizen::Base::String value)
+{
+       result r = E_OBJ_NOT_FOUND;
+
+       if(key == _FONT_SIZE)
+       {
+               int fontSize = 0;
+               int res = 0;
+               String lowerValue = value;
+               lowerValue.ToLowerCase();
+               r = E_SUCCESS;
+
+               if (lowerValue == _FONT_SIZE_GIANT)
+               {
+                       fontSize = _FONT_SIZE_GIANT_VCONF;
+               }
+               else if (lowerValue == _FONT_SIZE_HUGE)
+               {
+                       fontSize = _FONT_SIZE_HUGE_VCONF;
+               }
+               else if (lowerValue == _FONT_SIZE_LARGE)
+               {
+                       fontSize = _FONT_SIZE_LARGE_VCONF;
+               }
+               else if (lowerValue == _FONT_SIZE_MEDIUM)
+               {
+                       fontSize = _FONT_SIZE_MEDIUM_VCONF;
+               }
+               else if (lowerValue == _FONT_SIZE_SMALL)
+               {
+                       fontSize = _FONT_SIZE_SMALL_VCONF;
+               }
+               else
+               {
+                       return E_INVALID_ARG;
+               }
+               res = system_settings_set_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, fontSize);
+               SysTryReturnResult(NID_SYS, res == SYSTEM_SETTINGS_ERROR_NONE, E_SYSTEM, "It is failed to set font size.");
+       }
+       else if(key == _FONT_TYPE)
+       {
+               char* pFontType = null;
+               int res = 0;
+               r = E_SUCCESS;
+
+               pFontType = _StringConverter::CopyToCharArrayN(value);
+               SysTryReturnResult(NID_SYS, pFontType != null, E_SYSTEM, "It is failed to convert String to string.");
+               SysLog(NID_SYS, "Requested font type is %s.", pFontType);
+               res = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, pFontType);
+               delete [] pFontType;
+               SysTryReturnResult(NID_SYS, res == SYSTEM_SETTINGS_ERROR_NONE, E_SYSTEM, "It is failed to set font type.");
+       }
+       return r;
+}
+
+
 } } // Tizen::System
index dfa563c..8d70cd8 100644 (file)
@@ -61,6 +61,7 @@ public:
        static result SetValue(const Tizen::Base::String& key, int value);
        static result SetValue(const Tizen::Base::String& key, Tizen::Base::String value);
        static result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
+       static result SetValueAsync(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
        static result SetValueAsyncForPrivilegedKey(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
        static result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
 
@@ -68,6 +69,8 @@ public:
 private:
        static void InitSettingClient(void);
 
+       static result GetValueForFont(const Tizen::Base::String& key, Tizen::Base::String& value);
+       static result SetValueForFont(const Tizen::Base::String& key, Tizen::Base::String value);
 };
 
 } } // Tizen::Sys